OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4PlayerInfoList Class Reference

#include <C4PlayerInfo.h>

Public Member Functions

 C4PlayerInfoList ()
 
 C4PlayerInfoList (const C4PlayerInfoList &rCpy)
 
 ~C4PlayerInfoList ()
 
C4PlayerInfoListoperator= (const C4PlayerInfoList &rCpy)
 
void Clear ()
 
bool DoPlayerInfoUpdate (C4ClientPlayerInfos *pUpdate)
 
bool DoLocalNonNetworkPlayerJoin (const char *szPlayerFile)
 
bool DoLocalNonNetworkPlayerInfoUpdate (C4ClientPlayerInfos *pUpdate)
 
bool AssignPlayerIDs (C4ClientPlayerInfos *pNewClientInfo)
 
void AssignTeams (C4ClientPlayerInfos *pNewClientInfo, bool fByHost)
 
void RecheckAutoGeneratedTeams ()
 
C4ClientPlayerInfosAddInfo (C4ClientPlayerInfos *pNewClientInfo)
 
void ResolvePlayerAttributeConflicts (C4ClientPlayerInfos *pSecPacket)
 
void UpdatePlayerAttributes (C4ClientPlayerInfos *pForInfo, bool fResolveConflicts)
 
void UpdatePlayerAttributes ()
 
int32_t GetInfoCount () const
 
C4ClientPlayerInfosGetIndexedInfo (int32_t iIndex) const
 
C4ClientPlayerInfos ** GetInfoPtrByClientID (int32_t iClientID) const
 
C4ClientPlayerInfosGetInfoByClientID (int32_t iClientID) const
 
C4PlayerInfoGetPlayerInfoByIndex (int32_t index) const
 
C4PlayerInfoGetPlayerInfoByID (int32_t id) const
 
C4PlayerInfoGetPlayerInfoByID (int32_t id, int32_t *pidClient) const
 
C4ClientPlayerInfosGetClientInfoByPlayerID (int32_t id) const
 
C4PlayerInfoGetPlayerInfoBySavegameID (int32_t id) const
 
C4PlayerInfoGetNextPlayerInfoByID (int32_t id) const
 
C4PlayerInfoGetActivePlayerInfoByName (const char *szName)
 
int32_t GetPlayerCount () const
 
int32_t GetJoinIssuedPlayerCount () const
 
int32_t GetJoinPendingPlayerCount () const
 
int32_t GetActivePlayerCount (bool fCountInvisible) const
 
StdStrBuf GetActivePlayerNames (bool fCountInvisible, int32_t iAtClientID=-1) const
 
int32_t GetActiveScriptPlayerCount (bool fCountSavegameResumes, bool fCountInvisible) const
 
C4PlayerInfoGetPrimaryInfoByClientID (int32_t iClientID) const
 
C4PlayerInfoFindSavegameResumePlayerInfo (const C4PlayerInfo *pMatchInfo, MatchingLevel mlMatchStart, MatchingLevel mlMatchEnd) const
 
bool HasSameTeamPlayers (int32_t iClient1, int32_t iClient2) const
 
C4PlayerInfoFindUnassociatedRestoreInfo (const C4PlayerInfoList &rRestoreInfoList)
 
void RemoveInfo (C4ClientPlayerInfos **ppRemoveInfo)
 
bool Load (C4Group &hGroup, const char *szFromFile, class C4LangStringTable *pLang=nullptr)
 
bool Save (C4Group &hGroup, const char *szToFile)
 
void SetIDCounter (int32_t idNewCounter)
 
int32_t GetIDCounter ()
 
void FixIDCounter ()
 
bool InitLocal ()
 
bool LocalJoinUnjoinedPlayersInQueue ()
 
int32_t GetStartupCount ()
 
void CreateRestoreInfosForJoinedScriptPlayers (C4PlayerInfoList &rSavegamePlayers)
 
bool RecreatePlayers (C4ValueNumbers *)
 
bool RecreatePlayerFiles ()
 
bool RestoreSavegameInfos (C4PlayerInfoList &rSavegamePlayers)
 
bool SetAsRestoreInfos (C4PlayerInfoList &rFromPlayers, bool fSaveUserPlrs, bool fSaveScriptPlrs, bool fSetUserPlrRefToLocalGroup, bool fSetScriptPlrRefToLocalGroup)
 
void RemoveUnassociatedPlayers (C4PlayerInfoList &rSavegamePlayers)
 
int32_t GetFreePlayerSlotCount ()
 
void ResetLeagueProjectedGain (bool fSetUpdated)
 
void LoadResources ()
 
void CompileFunc (StdCompiler *pComp)
 

Detailed Description

Definition at line 308 of file C4PlayerInfo.h.

Constructor & Destructor Documentation

C4PlayerInfoList::C4PlayerInfoList ( )

Definition at line 682 of file C4PlayerInfo.cpp.

682  : iClientCount(0), iClientCapacity(0), ppClients(nullptr), iLastPlayerID(0)
683 {
684  // ctor: no need to alloc mem yet
685 }
C4PlayerInfoList::C4PlayerInfoList ( const C4PlayerInfoList rCpy)

Definition at line 687 of file C4PlayerInfo.cpp.

687  : iClientCount(rCpy.iClientCount), iClientCapacity(rCpy.iClientCapacity),
688  ppClients(nullptr), iLastPlayerID(rCpy.iLastPlayerID)
689 {
690  // copy client info vector
691  if (rCpy.ppClients)
692  {
693  ppClients = new C4ClientPlayerInfos*[iClientCapacity];
694  C4ClientPlayerInfos **ppInfo = ppClients, **ppCpy = rCpy.ppClients;
695  int32_t i = iClientCount;
696  while (i--) *ppInfo++ = new C4ClientPlayerInfos(**ppCpy++);
697  }
698 }
C4PlayerInfoList::~C4PlayerInfoList ( )
inline

Definition at line 324 of file C4PlayerInfo.h.

References Clear().

324 { Clear(); } // dtor

Here is the call graph for this function:

Member Function Documentation

C4ClientPlayerInfos * C4PlayerInfoList::AddInfo ( C4ClientPlayerInfos pNewClientInfo)

Definition at line 890 of file C4PlayerInfo.cpp.

References AssignPlayerIDs(), Game, C4ClientPlayerInfos::GetClientID(), C4TeamList::GetGenerateTeamByID(), GetInfoPtrByClientID(), C4ClientPlayerInfos::GetPlayerInfo(), C4PlayerInfo::GetTeam(), C4ClientPlayerInfos::GrabMergeFrom(), C4ClientPlayerInfos::IsAddPacket(), C4Network2::isEnabled(), C4Network2::isHost(), Network, C4ClientPlayerInfos::ResetAdd(), and C4Game::Teams.

Referenced by C4Network2Players::HandlePlayerInfo(), and InitLocal().

891 {
892  assert(pNewClientInfo);
893  // caution: also called for RestorePlayerInfos-list
894  // host: reserve new IDs for all players
895  // client: all IDs should be assigned already by host
896  if (::Network.isHost() || !::Network.isEnabled())
897  {
898  if (!AssignPlayerIDs(pNewClientInfo) && pNewClientInfo->IsAddPacket())
899  {
900  // no players could be added (probably MaxPlayer)
901  delete pNewClientInfo;
902  return nullptr;
903  }
904  }
905  // ensure all teams specified in the list exist (this should be done for savegame teams as well)
906  C4PlayerInfo *pInfo; int32_t i=0;
907  while ((pInfo = pNewClientInfo->GetPlayerInfo(i++)))
908  {
909  int32_t idTeam = pInfo->GetTeam();
910  if (idTeam) Game.Teams.GetGenerateTeamByID(idTeam);
911  }
912  // add info for client; overwriting or appending to existing info if necessary
913  // try to find existing data of same client
914  C4ClientPlayerInfos **ppExistingInfo = GetInfoPtrByClientID(pNewClientInfo->GetClientID());
915  if (ppExistingInfo)
916  {
917  // info exists: append to it?
918  if (pNewClientInfo->IsAddPacket())
919  {
920  (*ppExistingInfo)->GrabMergeFrom(*pNewClientInfo);
921  // info added: remove unused class
922  delete pNewClientInfo;
923  // assign existing info for further usage in this fn
924  return pNewClientInfo = *ppExistingInfo;
925  }
926  // no add packet: overwrite current info
927  delete *ppExistingInfo;
928  return *ppExistingInfo = pNewClientInfo;
929  }
930  // no existing info: add it directly
931  pNewClientInfo->ResetAdd();
932  // may need to grow list (vector) for that
933  if (iClientCount >= iClientCapacity) GrowList(4);
934  ppClients[iClientCount++] = pNewClientInfo;
935  // done; return actual info
936  return pNewClientInfo;
937 }
bool isHost() const
Definition: C4Network2.h:209
C4Game Game
Definition: C4Globals.cpp:52
C4Team * GetGenerateTeamByID(int32_t iID)
Definition: C4Teams.cpp:391
C4ClientPlayerInfos ** GetInfoPtrByClientID(int32_t iClientID) const
C4TeamList & Teams
Definition: C4Game.h:72
bool IsAddPacket() const
Definition: C4PlayerInfo.h:263
void GrabMergeFrom(C4ClientPlayerInfos &rFrom)
C4PlayerInfo * GetPlayerInfo(int32_t iIndex) const
C4Network2 Network
Definition: C4Globals.cpp:53
int32_t GetClientID() const
Definition: C4PlayerInfo.h:260
int32_t GetTeam() const
Definition: C4PlayerInfo.h:198
bool isEnabled() const
Definition: C4Network2.h:203
bool AssignPlayerIDs(C4ClientPlayerInfos *pNewClientInfo)

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4PlayerInfoList::AssignPlayerIDs ( C4ClientPlayerInfos pNewClientInfo)

Definition at line 838 of file C4PlayerInfo.cpp.

References FormatString(), Game, StdStrBuf::getData(), GetFreePlayerSlotCount(), C4PlayerInfo::GetID(), C4ClientPlayerInfos::GetPlayerCount(), C4ClientPlayerInfos::GetPlayerInfo(), LoadResStr(), Log(), C4GameParameters::MaxPlayers, C4Game::Parameters, C4ClientPlayerInfos::RemoveIndexedInfo(), and C4PlayerInfo::SetID().

Referenced by AddInfo(), DoLocalNonNetworkPlayerInfoUpdate(), and C4Network2Players::HandlePlayerInfoUpdRequest().

839 {
840  // assign player IDs to those player infos without
841  C4PlayerInfo *pPlrInfo; int32_t i=0;
842  while ((pPlrInfo = pNewClientInfo->GetPlayerInfo(i++)))
843  if (!pPlrInfo->GetID())
844  {
845  // are there still any player slots free?
846  if (GetFreePlayerSlotCount()<1)
847  {
848  // nope - then deny this join!
849  Log(FormatString(LoadResStr("IDS_MSG_TOOMANYPLAYERS"), (int)Game.Parameters.MaxPlayers).getData());
850  pNewClientInfo->RemoveIndexedInfo(--i);
851  continue;
852  }
853  // Join OK; grant an ID
854  pPlrInfo->SetID(++iLastPlayerID);
855  }
856  // return whether any join remains
857  return !!pNewClientInfo->GetPlayerCount();
858 }
const char * getData() const
Definition: StdBuf.h:450
C4Game Game
Definition: C4Globals.cpp:52
int32_t GetFreePlayerSlotCount()
C4GameParameters & Parameters
Definition: C4Game.h:69
const char * LoadResStr(const char *id)
Definition: C4Language.h:83
C4PlayerInfo * GetPlayerInfo(int32_t iIndex) const
int32_t GetPlayerCount() const
Definition: C4PlayerInfo.h:254
void SetID(int32_t iToID)
Definition: C4PlayerInfo.h:117
bool Log(const char *szMessage)
Definition: C4Log.cpp:195
void RemoveIndexedInfo(int32_t iAtIndex)
int32_t GetID() const
Definition: C4PlayerInfo.h:197
StdStrBuf FormatString(const char *szFmt,...)
Definition: StdBuf.cpp:277

Here is the call graph for this function:

Here is the caller graph for this function:

void C4PlayerInfoList::AssignTeams ( C4ClientPlayerInfos pNewClientInfo,
bool  fByHost 
)

Definition at line 866 of file C4PlayerInfo.cpp.

References Game, C4ClientPlayerInfos::GetPlayerInfo(), C4TeamList::IsMultiTeams(), C4TeamList::RecheckPlayerInfoTeams(), and C4Game::Teams.

Referenced by DoLocalNonNetworkPlayerInfoUpdate(), C4Network2Players::HandlePlayerInfoUpdRequest(), and InitLocal().

867 {
868  if (!Game.Teams.IsMultiTeams()) return;
869  // assign any unset teams (host/standalone only - fByHost determines whether the packet came from the host)
870  C4PlayerInfo *pPlrInfo; int32_t i=0;
871  while ((pPlrInfo = pNewClientInfo->GetPlayerInfo(i++)))
872  Game.Teams.RecheckPlayerInfoTeams(*pPlrInfo, fByHost);
873 }
C4Game Game
Definition: C4Globals.cpp:52
bool IsMultiTeams() const
Definition: C4Teams.h:163
C4TeamList & Teams
Definition: C4Game.h:72
bool RecheckPlayerInfoTeams(C4PlayerInfo &rNewJoin, bool fByHost)
Definition: C4Teams.cpp:464
C4PlayerInfo * GetPlayerInfo(int32_t iIndex) const

Here is the call graph for this function:

Here is the caller graph for this function:

void C4PlayerInfoList::Clear ( )

Definition at line 718 of file C4PlayerInfo.cpp.

Referenced by C4GameParameters::Clear(), CompileFunc(), C4Game::InitPlayers(), Load(), operator=(), and ~C4PlayerInfoList().

719 {
720  // delete client infos
721  C4ClientPlayerInfos **ppInfo = ppClients; int32_t i=iClientCount;
722  while (i--) delete *ppInfo++;
723  // clear client infos
724  delete [] ppClients; ppClients = nullptr;
725  iClientCount = iClientCapacity = 0;
726  // reset player ID counter
727  iLastPlayerID = 0;
728 }

Here is the caller graph for this function:

void C4PlayerInfoList::CompileFunc ( StdCompiler pComp)

Definition at line 1738 of file C4PlayerInfo.cpp.

References C4MaxClient, Clear(), StdCompiler::excCorrupt(), StdCompiler::hasNaming(), StdCompiler::isDeserializer(), mkArrayAdaptMap(), mkNamingAdapt(), StdCompiler::Value(), and ZeroMem().

1739 {
1740  bool deserializing = pComp->isDeserializer();
1741  if (deserializing) Clear();
1742  // skip compiling if there is nothing to compile (cosmentics)
1743  if (!deserializing && pComp->hasNaming() && iLastPlayerID == 0 && iClientCount == 0)
1744  return;
1745  // header
1746  pComp->Value(mkNamingAdapt(iLastPlayerID, "LastPlayerID", 0));
1747  // client count
1748  int32_t iTemp = iClientCount;
1749  pComp->Value(mkNamingCountAdapt<int32_t>(iTemp, "Client"));
1750  if (iTemp < 0 || iTemp > C4MaxClient)
1751  { pComp->excCorrupt("client count out of range"); return; }
1752  // grow list
1753  if (deserializing)
1754  {
1755  if (iTemp > iClientCapacity) GrowList(iTemp - iClientCapacity);
1756  iClientCount = iTemp;
1757  ZeroMem(ppClients, sizeof(*ppClients) * iClientCount);
1758  }
1759  // client packets
1760  pComp->Value(
1761  mkNamingAdapt(
1762  mkArrayAdaptMap(ppClients, iClientCount, mkPtrAdaptNoNull<C4ClientPlayerInfos>),
1763  "Client"));
1764  // force compiler to specialize
1765  mkPtrAdaptNoNull<C4ClientPlayerInfos>(*ppClients);
1766 }
virtual bool hasNaming()
Definition: StdCompiler.h:68
void excCorrupt(const char *szMessage,...)
Definition: StdCompiler.h:259
const int32_t C4MaxClient
Definition: C4Player.h:40
StdNamingAdapt< T > mkNamingAdapt(T &&rValue, const char *szName)
Definition: StdAdaptors.h:93
void Value(const T &rStruct)
Definition: StdCompiler.h:171
virtual bool isDeserializer()
Definition: StdCompiler.h:63
std::enable_if< std::is_pod< T >::value >::type ZeroMem(T *lpMem, size_t dwSize)
Definition: Standard.h:63
StdArrayAdapt< T, M > mkArrayAdaptMap(T *pArray, int iSize, M &&map)
Definition: StdAdaptors.h:311

Here is the call graph for this function:

void C4PlayerInfoList::CreateRestoreInfosForJoinedScriptPlayers ( C4PlayerInfoList rSavegamePlayers)

Definition at line 1331 of file C4PlayerInfo.cpp.

References C4ClientPlayerInfos::AddInfo(), C4PT_Script, Game, C4PlayerInfo::GetID(), GetIndexedInfo(), GetInfoCount(), C4PlayerInfo::GetName(), C4ClientPlayerInfos::GetPlayerInfo(), GetPlayerInfoBySavegameID(), C4PlayerInfo::GetType(), LogF(), C4TeamList::RecheckPlayers(), C4PlayerInfo::SetAssociatedSavegamePlayer(), and C4Game::Teams.

Referenced by C4Network2Players::Init(), and InitLocal().

1332 {
1333  // create matching script player joins for all script playeers in restore info
1334  // Just copy their infos to the first client
1335  int32_t i;
1336  C4ClientPlayerInfos *pHostInfo = GetIndexedInfo(0);
1337  for (i=0; i<rSavegamePlayers.GetInfoCount(); ++i)
1338  {
1339  C4ClientPlayerInfos *pkInfo = rSavegamePlayers.GetIndexedInfo(i);
1340  int32_t j=0; C4PlayerInfo *pInfo;
1341  while ((pInfo = pkInfo->GetPlayerInfo(j++)))
1342  if (pInfo->GetType() == C4PT_Script)
1343  {
1344  // safety
1345  C4PlayerInfo *pRejoinInfo;
1346  if ((pRejoinInfo = GetPlayerInfoBySavegameID(pInfo->GetID())))
1347  {
1348  LogF("Warning: User player %s takes over script player %s!", pRejoinInfo->GetName(), pInfo->GetName());
1349  continue;
1350  }
1351  if (!pHostInfo)
1352  {
1353  LogF("Error restoring savegame script players: No host player infos to add to!");
1354  continue;
1355  }
1356  // generate takeover info
1357  pRejoinInfo = new C4PlayerInfo(*pInfo);
1358  pRejoinInfo->SetAssociatedSavegamePlayer(pInfo->GetID());
1359  pHostInfo->AddInfo(pRejoinInfo);
1360  }
1361  }
1362  // teams must recognize the change
1364 }
void RecheckPlayers()
Definition: C4Teams.cpp:664
const char * GetName() const
Definition: C4PlayerInfo.h:160
void AddInfo(C4PlayerInfo *pAddInfo)
C4Game Game
Definition: C4Globals.cpp:52
C4ClientPlayerInfos * GetIndexedInfo(int32_t iIndex) const
Definition: C4PlayerInfo.h:361
C4TeamList & Teams
Definition: C4Game.h:72
C4PlayerInfo * GetPlayerInfo(int32_t iIndex) const
int32_t GetInfoCount() const
Definition: C4PlayerInfo.h:360
void SetAssociatedSavegamePlayer(int32_t aidSavegamePlayer)
Definition: C4PlayerInfo.h:127
int32_t GetID() const
Definition: C4PlayerInfo.h:197
C4PlayerType GetType() const
Definition: C4PlayerInfo.h:155
C4PlayerInfo * GetPlayerInfoBySavegameID(int32_t id) const
bool LogF(const char *strMessage,...)
Definition: C4Log.cpp:253

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4PlayerInfoList::DoLocalNonNetworkPlayerInfoUpdate ( C4ClientPlayerInfos pUpdate)

Definition at line 768 of file C4PlayerInfo.cpp.

References AssignPlayerIDs(), AssignTeams(), CDT_Direct, CDT_Queue, CID_PlrInfo, Control, C4GameControl::DoInput(), Game, C4Game::IsRunning, and UpdatePlayerAttributes().

Referenced by DoLocalNonNetworkPlayerJoin(), and DoPlayerInfoUpdate().

769 {
770  // assign IDs first: Must be done early, so AssignTeams works
771  if (!AssignPlayerIDs(pUpdate))
772  {
773  return false;
774  }
775  // set standard teams
776  AssignTeams(pUpdate, true);
777  // color/name change by team or savegame assignment
778  UpdatePlayerAttributes(pUpdate, true);
779  // add through queue: This will add directly, do the record and put player joins into the queue
780  // in running mode, this call will also put the actual player joins into the queue
782  // done, success
783  return true;
784 }
bool IsRunning
Definition: C4Game.h:141
C4Game Game
Definition: C4Globals.cpp:52
void UpdatePlayerAttributes()
void AssignTeams(C4ClientPlayerInfos *pNewClientInfo, bool fByHost)
C4GameControl Control
void DoInput(C4PacketType eCtrlType, C4ControlPacket *pPkt, C4ControlDeliveryType eDelivery)
bool AssignPlayerIDs(C4ClientPlayerInfos *pNewClientInfo)

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4PlayerInfoList::DoLocalNonNetworkPlayerJoin ( const char *  szPlayerFile)

Definition at line 744 of file C4PlayerInfo.cpp.

References DoLocalNonNetworkPlayerInfoUpdate().

Referenced by C4PlayerList::JoinNew().

745 {
746  // construct joining information
747  C4ClientPlayerInfos *pNewJoin = new C4ClientPlayerInfos(szPlayerFile, true);
748  // handle it
749  bool fSuccess = DoLocalNonNetworkPlayerInfoUpdate(pNewJoin);
750  // done
751  delete pNewJoin;
752  return fSuccess;
753 }
bool DoLocalNonNetworkPlayerInfoUpdate(C4ClientPlayerInfos *pUpdate)

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4PlayerInfoList::DoPlayerInfoUpdate ( C4ClientPlayerInfos pUpdate)

Definition at line 755 of file C4PlayerInfo.cpp.

References Control, DoLocalNonNetworkPlayerInfoUpdate(), C4GameControl::isCtrlHost(), C4GameControl::isNetwork(), Network, C4Network2::Players, and C4Network2Players::RequestPlayerInfoUpdate().

756 {
757  // never done by clients or in replay - update will be handled via queue
758  if (!::Control.isCtrlHost()) return false;
759  // in network game, process by host. In offline game, just create control
760  bool fSucc = true;
761  if (::Control.isNetwork())
763  else
764  fSucc = DoLocalNonNetworkPlayerInfoUpdate(pUpdate);
765  return fSucc;
766 }
void RequestPlayerInfoUpdate(const class C4ClientPlayerInfos &rRequest)
bool isCtrlHost() const
Definition: C4GameControl.h:99
bool isNetwork() const
Definition: C4GameControl.h:97
C4Network2 Network
Definition: C4Globals.cpp:53
C4GameControl Control
C4Network2Players Players
Definition: C4Network2.h:119
bool DoLocalNonNetworkPlayerInfoUpdate(C4ClientPlayerInfos *pUpdate)

Here is the call graph for this function:

C4PlayerInfo * C4PlayerInfoList::FindSavegameResumePlayerInfo ( const C4PlayerInfo pMatchInfo,
MatchingLevel  mlMatchStart,
MatchingLevel  mlMatchEnd 
) const

Definition at line 1162 of file C4PlayerInfo.cpp.

References Game, GetFilename(), C4PlayerInfo::GetFilename(), C4PlayerInfo::GetID(), C4PlayerInfo::GetName(), C4PlayerInfo::GetOriginalColor(), GetPlayerInfoByID(), GetPlayerInfoBySavegameID(), C4Game::PlayerInfos, and SEqualNoCase().

Referenced by RestoreSavegameInfos().

