Ejemplo n.º 1
0
 public static void HandleAdminQuietCommandMessage(WorldClient client, AdminQuietCommandMessage message)
 {
     if (client.UserGroup.Role >= RoleEnum.GameMaster_Padawan)
     {
         string[] array = message.content.Split(new char[]
         {
             ' '
         });
         string text  = array[0];
         string text2 = text;
         if (text2 != null)
         {
             if (!(text2 == "look"))
             {
                 if (text2 == "moveto")
                 {
                     string arg = array[1];
                     ServerBase <WorldServer> .Instance.CommandManager.HandleCommand(new TriggerConsole(string.Format("go {0}", arg), client.Character));
                 }
             }
             else
             {
                 ServerBase <WorldServer> .Instance.CommandManager.HandleCommand(new TriggerConsole("look " + array[2], client.Character));
             }
         }
     }
 }
Ejemplo n.º 2
0
        public static void HandleAdminQuietCommandMessage(WorldClient client, AdminQuietCommandMessage message)
        {
            if (!client.UserGroup.IsGameMaster)
            {
                return;
            }

            var data    = message.content.Split(' ');
            var command = data[0];

            switch (command)
            {
            case ("look"):
            {
                WorldServer.Instance.CommandManager.HandleCommand(new TriggerConsole("look " + data[2], client.Character));
                break;
            }

            case ("moveto"):
            {
                var id = data[1];

                WorldServer.Instance.CommandManager.HandleCommand(
                    new TriggerConsole(string.Format("go {0}", id), client.Character));
                break;
            }
            }
        }
Ejemplo n.º 3
0
 public static void HandleAdminQuietCommandMessage(GameClient client, AdminQuietCommandMessage message)
 {
     if (message.content.Contains("move"))
     {
         string[] pos = message.content.Remove(0, 7).Split(',');
         client.Character.Teleport(Functions.GetMapIdFromCoord(0, int.Parse(pos[0]), int.Parse(pos[1])), client.Character.CellId);
     }
 }
Ejemplo n.º 4
0
        //5662
        public static void HandleTP(BigEndianReader reader, WorldClient client, WorldServer server)
        {
            AdminQuietCommandMessage message = new AdminQuietCommandMessage();

            message.Unpack(reader);
            if (message.content.Contains("moveto"))
            {
                int position = int.TryParse(message.content.Remove(0, 6), out int pos) ? int.Parse(message.content.Remove(0, 6)) : -1;
                if (position != -1)
                {
                    client.Send(new CurrentMapMessage(position));
                }
            }
        }
Ejemplo n.º 5
0
        public void AdminQuietCommandMessageFrame(WorldClient client, AdminQuietCommandMessage adminQuietCommandMessage)
        {
            Console.WriteLine(adminQuietCommandMessage.content);
            string[] content = adminQuietCommandMessage.content.Split(" ");

            int.TryParse(content[1], out int mapId);

            if (mapId != 0 && mapId != null)
            {
                client.ActiveCharacter.MapId = mapId;

                client.SendPacket(new GameContextDestroyMessage());
                client.SendPacket(new GameContextCreateMessage(1));

                client.SendPacket(new CurrentMapMessage(client.ActiveCharacter.MapId, "649ae451ca33ec53bbcbcc33becf15f4"));
            }
        }
Ejemplo n.º 6
0
 public static void HandleAdminQuietCommand(AdminQuietCommandMessage message, WorldClient client)
 {
     if (client.Account.Role >= ServerRoleEnum.Administrator && !client.Character.Busy)
     {
         if (message.content.StartsWith(QUIET_TELEPORT))
         {
             int mapid;
             if (int.TryParse(message.content.Split(null).Last(), out mapid))
             {
                 client.Character.Teleport(mapid);
             }
         }
         else
         {
             client.Character.ReplyError("Unknown command: " + message.content);
         }
     }
 }
 public static void HandleAdminQuietCommand(AdminQuietCommandMessage message, WorldClient client)
 {
     if (message.content.StartsWith("moveto") && !client.Character.IsFighting && client.Account.Role >= ServerRoleEnum.ADMINISTRATOR)
     {
         int mapid;
         if (int.TryParse(message.content.Split(null).Last(), out mapid))
         {
             var map = MapRecord.GetMap(mapid);
             if (map.WalkableCells.Contains(client.Character.Record.CellId))
             {
                 client.Character.Teleport(mapid);
             }
             else
             {
                 client.Character.Teleport(mapid, map.RandomWalkableCell());
             }
         }
     }
 }
Ejemplo n.º 8
0
 public static void HandleAdminQuietCommandMessage(Client client, AdminQuietCommandMessage message)
 {
     ConsoleUtils.Write(ConsoleUtils.Type.INFO, message.content);
 }