Ejemplo n.º 1
0
		public void PM(Player source, string[] arguments)
		{
			if (arguments.Length >= 2)
			{
				Player target = getPlayer(arguments[0], source);
				if (target != source)
				{
					string message = string.Empty;
					for (int i = 1; i < arguments.Length; i++)
					{
						message += arguments[i];
					}
					target.SendMessage("[MailPE] " + source.Username + ": " + message);
					source.SendMessage("[MailPE] Message to " + target.Username + " was sent!");
				}
				else
				{
					source.SendMessage("[MailPE] Player not found!");
				}
			}
			else
			{
				source.SendMessage("[MailPE] Wrong command usage!");
			}
		}
Ejemplo n.º 2
0
        public void RegisterCommand(Player player, string password)
        {
            var userManager = Context.Server.UserManager;

            var user = userManager.FindByNameAsync(player.Username).Result;

            if (user == null)
            {
                if (password == null && password.IndexOf(' ') > -1)
                {
                    player.SendMessage($"Do not add any space in your password!");
                    return;
                }
                user = new User(player.Username);
                Context.Server.UserManager.CreateAsync(user, password);
                user.IsAuthenticated = true;
                userManager.UpdateAsync(user);
            }
            else if (user.IsAuthenticated)
            {
                player.SendMessage($"{ChatColors.Red}You has been Login!");
            }
            else if (Context.Server.UserManager.HasPasswordAsync(user.Id).Result)
            {
                player.SendMessage($"You has been register,Plz Type your password to login");
            }
        }
Ejemplo n.º 3
0
		public void ToggleDownfall(Player player)
		{
			ThreadPool.QueueUserWorkItem(delegate(object state)
			{
				for (int i = 0; i < short.MaxValue; i = i+2000)
				{
					var data = i;
					{
						McpeLevelEvent levelEvent = new McpeLevelEvent();
						levelEvent.eventId = 3001;
						levelEvent.data = data;
						player.SendPackage(levelEvent);
					}
					//{
					//	McpeLevelEvent levelEvent = new McpeLevelEvent();
					//	levelEvent.eventId = 3002;
					//	levelEvent.data = i;
					//	player.SendPackage(levelEvent);
					//}
					player.SendMessage("Downfall " + data, type: MessageType.Raw);
					Thread.Sleep(5000);
				}
				for (int i = short.MaxValue; i >= 0; i = i - 2000)
				{
					{
						McpeLevelEvent levelEvent = new McpeLevelEvent();
						levelEvent.eventId = 3001;
						levelEvent.data = i;
						player.SendPackage(levelEvent);
					}
					//{
					//	McpeLevelEvent levelEvent = new McpeLevelEvent();
					//	levelEvent.eventId = 3002;
					//	levelEvent.data = i;
					//	player.SendPackage(levelEvent);
					//}

					player.SendMessage("Downfall " + i, type: MessageType.Raw);
					Thread.Sleep(5000);
				}
			});

			//{
			//	McpeLevelEvent levelEvent = new McpeLevelEvent();
			//	levelEvent.eventId = 3001;
			//	levelEvent.data = 100000;
			//	player.SendPackage(levelEvent);
			//}
			//{
			//	McpeLevelEvent levelEvent = new McpeLevelEvent();
			//	levelEvent.eventId = 3002;
			//	levelEvent.data = 36625;
			//	player.SendPackage(levelEvent);
			//}
			player.SendMessage("Toggled downfall", type: MessageType.Raw);
		}
Ejemplo n.º 4
0
		public void ToggleDownfall(Player player, int value)
		{
			{
				McpeLevelEvent levelEvent = new McpeLevelEvent();
				levelEvent.eventId = 3001;
				levelEvent.data = value;
				player.SendPackage(levelEvent);
			}
			player.SendMessage("Downfall " + value, type: MessageType.Raw);
		}
Ejemplo n.º 5
0
		public void SetHome(Player source, string[] arguments)
		{
			if (PluginGlobals.Homes.ContainsKey(source))
			{
				PluginGlobals.Homes.Remove(source);
			}
			PlayerLocation p = source.KnownPosition;
			p.Y += 2; //Do not spawn underground....

			PluginGlobals.Homes.Add(source, p);
			source.SendMessage("[SetHome] Home set!");
		}