1163 {
1164  assert(pMatchInfo);
1165  // try different matching levels using the infamous for-case-paradigm
1166  for (int iMatchLvl = mlMatchStart; iMatchLvl <= mlMatchEnd; ++iMatchLvl)
1167  {
1168  for (int32_t i=0; i<iClientCount; ++i)
1169  {
1170  int32_t j=0; C4PlayerInfo *pInfo;
1171  while ((pInfo = ppClients[i]->GetPlayerInfo(j++)))
1172  if (!Game.PlayerInfos.GetPlayerInfoByID(pInfo->GetID()) && !Game.PlayerInfos.GetPlayerInfoBySavegameID(pInfo->GetID())) // only unassigned player infos
1173  switch (iMatchLvl)
1174  {
1175  case PML_PlrFileName: // file name and player name must match
1176  if (!pMatchInfo->GetFilename() || !pInfo->GetFilename()) break;
1177  if (!SEqualNoCase(GetFilename(pMatchInfo->GetFilename()), GetFilename(pInfo->GetFilename()))) break;
1178  // nobreak: Check player name as well
1179  case PML_PlrName: // match player name
1180  if (SEqualNoCase(pMatchInfo->GetName(), pInfo->GetName()))
1181  return pInfo;
1182  break;
1183  case PML_PrefColor: // match player color
1184  if (pMatchInfo->GetOriginalColor() == pInfo->GetOriginalColor())
1185  return pInfo;
1186  break;
1187  case PML_Any: // match anything
1188  return pInfo;
1189  }
1190  }
1191  }
1192  // no match
1193  return nullptr;
1194 }
char * GetFilename(char *szPath)
Definition: StdFile.cpp:55
const char * GetName() const
Definition: C4PlayerInfo.h:160
C4Game Game
Definition: C4Globals.cpp:52
bool SEqualNoCase(const char *szStr1, const char *szStr2, int iLen)
Definition: Standard.cpp:177
uint32_t GetOriginalColor() const
Definition: C4PlayerInfo.h:158
C4PlayerInfo * GetPlayerInfoByID(int32_t id) const
const char * GetFilename() const
Definition: C4PlayerInfo.h:164
C4PlayerInfoList & PlayerInfos
Definition: C4Game.h:73
int32_t GetID() const
Definition: C4PlayerInfo.h:197
C4PlayerInfo * GetPlayerInfoBySavegameID(int32_t id) const

Here is the call graph for this function:

Here is the caller graph for this function:

C4PlayerInfo * C4PlayerInfoList::FindUnassociatedRestoreInfo ( const C4PlayerInfoList rRestoreInfoList)

Definition at line 1196 of file C4PlayerInfo.cpp.

References C4PlayerInfo::GetID(), GetIndexedInfo(), C4ClientPlayerInfos::GetPlayerInfo(), GetPlayerInfoByID(), GetPlayerInfoBySavegameID(), and C4PlayerInfo::IsJoined().

Referenced by C4GameLobby::MainDlg::Start().

1197 {
1198  // search given list for a player that's not associated locally
1199  C4ClientPlayerInfos *pRestoreClient; int32_t iClient=0;
1200  while ((pRestoreClient = rRestoreInfoList.GetIndexedInfo(iClient++)))
1201  {
1202  C4PlayerInfo *pRestoreInfo; int32_t iInfo=0;
1203  while ((pRestoreInfo = pRestoreClient->GetPlayerInfo(iInfo++)))
1204  if (pRestoreInfo->IsJoined())
1205  // match association either by savegame ID (before C4Game::InitPlayers) or real ID (after C4Game::InitPlayers)
1206  if (!GetPlayerInfoBySavegameID(pRestoreInfo->GetID()) && !GetPlayerInfoByID(pRestoreInfo->GetID()))
1207  return pRestoreInfo;
1208  }
1209  // no unassociated info found
1210  return nullptr;
1211 }
C4ClientPlayerInfos * GetIndexedInfo(int32_t iIndex) const
Definition: C4PlayerInfo.h:361
C4PlayerInfo * GetPlayerInfoByID(int32_t id) const
C4PlayerInfo * GetPlayerInfo(int32_t iIndex) const
bool IsJoined() const
Definition: C4PlayerInfo.h:169
int32_t GetID() const
Definition: C4PlayerInfo.h:197
C4PlayerInfo * GetPlayerInfoBySavegameID(int32_t id) const

Here is the call graph for this function:

Here is the caller graph for this function:

void C4PlayerInfoList::FixIDCounter ( )

Definition at line 1788 of file C4PlayerInfo.cpp.

References C4PlayerInfo::GetID().

Referenced by C4GameControl::ChangeToLocal().

1789 {
1790  // make sure ID counter is same as largest info
1791  for (int32_t i=0; i<iClientCount; ++i)
1792  {
1793  int32_t j=0; C4PlayerInfo *pInfo;
1794  while ((pInfo = ppClients[i]->GetPlayerInfo(j++)))
1795  {
1796  iLastPlayerID = std::max<int32_t>(pInfo->GetID(), iLastPlayerID);
1797  }
1798  }
1799 }
int32_t GetID() const
Definition: C4PlayerInfo.h:197

Here is the call graph for this function:

Here is the caller graph for this function:

int32_t C4PlayerInfoList::GetActivePlayerCount ( bool  fCountInvisible) const

Definition at line 987 of file C4PlayerInfo.cpp.

References C4ClientPlayerInfos::GetPlayerCount(), C4ClientPlayerInfos::GetPlayerInfo(), C4PlayerInfo::IsInvisible(), and C4PlayerInfo::IsRemoved().

Referenced by C4Game::InitPlayers(), C4StartupNetListEntry::OnReference(), and C4StartupNetListEntry::SetReference().

988 {
989  // count players of all clients
990  int32_t iCount=0;
991  for (int32_t i=0; i<iClientCount; ++i)
992  {
993  C4ClientPlayerInfos *pClient = ppClients[i];
994  for (int32_t j=0; j<pClient->GetPlayerCount(); ++j)
995  {
996  C4PlayerInfo *pInfo = pClient->GetPlayerInfo(j);
997  if (!pInfo->IsRemoved())
998  if (fCountInvisible || !pInfo->IsInvisible())
999  ++iCount;
1000  }
1001  }
1002  // return it
1003  return iCount;
1004 }
bool IsInvisible() const
Definition: C4PlayerInfo.h:178
C4PlayerInfo * GetPlayerInfo(int32_t iIndex) const
int32_t GetPlayerCount() const
Definition: C4PlayerInfo.h:254
bool IsRemoved() const
Definition: C4PlayerInfo.h:167

Here is the call graph for this function:

Here is the caller graph for this function:

C4PlayerInfo * C4PlayerInfoList::GetActivePlayerInfoByName ( const char *  szName)

Definition at line 1147 of file C4PlayerInfo.cpp.

References C4PlayerInfo::GetName(), C4PlayerInfo::IsRemoved(), and SEqualNoCase().

Referenced by C4TeamList::GetScriptPlayerName().

1148 {
1149  // check all packets for matching players
1150  for (int32_t i=0; i<iClientCount; ++i)
1151  {
1152  int32_t j=0; C4PlayerInfo *pInfo;
1153  while ((pInfo = ppClients[i]->GetPlayerInfo(j++)))
1154  if (!pInfo->IsRemoved())
1155  if (SEqualNoCase(szName, pInfo->GetName()))
1156  return pInfo;
1157  }
1158  // nothing found
1159  return nullptr;
1160 }
const char * GetName() const
Definition: C4PlayerInfo.h:160
bool SEqualNoCase(const char *szStr1, const char *szStr2, int iLen)
Definition: Standard.cpp:177
bool IsRemoved() const
Definition: C4PlayerInfo.h:167

Here is the call graph for this function:

Here is the caller graph for this function:

StdStrBuf C4PlayerInfoList::GetActivePlayerNames ( bool  fCountInvisible,
int32_t  iAtClientID = -1 
) const

Definition at line 1027 of file C4PlayerInfo.cpp.

References StdStrBuf::Append(), C4ClientPlayerInfos::GetClientID(), C4PlayerInfo::GetName(), C4ClientPlayerInfos::GetPlayerCount(), C4ClientPlayerInfos::GetPlayerInfo(), C4PlayerInfo::IsInvisible(), and C4PlayerInfo::IsRemoved().

Referenced by C4StartupNetListEntry::SetReference().

1028 {
1029  // add up players of all clients
1030  StdStrBuf sPlr;
1031  int32_t iCount=0;
1032  for (int32_t i=0; i<iClientCount; ++i)
1033  {
1034  C4ClientPlayerInfos *pClient = ppClients[i];
1035  if (iAtClientID != -1 && pClient->GetClientID() != iAtClientID) continue;
1036  for (int32_t j=0; j<pClient->GetPlayerCount(); ++j)
1037  {
1038  C4PlayerInfo *pInfo = pClient->GetPlayerInfo(j);
1039  if (!pInfo->IsRemoved()) if (fCountInvisible || !pInfo->IsInvisible())
1040  {
1041  if (iCount++)
1042  {
1043  // not first name: Add separator
1044  sPlr.Append(", ");
1045  }
1046  sPlr.Append(pInfo->GetName());
1047  }
1048  }
1049  }
1050  // return it
1051  return sPlr;
1052 }
const char * GetName() const
Definition: C4PlayerInfo.h:160
bool IsInvisible() const
Definition: C4PlayerInfo.h:178
C4PlayerInfo * GetPlayerInfo(int32_t iIndex) const
int32_t GetClientID() const
Definition: C4PlayerInfo.h:260
void Append(const char *pnData, size_t iChars)
Definition: StdBuf.h:527
int32_t GetPlayerCount() const
Definition: C4PlayerInfo.h:254
bool IsRemoved() const
Definition: C4PlayerInfo.h:167

Here is the call graph for this function:

Here is the caller graph for this function:

int32_t C4PlayerInfoList::GetActiveScriptPlayerCount ( bool  fCountSavegameResumes,
bool  fCountInvisible 
) const

Definition at line 1006 of file C4PlayerInfo.cpp.

References C4PT_Script, C4PlayerInfo::GetAssociatedSavegamePlayerID(), C4ClientPlayerInfos::GetPlayerCount(), C4ClientPlayerInfos::GetPlayerInfo(), C4PlayerInfo::GetType(), C4PlayerInfo::IsInvisible(), and C4PlayerInfo::IsRemoved().

Referenced by C4Game::InitPlayers().

1007 {
1008  // count players of all clients
1009  int32_t iCount=0;
1010  for (int32_t i=0; i<iClientCount; ++i)
1011  {
1012  C4ClientPlayerInfos *pClient = ppClients[i];
1013  for (int32_t j=0; j<pClient->GetPlayerCount(); ++j)
1014  {
1015  C4PlayerInfo *pNfo = pClient->GetPlayerInfo(j);
1016  if (!pNfo->IsRemoved())
1017  if (pNfo->GetType() == C4PT_Script)
1018  if (fCountSavegameResumes || !pNfo->GetAssociatedSavegamePlayerID())
1019  if (fCountInvisible || !pNfo->IsInvisible())
1020  ++iCount;
1021  }
1022  }
1023  // return it
1024  return iCount;
1025 }
bool IsInvisible() const
Definition: C4PlayerInfo.h:178
C4PlayerInfo * GetPlayerInfo(int32_t iIndex) const
int32_t GetAssociatedSavegamePlayerID() const
Definition: C4PlayerInfo.h:129
int32_t GetPlayerCount() const
Definition: C4PlayerInfo.h:254
bool IsRemoved() const
Definition: C4PlayerInfo.h:167
C4PlayerType GetType() const
Definition: C4PlayerInfo.h:155

Here is the call graph for this function:

Here is the caller graph for this function:

C4ClientPlayerInfos * C4PlayerInfoList::GetClientInfoByPlayerID ( int32_t  id) const

Definition at line 1083 of file C4PlayerInfo.cpp.

References C4PlayerInfo::GetID().

Referenced by C4MessageInput::ProcessCommand(), C4TeamList::ReassignAllTeams(), and C4TeamList::RecheckTeams().

1084 {
1085  // get client info that contains a specific player
1086  assert(id);
1087  for (int32_t i=0; i<iClientCount; ++i)
1088  {
1089  int32_t j=0; C4PlayerInfo *pInfo;
1090  while ((pInfo = ppClients[i]->GetPlayerInfo(j++)))
1091  if (pInfo->GetID() == id) return ppClients[i];
1092  }
1093  // nothing found
1094  return nullptr;
1095 }
int32_t GetID() const
Definition: C4PlayerInfo.h:197

Here is the call graph for this function:

Here is the caller graph for this function:

int32_t C4PlayerInfoList::GetFreePlayerSlotCount ( )

Definition at line 860 of file C4PlayerInfo.cpp.

References Game, GetStartupCount(), C4GameParameters::MaxPlayers, and C4Game::Parameters.

Referenced by AssignPlayerIDs().

861 {
862  // number of free slots depends on max player setting
863  return std::max<int32_t>(Game.Parameters.MaxPlayers - GetStartupCount(), 0);
864 }
C4Game Game
Definition: C4Globals.cpp:52
C4GameParameters & Parameters
Definition: C4Game.h:69
int32_t GetStartupCount()

Here is the call graph for this function:

Here is the caller graph for this function:

