MCPcopy Create free account
hub / github.com/ddnet/ddnet / CGameContext

Method CGameContext

src/game/server/gamecontext.cpp:76–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76CGameContext::CGameContext(bool Resetting) :
77 m_Mutes("mutes"),
78 m_VoteMutes("votemutes")
79{
80 m_Resetting = false;
81 m_pServer = nullptr;
82
83 for(auto &pPlayer : m_apPlayers)
84 pPlayer = nullptr;
85
86 mem_zero(&m_aLastPlayerInput, sizeof(m_aLastPlayerInput));
87 std::fill(std::begin(m_aPlayerHasInput), std::end(m_aPlayerHasInput), false);
88
89 m_pController = nullptr;
90
91 m_pVoteOptionFirst = nullptr;
92 m_pVoteOptionLast = nullptr;
93 m_LastMapVote = 0;
94
95 m_SqlRandomMapResult = nullptr;
96
97 m_pLoadMapInfoResult = nullptr;
98 m_aMapInfoMessage[0] = '\0';
99
100 m_pScore = nullptr;
101
102 m_VoteCreator = -1;
103 m_VoteType = VOTE_TYPE_UNKNOWN;
104 m_VoteCloseTime = 0;
105 m_VoteUpdate = false;
106 m_VotePos = 0;
107 m_aVoteDescription[0] = '\0';
108 m_aSixupVoteDescription[0] = '\0';
109 m_aVoteCommand[0] = '\0';
110 m_aVoteReason[0] = '\0';
111 m_NumVoteOptions = 0;
112 m_VoteEnforce = VOTE_ENFORCE_UNKNOWN;
113
114 m_LatestLog = 0;
115 mem_zero(&m_aLogs, sizeof(m_aLogs));
116
117 if(!Resetting)
118 {
119 m_pMap = CreateMap();
120
121 for(auto &pSavedTee : m_apSavedTees)
122 pSavedTee = nullptr;
123
124 for(auto &pSavedTeam : m_apSavedTeams)
125 pSavedTeam = nullptr;
126
127 std::fill(std::begin(m_aTeamMapping), std::end(m_aTeamMapping), -1);
128
129 m_NonEmptySince = 0;
130 m_pVoteOptionHeap = new CHeap();
131 }
132
133 m_aDeleteTempfile[0] = 0;

Callers

nothing calls this directly

Calls 2

mem_zeroFunction · 0.85
CreateMapFunction · 0.85

Tested by

no test coverage detected