MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / init

Method init

plugins/webstats/webstats.cpp:169–308  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167}
168
169void WebStats::init(const char* commandLine) {
170 serverStartTime = bz_getCurrentTime();
171
172 joins = spawns = deaths = 0;
173 dataIn = dataOut = 0;
174
175 templateSystem.addSearchPath("./");
176 templateSystem.addSearchPath(commandLine);
177
178 templateSystem.setPluginName("WebStats", getBaseURL().c_str());
179
180 templateSystem.addKey("PlayerCount", this);
181 templateSystem.addLoop("Players", this);
182 templateSystem.addIF("NewTeam", this);
183 templateSystem.addIF("Players", this);
184 templateSystem.addKey("TeamName", this);
185 templateSystem.addKey("Callsign", this);
186 templateSystem.addKey("Wins", this);
187 templateSystem.addKey("Losses", this);
188 templateSystem.addKey("TeamKills", this);
189 templateSystem.addKey("Status", this);
190 templateSystem.addKey("PlayerID", this);
191 templateSystem.addKey("PlayerFlag", this);
192
193 templateSystem.addIF("Spawned", this);
194 templateSystem.addIF("Verified", this);
195 templateSystem.addIF("Global", this);
196 templateSystem.addIF("Admin", this);
197 templateSystem.addIF("Op", this);
198 templateSystem.addIF("CanSpawn", this);
199
200 templateSystem.addKey("BZID", this);
201
202 // groups
203 templateSystem.addKey("GroupCount", this);
204 templateSystem.addIF("Groups", this);
205 templateSystem.addLoop("Groups", this);
206 templateSystem.addKey("GroupName", this);
207
208 // flagHistory
209 templateSystem.addKey("FlagHistoryCount", this);
210 templateSystem.addIF("FlagHistory", this);
211 templateSystem.addLoop("FlagHistory", this);
212 templateSystem.addKey("FlagHistoryFlag", this);
213
214 // lag info
215 templateSystem.addKey("Lag", this);
216 templateSystem.addKey("Jitter", this);
217 templateSystem.addKey("PacketLoss", this);
218
219 templateSystem.addKey("IPAddress", this);
220
221 // player team info
222 templateSystem.addKey("TeamCount", this);
223 templateSystem.addKey("TeamScore", this);
224 templateSystem.addKey("TeamWins", this);
225 templateSystem.addKey("TeamLosses", this);
226

Callers 1

bz_LoadFunction · 0.45

Calls 7

bz_getCurrentTimeFunction · 0.85
addSearchPathMethod · 0.80
setPluginNameMethod · 0.80
c_strMethod · 0.80
addKeyMethod · 0.80
addLoopMethod · 0.80
addIFMethod · 0.80

Tested by

no test coverage detected