MCPcopy Create free account
hub / github.com/demoth/jake2 / SV_StatusString

Method SV_StatusString

server/src/main/java/jake2/server/SV_MAIN.java:139–158  ·  view source on GitHub ↗

Builds the string that is sent as heartbeats and status replies.

()

Source from the content-addressed store, hash-verified

137 * Builds the string that is sent as heartbeats and status replies.
138 */
139 private String SV_StatusString() {
140
141 String status = Cvar.getInstance().Serverinfo() + "\n";
142
143 for (client_t cl: clients) {
144 if (cl.state == ClientStates.CS_CONNECTED || cl.state == ClientStates.CS_SPAWNED) {
145 String player = "" + cl.edict.getClient().getPlayerState().stats[Defines.STAT_FRAGS] + " " + cl.ping + "\"" + cl.name + "\"\n";
146
147 int playerLength = player.length();
148 int statusLength = status.length();
149
150 if (statusLength + playerLength >= 1024)
151 break; // can't hold any more
152
153 status += player;
154 }
155 }
156
157 return status;
158 }
159
160 /**
161 * SVC_Info, responds with short info for broadcast scans The second parameter should

Callers 1

Calls 4

getInstanceMethod · 0.95
ServerinfoMethod · 0.80
getPlayerStateMethod · 0.65
getClientMethod · 0.45

Tested by

no test coverage detected