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

#include <C4GameControlNetwork.h>

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

Public Member Functions

 C4GameControlPacket ()
 
 C4GameControlPacket (const C4GameControlPacket &Pkt2)
 
C4GameControlPacketoperator= (const C4GameControlPacket &Pkt2)
 
int32_t getClientID () const
 
int32_t getCtrlTick () const
 
C4TimeMilliseconds getTime () const
 
const C4ControlgetControl () const
 
void Set (int32_t iClientID, int32_t iCtrlTick)
 
void Set (int32_t iClientID, int32_t iCtrlTick, const C4Control &Ctrl)
 
void Add (const C4GameControlPacket &Ctrl)
 
virtual void CompileFunc (StdCompiler *pComp)
 
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)
 

Protected Attributes

int32_t iClientID
 
int32_t iCtrlTick
 
C4TimeMilliseconds tTime
 
C4Control Ctrl
 
C4GameControlPacketpNext
 

Friends

class C4GameControlNetwork
 

Detailed Description

Definition at line 172 of file C4GameControlNetwork.h.

Constructor & Destructor Documentation

C4GameControlPacket::C4GameControlPacket ( )

Definition at line 851 of file C4GameControlNetwork.cpp.

853  iCtrlTick(-1),
855  pNext(nullptr)
856 {
857 
858 }
C4TimeMilliseconds tTime
C4GameControlPacket * pNext
const int32_t C4ClientIDUnknown
Definition: C4Client.h:24
static C4TimeMilliseconds Now()
C4GameControlPacket::C4GameControlPacket ( const C4GameControlPacket Pkt2)

Definition at line 860 of file C4GameControlNetwork.cpp.

References C4Control::Copy(), Ctrl, and getControl().

861  : C4PacketBase(Pkt2), iClientID(Pkt2.getClientID()),
862  iCtrlTick(Pkt2.getCtrlTick()),
864  pNext(nullptr)
865 {
866  Ctrl.Copy(Pkt2.getControl());
867 }
C4TimeMilliseconds tTime
C4GameControlPacket * pNext
void Copy(const C4Control &Ctrl)
Definition: C4Control.h:86
int32_t getCtrlTick() const
const C4Control & getControl() const
int32_t getClientID() const
static C4TimeMilliseconds Now()

Here is the call graph for this function:

Member Function Documentation

void C4GameControlPacket::Add ( const C4GameControlPacket Ctrl)

Definition at line 888 of file C4GameControlNetwork.cpp.

References C4Control::Append(), Ctrl, and getControl().

Referenced by C4GameControlNetwork::PackCompleteCtrl().

889 {
890  Ctrl.Append(Ctrl2.getControl());
891 }

Here is the call graph for this function:

Here is the caller graph for this function:

void C4GameControlPacket::CompileFunc ( StdCompiler pComp)
virtual

Implements C4PacketBase.

Definition at line 893 of file C4GameControlNetwork.cpp.

References C4ClientIDUnknown, Ctrl, iClientID, iCtrlTick, mkIntPackAdapt(), mkNamingAdapt(), and StdCompiler::Value().

894 {
896  pComp->Value(mkNamingAdapt(mkIntPackAdapt(iCtrlTick), "CtrlTick", -1));
897  pComp->Value(mkNamingAdapt(Ctrl, "Ctrl"));
898 }
StdNamingAdapt< T > mkNamingAdapt(T &&rValue, const char *szName)
Definition: StdAdaptors.h:93
void Value(const T &rStruct)
Definition: StdCompiler.h:171
const int32_t C4ClientIDUnknown
Definition: C4Client.h:24
StdIntPackAdapt< T > mkIntPackAdapt(T &rVal)
Definition: StdAdaptors.h:760

Here is the call graph for this function:

int32_t C4GameControlPacket::getClientID ( ) const
inline

Definition at line 194 of file C4GameControlNetwork.h.

References iClientID.

Referenced by C4GameControlNetwork::HandleControl(), and operator=().

194 { return iClientID; }

Here is the caller graph for this function:

const C4Control& C4GameControlPacket::getControl ( ) const
inline

Definition at line 197 of file C4GameControlNetwork.h.

References Ctrl.

Referenced by Add(), C4GameControlPacket(), C4GameControlNetwork::CheckCompleteCtrl(), C4GameControlNetwork::ExecQueuedSyncCtrl(), C4GameControlNetwork::GetControl(), and operator=().

197 { return Ctrl; }

Here is the caller graph for this function:

int32_t C4GameControlPacket::getCtrlTick ( ) const
inline

Definition at line 195 of file C4GameControlNetwork.h.

References iCtrlTick.

