You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-09 12:50:35 +00:00
[Net] Move multiplayer to core subdir, split RPCManager.
Move multiplayer classes to "core/multiplayer" subdir. Move the RPCConfig and enums (TransferMode, RPCMode) to a separate file (multiplayer.h), and bind them to the global namespace. Move the RPC handling code to its own class (RPCManager). Renames "get_rpc_sender_id" to "get_remote_sender_id".
This commit is contained in:
@@ -100,7 +100,7 @@ String PluginScriptInstance::to_string(bool *r_valid) {
|
||||
return str_ret;
|
||||
}
|
||||
|
||||
const Vector<MultiplayerAPI::RPCConfig> PluginScriptInstance::get_rpc_methods() const {
|
||||
const Vector<Multiplayer::RPCConfig> PluginScriptInstance::get_rpc_methods() const {
|
||||
return _script->get_rpc_methods();
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
|
||||
void set_path(const String &p_path);
|
||||
|
||||
virtual const Vector<MultiplayerAPI::RPCConfig> get_rpc_methods() const;
|
||||
virtual const Vector<Multiplayer::RPCConfig> get_rpc_methods() const;
|
||||
|
||||
virtual void refcount_incremented();
|
||||
virtual bool refcount_decremented();
|
||||
|
||||
@@ -334,9 +334,9 @@ Error PluginScript::reload(bool p_keep_state) {
|
||||
// rpc_mode is passed as an optional field and is not part of MethodInfo
|
||||
Variant var = v["rpc_mode"];
|
||||
if (var != Variant()) {
|
||||
MultiplayerAPI::RPCConfig nd;
|
||||
Multiplayer::RPCConfig nd;
|
||||
nd.name = mi.name;
|
||||
nd.rpc_mode = MultiplayerAPI::RPCMode(int(var));
|
||||
nd.rpc_mode = Multiplayer::RPCMode(int(var));
|
||||
// TODO Transfer Channel
|
||||
if (_rpc_methods.find(nd) == -1) {
|
||||
_rpc_methods.push_back(nd);
|
||||
@@ -345,7 +345,7 @@ Error PluginScript::reload(bool p_keep_state) {
|
||||
}
|
||||
|
||||
// Sort so we are 100% that they are always the same.
|
||||
_rpc_methods.sort_custom<MultiplayerAPI::SortRPCConfig>();
|
||||
_rpc_methods.sort_custom<Multiplayer::SortRPCConfig>();
|
||||
|
||||
Array *signals = (Array *)&manifest.signals;
|
||||
for (int i = 0; i < signals->size(); ++i) {
|
||||
@@ -484,7 +484,7 @@ int PluginScript::get_member_line(const StringName &p_member) const {
|
||||
return -1;
|
||||
}
|
||||
|
||||
const Vector<MultiplayerAPI::RPCConfig> PluginScript::get_rpc_methods() const {
|
||||
const Vector<Multiplayer::RPCConfig> PluginScript::get_rpc_methods() const {
|
||||
return _rpc_methods;
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ private:
|
||||
Map<StringName, PropertyInfo> _properties_info;
|
||||
Map<StringName, MethodInfo> _signals_info;
|
||||
Map<StringName, MethodInfo> _methods_info;
|
||||
Vector<MultiplayerAPI::RPCConfig> _rpc_methods;
|
||||
Vector<Multiplayer::RPCConfig> _rpc_methods;
|
||||
|
||||
Set<Object *> _instances;
|
||||
//exported members
|
||||
@@ -136,7 +136,7 @@ public:
|
||||
|
||||
virtual int get_member_line(const StringName &p_member) const override;
|
||||
|
||||
virtual const Vector<MultiplayerAPI::RPCConfig> get_rpc_methods() const override;
|
||||
virtual const Vector<Multiplayer::RPCConfig> get_rpc_methods() const override;
|
||||
|
||||
PluginScript();
|
||||
void init(PluginScriptLanguage *language);
|
||||
|
||||
Reference in New Issue
Block a user