public void Run(Client client, MessageEvent msgEvent)
        {
            msgEvent.ReadVL64();
            int id = msgEvent.ReadVL64();

            msgEvent.ReadVL64();

            Room room = Engine.Locator.RoomController.GetRoom(id);

            if (room == null)
            {
                return;
            }

            if (client.CurrentRoomId != 0 &&
                Engine.Locator.RoomController.Rooms.TryGetValue(client.CurrentRoomId, out Room currentRoom))
            {
                currentRoom.RemoveActor(client.UserActor, false);
            }

            client.LoadingRoomId = id;

            MessageComposer fuseResponse = new MessageComposer(166);

            fuseResponse.AppendString("/client/public/" + room.Model + "/0", 0);
            client.SendComposer(fuseResponse);

            client.SendComposer(new RoomReadyMessageComposer(id, room.Model));
        }
 public static void SerializeRoom(Room room, MessageComposer composer)
 {
     composer.AppendVL64(room.Id);
     composer.AppendVL64(false); // events
     composer.AppendString(room.Name);
     composer.AppendString(room.Owner);
     composer.AppendVL64((int)room.State);
     composer.AppendVL64(room.PlayersIn);
     composer.AppendVL64(room.PlayersMax);
     composer.AppendString(room.Description);
     composer.AppendVL64(0);
     composer.AppendVL64(Engine.Locator.NavigatorController.Categories[room.CategoryId].TradeAllowed);
     composer.AppendVL64(0); // score
     composer.AppendVL64(0); // tags
     composer.AppendString("");
     composer.AppendVL64(0);
     composer.AppendString(room.Icon, 0);
 }
Пример #3
0
        public void Invoke(Client client, params object[] args)
        {
            MessageComposer composer = new MessageComposer(139);

            composer.AppendString(string.Join(" ", args) + "\r\n - " + client.Player.Username);

            foreach (Client target in Engine.Locator.ClientController.Clients.Values)
            {
                target.SendComposer(composer);
            }
        }