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

Public Member Functions

 DisconnectData (C4LeagueFBIDList &rFBIDList, const C4ClientPlayerInfos &rPlayerInfos)
 
void CompileFunc (StdCompiler *pComp)
 

Detailed Description

Definition at line 252 of file C4League.cpp.

Constructor & Destructor Documentation

DisconnectData::DisconnectData ( C4LeagueFBIDList rFBIDList,
const C4ClientPlayerInfos rPlayerInfos 
)
inline

Definition at line 259 of file C4League.cpp.

260  : rFBIDList(rFBIDList), rPlayerInfos(rPlayerInfos) {}

Member Function Documentation

void DisconnectData::CompileFunc ( StdCompiler pComp)
inline

Definition at line 262 of file C4League.cpp.

References C4LeagueFBIDList::FindFBIDByAccount(), C4PlayerInfo::GetID(), C4PlayerInfo::getLeagueAccount(), C4ClientPlayerInfos::GetPlayerInfo(), StdCompiler::isDeserializer(), C4PlayerInfo::IsJoined(), C4PlayerInfo::IsRemoved(), mkDecompileAdapt(), mkNamingAdapt(), mkParAdapt(), StdCompiler::Name(), StdCompiler::NameEnd(), StdCompiler::RCT_IdtfAllowEmpty, and StdCompiler::Value().

263  {
264  if (pComp->isDeserializer())
265  {
266  // compiling not yet needed
267  assert(!"DisconnectData::CompileFunc not defined for compiler!");
268  }
269  else
270  {
271  // decompiling: Compile all joined and not removed player infos.
272  // Compile them even if they're not in the FBID-List, but omit
273  // the FBID (used for host message)
274  int32_t i=0; C4PlayerInfo *pInfo;
275  while ((pInfo = rPlayerInfos.GetPlayerInfo(i++)))
276  if (pInfo->IsJoined() && !pInfo->IsRemoved())
277  {
278  pComp->Name("Player");
279  try
280  {
281  pComp->Value(mkNamingAdapt(mkDecompileAdapt(pInfo->GetID()), "ID"));
282  StdCopyStrBuf sFBID;
283  if (rFBIDList.FindFBIDByAccount(pInfo->getLeagueAccount(), &sFBID)) pComp->Value(mkNamingAdapt(mkParAdapt(sFBID, StdCompiler::RCT_IdtfAllowEmpty), "FBID"));
284  }
285  catch (StdCompiler::Exception *)
286  {
287  pComp->NameEnd();
288  throw;
289  }
290  pComp->NameEnd();
291  }
292  }
293  }
virtual bool Name(const char *szName)
Definition: StdCompiler.h:87
const char * getLeagueAccount() const
Definition: C4PlayerInfo.h:187
StdNamingAdapt< T > mkNamingAdapt(T &&rValue, const char *szName)
Definition: StdAdaptors.h:93
C4PlayerInfo * GetPlayerInfo(int32_t iIndex) const
bool IsJoined() const
Definition: C4PlayerInfo.h:169
StdDecompileAdapt< T > mkDecompileAdapt(const T &rValue)
Definition: StdAdaptors.h:154
bool IsRemoved() const
Definition: C4PlayerInfo.h:167
bool FindFBIDByAccount(const char *szAccount, StdStrBuf *pFBIDOut)
Definition: C4League.cpp:208
void Value(const T &rStruct)
Definition: StdCompiler.h:171
virtual bool isDeserializer()
Definition: StdCompiler.h:63
StdParameterAdapt< T, P > mkParAdapt(T &&rObj, P &&rPar)
Definition: StdAdaptors.h:456
int32_t GetID() const
Definition: C4PlayerInfo.h:197
virtual void NameEnd(bool fBreak=false)
Definition: StdCompiler.h:88

Here is the call graph for this function:


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