Ejemplo n.º 1
0
        public async Task <bool> AddServerAsync(IPEndPoint endpoint, ulong guildID, ulong channelID)
        {
            var server = new GameServer {
                GameServerType = gameServerType, ServerIP = endpoint, GuildID = guildID, ChannelID = channelID
            };
            bool success = await PostServerInfoAsync(server).ConfigureAwait(false);

            if (success)
            {
                dbContext.Add(server);
                await dbContext.SaveChangesAsync().ConfigureAwait(false);
            }
            return(success);
        }
Ejemplo n.º 2
0
        public async Task <bool> AddServerAsync(IPEndPoint endpoint, ulong guildID, ulong channelID)
        {
            var server = new GameServer {
                GameServerType = _gameServerType, ServerIP = endpoint, GuildID = guildID, ChannelID = channelID
            };
            bool success = await PostServerInfoAsync(server);

            if (success && !_dbContext.GameServers.Contains(server))
            {
                _dbContext.Add(server);
                await _dbContext.SaveChangesAsync();
            }
            return(success);
        }