Ejemplo n.º 6
0
        public Package OnPlayerSendMessage(McpeText packet, Player player)
        {
            var userManager = Context.Server.UserManager;
            var user = userManager.FindByNameAsync(player.Username).Result;
            if (user != null)
            {
                if (user.IsAuthenticated)
                {
                    if (userManager.CheckPasswordAsync(user, packet.message).Result)
                    {
                        user.IsAuthenticated = true;
                        userManager.UpdateAsync(user);
                        player.SendMessage("you has been Logged");
                    }
                    else
                    {
                        player.SendMessage($"{ChatColors.Green}Check your password again,that have some error!");
                    }
                    packet.message = null;
                    return packet;
                }
                else
                {
                    return packet;
                }

            }
            else if (packet.message.StartsWith("/reg"))
            {
                return packet;
            }
            else
            {
                player.SendMessage($"{ChatColors.Green}Plz Register frist!");
                packet.message = null;
                return packet;
            }
        }
Ejemplo n.º 7
0
		public void Home(Player source, string[] arguments)
		{
			if (PluginGlobals.Homes.ContainsKey(source))
			{
				PlayerLocation pos = null;
				PluginGlobals.Homes.TryGetValue(source, out pos);
				if (pos != null)
				{
					source.SendMessage("[SetHome] Teleporting you to your home!");
					source.KnownPosition = pos;
					source.SendMovePlayer();
				}
				else
				{
					source.SendMessage("[SetHome] Something went wrong!");
				}
			}
			else
			{
				source.SendMessage("[SetHome] You don't have a home set!");
				source.SendMessage("[SetHome] Set a home with \"/sethome\" first!");
			}
		}
Ejemplo n.º 8
0
		//public void Pet(Player player, string type)
		public void Pet(Player player, string type, params string[] name)
		{
			//TODO: Fix space in pets name, too difficult damn..

			PetTypes petType;
			try
			{
				petType = (PetTypes) Enum.Parse(typeof (PetTypes), type, true);
			}
			catch (ArgumentException e)
			{
				return;
			}

			if (!Enum.IsDefined(typeof (PetTypes), petType))
			{
				player.SendMessage("No pet found");
				return;
			}

			string petName = null;
			if (name.Length > 0)
			{
				petName = string.Join(" ", name);
			}

			var entities = player.Level.GetEntites();
			foreach (var entity in entities)
			{
				Pet pet = entity as Pet;
				if (pet != null && pet.Owner == player)
				{
					pet.HealthManager.Kill();
					break;
				}
			}

			//ThreadPool.QueueUserWorkItem(delegate(object state)
			//{
			Pet newPet = new Pet(player, player.Level, (int) petType)
			{
				NameTag = petName,
				KnownPosition = (PlayerLocation) player.KnownPosition.Clone()
			};
			newPet.SpawnEntity();
			//});
		}
Ejemplo n.º 9
0
 public void Auth(Player player, string password)
 {
     if (!_registerlist.Contains(player.User))
     {
         player.User.IsAuthenticated = player.User.PasswordHash == GetPasswordHash(password);
         player.ClearPopups();
         player.AddPopup(new Popup()
         {
             Message = ChatColors.Green + "Добро пожаловать назад!.",
             Duration = 20 * 10,
             MessageType = MessageType.Popup
         });
     }
     else
     {
         player.SendMessage(ChatColors.Red + "Вы не зарегистрированы!!");
     }
 }
Ejemplo n.º 10
0
        public void Plugins(Player player)
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("Plugins: ");
            foreach (var plugin in Context.PluginManager.Plugins)
            {
                sb.AppendLine(plugin.GetType().Name);
            }

            player.SendMessage(sb.ToString(), type: MessageType.Raw);
        }
Ejemplo n.º 11
0
 public void PlayerInfo(Player player)
 {
     player.SendMessage(string.Format("Username={0}", player.Username), type: MessageType.Raw);
     player.SendMessage(string.Format("Entity ID={0}", player.EntityId), type: MessageType.Raw);
     player.SendMessage(string.Format("Client GUID={0}", player.ClientGuid), type: MessageType.Raw);
     player.SendMessage(string.Format("Client ID={0}", player.ClientId), type: MessageType.Raw);
 }
