WIP
This commit is contained in:
parent
21a11a67a7
commit
41c3d9309c
@ -35,12 +35,10 @@ ss_ dump(const magic::VectorBuffer &buf)
|
|||||||
{
|
{
|
||||||
std::ostringstream os(std::ios::binary);
|
std::ostringstream os(std::ios::binary);
|
||||||
os<<"[";
|
os<<"[";
|
||||||
bool first = true;
|
for(size_t i = 0; i < buf.GetBuffer().Size(); i++){
|
||||||
for(auto it = buf.GetBuffer().Begin(); it != buf.GetBuffer().End(); ++it){
|
if(i != 0)
|
||||||
if(!first)
|
|
||||||
os<<", ";
|
os<<", ";
|
||||||
first = false;
|
os<<cs(buf.GetBuffer().At(i));
|
||||||
os<<(*it);
|
|
||||||
}
|
}
|
||||||
os<<"]";
|
os<<"]";
|
||||||
return os.str();
|
return os.str();
|
||||||
@ -102,10 +100,10 @@ struct Module: public interface::Module, public entitysync::Interface
|
|||||||
|
|
||||||
void event(const Event::Type &type, const Event::Private *p)
|
void event(const Event::Type &type, const Event::Private *p)
|
||||||
{
|
{
|
||||||
EVENT_VOIDN("core:start", on_start)
|
EVENT_VOIDN("core:start", on_start)
|
||||||
EVENT_VOIDN("core:unload", on_unload)
|
EVENT_VOIDN("core:unload", on_unload)
|
||||||
EVENT_VOIDN("core:continue", on_continue)
|
EVENT_VOIDN("core:continue", on_continue)
|
||||||
EVENT_TYPEN("core:tick", on_tick, interface::TickEvent)
|
EVENT_TYPEN("core:tick", on_tick, interface::TickEvent)
|
||||||
#if 0
|
#if 0
|
||||||
EVENT_TYPEN("entitysync:node_added",
|
EVENT_TYPEN("entitysync:node_added",
|
||||||
on_node_added, interface::MagicEvent)
|
on_node_added, interface::MagicEvent)
|
||||||
@ -210,6 +208,7 @@ struct Module: public interface::Module, public entitysync::Interface
|
|||||||
node->WriteInitialDeltaUpdate(buf);
|
node->WriteInitialDeltaUpdate(buf);
|
||||||
|
|
||||||
// TODO: User variables (see Network/Connection.cpp)
|
// TODO: User variables (see Network/Connection.cpp)
|
||||||
|
buf.WriteVLE(0);
|
||||||
|
|
||||||
// Components
|
// Components
|
||||||
buf.WriteVLE(node->GetNumNetworkComponents());
|
buf.WriteVLE(node->GetNumNetworkComponents());
|
||||||
@ -274,6 +273,18 @@ struct Module: public interface::Module, public entitysync::Interface
|
|||||||
|
|
||||||
send_to_all("entitysync:latest_node_data", buf);
|
send_to_all("entitysync:latest_node_data", buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(node_state.dirtyAttributes_.Count() || node_state.dirtyVars_.Size()){
|
||||||
|
magic::VectorBuffer buf;
|
||||||
|
|
||||||
|
buf.WriteNetID(node->GetID());
|
||||||
|
node->WriteDeltaUpdate(buf, node_state.dirtyAttributes_);
|
||||||
|
|
||||||
|
// TODO: User variables
|
||||||
|
buf.WriteVLE(0);
|
||||||
|
|
||||||
|
send_to_all("entitysync:latest_node_data", buf);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user