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

Function buildEntityResponse

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

Source from the content-addressed store, hash-verified

668}
669
670void buildEntityResponse(EntitiesResponse *res,MapClientSession &to_client,EntityUpdateMode mode,bool use_debug)
671{
672 bool is_incremental = mode!=EntityUpdateMode::FULL;
673 res->blob_of_death.StorePackedBits(1,is_incremental ? 2 : 3); // opcode 3 - full update.
674 res->blob_of_death.StoreBits(1,res->ent_major_update); // passed to Entity::EntReceive as a parameter
675 res->is_incremental(is_incremental); // full world update = op 3
676
677 res->debug_info = use_debug;
678 storeEntityResponseCommands(res->blob_of_death,res->m_map_time_of_day);
679
680 res->blob_of_death.StoreBits(32,res->abs_time);
681 //tgt.StoreBits(32,db_time);
682 bool all_defaults = (use_debug==0) && (res->g_interpolation_level==2) && (res->g_interpolation_bits==1);
683 res->blob_of_death.StoreBits(1,all_defaults);
684 if(!all_defaults)
685 {
686 res->blob_of_death.StoreBits(1,use_debug);
687 res->blob_of_death.StoreBits(1,res->g_interpolation_level!=0);
688 if(res->g_interpolation_level!=0)
689 {
690 res->blob_of_death.StoreBits(2,res->g_interpolation_level);
691 res->blob_of_death.StoreBits(2,res->g_interpolation_bits);
692 }
693 }
694
695 storeEntityResponseOtherEntities(res->blob_of_death,to_client.m_current_map->m_entities, &to_client, is_incremental,use_debug);
696 storeServerPhysicsPositions(res->blob_of_death,to_client.m_ent);
697 storeControlState(res->blob_of_death,to_client.m_ent);
698 storeEntityRemovals(res->blob_of_death,to_client.m_current_map->m_entities,&to_client);
699 storeClientData(res->blob_of_death,to_client.m_ent,is_incremental);
700 storeFollowupCommands(res->blob_of_death,&to_client);
701}

Callers 3

on_entities_requestMethod · 0.85
sendStateMethod · 0.85
on_cookie_confirmMethod · 0.85

Calls 10

storeControlStateFunction · 0.85
storeEntityRemovalsFunction · 0.85
storeClientDataFunction · 0.85
storeFollowupCommandsFunction · 0.85
is_incrementalMethod · 0.80
StorePackedBitsMethod · 0.45
StoreBitsMethod · 0.45

Tested by

no test coverage detected