Ejemplo n.º 12
0
        public void VideoX(Player player, int numberOfFrames, bool color)
        {
            Task.Run(delegate
            {
                try
                {
                    Dictionary<Tuple<int, int>, MapEntity> entities = new Dictionary<Tuple<int, int>, MapEntity>();

                    int width = 1;
                    int height = 1;
                    int frameCount = numberOfFrames;
                    //int frameOffset = 0;
                    int frameOffset = 120;

                    var frameTicker = new FrameTicker(frameCount);

                    // 768x384
                    for (int frame = frameOffset; frame < frameCount + frameOffset; frame++)
                    {
                        Log.Info($"Generating frame {frame}");

                        string file = Path.Combine(@"D:\Development\Other\Smash Heroes 3x6 (128)\Smash Heroes 3x6 (128)", $"Smash Heroes Trailer{frame:D4}.bmp");
                        //string file = Path.Combine(@"D:\Development\Other\2 by 1 PE test app ad for Gurun-2\exported frames 2", $"pe app ad{frame:D2}.bmp");
                        if (!File.Exists(file)) continue;

                        Bitmap image = new Bitmap((Bitmap) Image.FromFile(file), width*128, height*128);

                        for (int x = 0; x < width; x++)
                        {
                            for (int y = 0; y < height; y++)
                            {
                                var key = new Tuple<int, int>(x, y);
                                if (!entities.ContainsKey(key))
                                {
                                    entities.Add(key, new MapEntity(player.Level) {ImageProvider = new VideoImageProvider(frameTicker)});
                                }

                                var croppedImage = CropImage(image, new Rectangle(new Point(x*128, y*128), new Size(128, 128)));
                                byte[] bitmapToBytes = BitmapToBytes(croppedImage, color);

                                if (bitmapToBytes.Length != 128*128*4) return;

                                ((VideoImageProvider) entities[key].ImageProvider).Frames.Add(CreateCachedPacket(entities[key].EntityId, bitmapToBytes));
                            }
                        }
                    }

                    int i = 0;

                    player.Inventory.Slots[i++] = new ItemBlock(new Planks(), 0) {Count = 64};
                    player.Inventory.Slots[i++] = new ItemItemFrame {Count = 64};

                    foreach (MapEntity entity in entities.Values)
                    {
                        entity.SpawnEntity();
                        player.Inventory.Slots[i++] = new ItemMap(entity.EntityId);
                    }

                    player.SendPlayerInventory();
                    player.SendMessage("Done generating video.", MessageType.Raw);
                }
                catch (Exception e)
                {
                    Log.Error("Aborted video generation", e);
                }
            });

            player.SendMessage("Generating video...", MessageType.Raw);
        }
