コード例 #1
0
        public void OnSlashCommand(MessageEventArgs args, SlashCommand command)
        {
            // client sends "&gc info 1" on entering the world
            var split = command.Command.Split(' ');

            switch (split[0].ToLower(CultureInfo.InvariantCulture))
            {
            case "&quit":
                args.Session.Send(new Quit(false));
                break;

            case "&exit":
                args.Session.Send(new Quit(true));
                break;

            case "&speed":
                if (split.Length > 1 && ushort.TryParse(split[1], out ushort value))
                {
                    var speed = new CharacterSpeed(value, 100, false);
                    args.Session.Send(speed);
                }
                break;

            case "&up":
                if (split.Length > 1 && ushort.TryParse(split[1], out ushort height))
                {
                    var coords = _selected.Coordinates;
                    _selected.Coordinates = new Coordinates(coords.X, coords.Y, coords.Z + height, coords.Heading);
                    var position = new PositionAndObjectId(_selected);
                    args.Session.Send(position);
                }
                break;
            }
        }
コード例 #2
0
        public void OnWorldInit(MessageEventArgs args, WorldInitRequest request)
        {
            // DoL sends a ton of messages here
            // most of these are sent in WorldInitRequestHandler.cs
            // not sure where AddFriend and the last CharacterStatusUpdate come from

            // AddFriend - ???
            // PositionAndObjectId
            // Encumberance
            // MaxSpeed
            // MaxSpeed
            // CharacterStatusUpdate
            // InventoryUpdate (equipment)
            // InventoryUpdate (inventory)
            // VariousUpdate (skills)
            // VariousUpdate (crafting skills)
            // DelveInfo times a million ("update player")
            // VariousUpdate (apparently part of "update player")
            // MoneyUpdate
            // StatsUpdate
            // VariousUpdate (resists, icons, weapon and armor stats)
            // QuestEntry
            // CharacterStatusUpdate
            // CharacterPointsUpdate
            // Encumberance
            // ConcentrationList
            // CharacterStatusUpdate - ???
            // ObjectGuildId
            // DebugMode
            // MaxSpeed
            // ControlledHorse

            var position = new PositionAndObjectId(_selected);

            args.Session.Send(position);
            var debug = new DebugMode();

            args.Session.Send(debug);
        }