Fix things

This commit is contained in:
Learath 2020-04-13 15:19:07 +03:00
parent 442148a194
commit 5000b248bb
3 changed files with 29 additions and 35 deletions

View file

@ -1051,7 +1051,7 @@ void CServer::SendMap(int ClientID)
Msg.AddInt(1024-128); Msg.AddInt(1024-128);
Msg.AddRaw(m_CurrentMapSha256.data, sizeof(m_CurrentMapSha256.data)); Msg.AddRaw(m_CurrentMapSha256.data, sizeof(m_CurrentMapSha256.data));
} }
SendMsgEx(&Msg, MSGFLAG_VITAL|MSGFLAG_FLUSH, ClientID, true); SendMsg(&Msg, MSGFLAG_VITAL|MSGFLAG_FLUSH, ClientID);
} }
m_aClients[ClientID].m_NextMapChunk = 0; m_aClients[ClientID].m_NextMapChunk = 0;

View file

@ -1110,48 +1110,45 @@ void CGameContext::OnClientEnter(int ClientID)
Server()->ExpireServerInfo(); Server()->ExpireServerInfo();
// update client infos (others before local) // update client infos (others before local)
CMsgPacker NewClientInfoMsg(18 + 24);
NewClientInfoMsg.AddInt(ClientID);
NewClientInfoMsg.AddInt(0); // m_Local
NewClientInfoMsg.AddInt(m_apPlayers[ClientID]->GetTeam());
NewClientInfoMsg.AddString(Server()->ClientName(ClientID), -1);
NewClientInfoMsg.AddString(Server()->ClientClan(ClientID), -1);
NewClientInfoMsg.AddInt(Server()->ClientCountry(ClientID));
for(int p = 0; p < 6; p++)
{
NewClientInfoMsg.AddString("", -1); // m_apSkinPartNames
NewClientInfoMsg.AddInt(0); // m_aUseCustomColors
NewClientInfoMsg.AddInt(0); // m_aSkinPartColors
}
NewClientInfoMsg.AddInt(0); // m_Silent
for(int i = 0; i < MAX_CLIENTS; ++i) for(int i = 0; i < MAX_CLIENTS; ++i)
{ {
if(i == ClientID || !m_apPlayers[i] || !Server()->ClientIngame(i)) if(i == ClientID || !m_apPlayers[i] || !Server()->ClientIngame(i))
continue; continue;
// new info for others if(Server()->IsSixup(i))
if(Server()->ClientIngame(i) && Server()->IsSixup(i)) {
// new info for others
CMsgPacker NewClientInfoMsg(18 + 24); // NETMSGTYPE_SV_CLIENTINFO
NewClientInfoMsg.AddInt(ClientID);
NewClientInfoMsg.AddInt(0); // m_Local
NewClientInfoMsg.AddInt(m_apPlayers[ClientID]->GetTeam());
NewClientInfoMsg.AddString(Server()->ClientName(ClientID), -1);
NewClientInfoMsg.AddString(Server()->ClientClan(ClientID), -1);
NewClientInfoMsg.AddInt(Server()->ClientCountry(ClientID));
for(int p = 0; p < 6; p++) NewClientInfoMsg.AddString("", -1);
for(int p = 0; p < 6; p++) NewClientInfoMsg.AddInt(0);
for(int p = 0; p < 6; p++) NewClientInfoMsg.AddInt(0);
NewClientInfoMsg.AddInt(0); // m_Silent
Server()->SendMsg(&NewClientInfoMsg, MSGFLAG_VITAL|MSGFLAG_NORECORD, i); Server()->SendMsg(&NewClientInfoMsg, MSGFLAG_VITAL|MSGFLAG_NORECORD, i);
}
if(Server()->IsSixup(ClientID)) if(Server()->IsSixup(ClientID))
{ {
// existing infos for new player // existing infos for new player
CMsgPacker ClientInfoMsg(18 + 24); CMsgPacker ClientInfoMsg(18 + 24); // NETMSGTYPE_SV_CLIENTINFO
ClientInfoMsg.AddInt(i); ClientInfoMsg.AddInt(i);
ClientInfoMsg.AddInt(0); // m_Local ClientInfoMsg.AddInt(0); // m_Local
ClientInfoMsg.AddInt(m_apPlayers[i]->GetTeam()); ClientInfoMsg.AddInt(m_apPlayers[i]->GetTeam());
ClientInfoMsg.AddString(Server()->ClientName(i), -1); ClientInfoMsg.AddString(Server()->ClientName(i), -1);
ClientInfoMsg.AddString(Server()->ClientClan(i), -1); ClientInfoMsg.AddString(Server()->ClientClan(i), -1);
ClientInfoMsg.AddInt(Server()->ClientCountry(i)); ClientInfoMsg.AddInt(Server()->ClientCountry(i));
for(int p = 0; p < 6; p++) for(int p = 0; p < 6; p++) ClientInfoMsg.AddString("", -1);
{ for(int p = 0; p < 6; p++) ClientInfoMsg.AddInt(0);
ClientInfoMsg.AddString("", -1); // m_apSkinPartNames for(int p = 0; p < 6; p++) ClientInfoMsg.AddInt(0);
ClientInfoMsg.AddInt(0); // m_aUseCustomColors
ClientInfoMsg.AddInt(0); // m_aSkinPartColors
}
ClientInfoMsg.AddInt(0); // m_Silent ClientInfoMsg.AddInt(0); // m_Silent
Server()->SendMsg(&ClientInfoMsg, MSGFLAG_VITAL|MSGFLAG_NORECORD, ClientID); Server()->SendMsg(&ClientInfoMsg, MSGFLAG_VITAL|MSGFLAG_NORECORD, ClientID);
} }
} }
@ -1159,20 +1156,19 @@ void CGameContext::OnClientEnter(int ClientID)
// local info // local info
if(Server()->IsSixup(ClientID)) if(Server()->IsSixup(ClientID))
{ {
CMsgPacker SelfClientInfoMsg(18 + 24); dbg_msg("debug", "sending local client");
CMsgPacker SelfClientInfoMsg(18 + 24); // NETMSGTYPE_SV_CLIENTINFO
SelfClientInfoMsg.AddInt(ClientID); SelfClientInfoMsg.AddInt(ClientID);
SelfClientInfoMsg.AddInt(1); // m_Local SelfClientInfoMsg.AddInt(1); // m_Local
SelfClientInfoMsg.AddInt(m_apPlayers[ClientID]->GetTeam()); SelfClientInfoMsg.AddInt(m_apPlayers[ClientID]->GetTeam());
SelfClientInfoMsg.AddString(Server()->ClientName(ClientID), -1); SelfClientInfoMsg.AddString(Server()->ClientName(ClientID), -1);
SelfClientInfoMsg.AddString(Server()->ClientClan(ClientID), -1); SelfClientInfoMsg.AddString(Server()->ClientClan(ClientID), -1);
SelfClientInfoMsg.AddInt(Server()->ClientCountry(ClientID)); SelfClientInfoMsg.AddInt(Server()->ClientCountry(ClientID));
for(int p = 0; p < 6; p++) for(int p = 0; p < 6; p++) SelfClientInfoMsg.AddString("", -1);
{ for(int p = 0; p < 6; p++) SelfClientInfoMsg.AddInt(0);
SelfClientInfoMsg.AddString("", -1); // m_apSkinPartNames for(int p = 0; p < 6; p++) SelfClientInfoMsg.AddInt(0);
SelfClientInfoMsg.AddInt(0); // m_aUseCustomColors
SelfClientInfoMsg.AddInt(0); // m_aSkinPartColors
}
SelfClientInfoMsg.AddInt(0); // m_Silent SelfClientInfoMsg.AddInt(0); // m_Silent
Server()->SendMsg(&SelfClientInfoMsg, MSGFLAG_VITAL|MSGFLAG_NORECORD, ClientID); Server()->SendMsg(&SelfClientInfoMsg, MSGFLAG_VITAL|MSGFLAG_NORECORD, ClientID);
} }
} }

View file

@ -569,8 +569,6 @@ void IGameController::Snap(int SnappingClient)
pGameData[1] = 0; // m_GameStateFlags pGameData[1] = 0; // m_GameStateFlags
pGameData[2] = 0; // m_GameStateEndTick pGameData[2] = 0; // m_GameStateEndTick
} }
SnapFlags(SnappingClient);
} }
int IGameController::GetAutoTeam(int NotThisID) int IGameController::GetAutoTeam(int NotThisID)