Ejemplo n.º 13
0
        public void Video2X(Player player, int numberOfFrames, bool color)
        {
            Task.Run(delegate
            {
                try
                {
                    Dictionary<Tuple<int, int>, List<MapEntity>> entities = new Dictionary<Tuple<int, int>, List<MapEntity>>();

                    int width = 3;
                    int height = 2;
                    int frameCount = numberOfFrames;
                    //int frameOffset = 0;
                    int frameOffset = 120;

                    var frameTicker = new FrameTicker(frameCount);

                    // 768x384
                    for (int frame = frameOffset; frame < frameCount + frameOffset; frame++)
                    {
                        Log.Info($"Generating frame {frame}");

                        string file = Path.Combine(@"D:\Development\Other\Smash Heroes 3x6 (128)\Smash Heroes 3x6 (128)", $"Smash Heroes Trailer{frame:D4}.bmp");
                        //string file = Path.Combine(@"D:\Development\Other\2 by 1 PE test app ad for Gurun-2\exported frames 2", $"pe app ad{frame:D2}.bmp");
                        if (!File.Exists(file)) continue;

                        Bitmap image = new Bitmap((Bitmap) Image.FromFile(file), width*128, height*128);

                        for (int x = 0; x < width; x++)
                        {
                            for (int y = 0; y < height; y++)
                            {
                                var key = new Tuple<int, int>(x, y);
                                if (!entities.ContainsKey(key))
                                {
                                    entities.Add(key, new List<MapEntity>());
                                }

                                List<MapEntity> frames = entities[key];

                                var croppedImage = CropImage(image, new Rectangle(new Point(x*128, y*128), new Size(128, 128)));
                                byte[] bitmapToBytes = BitmapToBytes(croppedImage, color);

                                if (bitmapToBytes.Length != 128*128*4) return;

                                MapEntity entity = new MapEntity(player.Level);
                                entity.ImageProvider = new MapImageProvider {Batch = CreateCachedPacket(entity.EntityId, bitmapToBytes)};
                                entity.SpawnEntity();
                                frames.Add(entity);
                            }
                        }
                    }

                    int i = 0;

                    player.Inventory.Slots[i++] = new ItemBlock(new Planks(), 0) {Count = 64};

                    foreach (var entites in entities.Values)
                    {
                        player.Inventory.Slots[i++] = new CustomItemItemFrame(entites, frameTicker) {Count = 64};
                    }

                    player.SendPlayerInventory();
                    player.SendMessage("Done generating video.", MessageType.Raw);

                    BlockCoordinates center = player.KnownPosition.GetCoordinates3D();
                    var level = player.Level;

                    for (int x = 0; x < width; x++)
                    {
                        for (int y = 0; y < height; y++)
                        {
                            var key = new Tuple<int, int>(x, y);
                            List<MapEntity> frames = entities[key];

                            BlockCoordinates bc = new BlockCoordinates(center.X - x, center.Y + height - y - 1, center.Z + 2);
                            var wood = new Planks {Coordinates = bc};
                            level.SetBlock(wood);

                            BlockCoordinates frambc = new BlockCoordinates(center.X - x, center.Y + height - y - 1, center.Z + 1);
                            ItemFrameBlockEntity itemFrameBlockEntity = new ItemFrameBlockEntity
                            {
                                Coordinates = frambc
                            };

                            var itemFrame = new CustomItemFrame(frames, itemFrameBlockEntity, level, frameTicker) {Coordinates = frambc, Metadata = 3};
                            level.SetBlock(itemFrame);
                            level.SetBlockEntity(itemFrameBlockEntity);
                        }
                    }
                }
                catch (Exception e)
                {
                    Log.Error("Aborted video generation", e);
                }
            });

            player.SendMessage("Generating video...", MessageType.Raw);
        }
Ejemplo n.º 14
0
        public void Position(Player player)
        {
            BlockCoordinates position = new BlockCoordinates(player.KnownPosition);

            int chunkX = position.X >> 4;
            int chunkZ = position.Z >> 4;

            int xi = (chunkX%32);
            if (xi < 0) xi += 32;
            int zi = (chunkZ%32);
            if (zi < 0) zi += 32;

            StringBuilder sb = new StringBuilder();
            sb.AppendLine(string.Format("Region X:{0} Z:{1}", chunkX >> 5, chunkZ >> 5));
            sb.AppendLine(string.Format("Local chunk X:{0} Z:{1}", xi, zi));
            sb.AppendLine(string.Format("Chunk X:{0} Z:{1}", chunkX, chunkZ));
            sb.AppendLine(string.Format("Position X:{0:F1} Y:{1:F1} Z:{2:F1}", player.KnownPosition.X, player.KnownPosition.Y, player.KnownPosition.Z));
            sb.AppendLine(string.Format("Direction Yaw:{0:F1} HeadYap:{1:F1} Pitch:{2:F1}", player.KnownPosition.Yaw, player.KnownPosition.HeadYaw, player.KnownPosition.Pitch));
            string text = sb.ToString();

            player.SendMessage(text, type: MessageType.Raw);
            Log.Info(text);
        }
Ejemplo n.º 15
0
 public void test(Player player)
 {
     player.SendMessage(string.Format(ChatColors.Yellow + "Hi " + player.Username + " this is test command :-)"), type: MessageType.Raw);
     var inventory = player.Inventory;
     inventory.Boots = new ItemLeatherBoots();
     inventory.Leggings = new ItemLeatherLeggings();
     inventory.Chest = new ItemLeatherChestplate();
     inventory.Helmet = new ItemLeatherHelmet();
     player.SendPlayerInventory();
     SendArmorForPlayer(player);
 }
Ejemplo n.º 16
0
 public void Register(Player player, string password)
 {
     if (!_registerlist.Contains(player.User))
     {
         register(player, password);
     }
     else
     {
         player.SendMessage(ChatColors.Red + "Вы уже зарегистрированы!");
     }
 }
Ejemplo n.º 17
0
 public void Version(Player player)
 {
     string productVersion = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).ProductVersion;
     player.SendMessage(string.Format("MiNET v{0}", productVersion), type: MessageType.Raw);
 }
