DDraceNetwork Docs
gamecontext.h
Go to the documentation of this file.
1/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
2/* If you are missing that file, acquire a complete release at teeworlds.com. */
3#ifndef GAME_SERVER_GAMECONTEXT_H
4#define GAME_SERVER_GAMECONTEXT_H
5
6#include <engine/console.h>
7#include <engine/server.h>
8
9#include <game/collision.h>
11#include <game/layers.h>
12#include <game/mapbugs.h>
13#include <game/voting.h>
14
15#include "eventhandler.h"
16#include "gameworld.h"
17#include "teehistorian.h"
18
19#include <memory>
20#include <string>
21
22/*
23 Tick
24 Game Context (CGameContext::tick)
25 Game World (GAMEWORLD::tick)
26 Reset world if requested (GAMEWORLD::reset)
27 All entities in the world (ENTITY::tick)
28 All entities in the world (ENTITY::tick_defered)
29 Remove entities marked for deletion (GAMEWORLD::remove_entities)
30 Game Controller (GAMECONTROLLER::tick)
31 All players (CPlayer::tick)
32
33
34 Snap
35 Game Context (CGameContext::snap)
36 Game World (GAMEWORLD::snap)
37 All entities in the world (ENTITY::snap)
38 Game Controller (GAMECONTROLLER::snap)
39 Events handler (EVENT_HANDLER::snap)
40 All players (CPlayer::snap)
41
42*/
43
44enum
45{
46 NUM_TUNEZONES = 256
47};
48
49class CCharacter;
50class IConfigManager;
51class CConfig;
52class CHeap;
53class CPlayer;
54class CScore;
55class CUnpacker;
56class IAntibot;
57class IGameController;
58class IEngine;
59class IStorage;
62
64{
65 CSnapContext(int Version, bool Sixup = false) :
66 m_ClientVersion(Version), m_Sixup(Sixup)
67 {
68 }
69
70 int GetClientVersion() const { return m_ClientVersion; }
71 bool IsSixup() const { return m_Sixup; }
72
73private:
75 bool m_Sixup;
76};
77
79{
93 std::vector<std::string> m_vCensorlist;
94
101
103
104 static void CommandCallback(int ClientId, int FlagMask, const char *pCmd, IConsole::IResult *pResult, void *pUser);
105 static void TeeHistorianWrite(const void *pData, int DataSize, void *pUser);
106
107 static void ConTuneParam(IConsole::IResult *pResult, void *pUserData);
108 static void ConToggleTuneParam(IConsole::IResult *pResult, void *pUserData);
109 static void ConTuneReset(IConsole::IResult *pResult, void *pUserData);
110 static void ConTunes(IConsole::IResult *pResult, void *pUserData);
111 static void ConTuneZone(IConsole::IResult *pResult, void *pUserData);
112 static void ConTuneDumpZone(IConsole::IResult *pResult, void *pUserData);
113 static void ConTuneResetZone(IConsole::IResult *pResult, void *pUserData);
114 static void ConTuneSetZoneMsgEnter(IConsole::IResult *pResult, void *pUserData);
115 static void ConTuneSetZoneMsgLeave(IConsole::IResult *pResult, void *pUserData);
116 static void ConMapbug(IConsole::IResult *pResult, void *pUserData);
117 static void ConSwitchOpen(IConsole::IResult *pResult, void *pUserData);
118 static void ConPause(IConsole::IResult *pResult, void *pUserData);
119 static void ConChangeMap(IConsole::IResult *pResult, void *pUserData);
120 static void ConRandomMap(IConsole::IResult *pResult, void *pUserData);
121 static void ConRandomUnfinishedMap(IConsole::IResult *pResult, void *pUserData);
122 static void ConRestart(IConsole::IResult *pResult, void *pUserData);
123 static void ConBroadcast(IConsole::IResult *pResult, void *pUserData);
124 static void ConSay(IConsole::IResult *pResult, void *pUserData);
125 static void ConSetTeam(IConsole::IResult *pResult, void *pUserData);
126 static void ConSetTeamAll(IConsole::IResult *pResult, void *pUserData);
127 static void ConHotReload(IConsole::IResult *pResult, void *pUserData);
128 static void ConAddVote(IConsole::IResult *pResult, void *pUserData);
129 static void ConRemoveVote(IConsole::IResult *pResult, void *pUserData);
130 static void ConForceVote(IConsole::IResult *pResult, void *pUserData);
131 static void ConClearVotes(IConsole::IResult *pResult, void *pUserData);
132 static void ConAddMapVotes(IConsole::IResult *pResult, void *pUserData);
133 static void ConVote(IConsole::IResult *pResult, void *pUserData);
134 static void ConVotes(IConsole::IResult *pResult, void *pUserData);
135 static void ConVoteNo(IConsole::IResult *pResult, void *pUserData);
136 static void ConDrySave(IConsole::IResult *pResult, void *pUserData);
137 static void ConDumpAntibot(IConsole::IResult *pResult, void *pUserData);
138 static void ConAntibot(IConsole::IResult *pResult, void *pUserData);
139 static void ConchainSpecialMotdupdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
140 static void ConchainSettingUpdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
141 static void ConDumpLog(IConsole::IResult *pResult, void *pUserData);
142
143 void Construct(int Resetting);
144 void Destruct(int Resetting);
145 void AddVote(const char *pDescription, const char *pCommand);
146 static int MapScan(const char *pName, int IsDir, int DirType, void *pUserData);
147
149 {
151 };
152
154 {
157 };
158
159public:
160 IServer *Server() const { return m_pServer; }
162 CConfig *Config() { return m_pConfig; }
164 IEngine *Engine() { return m_pEngine; }
172
173 CGameContext();
174 CGameContext(int Reset);
176
177 void Clear();
178
181 // keep last input to always apply when none is sent
188
189 // returns last input if available otherwise nulled PlayerInput object
190 // ClientId has to be valid
191 CNetObj_PlayerInput GetLastPlayerInput(int ClientId) const;
192
195
196 // helper functions
197 class CCharacter *GetPlayerChar(int ClientId);
198 bool EmulateBug(int Bug);
199 std::vector<SSwitchers> &Switchers() { return m_World.m_Core.m_vSwitchers; }
200
201 // voting
202 void StartVote(const char *pDesc, const char *pCommand, const char *pReason, const char *pSixupDesc);
203 void EndVote();
204 void SendVoteSet(int ClientId);
205 void SendVoteStatus(int ClientId, int Total, int Yes, int No);
206 void AbortVoteKickOnDisconnect(int ClientId);
207
219 char m_aaZoneEnterMsg[NUM_TUNEZONES][256]; // 0 is used for switching from or to area without tunings
221
222 void CreateAllEntities(bool Initial);
223
225 void DeleteTempfile();
226
227 enum
228 {
236 };
240
241 // helper functions
242 void CreateDamageInd(vec2 Pos, float AngleMod, int Amount, CClientMask Mask = CClientMask().set());
243 void CreateExplosion(vec2 Pos, int Owner, int Weapon, bool NoDamage, int ActivatedTeam, CClientMask Mask = CClientMask().set());
244 void CreateHammerHit(vec2 Pos, CClientMask Mask = CClientMask().set());
245 void CreatePlayerSpawn(vec2 Pos, CClientMask Mask = CClientMask().set());
246 void CreateDeath(vec2 Pos, int ClientId, CClientMask Mask = CClientMask().set());
247 void CreateBirthdayEffect(vec2 Pos, CClientMask Mask = CClientMask().set());
248 void CreateFinishEffect(vec2 Pos, CClientMask Mask = CClientMask().set());
249 void CreateSound(vec2 Pos, int Sound, CClientMask Mask = CClientMask().set());
250 void CreateSoundGlobal(int Sound, int Target = -1) const;
251
252 void SnapSwitchers(int SnappingClient);
253 bool SnapLaserObject(const CSnapContext &Context, int SnapId, const vec2 &To, const vec2 &From, int StartTick, int Owner = -1, int LaserType = -1, int Subtype = -1, int SwitchNumber = -1) const;
254 bool SnapPickup(const CSnapContext &Context, int SnapId, const vec2 &Pos, int Type, int SubType, int SwitchNumber) const;
255
256 enum
257 {
258 FLAG_SIX = 1 << 0,
259 FLAG_SIXUP = 1 << 1,
260 };
261
262 // network
263 void CallVote(int ClientId, const char *pDesc, const char *pCmd, const char *pReason, const char *pChatmsg, const char *pSixupDesc = 0);
264 void SendChatTarget(int To, const char *pText, int VersionFlags = FLAG_SIX | FLAG_SIXUP) const;
265 void SendChatTeam(int Team, const char *pText) const;
266 void SendChat(int ClientId, int Team, const char *pText, int SpamProtectionClientId = -1, int VersionFlags = FLAG_SIX | FLAG_SIXUP);
267 void SendStartWarning(int ClientId, const char *pMessage);
268 void SendEmoticon(int ClientId, int Emoticon, int TargetClientId) const;
269 void SendWeaponPickup(int ClientId, int Weapon) const;
270 void SendMotd(int ClientId) const;
271 void SendSettings(int ClientId) const;
272 void SendBroadcast(const char *pText, int ClientId, bool IsImportant = true);
273
274 void List(int ClientId, const char *pFilter);
275
276 //
277 void CheckPureTuning();
278 void SendTuningParams(int ClientId, int Zone = 0);
279
280 const CVoteOptionServer *GetVoteOption(int Index) const;
281 void ProgressVoteOptions(int ClientId);
282
283 //
284 void LoadMapSettings();
285
286 // engine events
287 void OnInit(const void *pPersistentData) override;
288 void OnConsoleInit() override;
291 void OnMapChange(char *pNewMapName, int MapNameSize) override;
292 void OnShutdown(void *pPersistentData) override;
293
294 void OnTick() override;
295 void OnPreSnap() override;
296 void OnSnap(int ClientId) override;
297 void OnPostSnap() override;
298
299 void UpdatePlayerMaps();
300
301 void *PreProcessMsg(int *pMsgId, CUnpacker *pUnpacker, int ClientId);
302 void CensorMessage(char *pCensoredMessage, const char *pMessage, int Size);
303 void OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId) override;
304 void OnSayNetMessage(const CNetMsg_Cl_Say *pMsg, int ClientId, const CUnpacker *pUnpacker);
305 void OnCallVoteNetMessage(const CNetMsg_Cl_CallVote *pMsg, int ClientId);
306 void OnVoteNetMessage(const CNetMsg_Cl_Vote *pMsg, int ClientId);
307 void OnSetTeamNetMessage(const CNetMsg_Cl_SetTeam *pMsg, int ClientId);
308 void OnIsDDNetLegacyNetMessage(const CNetMsg_Cl_IsDDNetLegacy *pMsg, int ClientId, CUnpacker *pUnpacker);
309 void OnShowOthersLegacyNetMessage(const CNetMsg_Cl_ShowOthersLegacy *pMsg, int ClientId);
310 void OnShowOthersNetMessage(const CNetMsg_Cl_ShowOthers *pMsg, int ClientId);
311 void OnShowDistanceNetMessage(const CNetMsg_Cl_ShowDistance *pMsg, int ClientId);
312 void OnCameraInfoNetMessage(const CNetMsg_Cl_CameraInfo *pMsg, int ClientId);
313 void OnSetSpectatorModeNetMessage(const CNetMsg_Cl_SetSpectatorMode *pMsg, int ClientId);
314 void OnChangeInfoNetMessage(const CNetMsg_Cl_ChangeInfo *pMsg, int ClientId);
315 void OnEmoticonNetMessage(const CNetMsg_Cl_Emoticon *pMsg, int ClientId);
316 void OnKillNetMessage(const CNetMsg_Cl_Kill *pMsg, int ClientId);
317 void OnStartInfoNetMessage(const CNetMsg_Cl_StartInfo *pMsg, int ClientId);
318
319 bool OnClientDataPersist(int ClientId, void *pData) override;
320 void OnClientConnected(int ClientId, void *pData) override;
321 void OnClientEnter(int ClientId) override;
322 void OnClientDrop(int ClientId, const char *pReason) override;
323 void OnClientPrepareInput(int ClientId, void *pInput) override;
324 void OnClientDirectInput(int ClientId, void *pInput) override;
325 void OnClientPredictedInput(int ClientId, void *pInput) override;
326 void OnClientPredictedEarlyInput(int ClientId, void *pInput) override;
327
328 void TeehistorianRecordAntibot(const void *pData, int DataSize) override;
329 void TeehistorianRecordPlayerJoin(int ClientId, bool Sixup) override;
330 void TeehistorianRecordPlayerDrop(int ClientId, const char *pReason) override;
331 void TeehistorianRecordPlayerRejoin(int ClientId) override;
332 void TeehistorianRecordPlayerName(int ClientId, const char *pName) override;
333 void TeehistorianRecordPlayerFinish(int ClientId, int TimeTicks) override;
334 void TeehistorianRecordTeamFinish(int TeamId, int TimeTicks) override;
335
336 bool IsClientReady(int ClientId) const override;
337 bool IsClientPlayer(int ClientId) const override;
338 int PersistentDataSize() const override { return sizeof(CPersistentData); }
339 int PersistentClientDataSize() const override { return sizeof(CPersistentClientData); }
340
341 CUuid GameUuid() const override;
342 const char *GameType() const override;
343 const char *Version() const override;
344 const char *NetVersion() const override;
345
346 // DDRace
347 void OnPreTickTeehistorian() override;
348 bool OnClientDDNetVersionKnown(int ClientId);
349 void FillAntibot(CAntibotRoundData *pData) override;
350 bool ProcessSpamProtection(int ClientId, bool RespectChatInitialDelay = true);
351 int GetDDRaceTeam(int ClientId) const;
352 // Describes the time when the first player joined the server.
355 int GetClientVersion(int ClientId) const;
357 bool PlayerExists(int ClientId) const override { return m_apPlayers[ClientId]; }
358 // Returns true if someone is actively moderating.
359 bool PlayerModerating() const;
360 void ForceVote(int EnforcerId, bool Success);
361
362 // Checks if player can vote and notify them about the reason
363 bool RateLimitPlayerVote(int ClientId);
364 bool RateLimitPlayerMapVote(int ClientId) const;
365
366 void OnUpdatePlayerServerInfo(CJsonStringWriter *pJSonWriter, int Id) override;
367 void ReadCensorList();
368
369 std::shared_ptr<CScoreRandomMapResult> m_SqlRandomMapResult;
370
371private:
372 // starting 1 to make 0 the special value "no client id"
373 uint32_t NextUniqueClientId = 1;
376
377 // DDRace Console Commands
378
379 static void ConKillPlayer(IConsole::IResult *pResult, void *pUserData);
380
381 static void ConNinja(IConsole::IResult *pResult, void *pUserData);
382 static void ConUnNinja(IConsole::IResult *pResult, void *pUserData);
383 static void ConEndlessHook(IConsole::IResult *pResult, void *pUserData);
384 static void ConUnEndlessHook(IConsole::IResult *pResult, void *pUserData);
385 static void ConSolo(IConsole::IResult *pResult, void *pUserData);
386 static void ConUnSolo(IConsole::IResult *pResult, void *pUserData);
387 static void ConFreeze(IConsole::IResult *pResult, void *pUserData);
388 static void ConUnFreeze(IConsole::IResult *pResult, void *pUserData);
389 static void ConDeep(IConsole::IResult *pResult, void *pUserData);
390 static void ConUnDeep(IConsole::IResult *pResult, void *pUserData);
391 static void ConLiveFreeze(IConsole::IResult *pResult, void *pUserData);
392 static void ConUnLiveFreeze(IConsole::IResult *pResult, void *pUserData);
393 static void ConUnSuper(IConsole::IResult *pResult, void *pUserData);
394 static void ConSuper(IConsole::IResult *pResult, void *pUserData);
395 static void ConToggleInvincible(IConsole::IResult *pResult, void *pUserData);
396 static void ConShotgun(IConsole::IResult *pResult, void *pUserData);
397 static void ConGrenade(IConsole::IResult *pResult, void *pUserData);
398 static void ConLaser(IConsole::IResult *pResult, void *pUserData);
399 static void ConJetpack(IConsole::IResult *pResult, void *pUserData);
400 static void ConEndlessJump(IConsole::IResult *pResult, void *pUserData);
401 static void ConSetJumps(IConsole::IResult *pResult, void *pUserData);
402 static void ConWeapons(IConsole::IResult *pResult, void *pUserData);
403 static void ConUnShotgun(IConsole::IResult *pResult, void *pUserData);
404 static void ConUnGrenade(IConsole::IResult *pResult, void *pUserData);
405 static void ConUnLaser(IConsole::IResult *pResult, void *pUserData);
406 static void ConUnJetpack(IConsole::IResult *pResult, void *pUserData);
407 static void ConUnEndlessJump(IConsole::IResult *pResult, void *pUserData);
408 static void ConUnWeapons(IConsole::IResult *pResult, void *pUserData);
409 static void ConAddWeapon(IConsole::IResult *pResult, void *pUserData);
410 static void ConRemoveWeapon(IConsole::IResult *pResult, void *pUserData);
411 void ModifyWeapons(IConsole::IResult *pResult, void *pUserData, int Weapon, bool Remove);
412 void MoveCharacter(int ClientId, int X, int Y, bool Raw = false);
413 static void ConGoLeft(IConsole::IResult *pResult, void *pUserData);
414 static void ConGoRight(IConsole::IResult *pResult, void *pUserData);
415 static void ConGoUp(IConsole::IResult *pResult, void *pUserData);
416 static void ConGoDown(IConsole::IResult *pResult, void *pUserData);
417 static void ConMove(IConsole::IResult *pResult, void *pUserData);
418 static void ConMoveRaw(IConsole::IResult *pResult, void *pUserData);
419
420 static void ConToTeleporter(IConsole::IResult *pResult, void *pUserData);
421 static void ConToCheckTeleporter(IConsole::IResult *pResult, void *pUserData);
422 void Teleport(CCharacter *pChr, vec2 Pos);
423 static void ConTeleport(IConsole::IResult *pResult, void *pUserData);
424
425 static void ConCredits(IConsole::IResult *pResult, void *pUserData);
426 static void ConInfo(IConsole::IResult *pResult, void *pUserData);
427 static void ConHelp(IConsole::IResult *pResult, void *pUserData);
428 static void ConSettings(IConsole::IResult *pResult, void *pUserData);
429 static void ConRules(IConsole::IResult *pResult, void *pUserData);
430 static void ConKill(IConsole::IResult *pResult, void *pUserData);
431 static void ConTogglePause(IConsole::IResult *pResult, void *pUserData);
432 static void ConTogglePauseVoted(IConsole::IResult *pResult, void *pUserData);
433 static void ConToggleSpec(IConsole::IResult *pResult, void *pUserData);
434 static void ConToggleSpecVoted(IConsole::IResult *pResult, void *pUserData);
435 static void ConForcePause(IConsole::IResult *pResult, void *pUserData);
436 static void ConTeamTop5(IConsole::IResult *pResult, void *pUserData);
437 static void ConTop(IConsole::IResult *pResult, void *pUserData);
438 static void ConTimes(IConsole::IResult *pResult, void *pUserData);
439 static void ConPoints(IConsole::IResult *pResult, void *pUserData);
440 static void ConTopPoints(IConsole::IResult *pResult, void *pUserData);
441 static void ConTimeCP(IConsole::IResult *pResult, void *pUserData);
442
443 static void ConDND(IConsole::IResult *pResult, void *pUserData);
444 static void ConWhispers(IConsole::IResult *pResult, void *pUserData);
445 static void ConMapInfo(IConsole::IResult *pResult, void *pUserData);
446 static void ConTimeout(IConsole::IResult *pResult, void *pUserData);
447 static void ConPractice(IConsole::IResult *pResult, void *pUserData);
448 static void ConPracticeCmdList(IConsole::IResult *pResult, void *pUserData);
449 static void ConSwap(IConsole::IResult *pResult, void *pUserData);
450 static void ConSave(IConsole::IResult *pResult, void *pUserData);
451 static void ConLoad(IConsole::IResult *pResult, void *pUserData);
452 static void ConMap(IConsole::IResult *pResult, void *pUserData);
453 static void ConTeamRank(IConsole::IResult *pResult, void *pUserData);
454 static void ConRank(IConsole::IResult *pResult, void *pUserData);
455 static void ConTeam(IConsole::IResult *pResult, void *pUserData);
456 static void ConLock(IConsole::IResult *pResult, void *pUserData);
457 static void ConUnlock(IConsole::IResult *pResult, void *pUserData);
458 static void ConInvite(IConsole::IResult *pResult, void *pUserData);
459 static void ConJoin(IConsole::IResult *pResult, void *pUserData);
460 static void ConTeam0Mode(IConsole::IResult *pResult, void *pUserData);
461 static void ConMe(IConsole::IResult *pResult, void *pUserData);
462 static void ConWhisper(IConsole::IResult *pResult, void *pUserData);
463 static void ConConverse(IConsole::IResult *pResult, void *pUserData);
464 static void ConSetEyeEmote(IConsole::IResult *pResult, void *pUserData);
465 static void ConEyeEmote(IConsole::IResult *pResult, void *pUserData);
466 static void ConShowOthers(IConsole::IResult *pResult, void *pUserData);
467 static void ConShowAll(IConsole::IResult *pResult, void *pUserData);
468 static void ConSpecTeam(IConsole::IResult *pResult, void *pUserData);
469 static void ConNinjaJetpack(IConsole::IResult *pResult, void *pUserData);
470 static void ConSayTime(IConsole::IResult *pResult, void *pUserData);
471 static void ConSayTimeAll(IConsole::IResult *pResult, void *pUserData);
472 static void ConTime(IConsole::IResult *pResult, void *pUserData);
473 static void ConSetTimerType(IConsole::IResult *pResult, void *pUserData);
474 static void ConRescue(IConsole::IResult *pResult, void *pUserData);
475 static void ConRescueMode(IConsole::IResult *pResult, void *pUserData);
476 static void ConTeleTo(IConsole::IResult *pResult, void *pUserData);
477 static void ConTeleXY(IConsole::IResult *pResult, void *pUserData);
478 static void ConTeleCursor(IConsole::IResult *pResult, void *pUserData);
479 static void ConLastTele(IConsole::IResult *pResult, void *pUserData);
480
481 // Chat commands for practice mode
482 static void ConPracticeToTeleporter(IConsole::IResult *pResult, void *pUserData);
483 static void ConPracticeToCheckTeleporter(IConsole::IResult *pResult, void *pUserData);
484 static void ConPracticeUnSolo(IConsole::IResult *pResult, void *pUserData);
485 static void ConPracticeSolo(IConsole::IResult *pResult, void *pUserData);
486 static void ConPracticeUnDeep(IConsole::IResult *pResult, void *pUserData);
487 static void ConPracticeDeep(IConsole::IResult *pResult, void *pUserData);
488 static void ConPracticeUnLiveFreeze(IConsole::IResult *pResult, void *pUserData);
489 static void ConPracticeLiveFreeze(IConsole::IResult *pResult, void *pUserData);
490 static void ConPracticeShotgun(IConsole::IResult *pResult, void *pUserData);
491 static void ConPracticeGrenade(IConsole::IResult *pResult, void *pUserData);
492 static void ConPracticeLaser(IConsole::IResult *pResult, void *pUserData);
493 static void ConPracticeJetpack(IConsole::IResult *pResult, void *pUserData);
494 static void ConPracticeEndlessJump(IConsole::IResult *pResult, void *pUserData);
495 static void ConPracticeSetJumps(IConsole::IResult *pResult, void *pUserData);
496 static void ConPracticeWeapons(IConsole::IResult *pResult, void *pUserData);
497 static void ConPracticeUnShotgun(IConsole::IResult *pResult, void *pUserData);
498 static void ConPracticeUnGrenade(IConsole::IResult *pResult, void *pUserData);
499 static void ConPracticeUnLaser(IConsole::IResult *pResult, void *pUserData);
500 static void ConPracticeUnJetpack(IConsole::IResult *pResult, void *pUserData);
501 static void ConPracticeUnEndlessJump(IConsole::IResult *pResult, void *pUserData);
502 static void ConPracticeUnWeapons(IConsole::IResult *pResult, void *pUserData);
503 static void ConPracticeNinja(IConsole::IResult *pResult, void *pUserData);
504 static void ConPracticeUnNinja(IConsole::IResult *pResult, void *pUserData);
505 static void ConPracticeEndlessHook(IConsole::IResult *pResult, void *pUserData);
506 static void ConPracticeUnEndlessHook(IConsole::IResult *pResult, void *pUserData);
507 static void ConPracticeToggleInvincible(IConsole::IResult *pResult, void *pUserData);
508
509 static void ConPracticeAddWeapon(IConsole::IResult *pResult, void *pUserData);
510 static void ConPracticeRemoveWeapon(IConsole::IResult *pResult, void *pUserData);
511
512 static void ConProtectedKill(IConsole::IResult *pResult, void *pUserData);
513
514 static void ConVoteMute(IConsole::IResult *pResult, void *pUserData);
515 static void ConVoteUnmute(IConsole::IResult *pResult, void *pUserData);
516 static void ConVoteMutes(IConsole::IResult *pResult, void *pUserData);
517 static void ConMute(IConsole::IResult *pResult, void *pUserData);
518 static void ConMuteId(IConsole::IResult *pResult, void *pUserData);
519 static void ConMuteIp(IConsole::IResult *pResult, void *pUserData);
520 static void ConUnmute(IConsole::IResult *pResult, void *pUserData);
521 static void ConUnmuteId(IConsole::IResult *pResult, void *pUserData);
522 static void ConMutes(IConsole::IResult *pResult, void *pUserData);
523 static void ConModerate(IConsole::IResult *pResult, void *pUserData);
524
525 static void ConList(IConsole::IResult *pResult, void *pUserData);
526 static void ConSetDDRTeam(IConsole::IResult *pResult, void *pUserData);
527 static void ConUninvite(IConsole::IResult *pResult, void *pUserData);
528 static void ConFreezeHammer(IConsole::IResult *pResult, void *pUserData);
529 static void ConUnFreezeHammer(IConsole::IResult *pResult, void *pUserData);
530
531 static void ConReloadCensorlist(IConsole::IResult *pResult, void *pUserData);
532
534
535 enum
536 {
539 };
540 struct CMute
541 {
544 char m_aReason[128];
546 };
547
552 bool TryMute(const NETADDR *pAddr, int Secs, const char *pReason, bool InitialChatDelay);
553 void Mute(const NETADDR *pAddr, int Secs, const char *pDisplayName, const char *pReason = "", bool InitialChatDelay = false);
554 bool TryVoteMute(const NETADDR *pAddr, int Secs, const char *pReason);
555 void VoteMute(const NETADDR *pAddr, int Secs, const char *pReason, const char *pDisplayName, int AuthedId);
556 bool VoteUnmute(const NETADDR *pAddr, const char *pDisplayName, int AuthedId);
557 void Whisper(int ClientId, char *pStr);
558 void WhisperId(int ClientId, int VictimId, const char *pMessage);
559 void Converse(int ClientId, char *pStr);
560 bool IsVersionBanned(int Version);
561 void UnlockTeam(int ClientId, int Team) const;
562 void AttemptJoinTeam(int ClientId, int Team);
563
564 enum
565 {
567 MAX_LOGS = 512,
568 };
569 struct CLog
570 {
571 int64_t m_Timestamp;
573 char m_aDescription[128];
577 };
580
581 void LogEvent(const char *Description, int ClientId);
582
583public:
584 CLayers *Layers() { return &m_Layers; }
585 CScore *Score() { return m_pScore; }
586
587 enum
588 {
593 };
595
596 inline bool IsOptionVote() const { return m_VoteType == VOTE_TYPE_OPTION; }
597 inline bool IsKickVote() const { return m_VoteType == VOTE_TYPE_KICK; }
598 inline bool IsSpecVote() const { return m_VoteType == VOTE_TYPE_SPECTATE; }
599
600 void SendRecord(int ClientId);
601 void OnSetAuthed(int ClientId, int Level) override;
602
603 void ResetTuning();
604};
605
606#endif
Definition: character.h:30
int Team()
Definition: character.cpp:631
bool Remove()
Definition: collision.h:34
Definition: config.h:23
Definition: eventhandler.h:11
Definition: gamecontext.h:79
static void ConAntibot(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:928
static void ConUnNinja(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:108
static void ConLaser(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:266
void CreatePlayerSpawn(vec2 Pos, CClientMask Mask=CClientMask().set())
Definition: gamecontext.cpp:358
static void ConTuneZone(IConsole::IResult *pResult, void *pUserData)
Definition: gamecontext.cpp:2995
int m_NumVoteMutes
Definition: gamecontext.h:551
void CreateFinishEffect(vec2 Pos, CClientMask Mask=CClientMask().set())
Definition: gamecontext.cpp:389
static void ConDumpLog(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:934
static void ConGoRight(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:25
static void ConRules(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:265
static void ConMutes(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:763
void OnClientDrop(int ClientId, const char *pReason) override
Definition: gamecontext.cpp:1722
static void ConMap(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:531
void OnStartInfoNetMessage(const CNetMsg_Cl_StartInfo *pMsg, int ClientId)
Definition: gamecontext.cpp:2849
static void ConPracticeGrenade(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:2153
static void ConSetJumps(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:288
CTeeHistorian m_TeeHistorian
Definition: gamecontext.h:96
void OnTick() override
Definition: gamecontext.cpp:1024
void OnCameraInfoNetMessage(const CNetMsg_Cl_CameraInfo *pMsg, int ClientId)
Definition: gamecontext.cpp:2603
bool SnapPickup(const CSnapContext &Context, int SnapId, const vec2 &Pos, int Type, int SubType, int SwitchNumber) const
Definition: gamecontext.cpp:521
CHeap * m_pVoteOptionHeap
Definition: gamecontext.h:237
static void ConTogglePause(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:389
void TeehistorianRecordPlayerJoin(int ClientId, bool Sixup) override
Definition: gamecontext.cpp:1779
void LogEvent(const char *Description, int ClientId)
Definition: ddracecommands.cpp:967
static void ConTimeCP(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:2345
void SendChatTarget(int To, const char *pText, int VersionFlags=FLAG_SIX|FLAG_SIXUP) const
Definition: gamecontext.cpp:591
static void ConTeam(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:1245
static void ConPracticeUnGrenade(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:2202
static void ConEyeEmote(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:1382
IConsole * m_pConsole
Definition: gamecontext.h:83
static void ConForcePause(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:470
void AttemptJoinTeam(int ClientId, int Team)
Definition: ddracechat.cpp:1022
void Teleport(CCharacter *pChr, vec2 Pos)
Definition: ddracecommands.cpp:383
void ForceVote(int EnforcerId, bool Success)
Definition: gamecontext.cpp:4860
static void ConUnmuteId(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:735
static void ConGrenade(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:260
int64_t m_VoteCloseTime
Definition: gamecontext.h:210
static void ConToggleInvincible(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:163
void DeleteTempfile()
Definition: gamecontext.cpp:4169
static void ConMove(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:55
void OnMapChange(char *pNewMapName, int MapNameSize) override
Definition: gamecontext.cpp:4178
static void ConchainSpecialMotdupdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData)
Definition: gamecontext.cpp:3621
static void ConPause(IConsole::IResult *pResult, void *pUserData)
Definition: gamecontext.cpp:3132
@ FLAG_SIXUP
Definition: gamecontext.h:259
@ FLAG_SIX
Definition: gamecontext.h:258
static void ConGoLeft(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:15
static void ConNinjaJetpack(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:1445
static void ConSetEyeEmote(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:1348
int m_NumMutes
Definition: gamecontext.h:549
~CGameContext()
Definition: gamecontext.cpp:172
IAntibot * Antibot()
Definition: gamecontext.h:169
IStorage * m_pStorage
Definition: gamecontext.h:85
void SendMotd(int ClientId) const
Definition: gamecontext.cpp:736
CScore * m_pScore
Definition: gamecontext.h:375
static void ConWhispers(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:517
static void ConUnEndlessJump(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:328
void OnSayNetMessage(const CNetMsg_Cl_Say *pMsg, int ClientId, const CUnpacker *pUnpacker)
Definition: gamecontext.cpp:2124
static void ConPracticeWeapons(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:2188
void OnIsDDNetLegacyNetMessage(const CNetMsg_Cl_IsDDNetLegacy *pMsg, int ClientId, CUnpacker *pUnpacker)
Definition: gamecontext.cpp:2563
void SendTuningParams(int ClientId, int Zone=0)
Definition: gamecontext.cpp:930
static void ConPracticeToTeleporter(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:2009
static void ConDumpAntibot(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:922
bool IsVersionBanned(int Version)
Definition: gamecontext.cpp:4789
CVoteOptionServer * m_pVoteOptionLast
Definition: gamecontext.h:239
bool IsKickVote() const
Definition: gamecontext.h:597
int64_t m_LastMapVote
Definition: gamecontext.h:354
CNetObj_PlayerInput m_aLastPlayerInput[MAX_CLIENTS]
Definition: gamecontext.h:182
static void ConPracticeEndlessJump(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:2174
static void ConPracticeJetpack(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:2167
static void ConPracticeLiveFreeze(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:2136
void ModifyWeapons(IConsole::IResult *pResult, void *pUserData, int Weapon, bool Remove)
Definition: ddracecommands.cpp:354
CLayers m_Layers
Definition: gamecontext.h:87
void CreateDamageInd(vec2 Pos, float AngleMod, int Amount, CClientMask Mask=CClientMask().set())
Definition: gamecontext.cpp:271
CGameWorld m_World
Definition: gamecontext.h:194
static void ConUninvite(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:838
void VoteMute(const NETADDR *pAddr, int Secs, const char *pReason, const char *pDisplayName, int AuthedId)
Definition: ddracecommands.cpp:512
void OnSetTeamNetMessage(const CNetMsg_Cl_SetTeam *pMsg, int ClientId)
Definition: gamecontext.cpp:2516
char m_aVoteCommand[VOTE_CMD_LENGTH]
Definition: gamecontext.h:215
static void ConPracticeUnEndlessHook(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:2258
bool m_aPlayerHasInput[MAX_CLIENTS]
Definition: gamecontext.h:183
CMute m_aVoteMutes[MAX_VOTE_MUTES]
Definition: gamecontext.h:550
static void ConPracticeSetJumps(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:2181
static void ConDrySave(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:888
void RegisterDDRaceCommands()
Definition: gamecontext.cpp:3694
void OnClientPredictedInput(int ClientId, void *pInput) override
Definition: gamecontext.cpp:1353
CTuningParams m_Tuning
Definition: gamecontext.h:91
CCollision * Collision()
Definition: gamecontext.h:166
static void ConToggleSpecVoted(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:384
static void ConMuteId(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:681
static void ConUnWeapons(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:336
void SendWeaponPickup(int ClientId, int Weapon) const
Definition: gamecontext.cpp:729
static void ConUnJetpack(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:320
CEventHandler m_Events
Definition: gamecontext.h:179
void OnInit(const void *pPersistentData) override
Definition: gamecontext.cpp:3863
static void ConDND(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:503
void ResetTuning()
Definition: gamecontext.cpp:4577
void OnPostSnap() override
Definition: gamecontext.cpp:4396
static void ConLoad(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:880
void ReadCensorList()
Definition: gamecontext.cpp:5022
void CensorMessage(char *pCensoredMessage, const char *pMessage, int Size)
Definition: gamecontext.cpp:2034
static void ConVotes(IConsole::IResult *pResult, void *pUserData)
Definition: gamecontext.cpp:3589
bool OnClientDDNetVersionKnown(int ClientId)
Definition: gamecontext.cpp:1827
static void ConGoDown(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:35
void TeehistorianRecordPlayerRejoin(int ClientId) override
Definition: gamecontext.cpp:1795
static void ConJoin(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:1288
static void ConPracticeSolo(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:2077
CClientMask ClientsMaskExcludeClientVersionAndHigher(int Version) const
Definition: gamecontext.cpp:4843
void CreateDeath(vec2 Pos, int ClientId, CClientMask Mask=CClientMask().set())
Definition: gamecontext.cpp:368
void OnKillNetMessage(const CNetMsg_Cl_Kill *pMsg, int ClientId)
Definition: gamecontext.cpp:2816
void OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId) override
Definition: gamecontext.cpp:2056
IServer * m_pServer
Definition: gamecontext.h:80
static void ConPracticeDeep(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:2116
void UpdatePlayerMaps()
Definition: gamecontext.cpp:4402
CLog m_aLogs[MAX_LOGS]
Definition: gamecontext.h:578
static void ConPracticeLaser(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:2160
static void ConPracticeToCheckTeleporter(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:2029
CUuid GameUuid() const override
Definition: gamecontext.cpp:4473
static void ConConverse(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:1338
static void ConMapInfo(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:560
static void ConToTeleporter(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:391
static void ConWeapons(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:296
CSaveTee * m_apSavedTees[MAX_CLIENTS]
Definition: gamecontext.h:185
bool EmulateBug(int Bug)
Definition: gamecontext.cpp:224
static void ConHotReload(IConsole::IResult *pResult, void *pUserData)
Definition: gamecontext.cpp:3237
static void ConClearVotes(IConsole::IResult *pResult, void *pUserData)
Definition: gamecontext.cpp:3473
void SendRecord(int ClientId)
Definition: gamecontext.cpp:4507
static void ConUnGrenade(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:308
static void ConPracticeUnSolo(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:2049
static void ConUnLaser(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:314
void OnPreTickTeehistorian() override
Definition: gamecontext.cpp:1006
void OnClientPredictedEarlyInput(int ClientId, void *pInput) override
Definition: gamecontext.cpp:1370
static void ConTeam0Mode(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:1165
static void ConPracticeRemoveWeapon(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:2279
void MoveCharacter(int ClientId, int X, int Y, bool Raw=false)
Definition: ddracecommands.cpp:73
bool IsSpecVote() const
Definition: gamecontext.h:598
static void ConTunes(IConsole::IResult *pResult, void *pUserData)
Definition: gamecontext.cpp:2982
static void ConWhisper(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:1343
CMute m_aMutes[MAX_MUTES]
Definition: gamecontext.h:548
bool m_Resetting
Definition: gamecontext.h:102
void SendChat(int ClientId, int Team, const char *pText, int SpamProtectionClientId=-1, int VersionFlags=FLAG_SIX|FLAG_SIXUP)
Definition: gamecontext.cpp:629
bool VoteUnmute(const NETADDR *pAddr, const char *pDisplayName, int AuthedId)
Definition: ddracecommands.cpp:529
static void ConUnDeep(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:221
static void ConPracticeUnNinja(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:2244
static void ConSetTimerType(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:1622
void OnSnap(int ClientId) override
Definition: gamecontext.cpp:4368
void OnConsoleInit() override
Definition: gamecontext.cpp:3641
void OnClientPrepareInput(int ClientId, void *pInput) override
Definition: gamecontext.cpp:1334
static void ConReloadCensorlist(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:916
void * PreProcessMsg(int *pMsgId, CUnpacker *pUnpacker, int ClientId)
Definition: gamecontext.cpp:1882
void Destruct(int Resetting)
Definition: gamecontext.cpp:136
static void ConRank(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:919
void ProgressVoteOptions(int ClientId)
Definition: gamecontext.cpp:1414
static void ConRemoveWeapon(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:348
static void ConBroadcast(IConsole::IResult *pResult, void *pUserData)
Definition: gamecontext.cpp:3172
static void ConPracticeNinja(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:2237
int GetDDRaceTeam(int ClientId) const
Definition: gamecontext.cpp:4572
void OnCallVoteNetMessage(const CNetMsg_Cl_CallVote *pMsg, int ClientId)
Definition: gamecontext.cpp:2236
void TeehistorianRecordPlayerDrop(int ClientId, const char *pReason) override
Definition: gamecontext.cpp:1787
static void ConRandomUnfinishedMap(IConsole::IResult *pResult, void *pUserData)
Definition: gamecontext.cpp:3154
void AddVote(const char *pDescription, const char *pCommand)
Definition: gamecontext.cpp:3277
CUuid m_GameUuid
Definition: gamecontext.h:98
static void ConAddVote(IConsole::IResult *pResult, void *pUserData)
Definition: gamecontext.cpp:3268
static void ConTuneSetZoneMsgLeave(IConsole::IResult *pResult, void *pUserData)
Definition: gamecontext.cpp:3075
static void ConPracticeEndlessHook(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:2251
void OnShowOthersLegacyNetMessage(const CNetMsg_Cl_ShowOthersLegacy *pMsg, int ClientId)
Definition: gamecontext.cpp:2579
void TeehistorianRecordTeamFinish(int TeamId, int TimeTicks) override
Definition: gamecontext.cpp:1819
static void ConPracticeShotgun(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:2146
static void ConVoteMute(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:602
static void ConTimes(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:464
bool TryMute(const NETADDR *pAddr, int Secs, const char *pReason, bool InitialChatDelay)
Definition: ddracecommands.cpp:550
void SnapSwitchers(int SnappingClient)
Definition: gamecontext.cpp:432
static void ConPracticeUnDeep(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:2105
static void ConSetTeam(IConsole::IResult *pResult, void *pUserData)
Definition: gamecontext.cpp:3203
bool RateLimitPlayerVote(int ClientId)
Definition: gamecontext.cpp:4876
void CreateExplosion(vec2 Pos, int Owner, int Weapon, bool NoDamage, int ActivatedTeam, CClientMask Mask=CClientMask().set())
Definition: gamecontext.cpp:300
void SendStartWarning(int ClientId, const char *pMessage)
Definition: gamecontext.cpp:711
CNetObj_PlayerInput GetLastPlayerInput(int ClientId) const
Definition: gamecontext.cpp:211
IEngine * Engine()
Definition: gamecontext.h:164
static void ConUnFreeze(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:201
static void ConFreezeHammer(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:846
ASYNCIO * m_pTeeHistorianFile
Definition: gamecontext.h:97
CPlayer * m_apPlayers[MAX_CLIENTS]
Definition: gamecontext.h:180
static void ConSpecTeam(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:1511
static void ConLock(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:940
static void ConSwap(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:737
static void ConTuneParam(IConsole::IResult *pResult, void *pUserData)
Definition: gamecontext.cpp:2897
int PersistentDataSize() const override
Definition: gamecontext.h:338
void CreateSoundGlobal(int Sound, int Target=-1) const
Definition: gamecontext.cpp:414
const char * Version() const override
Definition: gamecontext.cpp:4475
CSaveTee * m_apSavedTeleTees[MAX_CLIENTS]
Definition: gamecontext.h:186
static void ConInfo(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:68
static void ConSetTeamAll(IConsole::IResult *pResult, void *pUserData)
Definition: gamecontext.cpp:3223
static void ConchainSettingUpdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData)
Definition: gamecontext.cpp:3631
static void ConUnlock(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:989
IConfigManager * m_pConfigManager
Definition: gamecontext.h:81
static void ConPracticeCmdList(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:713
int m_VoteEnforce
Definition: gamecontext.h:218
static void ConVote(IConsole::IResult *pResult, void *pUserData)
Definition: gamecontext.cpp:3579
CScore * Score()
Definition: gamecontext.h:585
IServer * Server() const
Definition: gamecontext.h:160
void TeehistorianRecordPlayerFinish(int ClientId, int TimeTicks) override
Definition: gamecontext.cpp:1811
static void ConGoUp(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:45
void StartVote(const char *pDesc, const char *pCommand, const char *pReason, const char *pSixupDesc)
Definition: gamecontext.cpp:787
void CreateAllEntities(bool Initial)
Definition: gamecontext.cpp:4068
void LoadMapSettings()
Definition: gamecontext.cpp:4332
static void ConSetDDRTeam(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:812
CTuningParams m_aTuningList[NUM_TUNEZONES]
Definition: gamecontext.h:92
void SendVoteSet(int ClientId)
Definition: gamecontext.cpp:816
static void ConTuneResetZone(IConsole::IResult *pResult, void *pUserData)
Definition: gamecontext.cpp:3035
void RegisterChatCommands()
Definition: gamecontext.cpp:3763
void Clear()
Definition: gamecontext.cpp:177
const char * GameType() const override
Definition: gamecontext.cpp:4474
static void ConVoteMutes(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:645
int m_aTeamMapping[MAX_CLIENTS]
Definition: gamecontext.h:187
bool ProcessSpamProtection(int ClientId, bool RespectChatInitialDelay=true)
Definition: gamecontext.cpp:4520
CConfig * Config()
Definition: gamecontext.h:162
CTuningParams * TuningList()
Definition: gamecontext.h:168
static void ConPoints(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:2305
CConfig * m_pConfig
Definition: gamecontext.h:82
static void ConPracticeToggleInvincible(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:2265
static void ConTeamTop5(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:399
static void ConNinja(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:102
CCollision m_Collision
Definition: gamecontext.h:88
static void ConUnFreezeHammer(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:864
CMapBugs m_MapBugs
Definition: gamecontext.h:99
static void ConJetpack(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:272
void OnClientDirectInput(int ClientId, void *pInput) override
Definition: gamecontext.cpp:1341
CCharacter * GetPracticeCharacter(IConsole::IResult *pResult)
Definition: ddracechat.cpp:1988
bool IsOptionVote() const
Definition: gamecontext.h:596
void CallVote(int ClientId, const char *pDesc, const char *pCmd, const char *pReason, const char *pChatmsg, const char *pSixupDesc=0)
Definition: gamecontext.cpp:568
bool m_VoteUpdate
Definition: gamecontext.h:211
static void ConTogglePauseVoted(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:394
CGameContext()
Definition: gamecontext.cpp:162
void WhisperId(int ClientId, int VictimId, const char *pMessage)
Definition: gamecontext.cpp:4699
void OnShowDistanceNetMessage(const CNetMsg_Cl_ShowDistance *pMsg, int ClientId)
Definition: gamecontext.cpp:2597
int PersistentClientDataSize() const override
Definition: gamecontext.h:339
static void ConMuteIp(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:702
static void ConPracticeUnLaser(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:2209
IConfigManager * ConfigManager() const
Definition: gamecontext.h:161
char m_aSixupVoteDescription[VOTE_DESC_LENGTH]
Definition: gamecontext.h:214
IAntibot * m_pAntibot
Definition: gamecontext.h:86
static void ConAddWeapon(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:342
static void ConRestart(IConsole::IResult *pResult, void *pUserData)
Definition: gamecontext.cpp:3163
static void ConTuneSetZoneMsgEnter(IConsole::IResult *pResult, void *pUserData)
Definition: gamecontext.cpp:3062
void CreateSound(vec2 Pos, int Sound, CClientMask Mask=CClientMask().set())
Definition: gamecontext.cpp:399
void Converse(int ClientId, char *pStr)
Definition: gamecontext.cpp:4772
static void ConSayTimeAll(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:1575
char m_aVoteDescription[VOTE_DESC_LENGTH]
Definition: gamecontext.h:213
const char * NetVersion() const override
Definition: gamecontext.cpp:4476
static void ConToCheckTeleporter(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:407
std::vector< std::string > m_vCensorlist
Definition: gamecontext.h:93
void SendVoteStatus(int ClientId, int Total, int Yes, int No)
Definition: gamecontext.cpp:878
static void ConMute(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:671
static void ConShowOthers(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:1460
uint32_t NextUniqueClientId
Definition: gamecontext.h:373
bool PlayerExists(int ClientId) const override
Definition: gamecontext.h:357
void OnShowOthersNetMessage(const CNetMsg_Cl_ShowOthers *pMsg, int ClientId)
Definition: gamecontext.cpp:2588
static void ConModerate(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:789
static void ConShowAll(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:1483
void AbortVoteKickOnDisconnect(int ClientId)
Definition: gamecontext.cpp:904
@ MAX_VOTE_MUTES
Definition: gamecontext.h:538
@ MAX_MUTES
Definition: gamecontext.h:537
static void ConTeleXY(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:1827
int64_t m_NonEmptySince
Definition: gamecontext.h:353
static void ConSayTime(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:1532
void OnClientConnected(int ClientId, void *pData) override
Definition: gamecontext.cpp:1679
static void ConForceVote(IConsole::IResult *pResult, void *pUserData)
Definition: gamecontext.cpp:3403
static void ConEndlessHook(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:114
static void ConVoteNo(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:881
void OnPreSnap() override
Definition: gamecontext.cpp:4395
void OnUpdatePlayerServerInfo(CJsonStringWriter *pJSonWriter, int Id) override
Definition: gamecontext.cpp:4963
static void ConRescueMode(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:1709
protocol7::CNetObjHandler m_NetObjHandler7
Definition: gamecontext.h:89
static void ConLastTele(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:1960
static void ConKill(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:456
static void CommandCallback(int ClientId, int FlagMask, const char *pCmd, IConsole::IResult *pResult, void *pUser)
Definition: gamecontext.cpp:202
IGameController * m_pController
Definition: gamecontext.h:193
IConsole * Console()
Definition: gamecontext.h:163
static void ConPracticeUnWeapons(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:2230
std::shared_ptr< CScoreRandomMapResult > m_SqlRandomMapResult
Definition: gamecontext.h:369
bool RateLimitPlayerMapVote(int ClientId) const
Definition: gamecontext.cpp:4950
void OnClientEnter(int ClientId) override
Definition: gamecontext.cpp:1500
static void ConInvite(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:1101
static void ConUnSuper(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:151
CLayers * Layers()
Definition: gamecontext.h:584
static int MapScan(const char *pName, int IsDir, int DirType, void *pUserData)
Definition: gamecontext.cpp:3563
static void ConPracticeUnJetpack(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:2216
static void ConLiveFreeze(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:234
void OnChangeInfoNetMessage(const CNetMsg_Cl_ChangeInfo *pMsg, int ClientId)
Definition: gamecontext.cpp:2631
void CreateBirthdayEffect(vec2 Pos, CClientMask Mask=CClientMask().set())
Definition: gamecontext.cpp:379
void EndVote()
Definition: gamecontext.cpp:810
void TeehistorianRecordPlayerName(int ClientId, const char *pName) override
Definition: gamecontext.cpp:1803
int m_VotePos
Definition: gamecontext.h:212
bool m_TeeHistorianActive
Definition: gamecontext.h:95
static void ConToggleTuneParam(IConsole::IResult *pResult, void *pUserData)
Definition: gamecontext.cpp:2931
char m_aDeleteTempfile[128]
Definition: gamecontext.h:224
void Whisper(int ClientId, char *pStr)
Definition: gamecontext.cpp:4589
static void ConPracticeUnLiveFreeze(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:2126
static void ConTopPoints(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:2326
char m_aaZoneLeaveMsg[NUM_TUNEZONES][256]
Definition: gamecontext.h:220
static void ConTeleTo(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:1766
void Construct(int Resetting)
Definition: gamecontext.cpp:77
static void ConPractice(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:616
static void ConSuper(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:138
static void ConUnmute(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:716
static void ConTeamRank(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:898
int m_VoteType
Definition: gamecontext.h:209
static void ConRandomMap(IConsole::IResult *pResult, void *pUserData)
Definition: gamecontext.cpp:3145
static void ConUnEndlessHook(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:126
IStorage * Storage()
Definition: gamecontext.h:165
static void ConMapbug(IConsole::IResult *pResult, void *pUserData)
Definition: gamecontext.cpp:3088
static void ConShotgun(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:254
static void ConToggleSpec(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:379
static void ConSwitchOpen(IConsole::IResult *pResult, void *pUserData)
Definition: gamecontext.cpp:3118
static void ConDeep(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:211
int m_VoteVictim
Definition: gamecontext.h:594
CPrng m_Prng
Definition: gamecontext.h:100
CSaveTeam * m_apSavedTeams[MAX_CLIENTS]
Definition: gamecontext.h:184
void OnVoteNetMessage(const CNetMsg_Cl_Vote *pMsg, int ClientId)
Definition: gamecontext.cpp:2485
static void ConSay(IConsole::IResult *pResult, void *pUserData)
Definition: gamecontext.cpp:3197
IEngine * m_pEngine
Definition: gamecontext.h:84
void CreateHammerHit(vec2 Pos, CClientMask Mask=CClientMask().set())
Definition: gamecontext.cpp:290
void SendBroadcast(const char *pText, int ClientId, bool IsImportant=true)
Definition: gamecontext.cpp:755
void List(int ClientId, const char *pFilter)
Definition: gamecontext.cpp:4797
bool m_VoteWillPass
Definition: gamecontext.h:374
bool TryVoteMute(const NETADDR *pAddr, int Secs, const char *pReason)
Definition: ddracecommands.cpp:485
int m_VoteCreator
Definition: gamecontext.h:208
int m_NumVoteOptions
Definition: gamecontext.h:217
CTuningParams * Tuning()
Definition: gamecontext.h:167
void CheckPureTuning()
Definition: gamecontext.cpp:911
void OnSetAuthed(int ClientId, int Level) override
Definition: gamecontext.cpp:4480
static void ConTimeout(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:576
void TeehistorianRecordAntibot(const void *pData, int DataSize) override
Definition: gamecontext.cpp:1771
static void ConPracticeUnShotgun(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:2195
void SendChatTeam(int Team, const char *pText) const
Definition: gamecontext.cpp:622
static void ConTeleCursor(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:1905
bool SnapLaserObject(const CSnapContext &Context, int SnapId, const vec2 &To, const vec2 &From, int StartTick, int Owner=-1, int LaserType=-1, int Subtype=-1, int SwitchNumber=-1) const
Definition: gamecontext.cpp:486
@ MAX_LOG_SECONDS
Definition: gamecontext.h:566
@ MAX_LOGS
Definition: gamecontext.h:567
static void ConSave(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:861
void SendSettings(int ClientId) const
Definition: gamecontext.cpp:743
const CVoteOptionServer * GetVoteOption(int Index) const
Definition: gamecontext.cpp:1401
static void ConTeleport(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:424
static void ConPracticeUnEndlessJump(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:2223
void SendEmoticon(int ClientId, int Emoticon, int TargetClientId) const
Definition: gamecontext.cpp:721
static void ConTuneDumpZone(IConsole::IResult *pResult, void *pUserData)
Definition: gamecontext.cpp:3018
int GetClientVersion(int ClientId) const
Definition: gamecontext.cpp:4838
static void ConProtectedKill(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:2286
@ VOTE_TYPE_SPECTATE
Definition: gamecontext.h:592
@ VOTE_TYPE_KICK
Definition: gamecontext.h:591
@ VOTE_TYPE_UNKNOWN
Definition: gamecontext.h:589
@ VOTE_TYPE_OPTION
Definition: gamecontext.h:590
static void ConKillPlayer(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:84
static void ConUnSolo(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:181
bool TeeHistorianActive() const
Definition: gamecontext.h:171
void UnlockTeam(int ClientId, int Team) const
Definition: ddracechat.cpp:1013
static void ConTop(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:445
static void ConMe(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:1318
static void ConTime(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:1599
static void ConFreeze(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:191
static void ConEndlessJump(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:280
void Mute(const NETADDR *pAddr, int Secs, const char *pDisplayName, const char *pReason="", bool InitialChatDelay=false)
Definition: ddracecommands.cpp:583
void OnShutdown(void *pPersistentData) override
Definition: gamecontext.cpp:4295
CNetObjHandler m_NetObjHandler
Definition: gamecontext.h:90
static void ConVoteUnmute(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:621
static void ConTuneReset(IConsole::IResult *pResult, void *pUserData)
Definition: gamecontext.cpp:2955
static void ConMoveRaw(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:64
CTeeHistorian * TeeHistorian()
Definition: gamecontext.h:170
static void ConChangeMap(IConsole::IResult *pResult, void *pUserData)
Definition: gamecontext.cpp:3139
bool OnClientDataPersist(int ClientId, void *pData) override
Definition: gamecontext.cpp:1667
static void ConRemoveVote(IConsole::IResult *pResult, void *pUserData)
Definition: gamecontext.cpp:3334
static void ConCredits(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:18
static void ConList(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:87
char m_aVoteReason[VOTE_REASON_LENGTH]
Definition: gamecontext.h:216
int m_LatestLog
Definition: gamecontext.h:579
static void ConSolo(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:171
char m_aaZoneEnterMsg[NUM_TUNEZONES][256]
Definition: gamecontext.h:219
static void ConAddMapVotes(IConsole::IResult *pResult, void *pUserData)
Definition: gamecontext.cpp:3509
static void ConRescue(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:1674
bool IsClientReady(int ClientId) const override
Definition: gamecontext.cpp:4463
std::vector< SSwitchers > & Switchers()
Definition: gamecontext.h:199
@ VOTE_ENFORCE_NO
Definition: gamecontext.h:230
@ VOTE_ENFORCE_NO_ADMIN
Definition: gamecontext.h:232
@ VOTE_ENFORCE_YES_ADMIN
Definition: gamecontext.h:233
@ VOTE_ENFORCE_UNKNOWN
Definition: gamecontext.h:229
@ VOTE_ENFORCE_CANCEL
Definition: gamecontext.h:235
@ VOTE_ENFORCE_ABORT
Definition: gamecontext.h:234
@ VOTE_ENFORCE_YES
Definition: gamecontext.h:231
static void ConUnShotgun(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:302
static void ConHelp(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:101
CVoteOptionServer * m_pVoteOptionFirst
Definition: gamecontext.h:238
static void ConUnLiveFreeze(IConsole::IResult *pResult, void *pUserData)
Definition: ddracecommands.cpp:244
static void ConPracticeAddWeapon(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:2272
bool IsClientPlayer(int ClientId) const override
Definition: gamecontext.cpp:4468
static void TeeHistorianWrite(const void *pData, int DataSize, void *pUser)
Definition: gamecontext.cpp:196
bool PlayerModerating() const
Definition: gamecontext.cpp:4855
void OnEmoticonNetMessage(const CNetMsg_Cl_Emoticon *pMsg, int ClientId)
Definition: gamecontext.cpp:2737
void FillAntibot(CAntibotRoundData *pData) override
Definition: gamecontext.cpp:229
class CCharacter * GetPlayerChar(int ClientId)
Definition: gamecontext.cpp:217
static void ConSettings(IConsole::IResult *pResult, void *pUserData)
Definition: ddracechat.cpp:140
void OnSetSpectatorModeNetMessage(const CNetMsg_Cl_SetSpectatorMode *pMsg, int ClientId)
Definition: gamecontext.cpp:2609
Definition: gameworld.h:17
CWorldCore m_Core
Definition: gameworld.h:34
Definition: memheap.h:11
Definition: jsonwriter.h:105
Definition: layers.h:13
Definition: mapbugs.h:22
Definition: protocol.h:1261
Definition: player.h:33
Definition: prng.h:7
Definition: save.h:152
Definition: save.h:34
Definition: score.h:15
Definition: teehistorian.h:16
Definition: gamecore.h:41
Definition: packer.h:54
std::vector< SSwitchers > m_vSwitchers
Definition: gamecore.h:172
Definition: antibot.h:7
Definition: config.h:9
Definition: console.h:47
Definition: console.h:18
void(* FCommandCallback)(IResult *pResult, void *pUserData)
Definition: console.h:94
Definition: engine.h:15
Definition: gamecontroller.h:19
Definition: server.h:295
Definition: server.h:30
Definition: storage.h:20
Definition: protocol7.h:1229
std::bitset< MAX_CLIENTS > CClientMask
Definition: protocol.h:133
@ MAX_CLIENTS
Definition: protocol.h:88
@ MAX_NAME_LENGTH
Definition: protocol.h:97
@ NUM_TUNEZONES
Definition: gamecontext.h:46
Definition: system.cpp:493
Definition: antibot_data.h:98
Definition: gamecontext.h:570
char m_aClientName[MAX_NAME_LENGTH]
Definition: gamecontext.h:575
char m_aDescription[128]
Definition: gamecontext.h:573
bool m_FromServer
Definition: gamecontext.h:572
int64_t m_Timestamp
Definition: gamecontext.h:571
int m_ClientVersion
Definition: gamecontext.h:574
char m_aClientAddrStr[NETADDR_MAXSTRSIZE]
Definition: gamecontext.h:576
Definition: gamecontext.h:541
int m_Expire
Definition: gamecontext.h:543
char m_aReason[128]
Definition: gamecontext.h:544
NETADDR m_Addr
Definition: gamecontext.h:542
bool m_InitialChatDelay
Definition: gamecontext.h:545
Definition: gamecontext.h:154
bool m_IsSpectator
Definition: gamecontext.h:155
bool m_IsAfk
Definition: gamecontext.h:156
Definition: gamecontext.h:149
CUuid m_PrevGameUuid
Definition: gamecontext.h:150
Definition: protocol.h:1025
Definition: protocol.h:967
Definition: protocol.h:1001
Definition: protocol.h:1041
Definition: protocol.h:991
Definition: protocol.h:905
Definition: protocol.h:931
Definition: protocol.h:919
Definition: protocol.h:1125
Definition: protocol.h:1101
Definition: protocol.h:1139
Definition: protocol.h:943
Definition: protocol.h:1013
Definition: protocol.h:360
Definition: scoreworker.h:104
Definition: gamecontext.h:64
bool m_Sixup
Definition: gamecontext.h:75
int GetClientVersion() const
Definition: gamecontext.h:70
bool IsSixup() const
Definition: gamecontext.h:71
CSnapContext(int Version, bool Sixup=false)
Definition: gamecontext.h:65
int m_ClientVersion
Definition: gamecontext.h:74
Definition: uuid_manager.h:17
Definition: voting.h:23
Definition: types.h:67
@ NETADDR_MAXSTRSIZE
Definition: types.h:45
@ VOTE_DESC_LENGTH
Definition: voting.h:8
@ VOTE_CMD_LENGTH
Definition: voting.h:9
@ VOTE_REASON_LENGTH
Definition: voting.h:10