コード例 #1
0
    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);
    }
コード例 #2
0
ファイル: Net.cs プロジェクト: Stenodyon/SkyOfSteel
    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");
    }
コード例 #3
0
ファイル: Connection.cs プロジェクト: codecomedytv/CardGame
 protected Connection()
 {
     CustomMultiplayer = new MultiplayerAPI();
     CustomMultiplayer.SetRootNode(this);
 }