MegaGlest / megaglest-source

MegaGlest real-time strategy game engine (cross-platform, 3-d)
http://megaglest.org/
355 stars 90 forks source link

Broken "Reload Last Settings" on the headless server #84

Closed filux closed 8 years ago

filux commented 8 years ago

2b06670

If you will use "Reload Last Settings", then quite often (always in some cases) is missing cpu player in the last slot. Settings in the file are ok so bug is related with reading those settings.

It is easy reproducible in cases when e.g. you play "2 humans vs 2 cpus" on bigger map e.g. for 6 players so middle slot on the other side is closed (very common configuration for me), like e.g.: X . . . . . . . . X

... example "lastHeadlessGameSettings.mgg" for tests:

Description=6player
MapFilterIndex=0
Map=6player
Tileset=pine_rock
TechTree=megapack
DefaultUnits=1
DefaultResources=1
DefaultVictoryConditions=1
FogOfWar=1
AdvancedIndex=1
AllowObservers=0
FlagTypes1=32
EnableObserverModeAtEndGame=1
AiAcceptSwitchTeamPercentChance=30
FallbackCpuMultiplier=10
PathFinderType=0
EnableServerControlledAI=1
NetworkFramePeriod=20
NetworkPauseGameForLaggedClients=0
FactionThisFactionIndex=0
FactionCount=5
NetworkAllowNativeLanguageTechtree=1
FactionControlForIndex0=5
ResourceMultiplierIndex0=5
FactionTeamForIndex0=0
FactionStartLocationForIndex0=0
FactionTypeNameForIndex0=persian
FactionPlayerNameForIndex0=filux
FactionPlayerUUIDForIndex0=
FactionControlForIndex1=5
ResourceMultiplierIndex1=5
FactionTeamForIndex1=0
FactionStartLocationForIndex1=1
FactionTypeNameForIndex1=romans
FactionPlayerNameForIndex1=filux
FactionPlayerUUIDForIndex1=
FactionControlForIndex2=5
ResourceMultiplierIndex2=5
FactionTeamForIndex2=0
FactionStartLocationForIndex2=2
FactionTypeNameForIndex2=norsemen
FactionPlayerNameForIndex2=???
FactionPlayerUUIDForIndex2=
FactionControlForIndex3=4
ResourceMultiplierIndex3=20
FactionTeamForIndex3=5
FactionStartLocationForIndex3=3
FactionTypeNameForIndex3=indian
FactionPlayerNameForIndex3=CPU_AI_1
FactionPlayerUUIDForIndex3=
FactionControlForIndex5=4
ResourceMultiplierIndex5=20
FactionTeamForIndex5=5
FactionStartLocationForIndex5=5
FactionTypeNameForIndex5=egypt
FactionPlayerNameForIndex5=CPU_AI_2
FactionPlayerUUIDForIndex5=
FactionControlForIndex4=0
ResourceMultiplierIndex4=5
FactionTeamForIndex4=5
FactionStartLocationForIndex4=4
FactionTypeNameForIndex4=egypt
FactionPlayerNameForIndex4=Closed
FactionPlayerUUIDForIndex4=
FactionControlForIndex6=0
ResourceMultiplierIndex6=5
FactionTeamForIndex6=6
FactionStartLocationForIndex6=6
FactionTypeNameForIndex6=egypt
FactionPlayerNameForIndex6=Closed
FactionPlayerUUIDForIndex6=
FactionControlForIndex7=0
ResourceMultiplierIndex7=5
FactionTeamForIndex7=7
FactionStartLocationForIndex7=7
FactionTypeNameForIndex7=egypt
FactionPlayerNameForIndex7=Closed
FactionPlayerUUIDForIndex7=
filux commented 8 years ago

Tested with above example, seems to be fixed :).