MegaGlest Forum

MegaGlest => Bug reports => Closed bug reports => Topic started by: tomreyn on 24 January 2014, 16:16:39

Title: [fixed] 3.9.1+git4634.1bd772a, Linux x86_64: Player name "AI1" on "reload last game"
Post by: tomreyn on 24 January 2014, 16:16:39
I've been trying to hunt this one down for a while, now (by accident) I finally found a way to reproduce it reliably (I think)...

1. Host a network game with the standard default setup (in my case this was a published game, not sure this matters)
2. Have a client connect to the game
3. Having the below $UserData_Root/lastCustomGameSettings.mgg file in place, hit "reload last game"

You end up loosing your player name. When you type something in chat you show up as "AI1". This should not happen, restoring last games' settings should never overwrite the names of connected human and network players.

It is possible to work around this by switching to a different slot and back.

Code: (lastCustomGameSettings.mgg) [Select]
Description=Six Swamp Of Sorrow
MapFilterIndex=6
Map=six_swamp_of_sorrow
Tileset=evergreen
TechTree=megapack
DefaultUnits=1
DefaultResources=1
DefaultVictoryConditions=1
FogOfWar=1
AdvancedIndex=0
AllowObservers=0
FlagTypes1=0
EnableObserverModeAtEndGame=1
AiAcceptSwitchTeamPercentChance=30
FallbackCpuMultiplier=5
PathFinderType=0
EnableServerControlledAI=1
NetworkFramePeriod=20
NetworkPauseGameForLaggedClients=0
FactionThisFactionIndex=1
FactionCount=6
NetworkAllowNativeLanguageTechtree=0
FactionControlForIndex0=2
ResourceMultiplierIndex0=5
FactionTeamForIndex0=0
FactionStartLocationForIndex0=0
FactionTypeNameForIndex0=persian
FactionPlayerNameForIndex0=AI1
FactionPlayerUUIDForIndex0=
FactionControlForIndex1=7
ResourceMultiplierIndex1=5
FactionTeamForIndex1=0
FactionStartLocationForIndex1=1
FactionTypeNameForIndex1=norsemen
FactionPlayerNameForIndex1=First Player
FactionPlayerUUIDForIndex1=11111111-1111-1111-1111-11111111111
FactionControlForIndex2=5
ResourceMultiplierIndex2=5
FactionTeamForIndex2=0
FactionStartLocationForIndex2=2
FactionTypeNameForIndex2=romans
FactionPlayerNameForIndex2=Second Player
FactionPlayerUUIDForIndex2=22222222-2222-2222-2222-222222222222
FactionControlForIndex3=3
ResourceMultiplierIndex3=10
FactionTeamForIndex3=1
FactionStartLocationForIndex3=3
FactionTypeNameForIndex3=norsemen
FactionPlayerNameForIndex3=AI2
FactionPlayerUUIDForIndex3=
FactionControlForIndex4=2
ResourceMultiplierIndex4=5
FactionTeamForIndex4=1
FactionStartLocationForIndex4=4
FactionTypeNameForIndex4=persian
FactionPlayerNameForIndex4=AI3
FactionPlayerUUIDForIndex4=
FactionControlForIndex5=2
ResourceMultiplierIndex5=5
FactionTeamForIndex5=1
FactionStartLocationForIndex5=5
FactionTypeNameForIndex5=romans
FactionPlayerNameForIndex5=AI4
FactionPlayerUUIDForIndex5=
FactionControlForIndex6=0
ResourceMultiplierIndex6=5
FactionTeamForIndex6=0
FactionStartLocationForIndex6=6
FactionTypeNameForIndex6=tech
FactionPlayerNameForIndex6=Closed
FactionPlayerUUIDForIndex6=
FactionControlForIndex7=0
ResourceMultiplierIndex7=5
FactionTeamForIndex7=0
FactionStartLocationForIndex7=7
FactionTypeNameForIndex7=*Random*
FactionPlayerNameForIndex7=Closed
FactionPlayerUUIDForIndex7=
Title: Re: 3.9.1+git4634.1bd772a, Linux x86_64: Player name "AI1" on "reload last game"
Post by: softcoder on 25 January 2014, 07:51:17
Please try if my fix worked on this bug using git HEAD.

Thanks
Title: Re: 3.9.1+git4634.1bd772a, Linux x86_64: Player name "AI1" on "reload last game"
Post by: tomreyn on 25 January 2014, 17:20:00
Sadly, it did not. Are you not able to reproduce it anymore?
Title: Re: 3.9.1+git4634.1bd772a, Linux x86_64: Player name "AI1" on "reload last game"
Post by: softcoder on 25 January 2014, 18:07:47
Should be fixed properly now, sorry about that.
Title: Re: 3.9.1+git4634.1bd772a, Linux x86_64: Player name "AI1" on "reload last game"
Post by: tomreyn on 26 January 2014, 20:45:11
This is fixed for me now, thanks.