int32_t C4PlayerInfoList::GetIDCounter ( )
inline

Definition at line 398 of file C4PlayerInfo.h.

Referenced by C4GameParameters::Load().

398 { return iLastPlayerID; }

Here is the caller graph for this function:

C4ClientPlayerInfos* C4PlayerInfoList::GetInfoByClientID ( int32_t  iClientID) const
inline

Definition at line 364 of file C4PlayerInfo.h.

References GetInfoPtrByClientID().

Referenced by C4Network2Players::GetClientChatColor(), GetPrimaryInfoByClientID(), C4Network2Players::HandlePlayerInfoUpdRequest(), HasSameTeamPlayers(), C4Network2::LeagueNotifyDisconnect(), and C4Network2::OpenVoteDialog().

365  { C4ClientPlayerInfos **ppNfo = GetInfoPtrByClientID(iClientID); return ppNfo ? *ppNfo : nullptr; }
C4ClientPlayerInfos ** GetInfoPtrByClientID(int32_t iClientID) const

Here is the call graph for this function:

Here is the caller graph for this function:

int32_t C4PlayerInfoList::GetInfoCount ( ) const
inline

Definition at line 360 of file C4PlayerInfo.h.

Referenced by C4PlayerInfoListAttributeConflictResolver::C4PlayerInfoListAttributeConflictResolver(), CreateRestoreInfosForJoinedScriptPlayers(), InitLocal(), and RestoreSavegameInfos().

360 { return iClientCount; } // get number of registered client infos

Here is the caller graph for this function:

C4ClientPlayerInfos ** C4PlayerInfoList::GetInfoPtrByClientID ( int32_t  iClientID) const

Definition at line 939 of file C4PlayerInfo.cpp.

Referenced by AddInfo(), GetInfoByClientID(), LocalJoinUnjoinedPlayersInQueue(), C4Network2Players::OnClientPart(), and SetAsRestoreInfos().

940 {
941  // search list
942  for (int32_t i=0; i<iClientCount; ++i) if (ppClients[i]->GetClientID() == iClientID) return ppClients+i;
943  // nothing found
944  return nullptr;
945 }

Here is the caller graph for this function:

int32_t C4PlayerInfoList::GetJoinIssuedPlayerCount ( ) const

Definition at line 957 of file C4PlayerInfo.cpp.

References C4ClientPlayerInfos::GetPlayerCount(), C4ClientPlayerInfos::GetPlayerInfo(), and C4PlayerInfo::HasJoinIssued().

Referenced by C4Viewport::Execute(), and C4Game::InitPlayers().

958 {
959  // count players of all clients
960  int32_t iCount=0;
961  for (int32_t i=0; i<iClientCount; ++i)
962  {
963  C4ClientPlayerInfos *pClient = ppClients[i];
964  for (int32_t j=0; j<pClient->GetPlayerCount(); ++j)
965  if (pClient->GetPlayerInfo(j)->HasJoinIssued())
966  ++iCount;
967  }
968  // return it
969  return iCount;
970 }
C4PlayerInfo * GetPlayerInfo(int32_t iIndex) const
int32_t GetPlayerCount() const
Definition: C4PlayerInfo.h:254
bool HasJoinIssued() const
Definition: C4PlayerInfo.h:170

Here is the call graph for this function:

Here is the caller graph for this function:

int32_t C4PlayerInfoList::GetJoinPendingPlayerCount ( ) const

Definition at line 972 of file C4PlayerInfo.cpp.

References C4ClientPlayerInfos::GetPlayerCount(), C4ClientPlayerInfos::GetPlayerInfo(), and C4PlayerInfo::HasJoinPending().

Referenced by C4Game::OnPlayerJoinFinished().

973 {
974  // count players of all clients
975  int32_t iCount = 0;
976  for (int32_t i = 0; i<iClientCount; ++i)
977  {
978  C4ClientPlayerInfos *pClient = ppClients[i];
979  for (int32_t j = 0; j<pClient->GetPlayerCount(); ++j)
980  if (pClient->GetPlayerInfo(j)->HasJoinPending())
981  ++iCount;
982  }
983  // return it
984  return iCount;
985 }
bool HasJoinPending() const
Definition: C4PlayerInfo.h:171
C4PlayerInfo * GetPlayerInfo(int32_t iIndex) const
int32_t GetPlayerCount() const
Definition: C4PlayerInfo.h:254

Here is the call graph for this function:

Here is the caller graph for this function:

C4PlayerInfo * C4PlayerInfoList::GetNextPlayerInfoByID ( int32_t  id) const

Definition at line 1131 of file C4PlayerInfo.cpp.

References C4PlayerInfo::GetID().

Referenced by C4MessageInput::ProcessCommand(), C4TeamList::ReassignAllTeams(), and C4Team::RecheckPlayers().

1132 {
1133  // check all packets for players
1134  C4PlayerInfo *pSmallest=nullptr;
1135  for (int32_t i=0; i<iClientCount; ++i)
1136  {
1137  int32_t j=0; C4PlayerInfo *pInfo;
1138  while ((pInfo = ppClients[i]->GetPlayerInfo(j++)))
1139  if (pInfo->GetID() > id)
1140  if (!pSmallest || pSmallest->GetID()>pInfo->GetID())
1141  pSmallest = pInfo;
1142  }
1143  // return best found
1144  return pSmallest;
1145 }
int32_t GetID() const
Definition: C4PlayerInfo.h:197

Here is the call graph for this function:

Here is the caller graph for this function:

int32_t C4PlayerInfoList::GetPlayerCount ( ) const

Definition at line 947 of file C4PlayerInfo.cpp.

Referenced by C4GameLobby::Countdown::OnSec1Timer(), RestoreSavegameInfos(), C4PlayerInfoListBox::Update(), and C4GameSave::WriteDescPlayers().

948 {
949  // count players of all clients
950  int32_t iCount=0;
951  for (int32_t i=0; i<iClientCount; ++i)
952  iCount += ppClients[i]->GetPlayerCount();
953  // return it
954  return iCount;
955 }
int32_t GetPlayerCount() const

Here is the caller graph for this function:

C4PlayerInfo * C4PlayerInfoList::GetPlayerInfoByID ( int32_t  id) const

Definition at line 1068 of file C4PlayerInfo.cpp.

References C4PlayerInfo::GetID().

Referenced by C4Player::CreateGraphs(), C4Player::FindNewOwner(), FindSavegameResumePlayerInfo(), FindUnassociatedRestoreInfo(), C4Team::GetFirstUnjoinedPlayerID(), C4Player::GetInfo(), C4Team::GetNameWithParticipants(), C4Player::GetType(), C4Network2Players::HandlePlayerInfoUpdRequest(), C4Team::HasWon(), C4Player::IsInvisible(), C4Team::RecheckPlayers(), C4TeamList::RecheckTeams(), C4PlayerList::Remove(), RestoreSavegameInfos(), C4PlayerList::Save(), and UpdatePlayerAttributes().

1069 {
1070  // must be a valid ID
1071  assert(id);
1072  // check all packets for a player
1073  for (int32_t i=0; i<iClientCount; ++i)
1074  {
1075  int32_t j=0; C4PlayerInfo *pInfo;
1076  while ((pInfo = ppClients[i]->GetPlayerInfo(j++)))
1077  if (pInfo->GetID() == id) return pInfo;
1078  }
1079  // nothing found
1080  return nullptr;
1081 }
int32_t GetID() const
Definition: C4PlayerInfo.h:197

Here is the call graph for this function:

Here is the caller graph for this function:

C4PlayerInfo * C4PlayerInfoList::GetPlayerInfoByID ( int32_t  id,
int32_t *  pidClient 
) const

Definition at line 1097 of file C4PlayerInfo.cpp.

References C4ClientPlayerInfos::GetClientID(), and C4PlayerInfo::GetID().

1098 {
1099  // must be a valid ID
1100  assert(id); assert(pidClient);
1101  // check all packets for a player
1102  for (int32_t i=0; i<iClientCount; ++i)
1103  {
1104  int32_t j=0; C4PlayerInfo *pInfo;
1105  while ((pInfo = ppClients[i]->GetPlayerInfo(j++)))
1106  if (pInfo->GetID() == id)
1107  {
1108  *pidClient = ppClients[i]->GetClientID();
1109  return pInfo;
1110  }
1111  }
1112  // nothing found
1113  return nullptr;
1114 }
int32_t GetClientID() const
Definition: C4PlayerInfo.h:260
int32_t GetID() const
Definition: C4PlayerInfo.h:197

Here is the call graph for this function:

C4PlayerInfo * C4PlayerInfoList::GetPlayerInfoByIndex ( int32_t  index) const

Definition at line 1054 of file C4PlayerInfo.cpp.

Referenced by C4Player::ScenarioInit(), and C4GameSave::WriteDescPlayers().

1055 {
1056  // check all packets for a player
1057  for (int32_t i=0; i<iClientCount; ++i)
1058  {
1059  int32_t j=0; C4PlayerInfo *pInfo;
1060  while ((pInfo = ppClients[i]->GetPlayerInfo(j++)))
1061  if (index-- <= 0)
1062  return pInfo;
1063  }
1064  // nothing found
1065  return nullptr;
1066 }

Here is the caller graph for this function:

C4PlayerInfo * C4PlayerInfoList::GetPlayerInfoBySavegameID ( int32_t  id) const

Definition at line 1116 of file C4PlayerInfo.cpp.

References C4PlayerInfo::GetAssociatedSavegamePlayerID().

Referenced by CreateRestoreInfosForJoinedScriptPlayers(), FindSavegameResumePlayerInfo(), FindUnassociatedRestoreInfo(), and RemoveUnassociatedPlayers().

1117 {
1118  // must be a valid ID
1119  assert(id);
1120  // check all packets for a player
1121  for (int32_t i=0; i<iClientCount; ++i)
1122  {
1123  int32_t j=0; C4PlayerInfo *pInfo;
1124  while ((pInfo = ppClients[i]->GetPlayerInfo(j++)))
1125  if (pInfo->GetAssociatedSavegamePlayerID() == id) return pInfo;
1126  }
1127  // nothing found
1128  return nullptr;
1129 }
int32_t GetAssociatedSavegamePlayerID() const
Definition: C4PlayerInfo.h:129

Here is the call graph for this function:

Here is the caller graph for this function:

C4PlayerInfo* C4PlayerInfoList::GetPrimaryInfoByClientID ( int32_t  iClientID) const
inline

Definition at line 379 of file C4PlayerInfo.h.

References GetInfoByClientID(), and C4ClientPlayerInfos::GetPlayerInfo().

Referenced by C4MessageInput::ProcessCommand().

380  {
381  C4ClientPlayerInfos *pInfoPkt = GetInfoByClientID(iClientID);
382  if (!pInfoPkt) return nullptr;
383  return pInfoPkt->GetPlayerInfo(0);
384  }
C4PlayerInfo * GetPlayerInfo(int32_t iIndex) const
C4ClientPlayerInfos * GetInfoByClientID(int32_t iClientID) const
Definition: C4PlayerInfo.h:364

Here is the call graph for this function:

Here is the caller graph for this function:

int32_t C4PlayerInfoList::GetStartupCount ( )

Definition at line 1768 of file C4PlayerInfo.cpp.

References iCnt, and C4PlayerInfo::IsRemoved().

Referenced by GetFreePlayerSlotCount(), C4Console::InitGame(), and C4Game::InitGame().

1769 {
1770  // count all joined and to-be-joined
1771  int32_t iCnt=0;
1772  for (int32_t i=0; i<iClientCount; ++i)
1773  {
1774  int32_t j=0; C4PlayerInfo *pInfo;
1775  while ((pInfo = ppClients[i]->GetPlayerInfo(j++)))
1776  if (!pInfo->IsRemoved()) ++iCnt;
1777  }
1778  return iCnt;
1779 }
int iCnt
Definition: TstC4NetIO.cpp:35
bool IsRemoved() const
Definition: C4PlayerInfo.h:167

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4PlayerInfoList::HasSameTeamPlayers ( int32_t  iClient1,
int32_t  iClient2 
) const

Definition at line 1213 of file C4PlayerInfo.cpp.

References GetInfoByClientID(), C4ClientPlayerInfos::GetPlayerInfo(), C4PlayerInfo::GetTeam(), and C4PlayerInfo::IsUsingTeam().

