Example #1
0
        /// <summary>
        /// Goes the name of to room by.
        /// </summary>
        internal void GoToRoomByName()
        {
            string name = Request.GetString();

            switch (name)
            {
            case "predefined_noob_lobby":
                var roomFwd = new ServerMessage(LibraryParser.OutgoingRequest("RoomForwardMessageComposer"));
                roomFwd.AppendInteger(Convert.ToInt32(Plus.GetDbConfig().DbData["noob.lobby.roomid"]));
                Session.SendMessage(roomFwd);
                break;
            }
        }
Example #2
0
        /// <summary>
        /// Ambassadors the alert.
        /// </summary>
        internal void AmbassadorAlert()
        {
            if (Session.GetHabbo().Rank < Convert.ToUInt32(Plus.GetDbConfig().DbData["ambassador.minrank"]))
            {
                return;
            }
            uint       userId = Request.GetUInteger();
            GameClient user   = Plus.GetGame().GetClientManager().GetClientByUserId(userId);

            if (user == null)
            {
                return;
            }
            user.SendNotif("${notification.ambassador.alert.warning.message}", "${notification.ambassador.alert.warning.title}");
            Session.Shout("*Envia " + user.GetHabbo().UserName + " um alerta de embaixador*");
        }
Example #3
0
        /// <summary>
        /// Serializes the club.
        /// </summary>
        internal void SerializeClub()
        {
            var client        = GetClient();
            var serverMessage = new ServerMessage();

            serverMessage.Init(LibraryParser.OutgoingRequest("SubscriptionStatusMessageComposer"));
            serverMessage.AppendString("club_habbo");

            if (client == null)
            {
                return;
            }

            if (client.GetHabbo() == null)
            {
                return;
            }

            if (client.GetHabbo().GetSubscriptionManager() == null)
            {
                return;
            }

            if (client.GetHabbo().GetSubscriptionManager().HasSubscription)
            {
                double num  = client.GetHabbo().GetSubscriptionManager().GetSubscription().ExpireTime;
                var    num2 = num - Plus.GetUnixTimeStamp();

                {
                    var num3 = (int)Math.Ceiling(num2 / 86400.0);
                    var i    =
                        (int)
                        Math.Ceiling(
                            (

                                Plus.GetUnixTimeStamp() -
                                (double)client.GetHabbo().GetSubscriptionManager().GetSubscription().ActivateTime) /
                            86400.0);
                    var num4 = num3 / 31;
                    if (num4 >= 1)
                    {
                        num4--;
                    }
                    serverMessage.AppendInteger(num3 - num4 * 31);
                    serverMessage.AppendInteger(1);
                    serverMessage.AppendInteger(num4);
                    serverMessage.AppendInteger(1);
                    serverMessage.AppendBool(true);
                    serverMessage.AppendBool(true);
                    serverMessage.AppendInteger(i);
                    serverMessage.AppendInteger(i);
                    serverMessage.AppendInteger(10);
                }
            }
            else
            {
                serverMessage.AppendInteger(0);
                serverMessage.AppendInteger(0);
                serverMessage.AppendInteger(0);
                serverMessage.AppendInteger(0);
                serverMessage.AppendBool(false);
                serverMessage.AppendBool(false);
                serverMessage.AppendInteger(0);
                serverMessage.AppendInteger(0);
                serverMessage.AppendInteger(0);
            }
            client.SendMessage(serverMessage);
            var serverMessage2 = new ServerMessage(LibraryParser.OutgoingRequest("UserClubRightsMessageComposer"));

            serverMessage2.AppendInteger(GetSubscriptionManager().HasSubscription ? 2 : 0);
            serverMessage2.AppendInteger(Rank);
            serverMessage2.AppendBool((Rank == 4) ? false : Rank >= Convert.ToUInt32(Plus.GetDbConfig().DbData["ambassador.minrank"]));
            client.SendMessage(serverMessage2);
        }