Referenced by C4GameControlNetwork::CheckCompleteCtrl(), C4GameControlNetwork::ClearCtrl(), C4GameControlNetwork::ExecQueuedSyncCtrl(), C4GameControlNetwork::HandleControl(), C4GameControlNetwork::HandleControlReq(), and operator=().

195 { return iCtrlTick; }

Here is the caller graph for this function:

C4TimeMilliseconds C4GameControlPacket::getTime ( ) const
inline

Definition at line 196 of file C4GameControlNetwork.h.

References tTime.

Referenced by C4GameControlNetwork::CalcPerformance().

196 { return tTime; }
C4TimeMilliseconds tTime

Here is the caller graph for this function:

C4GameControlPacket & C4GameControlPacket::operator= ( const C4GameControlPacket Pkt2)

Definition at line 869 of file C4GameControlNetwork.cpp.

References getClientID(), getControl(), getCtrlTick(), and Set().

870 {
871  Set(Pkt2.getClientID(), Pkt2.getCtrlTick(), Pkt2.getControl());
872  return *this;
873 }
void Set(int32_t iClientID, int32_t iCtrlTick)
int32_t getCtrlTick() const
const C4Control & getControl() const
int32_t getClientID() const

Here is the call graph for this function:

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

Definition at line 156 of file C4Packet2.cpp.

Referenced by MkC4NetIOPacket().

157 {
158  return C4NetIOPacket(DecompileToBuf<StdCompilerBinWrite>(*this), addr);
159 }

Here is the caller graph for this function:

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

Definition at line 161 of file C4Packet2.cpp.

References mkDecompileAdapt(), and mkInsertAdapt().

162 {
163  return C4NetIOPacket(DecompileToBuf<StdCompilerBinWrite>(mkInsertAdapt(mkDecompileAdapt(*this), cStatus)), addr);
164 }
StdDecompileAdapt< T > mkDecompileAdapt(const T &rValue)
Definition: StdAdaptors.h:154
StdInsertAdapt< T, I > mkInsertAdapt(T &&rObj, I &&rIns, bool fBefore=true)
Definition: StdAdaptors.h:438

Here is the call graph for this function:

void C4GameControlPacket::Set ( int32_t  iClientID,
int32_t  iCtrlTick 
)

Definition at line 875 of file C4GameControlNetwork.cpp.

References iClientID, and iCtrlTick.

Referenced by C4GameControlNetwork::AddSyncCtrlToQueue(), C4GameControlNetwork::DoInput(), operator=(), and C4GameControlNetwork::PackCompleteCtrl().

876 {
877  iClientID = inClientID;
878  iCtrlTick = inCtrlTick;
879 }

Here is the caller graph for this function:

void C4GameControlPacket::Set ( int32_t  iClientID,
int32_t  iCtrlTick,
const C4Control Ctrl 
)

Definition at line 881 of file C4GameControlNetwork.cpp.

References C4Control::Copy(), Ctrl, iClientID, and iCtrlTick.

882 {
883  iClientID = inClientID;
884  iCtrlTick = inCtrlTick;
885  Ctrl.Copy(nCtrl);
886 }
void Copy(const C4Control &Ctrl)
Definition: C4Control.h:86

Here is the call graph for this function:

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

Definition at line 166 of file C4Packet2.cpp.

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

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

167 {
168  if (pStatus) *pStatus = Pkt.getStatus();
169  CompileFromBuf<StdCompilerBinRead>(*this, pStatus ? Pkt.getPBuf() : Pkt.getRef());
170 }
StdBuf getPBuf() const
Definition: C4NetIO.h:321
C4NetIOPacket getRef() const
Definition: C4NetIO.h:324
uint8_t getStatus() const
Definition: C4NetIO.h:318

Here is the call graph for this function:

Here is the caller graph for this function:

Friends And Related Function Documentation

friend class C4GameControlNetwork
friend

Definition at line 174 of file C4GameControlNetwork.h.

Member Data Documentation

C4Control C4GameControlPacket::Ctrl
protected

Definition at line 188 of file C4GameControlNetwork.h.

Referenced by Add(), C4GameControlPacket(), CompileFunc(), getControl(), and Set().

int32_t C4GameControlPacket::iClientID
protected

Definition at line 184 of file C4GameControlNetwork.h.

Referenced by CompileFunc(), getClientID(), and Set().

int32_t C4GameControlPacket::iCtrlTick
protected

Definition at line 184 of file C4GameControlNetwork.h.

Referenced by CompileFunc(), getCtrlTick(), and Set().

C4TimeMilliseconds C4GameControlPacket::tTime
protected

Definition at line 185 of file C4GameControlNetwork.h.

Referenced by getTime().


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