MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / ClientReceive

Method ClientReceive

ogsr_engine/xrGame/Level_network_messages.cpp:19–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17#include "UIGameSP.h"
18
19void CLevel::ClientReceive()
20{
21
22 m_dwRPC = 0;
23 m_dwRPS = 0;
24
25 for (NET_Packet* P = net_msg_Retreive(); P; P = net_msg_Retreive())
26 {
27 //-----------------------------------------------------
28 m_dwRPC++;
29 m_dwRPS += P->B.count;
30 //-----------------------------------------------------
31 u16 m_type;
32 P->r_begin(m_type);
33 switch (m_type)
34 {
35 case M_SPAWN: {
36 if (!m_bGameConfigStarted || !bReady)
37 {
38 Msg("Unconventional M_SPAWN received : cgf[%s] | bReady[%s]", (m_bGameConfigStarted) ? "true" : "false", (bReady) ? "true" : "false");
39 break;
40 }
41 /*/
42 cl_Process_Spawn(*P);
43 /*/
44 game_events->insert(*P);
45 if (g_bDebugEvents)
46 ProcessGameEvents();
47 //*/
48 }
49 break;
50 case M_EVENT:
51 game_events->insert(*P);
52 if (g_bDebugEvents)
53 ProcessGameEvents();
54 break;
55 case M_EVENT_PACK: {
56 NET_Packet tmpP;
57 while (!P->r_eof())
58 {
59 tmpP.B.count = P->r_u8();
60 P->r(&tmpP.B.data, tmpP.B.count);
61 tmpP.timeReceive = P->timeReceive;
62
63 game_events->insert(tmpP);
64 if (g_bDebugEvents)
65 ProcessGameEvents();
66 }
67 }
68 break;
69 case M_UPDATE: {
70 game->net_import_update(*P);
71 }
72 break;
73 case M_SV_CONFIG_NEW_CLIENT: InitializeClientGame(*P); break;
74 case M_SV_CONFIG_GAME: game->net_import_state(*P); break;
75 case M_SV_CONFIG_FINISHED:
76 game_configured = TRUE;

Callers

nothing calls this directly

Calls 15

net_msg_RetreiveFunction · 0.85
MsgFunction · 0.85
xr_strdupFunction · 0.85
net_msg_ReleaseFunction · 0.85
r_eofMethod · 0.80
net_import_updateMethod · 0.80
net_import_stateMethod · 0.80
GetUIMethod · 0.80
get_alifeMethod · 0.80
DeferMethod · 0.80
xr_strlenFunction · 0.50
r_beginMethod · 0.45

Tested by

no test coverage detected