Refactor RPCMode enum and checks
This commit is contained in:
parent
a71b0830ab
commit
9de4ffde61
25 changed files with 217 additions and 328 deletions
|
|
@ -747,7 +747,7 @@ Ref<Script> NativeScriptInstance::get_script() const {
|
|||
return script;
|
||||
}
|
||||
|
||||
NativeScriptInstance::RPCMode NativeScriptInstance::get_rpc_mode(const StringName &p_method) const {
|
||||
MultiplayerAPI::RPCMode NativeScriptInstance::get_rpc_mode(const StringName &p_method) const {
|
||||
|
||||
NativeScriptDesc *script_data = GET_SCRIPT_DESC();
|
||||
|
||||
|
|
@ -757,27 +757,27 @@ NativeScriptInstance::RPCMode NativeScriptInstance::get_rpc_mode(const StringNam
|
|||
if (E) {
|
||||
switch (E->get().rpc_mode) {
|
||||
case GODOT_METHOD_RPC_MODE_DISABLED:
|
||||
return RPC_MODE_DISABLED;
|
||||
return MultiplayerAPI::RPC_MODE_DISABLED;
|
||||
case GODOT_METHOD_RPC_MODE_REMOTE:
|
||||
return RPC_MODE_REMOTE;
|
||||
return MultiplayerAPI::RPC_MODE_REMOTE;
|
||||
case GODOT_METHOD_RPC_MODE_SYNC:
|
||||
return RPC_MODE_SYNC;
|
||||
return MultiplayerAPI::RPC_MODE_SYNC;
|
||||
case GODOT_METHOD_RPC_MODE_MASTER:
|
||||
return RPC_MODE_MASTER;
|
||||
return MultiplayerAPI::RPC_MODE_MASTER;
|
||||
case GODOT_METHOD_RPC_MODE_SLAVE:
|
||||
return RPC_MODE_SLAVE;
|
||||
return MultiplayerAPI::RPC_MODE_SLAVE;
|
||||
default:
|
||||
return RPC_MODE_DISABLED;
|
||||
return MultiplayerAPI::RPC_MODE_DISABLED;
|
||||
}
|
||||
}
|
||||
|
||||
script_data = script_data->base_data;
|
||||
}
|
||||
|
||||
return RPC_MODE_DISABLED;
|
||||
return MultiplayerAPI::RPC_MODE_DISABLED;
|
||||
}
|
||||
|
||||
NativeScriptInstance::RPCMode NativeScriptInstance::get_rset_mode(const StringName &p_variable) const {
|
||||
MultiplayerAPI::RPCMode NativeScriptInstance::get_rset_mode(const StringName &p_variable) const {
|
||||
|
||||
NativeScriptDesc *script_data = GET_SCRIPT_DESC();
|
||||
|
||||
|
|
@ -787,24 +787,24 @@ NativeScriptInstance::RPCMode NativeScriptInstance::get_rset_mode(const StringNa
|
|||
if (E) {
|
||||
switch (E.get().rset_mode) {
|
||||
case GODOT_METHOD_RPC_MODE_DISABLED:
|
||||
return RPC_MODE_DISABLED;
|
||||
return MultiplayerAPI::RPC_MODE_DISABLED;
|
||||
case GODOT_METHOD_RPC_MODE_REMOTE:
|
||||
return RPC_MODE_REMOTE;
|
||||
return MultiplayerAPI::RPC_MODE_REMOTE;
|
||||
case GODOT_METHOD_RPC_MODE_SYNC:
|
||||
return RPC_MODE_SYNC;
|
||||
return MultiplayerAPI::RPC_MODE_SYNC;
|
||||
case GODOT_METHOD_RPC_MODE_MASTER:
|
||||
return RPC_MODE_MASTER;
|
||||
return MultiplayerAPI::RPC_MODE_MASTER;
|
||||
case GODOT_METHOD_RPC_MODE_SLAVE:
|
||||
return RPC_MODE_SLAVE;
|
||||
return MultiplayerAPI::RPC_MODE_SLAVE;
|
||||
default:
|
||||
return RPC_MODE_DISABLED;
|
||||
return MultiplayerAPI::RPC_MODE_DISABLED;
|
||||
}
|
||||
}
|
||||
|
||||
script_data = script_data->base_data;
|
||||
}
|
||||
|
||||
return RPC_MODE_DISABLED;
|
||||
return MultiplayerAPI::RPC_MODE_DISABLED;
|
||||
}
|
||||
|
||||
ScriptLanguage *NativeScriptInstance::get_language() {
|
||||
|
|
|
|||
|
|
@ -196,8 +196,8 @@ public:
|
|||
virtual Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error);
|
||||
virtual void notification(int p_notification);
|
||||
virtual Ref<Script> get_script() const;
|
||||
virtual RPCMode get_rpc_mode(const StringName &p_method) const;
|
||||
virtual RPCMode get_rset_mode(const StringName &p_variable) const;
|
||||
virtual MultiplayerAPI::RPCMode get_rpc_mode(const StringName &p_method) const;
|
||||
virtual MultiplayerAPI::RPCMode get_rset_mode(const StringName &p_variable) const;
|
||||
virtual ScriptLanguage *get_language();
|
||||
|
||||
virtual void call_multilevel(const StringName &p_method, const Variant **p_args, int p_argcount);
|
||||
|
|
|
|||
|
|
@ -138,11 +138,11 @@ void PluginScriptInstance::notification(int p_notification) {
|
|||
_desc->notification(_data, p_notification);
|
||||
}
|
||||
|
||||
ScriptInstance::RPCMode PluginScriptInstance::get_rpc_mode(const StringName &p_method) const {
|
||||
MultiplayerAPI::RPCMode PluginScriptInstance::get_rpc_mode(const StringName &p_method) const {
|
||||
return _script->get_rpc_mode(p_method);
|
||||
}
|
||||
|
||||
ScriptInstance::RPCMode PluginScriptInstance::get_rset_mode(const StringName &p_variable) const {
|
||||
MultiplayerAPI::RPCMode PluginScriptInstance::get_rset_mode(const StringName &p_variable) const {
|
||||
return _script->get_rset_mode(p_variable);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -76,8 +76,8 @@ public:
|
|||
|
||||
void set_path(const String &p_path);
|
||||
|
||||
virtual RPCMode get_rpc_mode(const StringName &p_method) const;
|
||||
virtual RPCMode get_rset_mode(const StringName &p_variable) const;
|
||||
virtual MultiplayerAPI::RPCMode get_rpc_mode(const StringName &p_method) const;
|
||||
virtual MultiplayerAPI::RPCMode get_rset_mode(const StringName &p_variable) const;
|
||||
|
||||
virtual void refcount_incremented();
|
||||
virtual bool refcount_decremented();
|
||||
|
|
|
|||
|
|
@ -245,9 +245,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()) {
|
||||
_methods_rpc_mode[mi.name] = ScriptInstance::RPC_MODE_DISABLED;
|
||||
_methods_rpc_mode[mi.name] = MultiplayerAPI::RPC_MODE_DISABLED;
|
||||
} else {
|
||||
_methods_rpc_mode[mi.name] = ScriptInstance::RPCMode(int(var));
|
||||
_methods_rpc_mode[mi.name] = MultiplayerAPI::RPCMode(int(var));
|
||||
}
|
||||
}
|
||||
Array *signals = (Array *)&manifest.signals;
|
||||
|
|
@ -265,9 +265,9 @@ Error PluginScript::reload(bool p_keep_state) {
|
|||
// rset_mode is passed as an optional field and is not part of PropertyInfo
|
||||
Variant var = v["rset_mode"];
|
||||
if (var == Variant()) {
|
||||
_methods_rpc_mode[pi.name] = ScriptInstance::RPC_MODE_DISABLED;
|
||||
_methods_rpc_mode[pi.name] = MultiplayerAPI::RPC_MODE_DISABLED;
|
||||
} else {
|
||||
_methods_rpc_mode[pi.name] = ScriptInstance::RPCMode(int(var));
|
||||
_methods_rpc_mode[pi.name] = MultiplayerAPI::RPCMode(int(var));
|
||||
}
|
||||
}
|
||||
// Manifest's attributes must be explicitly freed
|
||||
|
|
@ -402,23 +402,23 @@ int PluginScript::get_member_line(const StringName &p_member) const {
|
|||
return -1;
|
||||
}
|
||||
|
||||
ScriptInstance::RPCMode PluginScript::get_rpc_mode(const StringName &p_method) const {
|
||||
ASSERT_SCRIPT_VALID_V(ScriptInstance::RPC_MODE_DISABLED);
|
||||
const Map<StringName, ScriptInstance::RPCMode>::Element *e = _methods_rpc_mode.find(p_method);
|
||||
MultiplayerAPI::RPCMode PluginScript::get_rpc_mode(const StringName &p_method) const {
|
||||
ASSERT_SCRIPT_VALID_V(MultiplayerAPI::RPC_MODE_DISABLED);
|
||||
const Map<StringName, MultiplayerAPI::RPCMode>::Element *e = _methods_rpc_mode.find(p_method);
|
||||
if (e != NULL) {
|
||||
return e->get();
|
||||
} else {
|
||||
return ScriptInstance::RPC_MODE_DISABLED;
|
||||
return MultiplayerAPI::RPC_MODE_DISABLED;
|
||||
}
|
||||
}
|
||||
|
||||
ScriptInstance::RPCMode PluginScript::get_rset_mode(const StringName &p_variable) const {
|
||||
ASSERT_SCRIPT_VALID_V(ScriptInstance::RPC_MODE_DISABLED);
|
||||
const Map<StringName, ScriptInstance::RPCMode>::Element *e = _variables_rset_mode.find(p_variable);
|
||||
MultiplayerAPI::RPCMode PluginScript::get_rset_mode(const StringName &p_variable) const {
|
||||
ASSERT_SCRIPT_VALID_V(MultiplayerAPI::RPC_MODE_DISABLED);
|
||||
const Map<StringName, MultiplayerAPI::RPCMode>::Element *e = _variables_rset_mode.find(p_variable);
|
||||
if (e != NULL) {
|
||||
return e->get();
|
||||
} else {
|
||||
return ScriptInstance::RPC_MODE_DISABLED;
|
||||
return MultiplayerAPI::RPC_MODE_DISABLED;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -62,8 +62,8 @@ private:
|
|||
Map<StringName, PropertyInfo> _properties_info;
|
||||
Map<StringName, MethodInfo> _signals_info;
|
||||
Map<StringName, MethodInfo> _methods_info;
|
||||
Map<StringName, ScriptInstance::RPCMode> _variables_rset_mode;
|
||||
Map<StringName, ScriptInstance::RPCMode> _methods_rpc_mode;
|
||||
Map<StringName, MultiplayerAPI::RPCMode> _variables_rset_mode;
|
||||
Map<StringName, MultiplayerAPI::RPCMode> _methods_rpc_mode;
|
||||
|
||||
Set<Object *> _instances;
|
||||
//exported members
|
||||
|
|
@ -116,8 +116,8 @@ public:
|
|||
|
||||
virtual int get_member_line(const StringName &p_member) const;
|
||||
|
||||
ScriptInstance::RPCMode get_rpc_mode(const StringName &p_method) const;
|
||||
ScriptInstance::RPCMode get_rset_mode(const StringName &p_variable) const;
|
||||
MultiplayerAPI::RPCMode get_rpc_mode(const StringName &p_method) const;
|
||||
MultiplayerAPI::RPCMode get_rset_mode(const StringName &p_variable) const;
|
||||
|
||||
PluginScript();
|
||||
void init(PluginScriptLanguage *language);
|
||||
|
|
|
|||
|
|
@ -1220,7 +1220,7 @@ ScriptLanguage *GDScriptInstance::get_language() {
|
|||
return GDScriptLanguage::get_singleton();
|
||||
}
|
||||
|
||||
GDScriptInstance::RPCMode GDScriptInstance::get_rpc_mode(const StringName &p_method) const {
|
||||
MultiplayerAPI::RPCMode GDScriptInstance::get_rpc_mode(const StringName &p_method) const {
|
||||
|
||||
const GDScript *cscript = script.ptr();
|
||||
|
||||
|
|
@ -1228,17 +1228,17 @@ GDScriptInstance::RPCMode GDScriptInstance::get_rpc_mode(const StringName &p_met
|
|||
const Map<StringName, GDScriptFunction *>::Element *E = cscript->member_functions.find(p_method);
|
||||
if (E) {
|
||||
|
||||
if (E->get()->get_rpc_mode() != RPC_MODE_DISABLED) {
|
||||
if (E->get()->get_rpc_mode() != MultiplayerAPI::RPC_MODE_DISABLED) {
|
||||
return E->get()->get_rpc_mode();
|
||||
}
|
||||
}
|
||||
cscript = cscript->_base;
|
||||
}
|
||||
|
||||
return RPC_MODE_DISABLED;
|
||||
return MultiplayerAPI::RPC_MODE_DISABLED;
|
||||
}
|
||||
|
||||
GDScriptInstance::RPCMode GDScriptInstance::get_rset_mode(const StringName &p_variable) const {
|
||||
MultiplayerAPI::RPCMode GDScriptInstance::get_rset_mode(const StringName &p_variable) const {
|
||||
|
||||
const GDScript *cscript = script.ptr();
|
||||
|
||||
|
|
@ -1253,7 +1253,7 @@ GDScriptInstance::RPCMode GDScriptInstance::get_rset_mode(const StringName &p_va
|
|||
cscript = cscript->_base;
|
||||
}
|
||||
|
||||
return RPC_MODE_DISABLED;
|
||||
return MultiplayerAPI::RPC_MODE_DISABLED;
|
||||
}
|
||||
|
||||
void GDScriptInstance::reload_members() {
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ class GDScript : public Script {
|
|||
int index;
|
||||
StringName setter;
|
||||
StringName getter;
|
||||
ScriptInstance::RPCMode rpc_mode;
|
||||
MultiplayerAPI::RPCMode rpc_mode;
|
||||
};
|
||||
|
||||
friend class GDScriptInstance;
|
||||
|
|
@ -248,8 +248,8 @@ public:
|
|||
|
||||
void reload_members();
|
||||
|
||||
virtual RPCMode get_rpc_mode(const StringName &p_method) const;
|
||||
virtual RPCMode get_rset_mode(const StringName &p_variable) const;
|
||||
virtual MultiplayerAPI::RPCMode get_rpc_mode(const StringName &p_method) const;
|
||||
virtual MultiplayerAPI::RPCMode get_rset_mode(const StringName &p_variable) const;
|
||||
|
||||
GDScriptInstance();
|
||||
~GDScriptInstance();
|
||||
|
|
|
|||
|
|
@ -1455,7 +1455,7 @@ GDScriptFunction::GDScriptFunction() :
|
|||
|
||||
_stack_size = 0;
|
||||
_call_size = 0;
|
||||
rpc_mode = ScriptInstance::RPC_MODE_DISABLED;
|
||||
rpc_mode = MultiplayerAPI::RPC_MODE_DISABLED;
|
||||
name = "<anonymous>";
|
||||
#ifdef DEBUG_ENABLED
|
||||
_func_cname = NULL;
|
||||
|
|
|
|||
|
|
@ -96,14 +96,6 @@ public:
|
|||
ADDR_TYPE_NIL = 9
|
||||
};
|
||||
|
||||
enum RPCMode {
|
||||
RPC_DISABLED,
|
||||
RPC_ENABLED,
|
||||
RPC_SYNC,
|
||||
RPC_SYNC_MASTER,
|
||||
RPC_SYNC_SLAVE
|
||||
};
|
||||
|
||||
struct StackDebug {
|
||||
|
||||
int line;
|
||||
|
|
@ -135,7 +127,7 @@ private:
|
|||
int _call_size;
|
||||
int _initial_line;
|
||||
bool _static;
|
||||
ScriptInstance::RPCMode rpc_mode;
|
||||
MultiplayerAPI::RPCMode rpc_mode;
|
||||
|
||||
GDScript *_script;
|
||||
|
||||
|
|
@ -230,7 +222,7 @@ public:
|
|||
|
||||
Variant call(GDScriptInstance *p_instance, const Variant **p_args, int p_argcount, Variant::CallError &r_err, CallState *p_state = NULL);
|
||||
|
||||
_FORCE_INLINE_ ScriptInstance::RPCMode get_rpc_mode() const { return rpc_mode; }
|
||||
_FORCE_INLINE_ MultiplayerAPI::RPCMode get_rpc_mode() const { return rpc_mode; }
|
||||
GDScriptFunction();
|
||||
~GDScriptFunction();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3365,7 +3365,7 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
|
|||
function->line = fnline;
|
||||
|
||||
function->rpc_mode = rpc_mode;
|
||||
rpc_mode = ScriptInstance::RPC_MODE_DISABLED;
|
||||
rpc_mode = MultiplayerAPI::RPC_MODE_DISABLED;
|
||||
|
||||
if (_static)
|
||||
p_class->static_functions.push_back(function);
|
||||
|
|
@ -3959,7 +3959,7 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
|
|||
return;
|
||||
}
|
||||
}
|
||||
rpc_mode = ScriptInstance::RPC_MODE_REMOTE;
|
||||
rpc_mode = MultiplayerAPI::RPC_MODE_REMOTE;
|
||||
|
||||
continue;
|
||||
} break;
|
||||
|
|
@ -3980,7 +3980,7 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
|
|||
}
|
||||
}
|
||||
|
||||
rpc_mode = ScriptInstance::RPC_MODE_MASTER;
|
||||
rpc_mode = MultiplayerAPI::RPC_MODE_MASTER;
|
||||
continue;
|
||||
} break;
|
||||
case GDScriptTokenizer::TK_PR_SLAVE: {
|
||||
|
|
@ -4000,7 +4000,7 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
|
|||
}
|
||||
}
|
||||
|
||||
rpc_mode = ScriptInstance::RPC_MODE_SLAVE;
|
||||
rpc_mode = MultiplayerAPI::RPC_MODE_SLAVE;
|
||||
continue;
|
||||
} break;
|
||||
case GDScriptTokenizer::TK_PR_SYNC: {
|
||||
|
|
@ -4015,7 +4015,7 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
|
|||
return;
|
||||
}
|
||||
|
||||
rpc_mode = ScriptInstance::RPC_MODE_SYNC;
|
||||
rpc_mode = MultiplayerAPI::RPC_MODE_SYNC;
|
||||
continue;
|
||||
} break;
|
||||
case GDScriptTokenizer::TK_PR_VAR: {
|
||||
|
|
@ -4045,7 +4045,7 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
|
|||
|
||||
tokenizer->advance();
|
||||
|
||||
rpc_mode = ScriptInstance::RPC_MODE_DISABLED;
|
||||
rpc_mode = MultiplayerAPI::RPC_MODE_DISABLED;
|
||||
|
||||
if (tokenizer->get_token() == GDScriptTokenizer::TK_OP_ASSIGN) {
|
||||
|
||||
|
|
@ -4470,7 +4470,7 @@ void GDScriptParser::clear() {
|
|||
current_class = NULL;
|
||||
|
||||
completion_found = false;
|
||||
rpc_mode = ScriptInstance::RPC_MODE_DISABLED;
|
||||
rpc_mode = MultiplayerAPI::RPC_MODE_DISABLED;
|
||||
|
||||
current_function = NULL;
|
||||
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ public:
|
|||
StringName getter;
|
||||
int line;
|
||||
Node *expression;
|
||||
ScriptInstance::RPCMode rpc_mode;
|
||||
MultiplayerAPI::RPCMode rpc_mode;
|
||||
};
|
||||
struct Constant {
|
||||
StringName identifier;
|
||||
|
|
@ -125,7 +125,7 @@ public:
|
|||
struct FunctionNode : public Node {
|
||||
|
||||
bool _static;
|
||||
ScriptInstance::RPCMode rpc_mode;
|
||||
MultiplayerAPI::RPCMode rpc_mode;
|
||||
StringName name;
|
||||
Vector<StringName> arguments;
|
||||
Vector<Node *> default_values;
|
||||
|
|
@ -134,7 +134,7 @@ public:
|
|||
FunctionNode() {
|
||||
type = TYPE_FUNCTION;
|
||||
_static = false;
|
||||
rpc_mode = ScriptInstance::RPC_MODE_DISABLED;
|
||||
rpc_mode = MultiplayerAPI::RPC_MODE_DISABLED;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -493,7 +493,7 @@ private:
|
|||
|
||||
PropertyInfo current_export;
|
||||
|
||||
ScriptInstance::RPCMode rpc_mode;
|
||||
MultiplayerAPI::RPCMode rpc_mode;
|
||||
|
||||
void _set_error(const String &p_error, int p_line = -1, int p_column = -1);
|
||||
bool _recover_from_completion();
|
||||
|
|
|
|||
|
|
@ -1310,21 +1310,21 @@ bool CSharpInstance::refcount_decremented() {
|
|||
return ref_dying;
|
||||
}
|
||||
|
||||
ScriptInstance::RPCMode CSharpInstance::_member_get_rpc_mode(GDMonoClassMember *p_member) const {
|
||||
MultiplayerAPI::RPCMode CSharpInstance::_member_get_rpc_mode(GDMonoClassMember *p_member) const {
|
||||
|
||||
if (p_member->has_attribute(CACHED_CLASS(RemoteAttribute)))
|
||||
return RPC_MODE_REMOTE;
|
||||
return MultiplayerAPI::RPC_MODE_REMOTE;
|
||||
if (p_member->has_attribute(CACHED_CLASS(SyncAttribute)))
|
||||
return RPC_MODE_SYNC;
|
||||
return MultiplayerAPI::RPC_MODE_SYNC;
|
||||
if (p_member->has_attribute(CACHED_CLASS(MasterAttribute)))
|
||||
return RPC_MODE_MASTER;
|
||||
return MultiplayerAPI::RPC_MODE_MASTER;
|
||||
if (p_member->has_attribute(CACHED_CLASS(SlaveAttribute)))
|
||||
return RPC_MODE_SLAVE;
|
||||
return MultiplayerAPI::RPC_MODE_SLAVE;
|
||||
|
||||
return RPC_MODE_DISABLED;
|
||||
return MultiplayerAPI::RPC_MODE_DISABLED;
|
||||
}
|
||||
|
||||
ScriptInstance::RPCMode CSharpInstance::get_rpc_mode(const StringName &p_method) const {
|
||||
MultiplayerAPI::RPCMode CSharpInstance::get_rpc_mode(const StringName &p_method) const {
|
||||
|
||||
GDMonoClass *top = script->script_class;
|
||||
|
||||
|
|
@ -1337,10 +1337,10 @@ ScriptInstance::RPCMode CSharpInstance::get_rpc_mode(const StringName &p_method)
|
|||
top = top->get_parent_class();
|
||||
}
|
||||
|
||||
return RPC_MODE_DISABLED;
|
||||
return MultiplayerAPI::RPC_MODE_DISABLED;
|
||||
}
|
||||
|
||||
ScriptInstance::RPCMode CSharpInstance::get_rset_mode(const StringName &p_variable) const {
|
||||
MultiplayerAPI::RPCMode CSharpInstance::get_rset_mode(const StringName &p_variable) const {
|
||||
|
||||
GDMonoClass *top = script->script_class;
|
||||
|
||||
|
|
@ -1358,7 +1358,7 @@ ScriptInstance::RPCMode CSharpInstance::get_rset_mode(const StringName &p_variab
|
|||
top = top->get_parent_class();
|
||||
}
|
||||
|
||||
return RPC_MODE_DISABLED;
|
||||
return MultiplayerAPI::RPC_MODE_DISABLED;
|
||||
}
|
||||
|
||||
void CSharpInstance::notification(int p_notification) {
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ class CSharpInstance : public ScriptInstance {
|
|||
|
||||
void _call_multilevel(MonoObject *p_mono_object, const StringName &p_method, const Variant **p_args, int p_argcount);
|
||||
|
||||
RPCMode _member_get_rpc_mode(GDMonoClassMember *p_member) const;
|
||||
MultiplayerAPI::RPCMode _member_get_rpc_mode(GDMonoClassMember *p_member) const;
|
||||
|
||||
public:
|
||||
MonoObject *get_mono_object() const;
|
||||
|
|
@ -213,8 +213,8 @@ public:
|
|||
virtual void refcount_incremented();
|
||||
virtual bool refcount_decremented();
|
||||
|
||||
virtual RPCMode get_rpc_mode(const StringName &p_method) const;
|
||||
virtual RPCMode get_rset_mode(const StringName &p_variable) const;
|
||||
virtual MultiplayerAPI::RPCMode get_rpc_mode(const StringName &p_method) const;
|
||||
virtual MultiplayerAPI::RPCMode get_rset_mode(const StringName &p_variable) const;
|
||||
|
||||
virtual void notification(int p_notification);
|
||||
void call_notification_no_check(MonoObject *p_mono_object, int p_notification);
|
||||
|
|
|
|||
|
|
@ -1967,11 +1967,11 @@ Ref<Script> VisualScriptInstance::get_script() const {
|
|||
return script;
|
||||
}
|
||||
|
||||
ScriptInstance::RPCMode VisualScriptInstance::get_rpc_mode(const StringName &p_method) const {
|
||||
MultiplayerAPI::RPCMode VisualScriptInstance::get_rpc_mode(const StringName &p_method) const {
|
||||
|
||||
const Map<StringName, VisualScript::Function>::Element *E = script->functions.find(p_method);
|
||||
if (!E) {
|
||||
return RPC_MODE_DISABLED;
|
||||
return MultiplayerAPI::RPC_MODE_DISABLED;
|
||||
}
|
||||
|
||||
if (E->get().function_id >= 0 && E->get().nodes.has(E->get().function_id)) {
|
||||
|
|
@ -1983,12 +1983,12 @@ ScriptInstance::RPCMode VisualScriptInstance::get_rpc_mode(const StringName &p_m
|
|||
}
|
||||
}
|
||||
|
||||
return RPC_MODE_DISABLED;
|
||||
return MultiplayerAPI::RPC_MODE_DISABLED;
|
||||
}
|
||||
|
||||
ScriptInstance::RPCMode VisualScriptInstance::get_rset_mode(const StringName &p_variable) const {
|
||||
MultiplayerAPI::RPCMode VisualScriptInstance::get_rset_mode(const StringName &p_variable) const {
|
||||
|
||||
return RPC_MODE_DISABLED;
|
||||
return MultiplayerAPI::RPC_MODE_DISABLED;
|
||||
}
|
||||
|
||||
void VisualScriptInstance::create(const Ref<VisualScript> &p_script, Object *p_owner) {
|
||||
|
|
|
|||
|
|
@ -433,8 +433,8 @@ public:
|
|||
|
||||
virtual ScriptLanguage *get_language();
|
||||
|
||||
virtual RPCMode get_rpc_mode(const StringName &p_method) const;
|
||||
virtual RPCMode get_rset_mode(const StringName &p_variable) const;
|
||||
virtual MultiplayerAPI::RPCMode get_rpc_mode(const StringName &p_method) const;
|
||||
virtual MultiplayerAPI::RPCMode get_rset_mode(const StringName &p_variable) const;
|
||||
|
||||
VisualScriptInstance();
|
||||
~VisualScriptInstance();
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ bool VisualScriptFunction::_set(const StringName &p_name, const Variant &p_value
|
|||
}
|
||||
|
||||
if (p_name == "rpc/mode") {
|
||||
rpc_mode = ScriptInstance::RPCMode(int(p_value));
|
||||
rpc_mode = MultiplayerAPI::RPCMode(int(p_value));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -267,11 +267,11 @@ int VisualScriptFunction::get_argument_count() const {
|
|||
return arguments.size();
|
||||
}
|
||||
|
||||
void VisualScriptFunction::set_rpc_mode(ScriptInstance::RPCMode p_mode) {
|
||||
void VisualScriptFunction::set_rpc_mode(MultiplayerAPI::RPCMode p_mode) {
|
||||
rpc_mode = p_mode;
|
||||
}
|
||||
|
||||
ScriptInstance::RPCMode VisualScriptFunction::get_rpc_mode() const {
|
||||
MultiplayerAPI::RPCMode VisualScriptFunction::get_rpc_mode() const {
|
||||
return rpc_mode;
|
||||
}
|
||||
|
||||
|
|
@ -319,7 +319,7 @@ VisualScriptFunction::VisualScriptFunction() {
|
|||
stack_size = 256;
|
||||
stack_less = false;
|
||||
sequenced = true;
|
||||
rpc_mode = ScriptInstance::RPC_MODE_DISABLED;
|
||||
rpc_mode = MultiplayerAPI::RPC_MODE_DISABLED;
|
||||
}
|
||||
|
||||
void VisualScriptFunction::set_stack_less(bool p_enable) {
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ class VisualScriptFunction : public VisualScriptNode {
|
|||
|
||||
bool stack_less;
|
||||
int stack_size;
|
||||
ScriptInstance::RPCMode rpc_mode;
|
||||
MultiplayerAPI::RPCMode rpc_mode;
|
||||
bool sequenced;
|
||||
|
||||
protected:
|
||||
|
|
@ -93,8 +93,8 @@ public:
|
|||
void set_return_type(Variant::Type p_type);
|
||||
Variant::Type get_return_type() const;
|
||||
|
||||
void set_rpc_mode(ScriptInstance::RPCMode p_mode);
|
||||
ScriptInstance::RPCMode get_rpc_mode() const;
|
||||
void set_rpc_mode(MultiplayerAPI::RPCMode p_mode);
|
||||
MultiplayerAPI::RPCMode get_rpc_mode() const;
|
||||
|
||||
virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue