Beispiel #1
0
        public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
        {
            int    UserId    = Packet.PopInt();
            int    RoomId    = Packet.PopInt();
            int    Time      = Packet.PopInt();
            string HotelName = CloudServer.HotelName;

            Room     Room   = Session.GetHabbo().CurrentRoom;
            RoomUser Target = Room.GetRoomUserManager().GetRoomUserByHabbo(CloudServer.GetUsernameById(UserId));

            if (Target == null)
            {
                return;
            }

            long nowTime     = CloudServer.CurrentTimeMillis();
            long timeBetween = nowTime - Session.GetHabbo()._lastTimeUsedHelpCommand;

            if (timeBetween < 60000)
            {
                Session.SendMessage(RoomNotificationComposer.SendBubble("Abuso", "Espere pelo menos 1 minuto para enviar um alerta de novo.", ""));
                return;
            }

            else
            {
                CloudServer.GetGame().GetClientManager().StaffAlert(RoomNotificationComposer.SendBubble("advice", "" + Session.GetHabbo().Username + " acaba de mandar um alerta embaixador a " + Target.GetClient().GetHabbo().Username + ", clique aqui para ir.", "event:navigator/goto/" + Session.GetHabbo().CurrentRoomId));
            }
            Target.GetClient().SendMessage(new BroadcastMessageAlertComposer("<b><font size='15px' color='#c40101'>Mensagem de embaixadores<br></font></b>embaixadores de " + HotelName + " considerar que o seu comportamento não é o melhor. Por favor, reconsidere a sua atitude, antes de um moderador tomar medidas."));

            Session.GetHabbo()._lastTimeUsedHelpCommand = nowTime;
        }
Beispiel #2
0
        public GroupInfoComposer(Group Group, GameClient Session, bool NewWindow = false)
            : base(ServerPacketHeader.GroupInfoMessageComposer)
        {
            DateTime Origin = new DateTime(1970, 1, 1, 0, 0, 0, 0).AddSeconds(Group.CreateTime);

            WriteInteger(Group.Id);
            WriteBoolean(true);
            WriteInteger(Group.GroupType == GroupType.OPEN ? 0 : Group.GroupType == GroupType.LOCKED ? 1 : 2);
            WriteString(Group.Name);
            WriteString(Group.Description);
            WriteString(Group.Badge);
            WriteInteger(Group.RoomId);
            WriteString((CloudServer.GetGame().GetRoomManager().GenerateRoomData(Group.RoomId) == null) ? "Nenhum quarto encontrado ..." : CloudServer.GetGame().GetRoomManager().GenerateRoomData(Group.RoomId).Name); // room name
            WriteInteger(Group.CreatorId == Session.GetHabbo().Id ? 3 : Group.HasRequest(Session.GetHabbo().Id) ? 2 : Group.IsMember(Session.GetHabbo().Id) ? 1 : 0);
            WriteInteger(Group.MemberCount);                                                                                                                                                                            // Members
            WriteBoolean(false);                                                                                                                                                                                        //?? CHANGED
            WriteString(Origin.Day + "-" + Origin.Month + "-" + Origin.Year);
            WriteBoolean(Group.CreatorId == Session.GetHabbo().Id);
            WriteBoolean(Group.IsAdmin(Session.GetHabbo().Id));                                                                                                                                      // admin
            WriteString(CloudServer.GetUsernameById(Group.CreatorId));
            WriteBoolean(NewWindow);                                                                                                                                                                 // Show group info
            WriteBoolean(Group.AdminOnlyDeco == 0);                                                                                                                                                  // Any user can place furni in home room
            WriteInteger(Group.CreatorId == Session.GetHabbo().Id ? Group.RequestCount : Group.IsAdmin(Session.GetHabbo().Id) ? Group.RequestCount : Group.IsMember(Session.GetHabbo().Id) ? 0 : 0); // Pending users
            //base.WriteInteger(0);//what the f**k
            WriteBoolean(Group != null ? Group.ForumEnabled : true);                                                                                                                                 //HabboTalk.
        }
