Skip to content

Commit a3f5437

Browse files
committed
Added mastersync and puppetsync
1 parent 1bcb302 commit a3f5437

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

gdnative-core/src/nativescript/init.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,8 @@ pub enum RpcMode {
223223
RemoteSync,
224224
Master,
225225
Puppet,
226+
MasterSync,
227+
PuppetSync,
226228
}
227229

228230
pub struct ScriptMethodAttributes {
@@ -256,6 +258,8 @@ impl<C: NativeClass> ClassBuilder<C> {
256258
RpcMode::Puppet => sys::godot_method_rpc_mode_GODOT_METHOD_RPC_MODE_SLAVE,
257259
RpcMode::RemoteSync => sys::godot_method_rpc_mode_GODOT_METHOD_RPC_MODE_SYNC,
258260
RpcMode::Disabled => sys::godot_method_rpc_mode_GODOT_METHOD_RPC_MODE_DISABLED,
261+
RpcMode::MasterSync => sys::godot_method_rpc_mode_GODOT_METHOD_RPC_MODE_MASTERSYNC,
262+
RpcMode::PuppetSync => sys::godot_method_rpc_mode_GODOT_METHOD_RPC_MODE_PUPPETSYNC,
259263
};
260264

261265
let attr = sys::godot_method_attributes { rpc_type: rpc };
@@ -284,6 +288,8 @@ impl<C: NativeClass> ClassBuilder<C> {
284288
"remotesync" => RpcMode::RemoteSync,
285289
"master" => RpcMode::Master,
286290
"puppet" => RpcMode::Puppet,
291+
"puppetsync" => RpcMode::PuppetSync,
292+
"mastersync" => RpcMode::MasterSync,
287293
_ => RpcMode::Disabled,
288294
};
289295

gdnative-derive/src/methods.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,14 @@ fn impl_gdnative_expose(ast: ItemImpl) -> (ItemImpl, ClassMethodExport) {
272272
rpc = "disabled";
273273
return false;
274274
}
275+
"mastersync" => {
276+
rpc = "mastersync";
277+
return false;
278+
}
279+
"puppetsync" => {
280+
rpc = "puppetsync";
281+
return false;
282+
}
275283
_ => {
276284
errors.push(syn::Error::new(
277285
last.span(),

0 commit comments

Comments
 (0)