static private BeginCreate ( string serverHost, SessionType sessionType, int maxLocalGamers, int maxGamers, int privateReservedSlots, SessionProperties sessionProperties, AsyncCallback callback, object asyncState ) : IAsyncResult | ||
serverHost | string | |
sessionType | SessionType | |
maxLocalGamers | int | |
maxGamers | int | |
privateReservedSlots | int | |
sessionProperties | SessionProperties | |
callback | AsyncCallback | |
asyncState | object | |
return | IAsyncResult |
/// <summary> /// Creates a wide area network session /// </summary> /// <param name="maxPlayers">The total maximum players for this session</param> /// <param name="sessionProperties">The SessionProperties that will be used to find this session on the network. Can be null</param> /// <remarks>it doesn't yet support multiple local players</remarks> public override void CreateWanSession(int maxPlayers, SessionProperties sessionProperties) { IPAddress ipAddress; var host = NetUtility.GetMyAddress(out ipAddress); _networkSessionLocker = CreatingSession; LidgrenSession.BeginCreate(host.ToString(), SessionType.WideAreaNetwork, 1, maxPlayers, 0, sessionProperties, OnLidgrenSessionCreated, _networkSessionLocker); }
/// <summary> /// Creates a Single Player Session /// </summary> /// <remarks>No network resources will be used</remarks> public override void CreateSinglePlayerSession() { if (CurrentSession != null) { throw new CoreException("Session is already running"); } IPAddress ipAddress; var host = NetUtility.GetMyAddress(out ipAddress); _networkSessionLocker = CreatingSession; LidgrenSession.BeginCreate(host.ToString(), SessionType.SinglePlayer, 1, 1, 0, new SessionProperties(), OnLidgrenSessionCreated, _networkSessionLocker); }