MCPcopy Create free account
hub / github.com/Segs/Segs / storeServerPhysicsPositions

Function storeServerPhysicsPositions

Projects/CoX/Servers/MapServer/MessageHelpers.cpp:74–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72 }
73}
74void storeServerPhysicsPositions(BitStream &bs,Entity *self)
75{
76 PUTDEBUG("before physics");
77
78 bs.StoreBits(1,self->m_full_update);
79 if( !self->m_full_update )
80 bs.StoreBits(1,self->m_has_control_id);
81
82 qCDebug(logPosition,"Input_Ack: %d",self->m_input_ack);
83
84 if( self->m_full_update || self->m_has_control_id)
85 bs.StoreBits(16,self->m_input_ack); //target->m_input_ack
86 if(self->m_full_update)
87 {
88 for(int i=0; i<3; ++i)
89 bs.StoreFloat(self->m_entity_data.m_pos[i]); // server position
90 for(int i=0; i<3; ++i)
91 storeFloatConditional(bs,self->m_motion_state.m_velocity[i]);
92
93 qCDebug(logPosition) << "position" << glm::to_string(self->m_entity_data.m_pos).c_str();
94 qCDebug(logPosition) << "velocity" << glm::to_string(self->m_motion_state.m_velocity).c_str();
95 }
96}
97void storeServerControlState(BitStream &bs,Entity *self)
98{
99 bs.StoreBits(1,self->m_update_part_1);

Callers 1

buildEntityResponseFunction · 0.85

Calls 4

storeFloatConditionalFunction · 0.85
StoreFloatMethod · 0.80
c_strMethod · 0.80
StoreBitsMethod · 0.45

Tested by

no test coverage detected