Beispiel #3
0
        public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
        {
            if (!Session.GetHabbo().InRoom)
            {
                return;
            }

            int UserId = Packet.PopInt();
            int RoomId = Packet.PopInt();
            int Time   = Packet.PopInt();

            Room Room = Session.GetHabbo().CurrentRoom;

            if (Room == null)
            {
                return;
            }

            if (((Room.WhoCanMute == 0 && !Room.CheckRights(Session, true) && Room.Group == null) || (Room.WhoCanMute == 1 && !Room.CheckRights(Session)) && Room.Group == null) || (Room.Group != null && !Room.CheckRights(Session, false, true)))
            {
                return;
            }

            RoomUser Target = Room.GetRoomUserManager().GetRoomUserByHabbo(CloudServer.GetUsernameById(UserId));

            if (Target == null)
            {
                return;
            }
            else if (Target.GetClient().GetHabbo().GetPermissions().HasRight("mod_tool"))
            {
                return;
            }

            if (Room.MutedUsers.ContainsKey(UserId))
            {
                if (Room.MutedUsers[UserId] < CloudServer.GetUnixTimestamp())
                {
                    Room.MutedUsers.Remove(UserId);
                }
                else
                {
                    return;
                }
            }

            Room.MutedUsers.Add(UserId, (CloudServer.GetUnixTimestamp() + (Time * 60)));

            Target.GetClient().SendWhisper("O proprietário da sala silenciou por " + Time + " minutos!");
            CloudServer.GetGame().GetAchievementManager().ProgressAchievement(Session, "ACH_SelfModMuteSeen", 1);
        }
Beispiel #4
0
        public string GetUsername()
        {
            if (IsBot)
            {
                return(string.Empty);
            }

            if (GetClient() != null)
            {
                if (GetClient().GetHabbo() != null)
                {
                    return(GetClient().GetHabbo().Username);
                }
                else
                {
                    return(CloudServer.GetUsernameById(HabboId));
                }
            }
            else
            {
                return(CloudServer.GetUsernameById(HabboId));
            }
        }
