1#ifndef ENGINE_SHARED_TRANSLATION_CONTEXT_H
2#define ENGINE_SHARED_TRANSLATION_CONTEXT_H
3
4#include <engine/client/enums.h>
5#include <engine/shared/protocol.h>
6
7#include <generated/protocol7.h>
8
9class CTranslationContext
10{
11public:
12 CTranslationContext()
13 {
14 Reset();
15 }
16
17 void Reset();
18
19 // this class is not used
20 // it could be used in the in game menu
21 // to grey out buttons and similar
22 //
23 // but that can not be done without mixing it
24 // into the 0.6 code so it is out of scope for ddnet
25 class CServerSettings
26 {
27 public:
28 bool m_KickVote;
29 int m_KickMin;
30 bool m_SpecVote;
31 bool m_TeamLock;
32 bool m_TeamBalance;
33 int m_PlayerSlots;
34
35 CServerSettings()
36 {
37 Reset();
38 }
39
40 void Reset()
41 {
42 m_KickVote = false;
43 m_KickMin = 0;
44 m_SpecVote = false;
45 m_TeamLock = false;
46 m_TeamBalance = false;
47 m_PlayerSlots = 0;
48 }
49
50 } m_ServerSettings;
51
52 class CClientData
53 {
54 public:
55 CClientData()
56 {
57 Reset();
58 }
59
60 void Reset()
61 {
62 m_Active = false;
63
64 m_aName[0] = '\0';
65 m_aClan[0] = '\0';
66 m_Country = CountryCode::DEFAULT;
67 m_Team = 0;
68 m_PlayerFlags7 = 0;
69 }
70
71 bool m_Active;
72
73 char m_aName[MAX_NAME_LENGTH];
74 char m_aClan[MAX_CLAN_LENGTH];
75 /**
76 * Country code in ISO 3166-1 numeric.
77 */
78 int m_Country;
79 int m_Team;
80 int m_PlayerFlags7;
81 };
82
83 const protocol7::CNetObj_PlayerInfoRace *m_apPlayerInfosRace[MAX_CLIENTS];
84 CClientData m_aClients[MAX_CLIENTS];
85 int m_aDamageTaken[MAX_CLIENTS];
86 float m_aDamageTakenTick[MAX_CLIENTS];
87
88 int m_aLocalClientId[NUM_DUMMIES];
89
90 bool m_ShouldSendGameInfo;
91 int m_GameStateFlags7;
92 // 0.7 game flags
93 // use in combination with protocol7::GAMEFLAG_*
94 // for example protocol7::GAMEFLAG_TEAMS
95 int m_GameFlags;
96 int m_ScoreLimit;
97 int m_TimeLimit;
98 int m_MatchNum;
99 int m_MatchCurrent;
100
101 int m_MapdownloadTotalsize;
102 int m_MapDownloadChunkSize;
103 int m_MapDownloadChunksPerRequest;
104
105 int m_FlagCarrierBlue;
106 int m_FlagCarrierRed;
107 int m_TeamscoreRed;
108 int m_TeamscoreBlue;
109
110 int m_GameStartTick7;
111 int m_GameStateEndTick7;
112};
113
114#endif
115