Esempio n. 1
0
        private string ConnectionPlayersCommand(int id)
        {
            if (!Server.ConnectionStorage.ConnectionExists(id))
            {
                return("No connection with id " + id + " found!");
            }

            var connection = Server.ConnectionStorage.GetConnectionById(id);

            if (Data.IsSynchronized(connection))
            {
                return("Connection is not synchronized with player module!");
            }

            var playerInfo = Data.GetPlayerInfo(connection);


            string output = "Players on connection " + id + " (" + playerInfo.Players.Count + ")";

            if (playerInfo.Players.Count != 0)
            {
                output += "\n   ";
            }

            output += String.Join("\n   ", playerInfo.Players.Select(p => p.ToLongString()));

            return(output);
        }