1214 {
1215  // compare all player teams of clients
1216  const C4ClientPlayerInfos *pCnfo1 = GetInfoByClientID(iClient1);
1217  const C4ClientPlayerInfos *pCnfo2 = GetInfoByClientID(iClient2);
1218  if (!pCnfo1 || !pCnfo2) return false;
1219  int32_t i=0,j; const C4PlayerInfo *pNfo1, *pNfo2;
1220  while ((pNfo1 = pCnfo1->GetPlayerInfo(i++)))
1221  {
1222  if (!pNfo1->IsUsingTeam()) continue;
1223  j=0;
1224  while ((pNfo2 = pCnfo2->GetPlayerInfo(j++)))
1225  {
1226  if (!pNfo2->IsUsingTeam()) continue;
1227  if (pNfo2->GetTeam() == pNfo1->GetTeam())
1228  // match found!
1229  return true;
1230  }
1231  }
1232  // no match
1233  return false;
1234 }
C4PlayerInfo * GetPlayerInfo(int32_t iIndex) const
int32_t GetTeam() const
Definition: C4PlayerInfo.h:198
bool IsUsingTeam() const
Definition: C4PlayerInfo.h:176
C4ClientPlayerInfos * GetInfoByClientID(int32_t iClientID) const
Definition: C4PlayerInfo.h:364

Here is the call graph for this function:

bool C4PlayerInfoList::InitLocal ( )

Definition at line 1277 of file C4PlayerInfo.cpp.

References AddInfo(), AssignTeams(), C4Game::C4S, CreateRestoreInfosForJoinedScriptPlayers(), Game, GetInfoCount(), C4Scenario::Head, C4Network2::isEnabled(), C4TeamList::IsMultiTeams(), Network, C4Game::PlayerFilenames, C4SHead::Replay, C4Game::RestorePlayerInfos, and C4Game::Teams.

Referenced by C4Game::InitGame().

1278 {
1279  // not in replay
1280  if (Game.C4S.Head.Replay) return true;
1281  // no double init
1282  assert(!GetInfoCount());
1283  // no network
1284  assert(!::Network.isEnabled());
1285  // create player info for local player joins
1287  // register local info immediately
1288  pLocalInfo = AddInfo(pLocalInfo);
1289  // Script players in restore infos need to be associated with matching script players in main info list
1291  // and assign teams
1292  if (Game.Teams.IsMultiTeams() && pLocalInfo)
1293  AssignTeams(pLocalInfo, true);
1294  // done, success
1295  return true;
1296 }
C4PlayerInfoList & RestorePlayerInfos
Definition: C4Game.h:74
C4Game Game
Definition: C4Globals.cpp:52
C4Scenario C4S
Definition: C4Game.h:76
bool Replay
Definition: C4Scenario.h:72
bool IsMultiTeams() const
Definition: C4Teams.h:163
C4TeamList & Teams
Definition: C4Game.h:72
void AssignTeams(C4ClientPlayerInfos *pNewClientInfo, bool fByHost)
C4Network2 Network
Definition: C4Globals.cpp:53
C4ClientPlayerInfos * AddInfo(C4ClientPlayerInfos *pNewClientInfo)
int32_t GetInfoCount() const
Definition: C4PlayerInfo.h:360
bool isEnabled() const
Definition: C4Network2.h:203
char PlayerFilenames[20 *_MAX_PATH+1]
Definition: C4Game.h:106
C4SHead Head
Definition: C4Scenario.h:230
void CreateRestoreInfosForJoinedScriptPlayers(C4PlayerInfoList &rSavegamePlayers)

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4PlayerInfoList::Load ( C4Group hGroup,
const char *  szFromFile,
class C4LangStringTable pLang = nullptr 
)

Definition at line 1236 of file C4PlayerInfo.cpp.

References Clear(), C4Group::LoadEntryString(), mkNamingAdapt(), and C4LangStringTable::ReplaceStrings().

Referenced by C4Game::InitPlayers(), and C4GameParameters::Load().

1237 {
1238  // clear previous
1239  Clear();
1240  // load file contents
1241  StdStrBuf Buf;
1242  if (!hGroup.LoadEntryString(szFromFile, &Buf))
1243  // no file is OK; means no player infos
1244  return true;
1245  // replace strings
1246  if (pLang) pLang->ReplaceStrings(Buf);
1247  // (try to) compile
1248  if (!CompileFromBuf_LogWarn<StdCompilerINIRead>(
1249  mkNamingAdapt(*this, "PlayerInfoList"),
1250  Buf, szFromFile))
1251  return false;
1252  // done, success
1253  return true;
1254 }
StdNamingAdapt< T > mkNamingAdapt(T &&rValue, const char *szName)
Definition: StdAdaptors.h:93
bool LoadEntryString(const char *szEntryName, StdStrBuf *Buf)
Definition: C4Group.cpp:1932

Here is the call graph for this function:

Here is the caller graph for this function:

void C4PlayerInfoList::LoadResources ( )

Definition at line 1781 of file C4PlayerInfo.cpp.

Referenced by C4Network2::HandleJoinData(), and C4Network2Players::HandlePlayerInfo().

1782 {
1783  // load for all players
1784  int32_t i = iClientCount; C4ClientPlayerInfos **ppClient=ppClients;
1785  while (i--) (*ppClient++)->LoadResources();
1786 }

Here is the caller graph for this function:

bool C4PlayerInfoList::LocalJoinUnjoinedPlayersInQueue ( )

Definition at line 1298 of file C4PlayerInfo.cpp.

References C4Control::Add(), C4PT_Script, CID_JoinPlr, C4GameControl::ClientID(), Control, Game, C4PlayerInfo::GetFilename(), C4PlayerInfo::GetID(), GetInfoPtrByClientID(), C4PlayerInfo::GetName(), C4PlayerInfo::GetType(), C4PlayerInfo::HasJoinIssued(), C4Game::Input, C4Network2::isEnabled(), LoadResStr(), LogF(), Network, and C4PlayerInfo::SetJoinIssued().

Referenced by C4Game::InitPlayers().

1299 {
1300  // local call only - in network, C4Network2Players joins players!
1301  assert(!::Network.isEnabled());
1302  // get local players
1303  C4ClientPlayerInfos **ppkLocal = GetInfoPtrByClientID(::Control.ClientID()), *pkLocal;
1304  if (!ppkLocal) return false;
1305  pkLocal = *ppkLocal;
1306  // check all players
1307  int32_t i=0; C4PlayerInfo *pInfo;
1308  while ((pInfo = pkLocal->GetPlayerInfo(i++)))
1309  // not yet joined?
1310  if (!pInfo->HasJoinIssued())
1311  {
1312  // join will be marked when queue is executed (C4Player::Join)
1313  // but better mark join now already to prevent permanent sending overkill
1314  pInfo->SetJoinIssued();
1315  // join by filename if possible. Script players may not have a filename assigned though
1316  const char *szFilename = pInfo->GetFilename();
1317  if (!szFilename && (pInfo->GetType() != C4PT_Script))
1318  {
1319  // failure for user players
1320  const char *szPlrName = pInfo->GetName(); if (!szPlrName) szPlrName="???";
1321  LogF(LoadResStr("IDS_ERR_JOINQUEUEPLRS"), szPlrName);
1322  continue;
1323  }
1325  new C4ControlJoinPlayer(szFilename, ::Control.ClientID(), pInfo->GetID()));
1326  }
1327  // done, success
1328  return true;
1329 }
const char * GetName() const
Definition: C4PlayerInfo.h:160
C4Game Game
Definition: C4Globals.cpp:52
void Add(C4PacketType eType, C4ControlPacket *pCtrl)
Definition: C4Control.h:82
C4ClientPlayerInfos ** GetInfoPtrByClientID(int32_t iClientID) const
const char * LoadResStr(const char *id)
Definition: C4Language.h:83
C4Network2 Network
Definition: C4Globals.cpp:53
C4GameControl Control
bool HasJoinIssued() const
Definition: C4PlayerInfo.h:170
bool isEnabled() const
Definition: C4Network2.h:203
C4Control & Input
Definition: C4Game.h:84
void SetJoinIssued()
Definition: C4PlayerInfo.h:115
const char * GetFilename() const
Definition: C4PlayerInfo.h:164
int32_t ClientID() const
int32_t GetID() const
Definition: C4PlayerInfo.h:197
C4PlayerType GetType() const
Definition: C4PlayerInfo.h:155
bool LogF(const char *strMessage,...)
Definition: C4Log.cpp:253

Here is the call graph for this function:

Here is the caller graph for this function:

C4PlayerInfoList & C4PlayerInfoList::operator= ( const C4PlayerInfoList rCpy)

Definition at line 700 of file C4PlayerInfo.cpp.

References Clear().

701 {
702  Clear();
703  iClientCount = rCpy.iClientCount;
704  iClientCapacity = rCpy.iClientCapacity;
705  iLastPlayerID = rCpy.iLastPlayerID;
706  if (rCpy.ppClients)
707  {
708  ppClients = new C4ClientPlayerInfos*[iClientCapacity];
709  C4ClientPlayerInfos **ppInfo = ppClients, **ppCpy = rCpy.ppClients;
710  int32_t i = iClientCount;
711  while (i--) *ppInfo++ = new C4ClientPlayerInfos(**ppCpy++);
712  }
713  else
714  ppClients = nullptr;
715  return *this;
716 }

Here is the call graph for this function:

void C4PlayerInfoList::RecheckAutoGeneratedTeams ( )

Definition at line 875 of file C4PlayerInfo.cpp.

References Game, C4TeamList::GetGenerateTeamByID(), GetIndexedInfo(), C4ClientPlayerInfos::GetPlayerInfo(), C4PlayerInfo::GetTeam(), and C4Game::Teams.

Referenced by C4Game::InitGame().

876 {
877  // ensure all teams specified in the list exist
878  C4ClientPlayerInfos *pPlrInfos; int32_t j=0;
879  while ((pPlrInfos = GetIndexedInfo(j++)))
880  {
881  C4PlayerInfo *pPlrInfo; int32_t i=0;
882  while ((pPlrInfo = pPlrInfos->GetPlayerInfo(i++)))
883  {
884  int32_t idTeam = pPlrInfo->GetTeam();
885  if (idTeam) Game.Teams.GetGenerateTeamByID(idTeam);
886  }
887  }
888 }
C4Game Game
Definition: C4Globals.cpp:52
C4Team * GetGenerateTeamByID(int32_t iID)
Definition: C4Teams.cpp:391
C4ClientPlayerInfos * GetIndexedInfo(int32_t iIndex) const
Definition: C4PlayerInfo.h:361
C4TeamList & Teams
Definition: C4Game.h:72
C4PlayerInfo * GetPlayerInfo(int32_t iIndex) const
int32_t GetTeam() const
Definition: C4PlayerInfo.h:198

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4PlayerInfoList::RecreatePlayerFiles ( )

Definition at line 1454 of file C4PlayerInfo.cpp.

References C4Config::AtTempPath(), C4PT_Script, C4Game::C4S, Config, C4PlayerInfo::DiscardResource(), C4Group::Extract(), C4Group::FindEntry(), StdStrBuf::Format(), Game, StdStrBuf::getData(), GetFilename(), C4PlayerInfo::GetFilename(), C4PlayerInfo::GetID(), C4PlayerInfo::GetName(), C4ClientPlayerInfos::GetPlayerInfo(), C4PlayerInfo::GetType(), C4PlayerInfo::HasJoinIssued(), C4Scenario::Head, C4PlayerInfo::IsJoined(), LoadResStr(), LogF(), C4SHead::NetworkRuntimeJoin, C4SHead::Replay, C4Game::ScenarioFile, C4PlayerInfo::SetFilename(), and C4PlayerInfo::SetTempFile().

Referenced by C4Game::InitPlayers().