Ejemplo n.º 18
0
        public void Test1(Player player)
        {
            List<Pig> pigs = new List<Pig>();
            for (int i = 0; i < 10; i++)
            {
                Pig pig = new Pig(player.Level);
                pig.KnownPosition = (PlayerLocation)player.KnownPosition.Clone();
                pig.SpawnEntity();
                pigs.Add(pig);
            }
            player.SendMessage("Spawned pigs");

            Thread.Sleep(4000);

            PlayerLocation loc = (PlayerLocation)player.KnownPosition.Clone();
            loc.Y = loc.Y + 10;
            loc.X = loc.X + 10;
            loc.Z = loc.Z + 10;

            player.SendMessage("Moved pigs");

            Thread.Sleep(4000);

            foreach (var pig in pigs)
            {
                pig.KnownPosition = (PlayerLocation)loc.Clone();
                pig.LastUpdatedTime = DateTime.UtcNow;
            }

            player.SendMessage("Moved ALL pigs");
        }
Ejemplo n.º 19
0
 public void Params(Player player, params string[] args)
 {
     player.SendMessage($"Executed command params, got {args.Length} arguments", type: MessageType.Raw);
     foreach (string s in args)
     {
         player.SendMessage($"{s}", type: MessageType.Raw);
     }
 }
Ejemplo n.º 20
0
 public void NoDamage(Player player)
 {
     player.HealthManager = player.HealthManager is NoDamageHealthManager ? new HealthManager(player) : new NoDamageHealthManager(player);
     player.SendUpdateAttributes();
     player.SendMessage($"{player.Username} set NoDamage={player.HealthManager is NoDamageHealthManager}", type: McpeText.TypeRaw);
 }
Ejemplo n.º 21
0
        public void Kit(Player player, string kitName)
        {
            var inventory = player.Inventory;
            var InHandItem = inventory.GetItemInHand();

            if (!PlayersKitActivated.Contains(player.Username))
            {
                switch (kitName)
                {

                    case "Leather":
                        // Kit leather tier
                        inventory.Boots = new ItemLeatherBoots();
                        inventory.Leggings = new ItemLeatherLeggings();
                        inventory.Chest = new ItemLeatherChestplate();
                        inventory.Helmet = new ItemLeatherHelmet();
                        InHandItem = new ItemWoodenSword();
                        player.SendMessage(string.Format(ChatColors.Blue + "You have selected kit: Leather"), type: MessageType.Raw);
                        SendArmorForPlayer(player);
                        player.SendPlayerInventory();
                        //set player kit var to true.
                        PlayersKitActivated.Add(player.Username);
                        break;
                    case "Gold":
                        // Kit gold tier
                        inventory.Boots = new ItemGoldBoots();
                        inventory.Leggings = new ItemGoldLeggings();
                        inventory.Chest = new ItemGoldChestplate();
                        inventory.Helmet = new ItemGoldHelmet();
                        InHandItem = new ItemGoldSword();
                        player.SendMessage(string.Format(ChatColors.Blue + "You have selected kit: Gold"), type: MessageType.Raw);
                        SendArmorForPlayer(player);
                        player.SendPlayerInventory();
                        //set player kit var to true.
                        PlayersKitActivated.Add(player.Username);
                        break;
                    case "Chain":
                        // Kit chain tier
                        inventory.Boots = new ItemChainmailBoots();
                        inventory.Leggings = new ItemChainmailLeggings();
                        inventory.Chest = new ItemChainmailChestplate();
                        inventory.Helmet = new ItemChainmailHelmet();
                        InHandItem = new ItemStoneSword();
                        player.SendMessage(string.Format(ChatColors.Blue + "You have selected kit: Chain"), type: MessageType.Raw);
                        SendArmorForPlayer(player);
                        player.SendPlayerInventory();
                        //set player kit var to true.
                        PlayersKitActivated.Add(player.Username);
                        break;
                    case "Iron":
                        // Kit iron tier
                        inventory.Boots = new ItemIronBoots();
                        inventory.Leggings = new ItemIronLeggings();
                        inventory.Chest = new ItemIronChestplate();
                        inventory.Helmet = new ItemIronHelmet();
                        InHandItem = new ItemIronSword();
                        player.SendMessage(string.Format(ChatColors.Blue + "You have selected kit: Iron"), type: MessageType.Raw);
                        SendArmorForPlayer(player);
                        player.SendPlayerInventory();
                        //set player kit var to true.
                        PlayersKitActivated.Add(player.Username);
                        break;
                    case "Diamond":
                        // Kit diamond tier
                        inventory.Boots = new ItemDiamondBoots();
                        inventory.Leggings = new ItemDiamondLeggings();
                        inventory.Chest = new ItemDiamondChestplate();
                        inventory.Helmet = new ItemDiamondHelmet();
                        InHandItem = new ItemDiamondSword();
                        player.SendMessage(string.Format(ChatColors.Blue + "You have selected kit: Diamond"), type: MessageType.Raw);
                        SendArmorForPlayer(player);
                        player.SendPlayerInventory();
                        //set player kit var to true.
                        PlayersKitActivated.Add(player.Username);
                        break;
                }
            }
            else if (PlayersKitActivated.Contains(player.Username))
            {
                player.SendMessage(string.Format(ChatColors.Blue + "You have already selected a kit, only one kit per life."), type: MessageType.Raw);
            }
        }
