public override void _Ready() { Work = Multiplayer; //This means that anywhere we can Net.Work.Whatever instead of Game.Self.GetTree().Whatever GetTree().Connect("network_peer_connected", this, nameof(PlayerConnected)); GetTree().Connect("network_peer_disconnected", this, nameof(PlayerDisconnected)); GetTree().Connect("server_disconnected", this, nameof(ServerDisconnected), flags: (uint)ConnectFlags.Deferred); }
public override void _Ready() { Work = Multiplayer; //This means that anywhere we can Net.Work.Whatever instead of Game.Self.GetTree().Whatever GetTree().Connect("network_peer_connected", this, "_PlayerConnected"); GetTree().Connect("network_peer_disconnected", this, "_PlayerDisconnected"); GetTree().Connect("server_disconnected", this, "_ServerDisconnected"); }
protected Connection() { CustomMultiplayer = new MultiplayerAPI(); CustomMultiplayer.SetRootNode(this); }