MCPcopy Create free account
hub / github.com/JACoders/OpenJK / SV_ConnectionlessPacket

Function SV_ConnectionlessPacket

code/server/sv_main.cpp:261–289  ·  view source on GitHub ↗

================= SV_ConnectionlessPacket A connectionless packet has four leading 0xff characters to distinguish it from a game channel. Clients that are in the game can still send connectionless packets. ================= */

Source from the content-addressed store, hash-verified

259=================
260*/
261static void SV_ConnectionlessPacket( netadr_t from, msg_t *msg ) {
262 char *s;
263 const char *c;
264
265 MSG_BeginReading( msg );
266 MSG_ReadLong( msg ); // skip the -1 marker
267
268 s = MSG_ReadStringLine( msg );
269
270 Cmd_TokenizeString( s );
271
272 c = Cmd_Argv(0);
273 Com_DPrintf ("SV packet %s : %s\n", NET_AdrToString(from), c);
274
275 if (!strcmp(c,"getstatus")) {
276 SVC_Status( from );
277 } else if (!strcmp(c,"getinfo")) {
278 SVC_Info( from );
279 } else if (!strcmp(c,"connect")) {
280 SV_DirectConnect( from );
281 } else if (!strcmp(c,"disconnect")) {
282 // if a client starts up a local server, we may see some spurious
283 // server disconnect messages when their new server sees our final
284 // sequenced messages to the old client
285 } else {
286 Com_DPrintf ("bad connectionless packet from %s:\n%s\n"
287 , NET_AdrToString (from), s);
288 }
289}
290
291
292//============================================================================

Callers 1

SV_PacketEventFunction · 0.70

Calls 10

SVC_StatusFunction · 0.70
SVC_InfoFunction · 0.70
SV_DirectConnectFunction · 0.70
MSG_BeginReadingFunction · 0.50
MSG_ReadLongFunction · 0.50
MSG_ReadStringLineFunction · 0.50
Cmd_TokenizeStringFunction · 0.50
Cmd_ArgvFunction · 0.50
Com_DPrintfFunction · 0.50
NET_AdrToStringFunction · 0.50

Tested by

no test coverage detected