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)
 
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)
 

Protected Attributes

int32_t iClientID
 
int32_t iCtrlTick {-1}
 
C4TimeMilliseconds tTime
 
C4Control Ctrl
 
C4GameControlPacketpNext {nullptr}
 

Friends

class C4GameControlNetwork
 

Detailed Description

Definition at line 172 of file C4GameControlNetwork.h.

Constructor & Destructor Documentation

C4GameControlPacket::C4GameControlPacket ( )

Definition at line 849 of file C4GameControlNetwork.cpp.

852 {
853 
854 }
C4TimeMilliseconds tTime
const int32_t C4ClientIDUnknown
Definition: C4Client.h:24
static C4TimeMilliseconds Now()
C4GameControlPacket::C4GameControlPacket ( const C4GameControlPacket Pkt2)

Definition at line 856 of file C4GameControlNetwork.cpp.

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

857  : C4PacketBase(Pkt2), iClientID(Pkt2.getClientID()),
858  iCtrlTick(Pkt2.getCtrlTick()),
860 {
861  Ctrl.Copy(Pkt2.getControl());
862 }
C4TimeMilliseconds tTime
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 883 of file C4GameControlNetwork.cpp.

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

Referenced by C4GameControlNetwork::PackCompleteCtrl().

884 {
885  Ctrl.Append(Ctrl2.getControl());
886 }

Here is the call graph for this function:

Here is the caller graph for this function:

void C4GameControlPacket::CompileFunc ( StdCompiler pComp)
overridevirtual

Implements C4PacketBase.

Definition at line 888 of file C4GameControlNetwork.cpp.

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

889 {
891  pComp->Value(mkNamingAdapt(mkIntPackAdapt(iCtrlTick), "CtrlTick", -1));
892  pComp->Value(mkNamingAdapt(Ctrl, "Ctrl"));
893 }
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:759

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 864 of file C4GameControlNetwork.cpp.

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

865 {
866  Set(Pkt2.getClientID(), Pkt2.getCtrlTick(), Pkt2.getControl());
867  return *this;
868 }
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 149 of file C4Packet2.cpp.

Referenced by MkC4NetIOPacket().

150 {
151  return C4NetIOPacket(DecompileToBuf<StdCompilerBinWrite>(*this), addr);
152 }

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 154 of file C4Packet2.cpp.

References mkDecompileAdapt(), and mkInsertAdapt().

155 {
156  return C4NetIOPacket(DecompileToBuf<StdCompilerBinWrite>(mkInsertAdapt(mkDecompileAdapt(*this), cStatus)), addr);
157 }
StdDecompileAdapt< T > mkDecompileAdapt(const T &rValue)
Definition: StdAdaptors.h:153
StdInsertAdapt< T, I > mkInsertAdapt(T &&rObj, I &&rIns, bool fBefore=true)
Definition: StdAdaptors.h:437

Here is the call graph for this function:

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

Definition at line 870 of file C4GameControlNetwork.cpp.

References iClientID, and iCtrlTick.

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

871 {
872  iClientID = inClientID;
873  iCtrlTick = inCtrlTick;
874 }

Here is the caller graph for this function:

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

Definition at line 876 of file C4GameControlNetwork.cpp.

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

877 {
878  iClientID = inClientID;
879  iCtrlTick = inCtrlTick;
880  Ctrl.Copy(nCtrl);
881 }
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 159 of file C4Packet2.cpp.

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

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

160 {
161  if (pStatus) *pStatus = Pkt.getStatus();
162  CompileFromBuf<StdCompilerBinRead>(*this, pStatus ? Pkt.getPBuf() : Pkt.getRef());
163 }
StdBuf getPBuf() const
Definition: C4NetIO.h:320
C4NetIOPacket getRef() const
Definition: C4NetIO.h:323
uint8_t getStatus() const
Definition: C4NetIO.h:317

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 {-1}
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: