Skip to content

Commit

Permalink
No language barriers on low-pop servers. Fixes #314
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonrohrer committed Jun 13, 2019
1 parent 3ec4722 commit 1ed67e2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions documentation/changeLog.txt
Expand Up @@ -68,6 +68,8 @@ Server Fixes
roads in natural reclamation. However, surface non-permanent natural objects
(stones, iron, etc.) will re-occur on top of the road. Fixes #334

--No language barriers on low-pop servers. Fixes #314



Version 238 2019-June-8
Expand Down
13 changes: 12 additions & 1 deletion server/server.cpp
Expand Up @@ -130,6 +130,9 @@ static int babyBirthFoodDecrement = 10;
static int eatBonus = 0;


static int minActivePlayersForLanguages = 15;


// keep a running sequence number to challenge each connecting client
// to produce new login hashes, avoiding replay attacks.
static unsigned int nextSequenceNumber = 1;
Expand Down Expand Up @@ -4889,6 +4892,8 @@ int processLoggedInPlayer( Socket *inSock,
eatBonus =
SettingsManager::getIntSetting( "eatBonus", 0 );

minActivePlayersForLanguages =
SettingsManager::getIntSetting( "minActivePlayersForLanguages", 15 );


numConnections ++;
Expand Down Expand Up @@ -16890,9 +16895,15 @@ int main() {

char *translatedPhrase;

// skip language filtering in some cases
// VOG can talk to anyone
// also, skip in on very low pop servers
// (just let everyone talk together)
if( nextPlayer->vogMode ||
( speakerObj != NULL &&
speakerObj->vogMode ) ) {
speakerObj->vogMode ) ||
players.size() <
minActivePlayersForLanguages ) {

translatedPhrase =
stringDuplicate(
Expand Down
1 change: 1 addition & 0 deletions server/settings/minActivePlayersForLanguages.ini
@@ -0,0 +1 @@
15

0 comments on commit 1ed67e2

Please sign in to comment.