147 if (pExistingClientInfo)
152 if (!pPlrInfo->
GetID())
if ((pRes = pPlrInfo->
GetRes()))
157 Log(
"Network: Duplicate player join rejected!");
166 Log(
"Network: Empty player join request ignored!");
178 UpdateSavegameAssignments(&OwnInfoPacket);
187 int32_t iPlrInfo = 0;
232 pClientInfo = rInfoList.
AddInfo(pClientInfo);
246 JoinUnjoinedPlayersInControlQueue(pClientInfo);
275 if (!pNewInfo)
return;
350 const char *szPlrName = pInfo->
GetName();
if (!szPlrName) szPlrName=
"???";
351 LogF(
"Network: C4Network2Players::JoinUnjoinedPlayersInControlQueue failed to join player %s!", szPlrName);
377 #define GETPKT(type, name) \
378 assert(pPacket); const type &name = \
379 static_cast<const type &>(*pPacket);
394 if (!pClient || !pClient->
isHost())
return;
408 if (!ppCltInfo)
return;
410 for (int32_t i = 0; i < (*ppCltInfo)->GetPlayerCount();)
415 (*ppCltInfo)->RemoveIndexedInfo(i);
421 if (!(*ppCltInfo)->GetPlayerCount())
458 JoinUnjoinedPlayersInControlQueue(pkInfo);
bool Log(const char *szMessage)
bool LogF(const char *strMessage,...)
#define GETPKT(type, name)
C4NetIOPacket MkC4NetIOPacket(char cStatus, const class C4PacketBase &Pkt, const C4NetIO::addr_t &addr=C4NetIO::addr_t())
C4Client * getLocal() const
C4Client * getClientByID(int32_t iID) const
int32_t getLocalID() const
bool IsInitialPacket() const
int32_t GetClientID() const
void RemoveIndexedInfo(int32_t iAtIndex)
C4PlayerInfo * GetPlayerInfo(int32_t iIndex) const
int32_t GetPlayerCount() const
bool HasUnjoinedPlayers() const
C4PlayerInfo * GetPlayerInfoByRes(int32_t idResID) const
void Add(C4PacketType eType, C4ControlPacket *pCtrl)
void DoInput(C4PacketType eCtrlType, C4ControlPacket *pPkt, C4ControlDeliveryType eDelivery)
C4RoundResults & RoundResults
char PlayerFilenames[20 *_MAX_PATH_LEN]
C4PlayerInfoList & PlayerInfos
C4PlayerInfoList & RestorePlayerInfos
C4GameParameters & Parameters
C4Network2Client * GetClient(const char *szName) const
C4Network2Client * GetClientByID(int32_t iID) const
bool SendMsgToHost(C4NetIOPacket rPkt)
class C4GameLobby::MainDlg * GetLobby() const
void InvalidateReference()
bool LeaguePlrAuthCheck(C4PlayerInfo *pInfo)
C4Network2ClientList Clients
bool isLobbyActive() const
bool LeaguePlrAuth(C4PlayerInfo *pInfo)
C4ClientPlayerInfos * GetIndexedPlayerInfoPacket(int iIndex)
void OnClientPart(class C4Client *pPartClient)
void ResetUpdatedPlayers()
DWORD GetClientChatColor(int idForClient, bool fLobby) const
void HandlePlayerInfo(const class C4ClientPlayerInfos &rInfoPacket)
void HandlePlayerInfoUpdRequest(const class C4ClientPlayerInfos *pInfoPacket, bool fByHost)
C4ClientPlayerInfos * GetLocalPlayerInfoPacket() const
bool JoinLocalPlayer(const char *szLocalPlayerFilename, bool initial=false)
void SendUpdatedPlayers()
void RequestPlayerInfoUpdate(const class C4ClientPlayerInfos &rRequest)
void HandlePacket(char cStatus, const C4PacketBase *pPacket, class C4Network2IOConnection *pConn)
const char * getFile() const
const C4Network2ResCore & getCore() const
uint32_t GetColor() const
void ResetLeagueProjectedGain()
bool HasJoinIssued() const
void SetAssociatedSavegamePlayer(int32_t aidSavegamePlayer)
int32_t GetAssociatedSavegamePlayerID() const
uint32_t GetLobbyColor() const
const char * GetName() const
void SetAuthID(const char *sznAuthID)
C4PlayerType GetType() const
C4Network2Res * GetRes() const
bool IsJoinForSavegameOnly()
C4ClientPlayerInfos * GetInfoByClientID(int32_t iClientID) const
void UpdatePlayerAttributes(C4ClientPlayerInfos *pForInfo, bool fResolveConflicts)
C4ClientPlayerInfos * GetIndexedInfo(int32_t iIndex) const
void AssignTeams(C4ClientPlayerInfos *pNewClientInfo, bool fByHost)
void CreateRestoreInfosForJoinedScriptPlayers(C4PlayerInfoList &rSavegamePlayers)
void RemoveInfo(C4ClientPlayerInfos **ppRemoveInfo)
C4PlayerInfo * GetPlayerInfoByID(int32_t id) const
C4ClientPlayerInfos * AddInfo(C4ClientPlayerInfos *pNewClientInfo)
C4ClientPlayerInfos ** GetInfoPtrByClientID(int32_t iClientID) const
void ResetLeagueProjectedGain(bool fSetUpdated)
bool AssignPlayerIDs(C4ClientPlayerInfos *pNewClientInfo)
void EvaluateLeague(const char *szResultMsg, bool fSuccess, const C4RoundResultsPlayers &rLeagueInfo)