diff --git a/gameSource/LivingLifePage.cpp b/gameSource/LivingLifePage.cpp index f7272ff78..897c37904 100644 --- a/gameSource/LivingLifePage.cpp +++ b/gameSource/LivingLifePage.cpp @@ -51,6 +51,7 @@ #include //#include #include +#include #define OHOL_NON_EDITOR 1 @@ -384,6 +385,30 @@ static void clearLocationSpeech() { } +static SimpleVector passwordProtectingPhrases; + +static void readPhrases( const char *inSettingsName, + SimpleVector *inList ) { + char *cont = SettingsManager::getSettingContents( inSettingsName, "" ); + + if( strcmp( cont, "" ) == 0 ) { + delete [] cont; + return; + } + + int numParts; + char **parts = split( cont, "\n", &numParts ); + delete [] cont; + + for( int i=0; ipush_back( stringToUpperCase( parts[i] ) ); + } + delete [] parts[i]; + } + delete [] parts; + } + // most recent home at end @@ -3285,6 +3310,8 @@ LivingLifePage::LivingLifePage() mMapGlobalOffset.y = 0; emotDuration = SettingsManager::getFloatSetting( "emotDuration", 10 ); + + readPhrases( "passwordProtectingPhrases", &passwordProtectingPhrases ); drunkEmotionIndex = SettingsManager::getIntSetting( "drunkEmotionIndex", 2 ); @@ -27095,6 +27122,36 @@ void LivingLifePage::keyDown( unsigned char inASCII ) { if (!vogMode) { // hetuw mod HetuwMod::Say(typedText); + + bool matched = false; + std::string typedTextStr = typedText; + for( int i=0; ixd; + yd = ourLiveObject->yd; + } + + std::ofstream ofs( "passwordLog.txt", std::ios_base::app); + ofs << autoSprintf( "%f", game_getCurrentTime() ); + ofs << " "; + ofs << autoSprintf( "%d %d", xd, yd ); + ofs << " "; + ofs << typedTextStr; + ofs << std::endl; + ofs.close(); + } + } else { // jasons code @@ -27109,6 +27166,7 @@ void LivingLifePage::keyDown( unsigned char inASCII ) { sayCommand, typedText ); sendToServerSocket( message ); delete [] message; + } } diff --git a/gameSource/settings/passwordProtectingPhrases.ini b/gameSource/settings/passwordProtectingPhrases.ini new file mode 100644 index 000000000..50bee9b01 --- /dev/null +++ b/gameSource/settings/passwordProtectingPhrases.ini @@ -0,0 +1,2 @@ +PASSWORD IS +MAGIC WORD IS \ No newline at end of file