GridManager now works on net objects

This commit is contained in:
Yousef Khadadeh 2025-12-10 13:06:45 +03:00
parent 67507a9a39
commit ceafbf8bb6
20 changed files with 214 additions and 222 deletions

View file

@ -89,6 +89,13 @@ namespace NetworkingObjects {
}
}
template <typename T> void NetObjPtr<T>::send_update_to_all(const std::string& channel, std::function<void(const NetObjPtr<T>&, cereal::PortableBinaryOutputArchive&)> sendUpdateFunc) const {
if(objMan->is_server())
send_server_update_to_all_clients(channel, sendUpdateFunc);
else
send_client_update(channel, sendUpdateFunc);
}
template <typename T> void NetObjPtr<T>::write_create_message(cereal::PortableBinaryOutputArchive& a) const {
a(id);
objMan->typeList->get_type_index_data<T>(objMan->isServer).writeConstructorFunc(this->cast<void>(), a);