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

Method Process_update

ogsr_engine/xrGame/xrServer_process_update.cpp:7–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5int g_Dump_Update_Read = 0;
6
7void xrServer::Process_update(NET_Packet& P, ClientID sender)
8{
9 xrClientData* CL = ID_to_client(sender);
10 R_ASSERT2(CL, "Process_update client not found");
11
12 if (g_Dump_Update_Read)
13 Msg("---- UPDATE_Read --- ");
14
15 R_ASSERT(CL->flags.bLocal);
16 // while has information
17 while (!P.r_eof())
18 {
19 // find entity
20 u16 ID;
21 u8 size;
22
23 P.r_u16(ID);
24 P.r_u8(size);
25 u32 _pos = P.r_tell();
26 CSE_Abstract* E = ID_to_entity(ID);
27
28 if (E)
29 {
30 // Msg ("sv_import: %d '%s'",E->ID,E->name_replace());
31 E->net_Ready = TRUE;
32 E->UPDATE_Read(P);
33
34 if (g_Dump_Update_Read)
35 Msg("* %s : %d - %d", E->name(), size, P.r_tell() - _pos);
36
37 if ((P.r_tell() - _pos) != size)
38 {
39 string16 tmp;
40 CLSID2TEXT(E->m_tClassID, tmp);
41 Debug.fatal(DEBUG_INFO, "Beer from the creator of '%s'", tmp);
42 }
43 }
44 else
45 P.r_advance(size);
46 }
47 if (g_Dump_Update_Read)
48 Msg("-------------------- ");
49}
50
51void xrServer::Process_save(NET_Packet& P, ClientID sender)
52{

Callers

nothing calls this directly

Calls 10

MsgFunction · 0.85
CLSID2TEXTFunction · 0.85
r_eofMethod · 0.80
r_tellMethod · 0.80
r_advanceMethod · 0.80
r_u16Method · 0.45
r_u8Method · 0.45
UPDATE_ReadMethod · 0.45
nameMethod · 0.45
fatalMethod · 0.45

Tested by

no test coverage detected