1455 {
1456  // Note that this method will be called on the main list for savegame resumes (even in network) or regular games with RecreateInfos,
1457  // and on RestorePlayerInfos for runtime network joins
1458  // check all player files that need to be recreated
1459  for (int32_t i=0; i<iClientCount; ++i)
1460  {
1461  C4ClientPlayerInfos *pkInfo = ppClients[i];
1462  int32_t j=0; C4PlayerInfo *pInfo;
1463  while ((pInfo = pkInfo->GetPlayerInfo(j++)))
1464  if (pInfo->IsJoined())
1465  {
1466  // all players in replays and runtime joins; script players even in savegames need to be restored from the scenario goup
1468  {
1469  // in this case, a filename must have been assigned while saving
1470  // and mark a file inside the scenario file
1471  // get filename of joined player - this should always be valid!
1472  const char *szCurrPlrFile;
1473  StdStrBuf sFilenameInRecord;
1474  if (Game.C4S.Head.Replay)
1475  {
1476  // replay of resumed savegame: RecreatePlayers saves used player files into the record group in this manner
1477  sFilenameInRecord.Format("Recreate-%d.ocp", pInfo->GetID());
1478  szCurrPlrFile = sFilenameInRecord.getData();
1479  }
1480  else
1481  szCurrPlrFile = pInfo->GetFilename();
1482  const char *szPlrName = pInfo->GetName(); if (!szPlrName) szPlrName = "???";
1483  if (!szCurrPlrFile || !*szCurrPlrFile)
1484  {
1485  // that's okay for script players, because those may join w/o recreation files
1486  if (pInfo->GetType() != C4PT_Script)
1487  {
1488  LogF(LoadResStr("IDS_ERR_LOAD_RECR_NOFILE"), szPlrName);
1489  }
1490  continue;
1491  }
1492  // join from temp file
1493  StdCopyStrBuf szJoinPath;
1494  szJoinPath = Config.AtTempPath(GetFilename(szCurrPlrFile));
1495  // extract player there
1496  if (!Game.ScenarioFile.FindEntry(GetFilename(szCurrPlrFile)) || !Game.ScenarioFile.Extract(GetFilename(szCurrPlrFile), szJoinPath.getData()))
1497  {
1498  // that's okay for script players, because those may join w/o recreation files
1499  if (pInfo->GetType() != C4PT_Script)
1500  {
1501  LogF(LoadResStr("IDS_ERR_LOAD_RECR_NOEXTRACT"), szPlrName, GetFilename(szCurrPlrFile));
1502  }
1503  continue;
1504  }
1505  // set join source
1506  pInfo->SetFilename(szJoinPath.getData());
1507  pInfo->DiscardResource();
1508  // setting a temp file here will cause the player file to be deleted directly after recreation
1509  // if recreation fails (e.g. the game gets aborted due to invalid files), the info dtor will delete the file
1510  pInfo->SetTempFile();
1511  }
1512  else
1513  {
1514  // regular player in savegame being resumed in network or normal mode:
1515  // the filenames and/or resources should have been assigned
1516  // a) either in lobby mode during player re-acquisition
1517  // b) or when players from rSavegamePlayers were taken over
1518  }
1519  }
1520  else if (!pInfo->HasJoinIssued())
1521  {
1522  // new players to be joined into the game:
1523  // regular control queue join can be done; no special handling needed
1524  }
1525  }
1526  // done, success
1527  return true;
1528 }
char * GetFilename(char *szPath)
Definition: StdFile.cpp:55
const char * getData() const
Definition: StdBuf.h:450
bool FindEntry(const char *szWildCard, StdStrBuf *sFileName=nullptr, size_t *iSize=nullptr)
Definition: C4Group.cpp:1774
bool NetworkRuntimeJoin
Definition: C4Scenario.h:79
C4Config Config
Definition: C4Config.cpp:837
const char * GetName() const
Definition: C4PlayerInfo.h:160
void SetFilename(const char *szToFilename)
C4Game Game
Definition: C4Globals.cpp:52
C4Scenario C4S
Definition: C4Game.h:76
bool Replay
Definition: C4Scenario.h:72
void Format(const char *szFmt,...) GNUC_FORMAT_ATTRIBUTE_O
Definition: StdBuf.cpp:181
void DiscardResource()
const char * LoadResStr(const char *id)
Definition: C4Language.h:83
C4PlayerInfo * GetPlayerInfo(int32_t iIndex) const
bool IsJoined() const
Definition: C4PlayerInfo.h:169
C4Group ScenarioFile
Definition: C4Game.h:88
bool HasJoinIssued() const
Definition: C4PlayerInfo.h:170
void SetTempFile()
Definition: C4PlayerInfo.h:122
const char * GetFilename() const
Definition: C4PlayerInfo.h:164
int32_t GetID() const
Definition: C4PlayerInfo.h:197
C4PlayerType GetType() const
Definition: C4PlayerInfo.h:155
const char * AtTempPath(const char *szFilename)
Definition: C4Config.cpp:544
C4SHead Head
Definition: C4Scenario.h:230
bool Extract(const char *szFiles, const char *szExtractTo=nullptr, const char *szExclude=nullptr)
Definition: C4Group.cpp:1471
bool LogF(const char *strMessage,...)
Definition: C4Log.cpp:253

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4PlayerInfoList::RecreatePlayers ( C4ValueNumbers numbers)

Definition at line 1530 of file C4PlayerInfo.cpp.

References C4NetResRetrieveTimeout, C4PT_User, C4Game::C4S, C4GameControl::ClientID(), C4Game::Clients, Control, C4PlayerInfo::DeleteTempFile(), StdStrBuf::Format(), FormatString(), Game, C4ClientList::getClientByID(), C4ClientPlayerInfos::GetClientID(), C4Network2Res::getCore(), StdStrBuf::getData(), C4PlayerInfo::GetID(), C4ClientPlayerInfos::GetJoinedPlayerCount(), C4PlayerInfo::GetLocalJoinFilename(), C4Client::getName(), C4PlayerInfo::GetName(), C4ClientPlayerInfos::GetPlayerCount(), C4ClientPlayerInfos::GetPlayerInfo(), C4PlayerInfo::GetRes(), C4PlayerInfo::GetType(), C4Scenario::Head, C4Network2::isEnabled(), C4PlayerInfo::IsJoined(), C4Network2Res::isLoading(), C4GameControl::isRecord(), C4PlayerInfo::IsTempFile(), C4PlayerList::Join(), LoadResStr(), LogF(), Network, Players, C4GameControl::RecAddFile(), C4SHead::Replay, and C4Network2::RetrieveRes().

Referenced by C4Game::InitPlayers().

1531 {
1532  // check all player infos
1533  for (int32_t i=0; i<iClientCount; ++i)
1534  {
1535  C4ClientPlayerInfos *pkInfo = ppClients[i];
1536  // skip clients without joined players
1537  if (!pkInfo->GetJoinedPlayerCount()) continue;
1538  // determine client ID and name
1539  // client IDs must be set correctly even in replays,
1540  // so client-removal packets are executed correctly
1541  int32_t idAtClient = pkInfo->GetClientID();
1542  const char *szAtClientName;
1543  if (Game.C4S.Head.Replay)
1544  // the client name can currently not really be retrieved in replays
1545  // but it's not used anyway
1546  szAtClientName = "Replay";
1547  else
1548  // local non-network non-replay games set local name
1549  if (!::Network.isEnabled())
1550  {
1551  assert(idAtClient == ::Control.ClientID());
1552  szAtClientName = "Local";
1553  }
1554  else
1555  {
1556  // network non-replay games: find client and set name by it
1557  const C4Client *pClient = Game.Clients.getClientByID(idAtClient);
1558  if (pClient)
1559  szAtClientName = pClient->getName();
1560  else
1561  {
1562  // this shouldn't happen - remove the player info
1563  LogF(LoadResStr("IDS_PRC_RESUMENOCLIENT"), idAtClient, pkInfo->GetPlayerCount());
1564  continue;
1565  }
1566  }
1567  // rejoin all joined players of that client
1568  int32_t j=0; C4PlayerInfo *pInfo;
1569  while ((pInfo = pkInfo->GetPlayerInfo(j++)))
1570  if (pInfo->IsJoined())
1571  {
1572  // get filename to join from
1573  const char *szFilename = pInfo->GetLocalJoinFilename();
1574  // ensure resource is loaded, if joining from resource
1575  // this may display a waiting dialog and block the thread for a while
1576  C4Network2Res *pJoinRes = pInfo->GetRes();
1577  if (szFilename && pJoinRes && pJoinRes->isLoading())
1578  {
1579  const char *szName = pInfo->GetName();
1580  if (!::Network.RetrieveRes(pJoinRes->getCore(), C4NetResRetrieveTimeout,
1581  FormatString(LoadResStr("IDS_NET_RES_PLRFILE"), szName).getData()))
1582  szFilename=nullptr;
1583  }
1584  // file present?
1585  if (!szFilename || !*szFilename)
1586  {
1587  if (pInfo->GetType() == C4PT_User)
1588  {
1589  // for user players, this could happen only if the user cancelled the resource
1590  const char *szPlrName = pInfo->GetName(); if (!szPlrName) szPlrName = "???";
1591  LogF(LoadResStr("IDS_ERR_LOAD_RECR_NOFILEFROMNET"), szPlrName);
1592  continue;
1593  }
1594  else
1595  {
1596  // for script players: Recreation without filename OK
1597  szFilename = nullptr;
1598  }
1599  }
1600  // record file handling: Save to the record file in the manner it's expected by C4PlayerInfoList::RecreatePlayers
1601  if (::Control.isRecord() && szFilename)
1602  {
1603  StdStrBuf sFilenameInRecord;
1604  sFilenameInRecord.Format("Recreate-%d.ocp", pInfo->GetID());
1605  ::Control.RecAddFile(szFilename, sFilenameInRecord.getData());
1606  }
1607  // recreate join directly
1608  ::Players.Join(szFilename, false, idAtClient, szAtClientName, pInfo, numbers);
1609  // delete temporary files immediately
1610  if (pInfo->IsTempFile()) pInfo->DeleteTempFile();
1611  }
1612  }
1613  // done!
1614  return true;
1615 }
int32_t GetJoinedPlayerCount() const
const char * getData() const
Definition: StdBuf.h:450
C4Network2Res * GetRes() const
Definition: C4PlayerInfo.h:166
const char * GetName() const
Definition: C4PlayerInfo.h:160
C4Game Game
Definition: C4Globals.cpp:52
C4Scenario C4S
Definition: C4Game.h:76
bool isRecord() const
bool Replay
Definition: C4Scenario.h:72
void Format(const char *szFmt,...) GNUC_FORMAT_ATTRIBUTE_O
Definition: StdBuf.cpp:181
const char * LoadResStr(const char *id)
Definition: C4Language.h:83
bool isLoading() const
const char * GetLocalJoinFilename() const
C4Player * Join(const char *szFilename, bool fScenarioInit, int iAtClient, const char *szAtClientName, class C4PlayerInfo *pInfo, C4ValueNumbers *)
C4PlayerInfo * GetPlayerInfo(int32_t iIndex) const
C4Network2 Network
Definition: C4Globals.cpp:53
const C4Network2ResCore & getCore() const
C4Network2Res::Ref RetrieveRes(const C4Network2ResCore &Core, int32_t iTimeout, const char *szResName, bool fWaitForCore=false)
C4GameControl Control
bool IsJoined() const
Definition: C4PlayerInfo.h:169
int32_t GetClientID() const
Definition: C4PlayerInfo.h:260
C4PlayerList Players
void DeleteTempFile()
int32_t GetPlayerCount() const
Definition: C4PlayerInfo.h:254
bool isEnabled() const
Definition: C4Network2.h:203
const int C4NetResRetrieveTimeout
Definition: C4Network2.h:37
C4Client * getClientByID(int32_t iID) const
Definition: C4Client.cpp:217
int32_t ClientID() const
const char * getName() const
Definition: C4Client.h:107
C4ClientList & Clients
Definition: C4Game.h:71
int32_t GetID() const
Definition: C4PlayerInfo.h:197
C4PlayerType GetType() const
Definition: C4PlayerInfo.h:155
C4SHead Head
Definition: C4Scenario.h:230
bool RecAddFile(const char *szLocalFilename, const char *szAddAs)
bool LogF(const char *strMessage,...)
Definition: C4Log.cpp:253
StdStrBuf FormatString(const char *szFmt,...)
Definition: StdBuf.cpp:277
bool IsTempFile() const
Definition: C4PlayerInfo.h:199

Here is the call graph for this function:

Here is the caller graph for this function:

void C4PlayerInfoList::RemoveInfo ( C4ClientPlayerInfos **  ppRemoveInfo)
inline

Definition at line 389 of file C4PlayerInfo.h.

Referenced by C4Network2Players::OnClientPart(), and SetAsRestoreInfos().

390  { *ppRemoveInfo = ppClients[--iClientCount]; /* maybe redundant self-assignment; no vector shrink */ }

Here is the caller graph for this function:

void C4PlayerInfoList::RemoveUnassociatedPlayers ( C4PlayerInfoList rSavegamePlayers)

Definition at line 1617 of file C4PlayerInfo.cpp.

