Exemplo n.º 1
0
        public VirtualRoomUser GenerateRoomUser(Client Client)
        {
            if (!Client.IsValidUser)
            {
                return null;
            }

            VirtualRoomUser User = new VirtualRoomUser(VirtualIdCounter.Next, Client.GetUser().HabboId, RoomId, GetRoom().GetRoomModel().DoorRot);
            User.UpdatePoint(GetRoom().GetRoomModel().Door);

            Response EnterMessage = new Response(28);
            EnterMessage.AppendInt32(1); // Amount, just 1
            User.GetResponse(EnterMessage);
            BroadcastResponse(EnterMessage);

            User.GetClient().GetUser().AtEnterRoom(RoomId);

            lock (RoomUsers)
            {
                RoomUsers.Add(User.VirtualId, User);
            }

            return User;
        }
Exemplo n.º 2
0
        public VirtualRoomUser GenerateRoomPet(int PetId, iPoint Place, int Rot)
        {
            VirtualRoomUser User = new VirtualRoomUser(VirtualIdCounter.Next, PetId, RoomId, Rot);
            User.UpdatePoint(Place);

            User.Point.Z = GetTileHeight(Place);

            Response EnterMessage = new Response(28);
            EnterMessage.AppendInt32(1); // Amount, just 1
            User.GetResponse(EnterMessage);
            BroadcastResponse(EnterMessage);

            lock (RoomPets)
            {
                RoomPets.Add(User.VirtualId, User);
            }

            BrickEngine.GetPetReactor().GetPetInfo(PetId).X = Place.X;
            BrickEngine.GetPetReactor().GetPetInfo(PetId).Y = Place.Y;
            BrickEngine.GetPetReactor().GetPetInfo(PetId).Rot = Rot;

            return User;
        }