Example #1
0
        public void OpenGame(FullGameInfo game, NetPeer serverPeer)
        {
            if (HostedGame != null)
            {
                throw new InvalidOperationException("Already hosting a game");
            }

            HostedGame = game;
            OpenHostedGame(serverPeer);
            LastKeepalive = DateTime.Now;
        }
Example #2
0
        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);
        }
Example #3
0
        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;
            }
        }