Esempio n. 1
0
        public bool Handle(RoomUser user, Team team, RoomItem item)
        {
            if (user != null && !user.IsBot && user.GetClient() != null)
            {
                GenericTriggerWithModes.DoAnimation(this.item);
                ServerMessage servermsg = PacketHandelingManager.GetRecycledItem(OutputCode.WhisperMessageEvent);
                servermsg.AddInt32(user.VirtualId);
                servermsg.AddString(message);

                servermsg.AddInt32(0);
                servermsg.AddInt32(0);
                servermsg.AddInt32(0);
                servermsg.AddInt32(-1);

                user.GetClient().SendMessage(servermsg);
                handler.OnEvent(this.item.Id);
                return true;
            }
            else if (user == null)
            {
                return false;
            }
            return false;
        }
Esempio n. 2
0
File: Room.cs Progetto: habb0/Bfly
        internal void TryStartTrade(RoomUser UserOne, RoomUser UserTwo)
        {
            if (UserOne == null || UserTwo == null || UserOne.IsBot || UserTwo.IsBot || UserOne.IsTrading || UserTwo.IsTrading || HasActiveTrade(UserOne) || HasActiveTrade(UserTwo))
                return;

            ActiveTrades.Add(new Trade(UserOne.GetClient().GetHabbo().Id, UserTwo.GetClient().GetHabbo().Id, RoomId));
        }
Esempio n. 3
0
File: Room.cs Progetto: habb0/Bfly
        internal bool HasActiveTrade(RoomUser User)
        {
            if (User.IsBot)
                return false;

            return HasActiveTrade(User.GetClient().GetHabbo().Id);
        }
Esempio n. 4
0
File: Room.cs Progetto: BjkGkh/R106
        internal void TryStartTrade(RoomUser UserOne, RoomUser UserTwo)
        {
            if (UserOne == null || UserTwo == null || UserOne.IsBot || UserTwo.IsBot || UserOne.IsTrading || UserTwo.IsTrading || HasActiveTrade(UserOne) || HasActiveTrade(UserTwo)
				|| UserOne.GetClient() == null || UserTwo.GetClient() == null || UserOne.GetClient().GetHabbo() == null || UserTwo.GetClient().GetHabbo() == null)
                return;

			Trade trade = new Trade(UserOne.GetClient().GetHabbo().Id, UserTwo.GetClient().GetHabbo().Id, RoomId);

			UserOne.PrepareTrade();
			UserTwo.PrepareTrade();

            ServerMessage message = PacketHandelingManager.GetRecycledItem(OutputCode.TradingOpenEvent);
			message.AddUInt32(UserOne.userID);
            message.AddInt32(1);
            message.AddUInt32(UserTwo.userID);
            message.AddInt32(1);
			trade.SendMessageToUsers(message);

			ActiveTrades.Add(trade);
        }
Esempio n. 5
0
        public bool HasActiveTrade(RoomUser User)
        {
            if (User.IsBot)
            {
                return false;
            }

            return HasActiveTrade(User.GetClient().GetHabbo().Id);
        }
Esempio n. 6
0
        public Trade GetUserTrade(RoomUser User)
        {
            if (User.IsBot)
            {
                return null;
            }

            return GetUserTrade(User.GetClient().GetHabbo().Id);
        }
Esempio n. 7
0
 public void BallProcess(RoomItem ItemNow, RoomUser UserNow)
 {
     Thread.Sleep(500);
     int NewX = 0;
     int NewY = 0;
     int Rot = UserNow.RotBody;
     if (Rot == 3)
     {
         NewX = UserNow.X + 2;
         NewY = UserNow.Y + 2;
     }
     if (Rot == 4)
     {
         NewX = UserNow.X;
         NewY = UserNow.Y + 2;
     }
     if (Rot == 1)
     {
         NewX = UserNow.X + 2;
         NewY = UserNow.Y - 2;
     }
     if (Rot == 2)
     {
         NewX = UserNow.X + 2;
         NewY = UserNow.Y;
     }
     if (Rot == 0)
     {
         NewX = UserNow.X;
         NewY = UserNow.Y - 2;
     }
     if (Rot == 5)
     {
         NewX = UserNow.X - 2;
         NewY = UserNow.Y + 2;
     }
     if (Rot == 6)
     {
         NewX = UserNow.X - 2;
         NewY = UserNow.Y;
     }
     if (Rot == 7)
     {
         NewX = UserNow.X - 2;
         NewY = UserNow.Y - 2;
     }
     SetFloorItem(UserNow.GetClient(), ItemNow, NewX, NewY, ItemNow.Rot, false);
 }
Esempio n. 8
0
        public void AddUserToRoom(GameClient Session, bool Spectator)
        {
            RoomUser User = new RoomUser(Session.GetHabbo().Id, RoomId, UserCounter++);

            if (Spectator)
            {
                User.IsSpectator = true;
            }
            else
            {
                User.SetPos(Model.DoorX, Model.DoorY, Model.DoorZ);
                User.SetRot(Model.DoorOrientation);

                if (CheckRights(Session, true))
                {
                    User.AddStatus("flatcrtl", "useradmin");
                }
                else if (CheckRights(Session))
                {
                    User.AddStatus("flatcrtl", "");
                }

                if (!User.IsBot && User.GetClient().GetHabbo().IsTeleporting)
                {
                    RoomItem Item = GetItem(User.GetClient().GetHabbo().TeleporterId);

                    if (Item != null)
                    {
                        User.SetPos(Item.X, Item.Y, Item.Z);
                        User.SetRot(Item.Rot);

                        Item.InteractingUser2 = Session.GetHabbo().Id;
                        Item.ExtraData = "2";
                        Item.UpdateState(false, true);
                    }
                }

                User.GetClient().GetHabbo().IsTeleporting = false;
                User.GetClient().GetHabbo().TeleporterId = 0;

                ServerPacket EnterMessage = new ServerPacket(28);
                EnterMessage.AppendInt32(1);
                User.Serialize(EnterMessage);
                SendMessage(EnterMessage);
            }

            UserList.Add(User);
            Session.GetHabbo().OnEnterRoom(Id);

            if (!Spectator)
            {
                UpdateUserCount();

                foreach (RoomUser Usr in UserList)
                {
                    if (!Usr.IsBot)
                    {
                        continue;
                    }

                    Usr.BotAI.OnUserEnterRoom(User);
                }
            }
        }
Esempio n. 9
0
        public void TryStartTrade(RoomUser UserOne, RoomUser UserTwo)
        {
            if (UserOne == null || UserTwo == null || UserOne.IsBot || UserTwo.IsBot || UserOne.IsTrading || UserTwo.IsTrading || HasActiveTrade(UserOne) || HasActiveTrade(UserTwo))
            {
                if (HasActiveTrade(UserTwo) && !UserOne.IsTrading)
                {
                    UserOne.GetClient().SendNotif("This user is already trading with someone else.");
                }

                return;
            }

            ActiveTrades.Add(new Trade(UserOne.GetClient().GetHabbo().Id, UserTwo.GetClient().GetHabbo().Id, RoomId));
        }