diff --git a/src/game/g_netmsg.pas b/src/game/g_netmsg.pas
index 244b2ebd716ef55a21674fbd4b375f9c2324aad8..52e7ae64e0fa0d563a40b52ca1e1fb076e9b89b3 100644 (file)
--- a/src/game/g_netmsg.pas
+++ b/src/game/g_netmsg.pas
e_LogWritefln('*** client #%u (cid #%u) authenticated...', [C.ID, C.Player]);
//e_LogWritefln('spawning player with pid #%u...', [PID]);
//Respawn(gGameSettings.GameType = GT_SINGLE);
- //k8: no, do not spawn a player yet, wait for a 'i am ready' packet
+ //k8: no, do not spawn a player yet, wait for "request full state" packet
Lives := 0;
Spectate;
FNoRespawn := True;
- FWantsInGame := false; // TODO: look into this later
+ // `FWantsInGame` seems to mean "spawn the player on the next occasion".
+ // that is, if we'll set it to `true`, the player can be spawned after
+ // warmup time ran out, for example, regardless of the real player state.
+ // also, this seems to work only for the initial connection. further
+ // map changes could initiate resource downloading, but the player will
+ // be spawned immediately.
+ // the proper solution will require another player state, "ephemeral".
+ // the player should start any map in "ephemeral" state, and turned into
+ // real mobj only when they sent a special "i am ready" packet. this packet
+ // must be sent after receiving the full state, so the player will get a full
+ // map view before going into game.
+ FWantsInGame := false;
C^.WaitForFirstSpawn := true;
end;
end;
if gState in [STATE_INTERCUSTOM, STATE_FOLD] then
MH_SEND_GameEvent(NET_EV_MAPEND, 0, 'N', C^.ID);
- if NetUseMaster then g_Net_Slist_Update;
+ if NetUseMaster then
+ begin
+ //g_Net_Slist_Update;
+ g_Net_Slist_Pulse();
+ end;
end;
if not C.WaitForFirstSpawn then exit;
plr := g_Player_Get(C^.Player);
if not assigned(plr) then exit;
+ g_Net_Slist_ServerPlayerComes();
e_LogWritefln('*** client #%u (cid #%u) first spawn', [C.ID, C.Player]);
C.WaitForFirstSpawn := false;
plr.FNoRespawn := false;
end;
procedure MH_SEND_Info(ID: Byte);
-var
- Map: string;
begin
- Map := g_ExtractFileName(gMapInfo.Map);
-
NetOut.Clear();
NetOut.Write(Byte(NET_MSG_INFO));
NetOut.Write(ID);
NetOut.Write(NetClients[ID].Player);
- NetOut.Write(gGameSettings.WAD);
- NetOut.Write(Map);
+ NetOut.Write(ExtractFileName(gGameSettings.WAD));
+ NetOut.Write(g_ExtractFileName(gMapInfo.Map));
NetOut.Write(gWADHash);
NetOut.Write(gGameSettings.GameMode);
NetOut.Write(gGameSettings.GoalLimit);
gGameSettings.GameMode := gSwitchGameMode;
gWADHash := EvHash;
- if not g_Game_StartMap(EvStr, True) then
+ if not g_Game_StartMap(false{asMegawad}, EvStr, True) then
begin
if not isWadPath(EvStr) then
g_FatalError(Format(_lc[I_GAME_ERROR_MAP_LOAD], [gGameSettings.WAD + ':\' + EvStr]))