Beispiel #5
0
        private void WriteUser(RoomUser User)
        {
            if (!User.IsPet && !User.IsBot)
            {
                Habbo Habbo = User.GetClient().GetHabbo();

                Group Group = null;
                if (Habbo != null)
                {
                    if (Habbo.GetStats() != null)
                    {
                        if (Habbo.GetStats().FavouriteGroupId > 0)
                        {
                            if (!CloudServer.GetGame().GetGroupManager().TryGetGroup(Habbo.GetStats().FavouriteGroupId, out Group))
                            {
                                Group = null;
                            }
                        }
                    }
                }

                if (Habbo.PetId == 0)
                {
                    base.WriteInteger(Habbo.Id);
                    base.WriteString(Habbo.Username);
                    base.WriteString(Habbo.Motto);
                    base.WriteString(Habbo.Look);
                    base.WriteInteger(User.VirtualId);
                    base.WriteInteger(User.X);
                    base.WriteInteger(User.Y);
                    base.WriteDouble(User.Z);

                    base.WriteInteger(0); //2 for user, 4 for bot.
                    base.WriteInteger(1); //1 for user, 2 for pet, 3 for bot.
                    base.WriteString(Habbo.Gender.ToLower());

                    if (Group != null)
                    {
                        base.WriteInteger(Group.Id);
                        base.WriteInteger(0);
                        base.WriteString(Group.Name);
                    }
                    else
                    {
                        base.WriteInteger(0);
                        base.WriteInteger(0);
                        base.WriteString("");
                    }

                    base.WriteString("");                                  //Whats this?
                    base.WriteInteger(Habbo.GetStats().AchievementPoints); //Achievement score
                    base.WriteBoolean(false);                              //Builders club?
                }
                else if (Habbo.PetId > 0 && Habbo.PetId != 100)
                {
                    base.WriteInteger(Habbo.Id);
                    base.WriteString(Habbo.Username);
                    base.WriteString(Habbo.Motto);
                    base.WriteString(PetFigureForType(Habbo.PetId));

                    base.WriteInteger(User.VirtualId);
                    base.WriteInteger(User.X);
                    base.WriteInteger(User.Y);
                    base.WriteDouble(User.Z);
                    base.WriteInteger(0);
                    base.WriteInteger(2);             //Pet.

                    base.WriteInteger(Habbo.PetId);   //pet type.
                    base.WriteInteger(Habbo.Id);      //UserId of the owner.
                    base.WriteString(Habbo.Username); //Username of the owner.
                    base.WriteInteger(1);
                    base.WriteBoolean(false);         //Has saddle.
                    base.WriteBoolean(false);         //Is someone riding this horse?
                    base.WriteInteger(0);
                    base.WriteInteger(0);
                    base.WriteString("");
                }
                else if (Habbo.PetId > 0 && Habbo.PetId == 100)
                {
                    base.WriteInteger(Habbo.Id);
                    base.WriteString(Habbo.Username);
                    base.WriteString(Habbo.Motto);
                    base.WriteString(Habbo.Look.ToLower());
                    base.WriteInteger(User.VirtualId);
                    base.WriteInteger(User.X);
                    base.WriteInteger(User.Y);
                    base.WriteDouble(User.Z);
                    base.WriteInteger(0);
                    base.WriteInteger(4);

                    base.WriteString(Habbo.Gender.ToLower()); // ?
                    base.WriteInteger(Habbo.Id);              //Owner Id
                    base.WriteString(Habbo.Username);         // Owner name
                    base.WriteInteger(0);                     //Action Count
                }
            }
            else if (User.IsPet)
            {
                base.WriteInteger(User.BotAI.BaseId);
                base.WriteString(User.BotData.Name);
                base.WriteString(User.BotData.Motto);

                //base.WriteString("26 30 ffffff 5 3 302 4 2 201 11 1 102 12 0 -1 28 4 401 24");
                base.WriteString(User.BotData.Look.ToLower() + ((User.PetData.Saddle > 0) ? " 3 2 " + User.PetData.PetHair + " " + User.PetData.HairDye + " 3 " + User.PetData.PetHair + " " + User.PetData.HairDye + " 4 " + User.PetData.Saddle + " 0" : " 2 2 " + User.PetData.PetHair + " " + User.PetData.HairDye + " 3 " + User.PetData.PetHair + " " + User.PetData.HairDye + ""));

                base.WriteInteger(User.VirtualId);
                base.WriteInteger(User.X);
                base.WriteInteger(User.Y);
                base.WriteDouble(User.Z);
                base.WriteInteger(0);
                base.WriteInteger((User.BotData.AiType == BotAIType.PET) ? 2 : 4);
                base.WriteInteger(User.PetData.Type);
                base.WriteInteger(User.PetData.OwnerId);  // userid
                base.WriteString(User.PetData.OwnerName); // username
                base.WriteInteger(1);
                base.WriteBoolean(User.PetData.Saddle > 0);
                base.WriteBoolean(User.RidingHorse);
                base.WriteInteger(0);
                base.WriteInteger(0);
                base.WriteString("");
            }
            else if (User.IsBot)
            {
                base.WriteInteger(User.BotAI.BaseId);
                base.WriteString(User.BotData.Name);
                base.WriteString(User.BotData.Motto);
                base.WriteString(User.BotData.Look.ToLower());
                base.WriteInteger(User.VirtualId);
                base.WriteInteger(User.X);
                base.WriteInteger(User.Y);
                base.WriteDouble(User.Z);
                base.WriteInteger(0);
                base.WriteInteger((User.BotData.AiType == BotAIType.PET) ? 2 : 4);

                base.WriteString(User.BotData.Gender.ToLower());                     // ?
                base.WriteInteger(User.BotData.ownerID);                             //Owner Id
                base.WriteString(CloudServer.GetUsernameById(User.BotData.ownerID)); // Owner name
                base.WriteInteger(5);                                                //Action Count
                base.WriteShort(1);                                                  //Copy looks
                base.WriteShort(2);                                                  //Setup speech
                base.WriteShort(3);                                                  //Relax
                base.WriteShort(4);                                                  //Dance
                base.WriteShort(5);                                                  //Change name
            }
        }