References C4PlayerInfo::GetID(), GetIndexedInfo(), C4PlayerInfo::GetInGameNumber(), C4PlayerInfo::GetName(), C4ClientPlayerInfos::GetPlayerInfo(), GetPlayerInfoBySavegameID(), C4PlayerInfo::IsJoined(), LoadResStr(), LogF(), Players, C4PlayerList::RemoveUnjoined(), and C4PlayerInfo::SetRemoved().

Referenced by RestoreSavegameInfos().

1618 {
1619  // check all joined infos
1620  C4ClientPlayerInfos *pClient; int iClient=0;
1621  while ((pClient = rSavegamePlayers.GetIndexedInfo(iClient++)))
1622  {
1623  C4PlayerInfo *pInfo; int iInfo = 0;
1624  while ((pInfo = pClient->GetPlayerInfo(iInfo++)))
1625  {
1626  // remove players that were in the game but are not associated
1627  if (pInfo->IsJoined() && !GetPlayerInfoBySavegameID(pInfo->GetID()))
1628  {
1629  if (::Players.RemoveUnjoined(pInfo->GetInGameNumber()))
1630  {
1631  LogF(LoadResStr("IDS_PRC_REMOVEPLR"), pInfo->GetName());
1632  }
1633  }
1634  pInfo->SetRemoved();
1635  }
1636  }
1637 }
const char * GetName() const
Definition: C4PlayerInfo.h:160
C4ClientPlayerInfos * GetIndexedInfo(int32_t iIndex) const
Definition: C4PlayerInfo.h:361
const char * LoadResStr(const char *id)
Definition: C4Language.h:83
C4PlayerInfo * GetPlayerInfo(int32_t iIndex) const
bool RemoveUnjoined(int32_t iPlayer)
bool IsJoined() const
Definition: C4PlayerInfo.h:169
C4PlayerList Players
int32_t GetInGameNumber() const
Definition: C4PlayerInfo.h:192
int32_t GetID() const
Definition: C4PlayerInfo.h:197
C4PlayerInfo * GetPlayerInfoBySavegameID(int32_t id) const
bool LogF(const char *strMessage,...)
Definition: C4Log.cpp:253

Here is the call graph for this function:

Here is the caller graph for this function:

void C4PlayerInfoList::ResetLeagueProjectedGain ( bool  fSetUpdated)

Definition at line 1722 of file C4PlayerInfo.cpp.

References GetIndexedInfo(), C4ClientPlayerInfos::GetPlayerInfo(), C4PlayerInfo::IsLeagueProjectedGainValid(), C4PlayerInfo::ResetLeagueProjectedGain(), and C4ClientPlayerInfos::SetUpdated().

Referenced by C4Network2Players::HandlePlayerInfoUpdRequest(), and C4Network2Players::OnClientPart().

1723 {
1724  C4ClientPlayerInfos *pClient; int iClient=0;
1725  while ((pClient = GetIndexedInfo(iClient++)))
1726  {
1727  C4PlayerInfo *pInfo; int iInfo = 0;
1728  while ((pInfo = pClient->GetPlayerInfo(iInfo++)))
1729  if (pInfo->IsLeagueProjectedGainValid())
1730  {
1731  pInfo->ResetLeagueProjectedGain();
1732  if (fSetUpdated)
1733  pClient->SetUpdated();
1734  }
1735  }
1736 }
C4ClientPlayerInfos * GetIndexedInfo(int32_t iIndex) const
Definition: C4PlayerInfo.h:361
C4PlayerInfo * GetPlayerInfo(int32_t iIndex) const
bool IsLeagueProjectedGainValid() const
Definition: C4PlayerInfo.h:193
void ResetLeagueProjectedGain()
Definition: C4PlayerInfo.h:148

Here is the call graph for this function:

Here is the caller graph for this function:

void C4PlayerInfoList::ResolvePlayerAttributeConflicts ( C4ClientPlayerInfos pSecPacket)

Definition at line 107 of file C4PlayerInfoConflicts.cpp.

References Game, C4PlayerInfoListAttributeConflictResolver::Resolve(), and C4Game::RestorePlayerInfos.

Referenced by UpdatePlayerAttributes().

108 {
110  r.Resolve();
111 }
C4PlayerInfoList & RestorePlayerInfos
Definition: C4Game.h:74
C4Game Game
Definition: C4Globals.cpp:52

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4PlayerInfoList::RestoreSavegameInfos ( C4PlayerInfoList rSavegamePlayers)

Definition at line 1366 of file C4PlayerInfo.cpp.

References C4Window::Active, C4GUI::MessageDialog::btnOK, C4Game::C4S, Config, Control, FindSavegameResumePlayerInfo(), StdStrBuf::Format(), FullScreen, Game, C4PlayerInfo::GetAssociatedSavegamePlayerID(), StdStrBuf::getData(), C4PlayerInfo::GetID(), GetIndexedInfo(), GetInfoCount(), C4PlayerInfo::GetName(), GetPlayerCount(), C4ClientPlayerInfos::GetPlayerInfo(), GetPlayerInfoByID(), C4Scenario::Head, C4ConfigStartup::HideMsgPlrTakeOver, C4GUI::Ico_Notify, C4Network2::isEnabled(), C4GameControl::isReplay(), LoadResStr(), Log(), LogF(), Network, C4SHead::NetworkRuntimeJoin, pGUI, C4TeamList::RecheckPlayers(), RemoveUnassociatedPlayers(), C4SHead::Replay, C4SHead::SaveGame, C4PlayerInfo::SetAssociatedSavegamePlayer(), C4PlayerInfo::SetSavegameResume(), C4GUI::Screen::ShowMessageModal(), C4Config::Startup, and C4Game::Teams.

Referenced by C4Game::InitPlayers().

1367 {
1368  // any un-associated players?
1369  if (rSavegamePlayers.GetPlayerCount())
1370  {
1371  // for runtime network joins, this should never happen!
1372  assert(!Game.C4S.Head.NetworkRuntimeJoin);
1373 
1374  // do savegame player association of real players
1375  // for non-lobby games do automatic association first
1376  int32_t iNumGrabbed = 0, i;
1377  if (!::Network.isEnabled() && Game.C4S.Head.SaveGame)
1378  {
1379  // do several passes: First passes using regular player matching; following passes matching anything but with a warning message
1380  for (int eMatchingLevel = 0; eMatchingLevel <= PML_Any; ++eMatchingLevel)
1381  for (int32_t i=0; i<iClientCount; ++i)
1382  {
1383  C4ClientPlayerInfos *pkInfo = GetIndexedInfo(i);
1384  int32_t j=0, id; C4PlayerInfo *pInfo, *pSavegameInfo;
1385  while ((pInfo = pkInfo->GetPlayerInfo(j++)))
1386  if (!(id = pInfo->GetAssociatedSavegamePlayerID()))
1387  if ((pSavegameInfo = rSavegamePlayers.FindSavegameResumePlayerInfo(pInfo, (MatchingLevel)eMatchingLevel, (MatchingLevel)eMatchingLevel)))
1388  {
1389  pInfo->SetAssociatedSavegamePlayer(pSavegameInfo->GetID());
1390  if (eMatchingLevel > PML_PlrName)
1391  {
1392  // this is a "wild" match: Warn the player (but not in replays)
1393  StdStrBuf sMsg; sMsg.Format(LoadResStr("IDS_MSG_PLAYERASSIGNMENT"), pInfo->GetName(), pSavegameInfo->GetName());
1394  Log(sMsg.getData());
1395  if (::pGUI && FullScreen.Active && !Game.C4S.Head.Replay)
1397  }
1398  }
1399  }
1400  }
1401  // association complete: evaluate it
1402  for (i=0; i<iClientCount; ++i)
1403  {
1404  C4ClientPlayerInfos *pkInfo = GetIndexedInfo(i);
1405  int32_t j=0, id; C4PlayerInfo *pInfo, *pSavegameInfo;
1406  while ((pInfo = pkInfo->GetPlayerInfo(j++)))
1407  if ((id = pInfo->GetAssociatedSavegamePlayerID()))
1408  {
1409  if ((pSavegameInfo = rSavegamePlayers.GetPlayerInfoByID(id)))
1410  {
1411  // pInfo continues for pSavegameInfo
1412  pInfo->SetSavegameResume(pSavegameInfo);
1413  ++iNumGrabbed;
1414  }
1415  else
1416  {
1417  // shouldn't happen
1418  assert(!"Invalid savegame association");
1419  }
1420  }
1421  else
1422  {
1423  // no association for this info: Joins as new player
1424  // in savegames, this is unusual. For regular script player restore, it's not
1425  if (Game.C4S.Head.SaveGame) LogF(LoadResStr("IDS_PRC_RESUMENOPLRASSOCIATION"), (const char *)pInfo->GetName());
1426  }
1427  }
1428  // otherwise any remaining players
1429  int32_t iCountRemaining = rSavegamePlayers.GetPlayerCount() - iNumGrabbed;
1430  if (iCountRemaining)
1431  {
1432  // in replay mode, if there are no regular player joins, it must have been a runtime record
1433  // i.e., a record that was started during the game
1434  // in this case, the savegame player infos equal the real player infos to be used
1435  if (::Control.isReplay() && !GetInfoCount())
1436  {
1437  *this = rSavegamePlayers;
1438  }
1439  else
1440  {
1441  // in regular mode, these players must be removed
1442  LogF(LoadResStr("IDS_PRC_RESUMEREMOVEPLRS"), iCountRemaining);
1443  // remove them directly from the game
1444  RemoveUnassociatedPlayers(rSavegamePlayers);
1445  }
1446  }
1447  }
1448  // now that players are restored, restore teams
1450  // done, success
1451  return true;
1452 }
const char * getData() const
Definition: StdBuf.h:450
void RecheckPlayers()
Definition: C4Teams.cpp:664
bool NetworkRuntimeJoin
Definition: C4Scenario.h:79
C4Config Config
Definition: C4Config.cpp:837
const char * GetName() const
Definition: C4PlayerInfo.h:160
C4ConfigStartup Startup
Definition: C4Config.h:261
int32_t GetPlayerCount() const
C4Game Game
Definition: C4Globals.cpp:52
C4PlayerInfo * FindSavegameResumePlayerInfo(const C4PlayerInfo *pMatchInfo, MatchingLevel mlMatchStart, MatchingLevel mlMatchEnd) const
C4Scenario C4S
Definition: C4Game.h:76
bool Replay
Definition: C4Scenario.h:72
C4FullScreen FullScreen
Definition: C4Globals.cpp:46
void RemoveUnassociatedPlayers(C4PlayerInfoList &rSavegamePlayers)
void Format(const char *szFmt,...) GNUC_FORMAT_ATTRIBUTE_O
Definition: StdBuf.cpp:181
C4ClientPlayerInfos * GetIndexedInfo(int32_t iIndex) const
Definition: C4PlayerInfo.h:361
C4PlayerInfo * GetPlayerInfoByID(int32_t id) const
C4TeamList & Teams
Definition: C4Game.h:72
const char * LoadResStr(const char *id)
Definition: C4Language.h:83
bool SaveGame
Definition: C4Scenario.h:71
C4GUIScreen * pGUI
Definition: C4Gui.cpp:1194
C4PlayerInfo * GetPlayerInfo(int32_t iIndex) const
C4Network2 Network
Definition: C4Globals.cpp:53
int32_t GetAssociatedSavegamePlayerID() const
Definition: C4PlayerInfo.h:129
bool ShowMessageModal(const char *szMessage, const char *szCaption, DWORD dwButtons, Icons icoIcon, int32_t *piConfigDontShowAgainSetting=nullptr)
C4GameControl Control
int32_t GetInfoCount() const
Definition: C4PlayerInfo.h:360
bool isEnabled() const
Definition: C4Network2.h:203
int32_t HideMsgPlrTakeOver
Definition: C4Config.h:186
bool isReplay() const
Definition: C4GameControl.h:98
bool SetSavegameResume(C4PlayerInfo *pSavegameInfo)
bool Active
Definition: C4Window.h:278
bool Log(const char *szMessage)
Definition: C4Log.cpp:195
void SetAssociatedSavegamePlayer(int32_t aidSavegamePlayer)
Definition: C4PlayerInfo.h:127
int32_t GetID() const
Definition: C4PlayerInfo.h:197
C4SHead Head
Definition: C4Scenario.h:230
bool LogF(const char *strMessage,...)
Definition: C4Log.cpp:253

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4PlayerInfoList::Save ( C4Group hGroup,
const char *  szToFile 
)

Definition at line 1256 of file C4PlayerInfo.cpp.

References C4Group::Add(), C4Group::DeleteEntry(), and mkNamingAdapt().

