OpenClonk
C4PacketJoinData Class Reference

#include <C4Network2.h>

Inheritance diagram for C4PacketJoinData:
[legend]
Collaboration diagram for C4PacketJoinData:
[legend]

Public Member Functions

 C4PacketJoinData ()=default
 
const int32_t & getClientID () const
 
const C4Network2ResCoregetDynamicCore () const
 
const C4Network2StatusgetStatus () const
 
int32_t getStartCtrlTick () const
 
void SetClientID (int32_t inClientID)
 
void SetGameStatus (const C4Network2Status &Status)
 
void SetDynamicCore (const C4Network2ResCore &Core)
 
void SetStartCtrlTick (int32_t iTick)
 
void CompileFunc (StdCompiler *pComp) override
 
C4NetIOPacket pack (const C4NetIO::addr_t &addr=C4NetIO::addr_t()) const
 
C4NetIOPacket pack (uint8_t cStatus, const C4NetIO::addr_t &addr=C4NetIO::addr_t()) const
 
void unpack (const C4NetIOPacket &Pkt, char *pStatus=nullptr)
 

Public Attributes

C4ScenarioParameterDefs ScenarioParameterDefs
 
C4GameParameters Parameters
 

Protected Attributes

int32_t iClientID
 
C4Network2ResCore Dynamic
 
C4Network2Status GameStatus
 
int32_t iStartCtrlTick
 

Detailed Description

Definition at line 415 of file C4Network2.h.

Constructor & Destructor Documentation

◆ C4PacketJoinData()

C4PacketJoinData::C4PacketJoinData ( )
default

Member Function Documentation

◆ CompileFunc()

void C4PacketJoinData::CompileFunc ( StdCompiler pComp)
overridevirtual

Implements C4PacketBase.

Definition at line 477 of file C4Packet2.cpp.

References C4ClientIDUnknown, Dynamic, mkIntPackAdapt(), mkNamingAdapt(), mkParAdapt(), and StdCompiler::Value().

478 {
480  pComp->Value(mkNamingAdapt(mkIntPackAdapt(iStartCtrlTick), "CtrlTick", -1));
481  pComp->Value(mkNamingAdapt(mkParAdapt(GameStatus, true), "GameStatus"));
482  pComp->Value(mkNamingAdapt(Dynamic, "Dynamic"));
483  pComp->Value(mkNamingAdapt(ScenarioParameterDefs, "ParameterDefs"));
484  pComp->Value(Parameters);
485 }
C4Network2Status GameStatus
Definition: C4Network2.h:429
C4Network2ResCore Dynamic
Definition: C4Network2.h:426
C4ScenarioParameterDefs ScenarioParameterDefs
Definition: C4Network2.h:437
int32_t iStartCtrlTick
Definition: C4Network2.h:432
StdNamingAdapt< T > mkNamingAdapt(T &&rValue, const char *szName)
Definition: StdAdaptors.h:92
void Value(const T &rStruct)
Definition: StdCompiler.h:161
const int32_t C4ClientIDUnknown
Definition: C4Client.h:24
StdIntPackAdapt< T > mkIntPackAdapt(T &rVal)
Definition: StdAdaptors.h:777
int32_t iClientID
Definition: C4Network2.h:423
StdParameterAdapt< T, P > mkParAdapt(T &&rObj, P &&rPar)
Definition: StdAdaptors.h:476
C4GameParameters Parameters
Definition: C4Network2.h:440
Here is the call graph for this function:

◆ getClientID()

const int32_t& C4PacketJoinData::getClientID ( ) const
inline

Definition at line 443 of file C4Network2.h.

Referenced by C4Network2::HandleJoinData().

443 { return iClientID; }
int32_t iClientID
Definition: C4Network2.h:423
Here is the caller graph for this function:

◆ getDynamicCore()

const C4Network2ResCore& C4PacketJoinData::getDynamicCore ( ) const
inline

Definition at line 444 of file C4Network2.h.

References Dynamic.

Referenced by C4Network2::HandleJoinData().

444 { return Dynamic; }
C4Network2ResCore Dynamic
Definition: C4Network2.h:426
Here is the caller graph for this function:

◆ getStartCtrlTick()

int32_t C4PacketJoinData::getStartCtrlTick ( ) const
inline

Definition at line 446 of file C4Network2.h.

Referenced by C4Network2::HandleJoinData().

446 { return iStartCtrlTick; }
int32_t iStartCtrlTick
Definition: C4Network2.h:432
Here is the caller graph for this function:

◆ getStatus()

const C4Network2Status& C4PacketJoinData::getStatus ( ) const
inline

Definition at line 445 of file C4Network2.h.

Referenced by C4Network2::HandleJoinData().

445 { return GameStatus; }
C4Network2Status GameStatus
Definition: C4Network2.h:429
Here is the caller graph for this function:

◆ pack() [1/2]

C4NetIOPacket C4PacketBase::pack ( const C4NetIO::addr_t addr = C4NetIO::addr_t()) const
inherited

Definition at line 150 of file C4Packet2.cpp.

Referenced by MkC4NetIOPacket().

151 {
152  return C4NetIOPacket(DecompileToBuf<StdCompilerBinWrite>(*this), addr);
153 }
Here is the caller graph for this function:

◆ pack() [2/2]

C4NetIOPacket C4PacketBase::pack ( uint8_t  cStatus,
const C4NetIO::addr_t addr = C4NetIO::addr_t() 
) const
inherited

Definition at line 155 of file C4Packet2.cpp.

References mkDecompileAdapt(), and mkInsertAdapt().

156 {
157  return C4NetIOPacket(DecompileToBuf<StdCompilerBinWrite>(mkInsertAdapt(mkDecompileAdapt(*this), cStatus)), addr);
158 }
StdDecompileAdapt< T > mkDecompileAdapt(const T &rValue)
Definition: StdAdaptors.h:153
StdInsertAdapt< T, I > mkInsertAdapt(T &&rObj, I &&rIns, bool fBefore=true)
Definition: StdAdaptors.h:455
Here is the call graph for this function:

◆ SetClientID()

void C4PacketJoinData::SetClientID ( int32_t  inClientID)
inline

Definition at line 448 of file C4Network2.h.

Referenced by C4Network2::SendJoinData().

448 { iClientID = inClientID; }
int32_t iClientID
Definition: C4Network2.h:423
Here is the caller graph for this function:

◆ SetDynamicCore()

void C4PacketJoinData::SetDynamicCore ( const C4Network2ResCore Core)
inline

Definition at line 450 of file C4Network2.h.

Referenced by C4Network2::SendJoinData().

450 { Dynamic = Core; }
C4Network2ResCore Dynamic
Definition: C4Network2.h:426
Here is the caller graph for this function:

◆ SetGameStatus()

void C4PacketJoinData::SetGameStatus ( const C4Network2Status Status)
inline

Definition at line 449 of file C4Network2.h.

Referenced by C4Network2::SendJoinData().

449 { GameStatus = Status; }
C4Network2Status GameStatus
Definition: C4Network2.h:429
Here is the caller graph for this function:

◆ SetStartCtrlTick()

void C4PacketJoinData::SetStartCtrlTick ( int32_t  iTick)
inline

Definition at line 451 of file C4Network2.h.

References C4Network2Status::CompileFunc().

Referenced by C4Network2::SendJoinData().

451 { iStartCtrlTick = iTick; }
int32_t iStartCtrlTick
Definition: C4Network2.h:432
Here is the call graph for this function:
Here is the caller graph for this function:

◆ unpack()

void C4PacketBase::unpack ( const C4NetIOPacket Pkt,
char *  pStatus = nullptr 
)
inherited

Definition at line 160 of file C4Packet2.cpp.

References C4PktBuf::C4PktBuf(), C4NetIOPacket::getPBuf(), C4NetIOPacket::getRef(), and C4NetIOPacket::getStatus().

Referenced by C4IDPacket::C4IDPacket(), and C4Network2IO::HandlePacket().

161 {
162  if (pStatus) *pStatus = Pkt.getStatus();
163  CompileFromBuf<StdCompilerBinRead>(*this, pStatus ? Pkt.getPBuf() : Pkt.getRef());
164 }
uint8_t getStatus() const
Definition: C4NetIO.h:318
StdBuf getPBuf() const
Definition: C4NetIO.h:321
C4NetIOPacket getRef() const
Definition: C4NetIO.h:324
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ Dynamic

C4Network2ResCore C4PacketJoinData::Dynamic
protected

Definition at line 426 of file C4Network2.h.

◆ GameStatus

C4Network2Status C4PacketJoinData::GameStatus
protected

Definition at line 429 of file C4Network2.h.

◆ iClientID

int32_t C4PacketJoinData::iClientID
protected

Definition at line 423 of file C4Network2.h.

◆ iStartCtrlTick

int32_t C4PacketJoinData::iStartCtrlTick
protected

Definition at line 432 of file C4Network2.h.

◆ Parameters

C4GameParameters C4PacketJoinData::Parameters

Definition at line 440 of file C4Network2.h.

Referenced by C4Network2::HandleJoinData(), and C4Network2::SendJoinData().

◆ ScenarioParameterDefs

C4ScenarioParameterDefs C4PacketJoinData::ScenarioParameterDefs

Definition at line 437 of file C4Network2.h.

Referenced by C4Network2::HandleJoinData(), and C4Network2::SendJoinData().


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