public void OpenGame(FullGameInfo game, NetPeer serverPeer) { if (HostedGame != null) { throw new InvalidOperationException("Already hosting a game"); } HostedGame = game; OpenHostedGame(serverPeer); LastKeepalive = DateTime.Now; }
public FullGameInfo MakeGameInfo(string name, bool isPrivate) { var id = GetRandomString(); var secret = GetRandomString(); var game = new FullGameInfo { Name = name, IsPrivate = isPrivate, PublicId = id, Secret = secret }; return(game); }
private bool disposedValue = false; // To detect redundant calls protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { //GameListTask?.Dispose(); GameListTask = null; UpdatedOnlineGameList = null; HostedGame = null; } // TODO: free unmanaged resources (unmanaged objects) and override a finalizer below. // TODO: set large fields to null. disposedValue = true; } }