You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
[Net] Single rpc annotation. "sync" no longer part of mode.
- Move the "sync" property for RPCs to RPCConfig.
- Unify GDScript annotations into a single one:
- `@rpc(master)` # default
- `@rpc(puppet)`
- `@rpc(any)` # former `@remote`
- Implement three additional `@rpc` options:
- The second parameter is the "sync" option (which also calls the
function locally when RPCing). One of "sync", "nosync".
- The third parameter is the transfer mode (reliable, unreliable,
ordered).
- The third parameter is the channel (unused for now).
This commit is contained in:
@@ -155,7 +155,7 @@ void GDScriptByteCodeGenerator::end_parameters() {
|
||||
function->default_arguments.reverse();
|
||||
}
|
||||
|
||||
void GDScriptByteCodeGenerator::write_start(GDScript *p_script, const StringName &p_function_name, bool p_static, MultiplayerAPI::RPCMode p_rpc_mode, const GDScriptDataType &p_return_type) {
|
||||
void GDScriptByteCodeGenerator::write_start(GDScript *p_script, const StringName &p_function_name, bool p_static, MultiplayerAPI::RPCConfig p_rpc_config, const GDScriptDataType &p_return_type) {
|
||||
function = memnew(GDScriptFunction);
|
||||
debug_stack = EngineDebugger::is_active();
|
||||
|
||||
@@ -170,7 +170,7 @@ void GDScriptByteCodeGenerator::write_start(GDScript *p_script, const StringName
|
||||
|
||||
function->_static = p_static;
|
||||
function->return_type = p_return_type;
|
||||
function->rpc_mode = p_rpc_mode;
|
||||
function->rpc_config = p_rpc_config;
|
||||
function->_argument_count = 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user