However, I assume as a side effect, there is now another issue, which can be reproduced as follows:

1. Place this custom game settings file (which, despite redacted UUIDs, was created in a normal game) in ~/.megaglest/:
Code: (lastcustomgamesettings.mgg) [Select]
Description=Six Swamp Of Sorrow
MapFilterIndex=6
Map=six_swamp_of_sorrow
Tileset=desert2
TechTree=megapack
DefaultUnits=1
DefaultResources=1
DefaultVictoryConditions=1
FogOfWar=1
AdvancedIndex=0
AllowObservers=0
FlagTypes1=0
EnableObserverModeAtEndGame=1
AiAcceptSwitchTeamPercentChance=30
FallbackCpuMultiplier=5
PathFinderType=0
EnableServerControlledAI=1
NetworkFramePeriod=20
NetworkPauseGameForLaggedClients=0
FactionThisFactionIndex=1
FactionCount=6
NetworkAllowNativeLanguageTechtree=0
FactionControlForIndex0=5
ResourceMultiplierIndex0=5
FactionTeamForIndex0=0
FactionStartLocationForIndex0=0
FactionTypeNameForIndex0=romans
FactionPlayerNameForIndex0=Derek
FactionPlayerUUIDForIndex0=11111111-1111-1111-1111-111111111111
FactionControlForIndex1=7
ResourceMultiplierIndex1=5
FactionTeamForIndex1=0
FactionStartLocationForIndex1=1
FactionTypeNameForIndex1=norsemen
FactionPlayerNameForIndex1=tomr
FactionPlayerUUIDForIndex1=22222222-2222-2222-2222-222222222222
FactionControlForIndex2=5
ResourceMultiplierIndex2=5
FactionTeamForIndex2=0
FactionStartLocationForIndex2=2
FactionTypeNameForIndex2=romans
FactionPlayerNameForIndex2=typedef
FactionPlayerUUIDForIndex2=33333333-3333-3333-3333-333333333333
FactionControlForIndex3=3
ResourceMultiplierIndex3=10
FactionTeamForIndex3=1
FactionStartLocationForIndex3=3
FactionTypeNameForIndex3=norsemen
FactionPlayerNameForIndex3=AI1
FactionPlayerUUIDForIndex3=
FactionControlForIndex4=4
ResourceMultiplierIndex4=20
FactionTeamForIndex4=1
FactionStartLocationForIndex4=4
FactionTypeNameForIndex4=persian
FactionPlayerNameForIndex4=AI2
FactionPlayerUUIDForIndex4=
FactionControlForIndex5=4
ResourceMultiplierIndex5=20
FactionTeamForIndex5=1
FactionStartLocationForIndex5=5
FactionTypeNameForIndex5=romans
FactionPlayerNameForIndex5=AI3
FactionPlayerUUIDForIndex5=
FactionControlForIndex6=0
ResourceMultiplierIndex6=5
FactionTeamForIndex6=0
FactionStartLocationForIndex6=6
FactionTypeNameForIndex6=tech
FactionPlayerNameForIndex6=Closed
FactionPlayerUUIDForIndex6=
FactionControlForIndex7=0
ResourceMultiplierIndex7=5
FactionTeamForIndex7=0
FactionStartLocationForIndex7=7
FactionTypeNameForIndex7=*Random*
FactionPlayerNameForIndex7=Closed
FactionPlayerUUIDForIndex7=

2. Host an Internet game

3. Click on "reload last settings"

What I get then is that both the first and second slot is in use by a player named "tomr" (my player name), however, no other player has connected. This happens both before and after the masterserver connects to check, so doesn't seem to be related to the verification
Title: Re: 3.9.1+git4634.1bd772a, Linux x86_64: Player name "AI1" on "reload last game"
Post by: softcoder on 27 January 2014, 03:23:15
This additional test case should now be also fixed.

Thanks
Title: Re: 3.9.1+git4634.1bd772a, Linux x86_64: Player name "AI1" on "reload last game"
Post by: tomreyn on 30 January 2014, 03:38:06
Thanks, this second issue is now [fixed].

However, I'm afraid we need to revisit the first. I can still reproduce this as follows:

1. Host an Internet game with the standard default setup (in my case this was a published game, not sure this matters)
2. In a separate terminal, type: nc -vv 127.0.0.1 61357 to simulate a connecting client
3. Having the above (first post on this topic) $UserData_Root/lastCustomGameSettings.mgg file in place, hit "reload last game"

You end up loosing your player name. When you type something in chat you show up as "AI1". It is possible to work around this by switching to a different slot and back
Title: Re: 3.9.1+git4634.1bd772a, Linux x86_64: Player name "AI1" on "reload last game"
Post by: softcoder on 30 January 2014, 04:27:14
Hoping this is fixed now in git.