52 virtual int Port()
const = 0;
63 virtual void GetClientAddr(
int ClientId,
char *pAddrStr,
int Size)
const = 0;
78 template<class T, typename std::enable_if<!protocol7::is_sixup<T>::value,
int>::type = 0>
79 inline int SendPackMsg(
const T *pMsg,
int Flags,
int ClientId)
95 template<class T, typename std::enable_if<protocol7::is_sixup<T>::value,
int>::type = 1>
96 inline int SendPackMsg(
const T *pMsg,
int Flags,
int ClientId)
120 mem_copy(&MsgCopy, pMsg,
sizeof(MsgCopy));
127 mem_copy(&MsgCopy, pMsg,
sizeof(MsgCopy));
130 if(MsgCopy.m_ClientId >= 0 && !
Translate(MsgCopy.m_ClientId, ClientId))
140 Msg7.m_ClientId = MsgCopy.m_ClientId;
143 Msg7.m_TargetId = -1;
153 mem_copy(&MsgCopy, pMsg,
sizeof(MsgCopy));
166 Msg7.m_ClientId = pMsg->m_ClientId;
167 Msg7.
m_Diff = pMsg->m_Diff;
168 Msg7.
m_Time = pMsg->m_Time;
179 dbg_assert(ClientId != -1,
"SendPackMsgOne called with -1");
182 if(pMsg->Pack(&Packer))
184 return SendMsg(&Packer, Flags, ClientId);
197 if(Target == pMap[i])
215 if(pMap[Target] == -1)
217 Target = pMap[Target];
239 return static_cast<T *
>(
SnapNewItem(Type, Id,
sizeof(T)));
252 virtual void Kick(
int ClientId,
const char *pReason) = 0;
253 virtual void Ban(
int ClientId,
int Seconds,
const char *pReason,
bool VerbatimReason) = 0;
262 virtual void SaveDemo(
int ClientId,
float Time) = 0;
287 virtual void SendMsgRaw(
int ClientId,
const void *pData,
int Size,
int Flags) = 0;
301 virtual
void OnInit(const
void *pPersistentData) = 0;
Definition: jsonwriter.h:105
virtual void OnClientPredictedInput(int ClientId, void *pInput)=0
virtual void OnClientDirectInput(int ClientId, void *pInput)=0
virtual const char * GameType() const =0
virtual void TeehistorianRecordPlayerFinish(int ClientId, int TimeTicks)=0
virtual void TeehistorianRecordPlayerName(int ClientId, const char *pName)=0
virtual void OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)=0
virtual int PersistentDataSize() const =0
virtual bool OnClientDataPersist(int ClientId, void *pData)=0
virtual void FillAntibot(CAntibotRoundData *pData)=0
virtual void OnSetAuthed(int ClientId, int Level)=0
virtual void OnSnap(int ClientId)=0
virtual CUuid GameUuid() const =0
virtual void OnPreSnap()=0
virtual void OnClientPredictedEarlyInput(int ClientId, void *pInput)=0
virtual void OnPreTickTeehistorian()=0
virtual void TeehistorianRecordTeamFinish(int TeamId, int TimeTicks)=0
virtual const char * NetVersion() const =0
virtual void OnClientEnter(int ClientId)=0
virtual void TeehistorianRecordAntibot(const void *pData, int DataSize)=0
virtual void OnUpdatePlayerServerInfo(CJsonStringWriter *pJSonWriter, int Id)=0
virtual void OnClientConnected(int ClientId, void *pPersistentData)=0
virtual void OnConsoleInit()=0
virtual const char * Version() const =0
virtual bool IsClientPlayer(int ClientId) const =0
virtual bool PlayerExists(int ClientId) const =0
virtual void OnPostSnap()=0
virtual void OnClientDrop(int ClientId, const char *pReason)=0
virtual void TeehistorianRecordPlayerDrop(int ClientId, const char *pReason)=0
virtual bool IsClientReady(int ClientId) const =0
virtual void OnShutdown(void *pPersistentData)=0
virtual void OnClientPrepareInput(int ClientId, void *pInput)=0
virtual void TeehistorianRecordPlayerRejoin(int ClientId)=0
virtual void TeehistorianRecordPlayerJoin(int ClientId, bool Sixup)=0
virtual void OnMapChange(char *pNewMapName, int MapNameSize)=0
virtual int PersistentClientDataSize() const =0
virtual void OnInit(const void *pPersistentData)=0
virtual int ClientCount() const =0
virtual void SetTimeoutProtected(int ClientId)=0
bool ReverseTranslate(int &Target, int Client)
Definition: server.h:207
int SendPackMsgTranslate(const CNetMsg_Sv_RaceFinish *pMsg, int Flags, int ClientId)
Definition: server.h:161
virtual int SnapNewId()=0
virtual void GetMapInfo(char *pMapName, int MapNameSize, int *pMapSize, SHA256_DIGEST *pSha256, int *pMapCrc)=0
virtual void SetRconCid(int ClientId)=0
int SendPackMsg(const T *pMsg, int Flags, int ClientId)
Definition: server.h:79
virtual bool WouldClientClanChange(int ClientId, const char *pClanRequest)=0
virtual void SetClientName(int ClientId, const char *pName)=0
virtual const char * GetMapName() const =0
virtual bool WouldClientNameChange(int ClientId, const char *pNameRequest)=0
int SendPackMsgTranslate(const T *pMsg, int Flags, int ClientId)
Definition: server.h:112
virtual void SnapSetStaticsize(int ItemType, int Size)=0
virtual int Port() const =0
virtual bool DnsblBlack(int ClientId)=0
virtual void SnapFreeId(int Id)=0
int Tick() const
Definition: server.h:49
virtual bool DnsblWhite(int ClientId)=0
virtual int SendMsg(CMsgPacker *pMsg, int Flags, int ClientId)=0
virtual const char * GetAuthName(int ClientId) const =0
virtual bool IsSixup(int ClientId) const =0
int SendPackMsgTranslate(const CNetMsg_Sv_Chat *pMsg, int Flags, int ClientId)
Definition: server.h:124
virtual void StopDemos()=0
virtual void ExpireServerInfo()=0
virtual int ClientCountry(int ClientId) const =0
@ RCON_CID_VOTE
Definition: server.h:247
@ RCON_CID_SERV
Definition: server.h:246
virtual void Ban(int ClientId, int Seconds, const char *pReason, bool VerbatimReason)=0
virtual void GetClientAddr(int ClientId, char *pAddrStr, int Size) const =0
virtual int MaxClients() const =0
virtual void RedirectClient(int ClientId, int Port, bool Verbose=false)=0
virtual void SetClientScore(int ClientId, std::optional< int > Score)=0
virtual int * GetIdMap(int ClientId)=0
virtual void ReloadMap()=0
virtual void ChangeMap(const char *pMap)=0
virtual bool ClientPrevIngame(int ClientId)=0
virtual bool GetClientInfo(int ClientId, CClientInfo *pInfo) const =0
virtual void FillAntibot(CAntibotRoundData *pData)=0
virtual void SetErrorShutdown(const char *pReason)=0
virtual void SetClientFlags(int ClientId, int Flags)=0
virtual bool IsRecording(int ClientId)=0
int SendPackMsgOne(const T *pMsg, int Flags, int ClientId)
Definition: server.h:177
virtual void * SnapNewItem(int Type, int Id, int Size)=0
virtual int DistinctClientCount() const =0
int TickSpeed() const
Definition: server.h:50
virtual const char * ClientName(int ClientId) const =0
int m_CurrentGameTick
Definition: server.h:33
virtual int GetAuthedState(int ClientId) const =0
T * SnapNewItem(int Id)
Definition: server.h:236
virtual void SetClientDDNetVersion(int ClientId, int DDNetVersion)=0
virtual void DemoRecorder_HandleAutoStart()=0
virtual void GetClientAddr(int ClientId, NETADDR *pAddr) const =0
virtual void SetClientClan(int ClientId, const char *pClan)=0
virtual bool ClientIngame(int ClientId) const =0
virtual void StopRecord(int ClientId)=0
bool Translate(int &Target, int Client)
Definition: server.h:187
virtual void SetClientCountry(int ClientId, int Country)=0
int SendPackMsgTranslate(const CNetMsg_Sv_KillMsg *pMsg, int Flags, int ClientId)
Definition: server.h:150
virtual const char * GetAnnouncementLine()=0
virtual void Kick(int ClientId, const char *pReason)=0
virtual bool DnsblPending(int ClientId)=0
virtual void SaveDemo(int ClientId, float Time)=0
virtual void StartRecord(int ClientId)=0
int SendPackMsgTranslate(const CNetMsg_Sv_Emoticon *pMsg, int Flags, int ClientId)
Definition: server.h:117
virtual int GetClientVersion(int ClientId) const =0
virtual void ResetNetErrorString(int ClientId)=0
virtual void SendMsgRaw(int ClientId, const void *pData, int Size, int Flags)=0
virtual const char * ClientClan(int ClientId) const =0
virtual const char * GetNetErrorString(int ClientId)=0
virtual bool SetTimedOut(int ClientId, int OrigId)=0
virtual bool ClientSlotEmpty(int ClientId) const =0
@ VERSION_DDNET_OLD
Definition: protocol.h:114
@ SERVER_TICK_SPEED
Definition: protocol.h:80
@ VANILLA_MAX_CLIENTS
Definition: protocol.h:89
#define dbg_assert(test, msg)
Definition: system.h:76
void mem_copy(void *dest, const void *source, size_t size)
Definition: system.cpp:174
#define MACRO_INTERFACE(Name)
Definition: kernel.h:25
@ CHAT_ALL
Definition: protocol7.h:99
@ CHAT_TEAM
Definition: protocol7.h:100
@ SERVER_DEMO_CLIENT
Definition: server.h:26
IGameServer * CreateGameServer()
Definition: gamecontext.cpp:4478
Definition: antibot_data.h:98
Definition: protocol.h:693
const char * m_pMessage
Definition: protocol.h:697
int m_Team
Definition: protocol.h:695
Definition: protocol.h:781
Definition: protocol.h:709
int m_Victim
Definition: protocol.h:712
int m_Killer
Definition: protocol.h:711
Definition: uuid_manager.h:17
const char * m_pName
Definition: server.h:41
const CUuid * m_pConnectionId
Definition: server.h:46
int m_Latency
Definition: server.h:42
int m_DDNetVersion
Definition: server.h:44
bool m_GotDDNetVersion
Definition: server.h:43
const char * m_pDDNetVersionStr
Definition: server.h:45
Definition: protocol7.h:519
const char * m_pMessage
Definition: protocol7.h:525
int m_Mode
Definition: protocol7.h:522
Definition: protocol7.h:1093
int m_RecordServer
Definition: protocol7.h:1100
int m_Time
Definition: protocol7.h:1097
int m_RecordPersonal
Definition: protocol7.h:1099
int m_Diff
Definition: protocol7.h:1098
Definition: protocol7.h:247
#define str_format
Definition: system.cpp:2830