Builds the string that is sent as heartbeats and status replies.
()
| 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 |
no test coverage detected