Ejemplo n.º 22
0
        public void Position(Player player)
        {
            BlockCoordinates position = new BlockCoordinates(player.KnownPosition);

            int chunkX = position.X >> 4;
            int chunkZ = position.Z >> 4;

            int xi = (chunkX%32);
            if (xi < 0) xi += 32;
            int zi = (chunkZ%32);
            if (zi < 0) zi += 32;

            player.SendMessage(string.Format("Region X={0} Z={1}", chunkX >> 5, chunkZ >> 5), type: MessageType.Raw);
            player.SendMessage(string.Format("Local chunk X={0} Z={1}", xi, zi), type: MessageType.Raw);
            player.SendMessage(string.Format("Chunk X={0} Z={1}", chunkX, chunkZ), type: MessageType.Raw);
            player.SendMessage(string.Format("Position X={0:F1} Y={1:F1} Z={2:F1}", player.KnownPosition.X, player.KnownPosition.Y, player.KnownPosition.Z), type: MessageType.Raw);
        }
Ejemplo n.º 23
0
        public void Login(Player player, string password)
        {
            UserManager<User> userManager = player.Server.UserManager;
            if (userManager != null)
            {
                if (player.Username == null) return;

                User user = userManager.FindByName(player.Username);

                if (user == null)
                {
                    user = new User(player.Username);
                    if (!userManager.Create(user, password).Succeeded) return;
                }

                if (userManager.CheckPassword(user, password))
                {
                    player.SendMessage("Login successful");
                }
                else
                {
                    player.SendMessage("Login failed");
                }
            }
        }
Ejemplo n.º 24
0
 public void Stats(Player currentPlayer)
 {
     var players = Context.Levels[0].Players.Values.ToArray();
     currentPlayer.SendMessage("Statistics:", type: McpeText.TypeRaw);
     foreach (var player in players)
     {
         currentPlayer.SendMessage(string.Format("RTT: {1:0000} User: {0}", player.Username, player.Rtt), type: McpeText.TypeRaw);
     }
 }
Ejemplo n.º 25
0
        public Package McpeLogin(McpeLogin packet, Player player)
        {
            if (PlayersKitActivated.Contains(player.Username))
            {
                PlayersKitActivated.Remove(player.Username);
            }

            player.SendMessage(string.Format(ChatColors.Yellow + "Welcome " + player.Username), type: MessageType.Chat);

            player.AddPopup(new Popup()
            {
                Message = $"{ChatColors.Gold}Fury Is Godly At C# ~ USER: " + player.Username,
                Duration = 99999999,
                Priority = 1000
            });

            return packet;
        }
Ejemplo n.º 26
0
 public void Hi(Player player)
 {
     player.SendMessage(string.Format(ChatColors.Yellow + "Hi {0}!", player.Username), type: MessageType.Raw);
 }
Ejemplo n.º 27
0
        public void Count(Player player)
        {
            List<string> users = new List<string>();
            var levels = Context.Server.LevelManager.Levels;
            foreach (var level in levels)
            {
                foreach (var spawnedPlayer in level.GetSpawnedPlayers())
                {
                    users.Add(spawnedPlayer.Username);
                }
            }

            player.SendMessage($"There are {users.Count} of players online.");
        }