예제 #1
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);

            base.WriteInteger(Group.Id);
            base.WriteBoolean(true);
            base.WriteInteger(Group.GroupType == GroupType.OPEN ? 0 : Group.GroupType == GroupType.LOCKED ? 1 : 2);
            base.WriteString(Group.Name);
            base.WriteString(Group.Description);
            base.WriteString(Group.Badge);
            base.WriteInteger(Group.RoomId);
            base.WriteString((QuasarEnvironment.GetGame().GetRoomManager().GenerateRoomData(Group.RoomId) == null) ? "Oeps! Geen kamer gevonden.." : QuasarEnvironment.GetGame().GetRoomManager().GenerateRoomData(Group.RoomId).Name); // room name
            base.WriteInteger(Group.CreatorId == Session.GetHabbo().Id ? 3 : Group.HasRequest(Session.GetHabbo().Id) ? 2 : Group.IsMember(Session.GetHabbo().Id) ? 1 : 0);
            base.WriteInteger(Group.MemberCount);                                                                                                                                                                                       // Members
            base.WriteBoolean(false);                                                                                                                                                                                                   //?? CHANGED
            base.WriteString(Origin.Day + "-" + Origin.Month + "-" + Origin.Year);
            base.WriteBoolean(Group.CreatorId == Session.GetHabbo().Id);
            base.WriteBoolean(Group.IsAdmin(Session.GetHabbo().Id));                                                                                                                                      // admin
            base.WriteString(QuasarEnvironment.GetUsernameById(Group.CreatorId));
            base.WriteBoolean(NewWindow);                                                                                                                                                                 // Show group info
            base.WriteBoolean(Group.AdminOnlyDeco == 0);                                                                                                                                                  // Any user can place furni in home room
            base.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
            base.WriteBoolean(Group != null ? Group.ForumEnabled : true);                                                                                                                                 //HabboTalk.
        }
예제 #2
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(QuasarEnvironment.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] < QuasarEnvironment.GetUnixTimestamp())
                {
                    Room.MutedUsers.Remove(UserId);
                }
                else
                {
                    return;
                }
            }

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

            Target.GetClient().SendWhisper("Je hebt een spreekverbod voor " + Time + " minuten!");
            QuasarEnvironment.GetGame().GetAchievementManager().ProgressAchievement(Session, "ACH_SelfModMuteSeen", 1);
        }
예제 #3
0
        public string GetUsername()
        {
            if (IsBot)
            {
                return(string.Empty);
            }

            if (GetClient() != null)
            {
                if (GetClient().GetHabbo() != null)
                {
                    return(GetClient().GetHabbo().Username);
                }
                else
                {
                    return(QuasarEnvironment.GetUsernameById(HabboId));
                }
            }
            else
            {
                return(QuasarEnvironment.GetUsernameById(HabboId));
            }
        }