Referenced by C4GameSaveRecord::SaveComponents(), and C4Record::Stop().

1257 {
1258  // remove previous entry from group
1259  hGroup.DeleteEntry(szToFile);
1260  // anything to save?
1261  if (!iClientCount) return true;
1262  // save it
1263  try
1264  {
1265  // decompile
1266  StdStrBuf Buf = DecompileToBuf<StdCompilerINIWrite>(
1267  mkNamingAdapt(*this, "PlayerInfoList"));
1268  // save buffer to group
1269  hGroup.Add(szToFile, Buf, false, true);
1270  }
1271  catch (StdCompiler::Exception *)
1272  { return false; }
1273  // done, success
1274  return true;
1275 }
StdNamingAdapt< T > mkNamingAdapt(T &&rValue, const char *szName)
Definition: StdAdaptors.h:93
bool DeleteEntry(const char *szFilename, bool fRecycle=false)
Definition: C4Group.cpp:1384
bool Add(const char *szFile, const char *szAddAs)
Definition: C4Group.cpp:1316

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4PlayerInfoList::SetAsRestoreInfos ( C4PlayerInfoList rFromPlayers,
bool  fSaveUserPlrs,
bool  fSaveScriptPlrs,
bool  fSetUserPlrRefToLocalGroup,
bool  fSetScriptPlrRefToLocalGroup 
)

Definition at line 1639 of file C4PlayerInfo.cpp.

References C4PT_Script, C4PT_User, C4Game::Clients, StdStrBuf::Copy(), C4PlayerInfo::DiscardResource(), StdStrBuf::Format(), FormatString(), Game, C4ClientList::getClientByID(), C4ClientPlayerInfos::GetClientID(), StdStrBuf::getData(), GetFilename(), C4PlayerInfo::GetFilename(), C4PlayerInfo::GetID(), GetIndexedInfo(), GetInfoPtrByClientID(), C4PlayerInfo::GetLocalJoinFilename(), C4Client::getName(), C4ClientPlayerInfos::GetPlayerCount(), C4ClientPlayerInfos::GetPlayerInfo(), C4PlayerInfo::GetType(), C4Network2::isEnabled(), C4PlayerInfo::IsJoined(), C4PlayerInfo::IsScenarioSaveDesired(), Network, C4ClientPlayerInfos::RemoveIndexedInfo(), RemoveInfo(), StdStrBuf::Replace(), and C4PlayerInfo::SetFilename().

1640 {
1641  // copy everything
1642  *this = rFromPlayers;
1643  // then remove everything that's no longer joined and update the rest
1644  C4ClientPlayerInfos *pClient; int iClient=0;
1645  while ((pClient = GetIndexedInfo(iClient++)))
1646  {
1647  // update all players for this client
1648  C4PlayerInfo *pInfo; int iInfo = 0;
1649  while ((pInfo = pClient->GetPlayerInfo(iInfo++)))
1650  {
1651  bool fKeepInfo = false;
1652  // remove players that are not in the game
1653  if (pInfo->IsJoined())
1654  {
1655  // pre-reset filename
1656  pInfo->SetFilename(nullptr);
1657  if (pInfo->GetType() == C4PT_User)
1658  {
1659  fKeepInfo = fSaveUserPlrs;
1660  if (fSetUserPlrRefToLocalGroup)
1661  {
1662  // in the game: Set filename for inside savegame file
1663  StdStrBuf sNewName;
1664  if (::Network.isEnabled())
1665  {
1666  C4Client *pGameClient = Game.Clients.getClientByID(pClient->GetClientID());
1667  const char *szName = pGameClient ? pGameClient->getName() : "Unknown";
1668  sNewName.Format("%s-%s", szName, (const char *) GetFilename(pInfo->GetLocalJoinFilename()));
1669  }
1670  else
1671  sNewName.Copy(GetFilename(pInfo->GetFilename()));
1672 
1673  // O(n) is fast.
1674  // If not, blame whoever wrote Replace! ;)
1675  sNewName.Replace("%", "%25", 0);
1676  for (int ch = 128; ch < 256; ++ch)
1677  {
1678  const char* hexChars = "0123456789abcdef";
1679  char old[] = { char(ch), 0 };
1680  char safe[] = { '%', 'x', 'x', 0 };
1681  safe[1] = hexChars[ch / 16];
1682  safe[2] = hexChars[ch % 16];
1683  sNewName.Replace(old, safe, 0);
1684  }
1685 
1686  pInfo->SetFilename(sNewName.getData());
1687  }
1688  }
1689  else if (pInfo->GetType() == C4PT_Script)
1690  {
1691  // Save only if either all players should be saved (fSaveScriptPlrs && fSaveUserPlrs)
1692  // or if script players are saved and general scenario saving for this script player is desired
1693  fKeepInfo = fSaveScriptPlrs && (fSaveUserPlrs || pInfo->IsScenarioSaveDesired());
1694  if (fSetScriptPlrRefToLocalGroup)
1695  {
1696  // just compose a unique filename for script player
1697  pInfo->SetFilename(FormatString("ScriptPlr-%d.ocp", (int)pInfo->GetID()).getData());
1698  }
1699  }
1700  }
1701  if (!fKeepInfo)
1702  {
1703  pClient->RemoveIndexedInfo(--iInfo);
1704  }
1705  else
1706  {
1707  pInfo->DiscardResource();
1708  }
1709  }
1710  // remove empty clients
1711  if (!pClient->GetPlayerCount())
1712  {
1714  delete pClient;
1715  --iClient;
1716  }
1717  }
1718  // done
1719  return true;
1720 }
char * GetFilename(char *szPath)
Definition: StdFile.cpp:55
const char * getData() const
Definition: StdBuf.h:450
int Replace(const char *szOld, const char *szNew, size_t iStartSearch=0)
Definition: StdBuf.cpp:291
void SetFilename(const char *szToFilename)
C4Game Game
Definition: C4Globals.cpp:52
void RemoveInfo(C4ClientPlayerInfos **ppRemoveInfo)
Definition: C4PlayerInfo.h:389
void Format(const char *szFmt,...) GNUC_FORMAT_ATTRIBUTE_O
Definition: StdBuf.cpp:181
C4ClientPlayerInfos ** GetInfoPtrByClientID(int32_t iClientID) const
void DiscardResource()
C4ClientPlayerInfos * GetIndexedInfo(int32_t iIndex) const
Definition: C4PlayerInfo.h:361
const char * GetLocalJoinFilename() const
C4PlayerInfo * GetPlayerInfo(int32_t iIndex) const
C4Network2 Network
Definition: C4Globals.cpp:53
bool IsJoined() const
Definition: C4PlayerInfo.h:169
int32_t GetClientID() const
Definition: C4PlayerInfo.h:260
int32_t GetPlayerCount() const
Definition: C4PlayerInfo.h:254
bool isEnabled() const
Definition: C4Network2.h:203
const char * GetFilename() const
Definition: C4PlayerInfo.h:164
C4Client * getClientByID(int32_t iID) const
Definition: C4Client.cpp:217
const char * getName() const
Definition: C4Client.h:107
C4ClientList & Clients
Definition: C4Game.h:71
bool IsScenarioSaveDesired() const
Definition: C4PlayerInfo.h:180
void RemoveIndexedInfo(int32_t iAtIndex)
int32_t GetID() const
Definition: C4PlayerInfo.h:197
C4PlayerType GetType() const
Definition: C4PlayerInfo.h:155
void Copy()
Definition: StdBuf.h:475
StdStrBuf FormatString(const char *szFmt,...)
Definition: StdBuf.cpp:277

Here is the call graph for this function:

void C4PlayerInfoList::SetIDCounter ( int32_t  idNewCounter)
inline

Definition at line 397 of file C4PlayerInfo.h.

Referenced by C4GameParameters::Load().

397 { iLastPlayerID = idNewCounter; }

Here is the caller graph for this function:

void C4PlayerInfoList::UpdatePlayerAttributes ( C4ClientPlayerInfos pForInfo,
bool  fResolveConflicts 
)

Definition at line 786 of file C4PlayerInfo.cpp.

References Game, C4PlayerInfo::GetAssociatedSavegamePlayerID(), C4Team::GetColor(), C4PlayerInfo::GetColor(), C4ClientPlayerInfos::GetPlayerInfo(), GetPlayerInfoByID(), C4PlayerInfo::GetTeam(), C4TeamList::GetTeamByID(), C4PlayerInfo::HasJoined(), C4TeamList::IsTeamColors(), ResolvePlayerAttributeConflicts(), C4Game::RestorePlayerInfos, C4PlayerInfo::SetColor(), C4ClientPlayerInfos::SetUpdated(), and C4Game::Teams.

Referenced by C4Network2Players::HandlePlayerInfoUpdRequest(), C4Network2Players::OnClientPart(), and C4TeamList::SetTeamColors().

787 {
788  assert(pForInfo);
789  // update colors of all players of this packet
790  C4PlayerInfo *pInfo, *pInfo2; int32_t i=0;
791  while ((pInfo = pForInfo->GetPlayerInfo(i++)))
792  if (!pInfo->HasJoined())
793  {
794  // assign savegame colors
795  int32_t idSavegameID; bool fHasForcedColor = false; DWORD dwForceClr;
796  if ((idSavegameID = pInfo->GetAssociatedSavegamePlayerID()))
797  if ((pInfo2 = Game.RestorePlayerInfos.GetPlayerInfoByID(idSavegameID)))
798  {
799  dwForceClr = pInfo2->GetColor();
800  fHasForcedColor = true;
801  }
802  // assign team colors
803  if (!fHasForcedColor && Game.Teams.IsTeamColors())
804  {
805  C4Team *pPlrTeam = Game.Teams.GetTeamByID(pInfo->GetTeam());
806  if (pPlrTeam)
807  {
808  dwForceClr = pPlrTeam->GetColor();
809  fHasForcedColor = true;
810  }
811  }
812  // do color change
813  if (fHasForcedColor && (dwForceClr != pInfo->GetColor()))
814  {
815  pInfo->SetColor(dwForceClr);
816  pForInfo->SetUpdated();
817  }
818  // make sure colors have correct alpha (modified engines might send malformed packages of transparent colors)
819  if ((pInfo->GetColor() & 0xff000000u) != 0xff000000u)
820  {
821  pInfo->SetColor(pInfo->GetColor() | 0xff000000u);
822  pForInfo->SetUpdated();
823  }
824  }
825  if (fResolveConflicts) ResolvePlayerAttributeConflicts(pForInfo);
826 }
void SetColor(DWORD dwUseClr)
Definition: C4PlayerInfo.h:118
C4PlayerInfoList & RestorePlayerInfos
Definition: C4Game.h:74
C4Game Game
Definition: C4Globals.cpp:52
bool IsTeamColors() const
Definition: C4Teams.h:170
Definition: C4Teams.h:30
uint32_t GetColor() const
Definition: C4Teams.h:70
C4Team * GetTeamByID(int32_t iID) const
Definition: C4Teams.cpp:384
C4PlayerInfo * GetPlayerInfoByID(int32_t id) const
C4TeamList & Teams
Definition: C4Game.h:72
C4PlayerInfo * GetPlayerInfo(int32_t iIndex) const
int32_t GetAssociatedSavegamePlayerID() const
Definition: C4PlayerInfo.h:129
int32_t GetTeam() const
Definition: C4PlayerInfo.h:198
uint32_t GetColor() const
Definition: C4PlayerInfo.h:156
void ResolvePlayerAttributeConflicts(C4ClientPlayerInfos *pSecPacket)
uint32_t DWORD
bool HasJoined() const
Definition: C4PlayerInfo.h:168

Here is the call graph for this function:

Here is the caller graph for this function:

void C4PlayerInfoList::UpdatePlayerAttributes ( )

Definition at line 828 of file C4PlayerInfo.cpp.

References GetIndexedInfo(), and ResolvePlayerAttributeConflicts().

Referenced by DoLocalNonNetworkPlayerInfoUpdate().

829 {
830  // update attributes of all packets
831  int32_t iIdx=0;
832  C4ClientPlayerInfos *pForInfo;
833  while ((pForInfo = GetIndexedInfo(iIdx++))) UpdatePlayerAttributes(pForInfo, false);
834  // now resole all conflicts
836 }
void UpdatePlayerAttributes()
C4ClientPlayerInfos * GetIndexedInfo(int32_t iIndex) const
Definition: C4PlayerInfo.h:361
void ResolvePlayerAttributeConflicts(C4ClientPlayerInfos *pSecPacket)

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files: