Example #1
0
 /*********
 ** Public methods
 *********/
 /// <summary>Construct an instance.</summary>
 /// <param name="playerID">The player's unique ID.</param>
 /// <param name="model">The metadata to copy.</param>
 /// <param name="server">The server through which to send messages.</param>
 /// <param name="serverConnection">The server connection through which to send messages.</param>
 /// <param name="client">The client through which to send messages.</param>
 /// <param name="isHost">Whether this is a connection to the host player.</param>
 public MultiplayerPeer(long playerID, RemoteContextModel model, SLidgrenServer server, NetConnection serverConnection, SLidgrenClient client, bool isHost)
 {
     this.PlayerID = playerID;
     this.IsHost   = isHost;
     if (model != null)
     {
         this.Platform    = model.Platform;
         this.GameVersion = model.GameVersion;
         this.ApiVersion  = model.ApiVersion;
         this.Mods        = model.Mods.Select(mod => new MultiplayerPeerMod(mod)).ToArray();
     }
     this.Server           = server;
     this.ServerConnection = serverConnection;
     this.Client           = client;
 }
Example #2
0
 /// <summary>Construct an instance for a connection to the host player.</summary>
 /// <param name="playerID">The player's unique ID.</param>
 /// <param name="model">The metadata to copy.</param>
 /// <param name="client">The client through which to send messages.</param>
 /// <param name="isHost">Whether this connection is for the host player.</param>
 public static MultiplayerPeer ForConnectionToHost(long playerID, RemoteContextModel model, SLidgrenClient client, bool isHost)
 {
     return(new MultiplayerPeer(
                playerID: playerID,
                model: model,
                server: null,
                serverConnection: null,
                client: client,
                isHost: isHost
                ));
 }