コード例 #1
0
        internal static void ProcessSubscriptionDataRequest(Habbo sender, IncomingMessage message)
        {
            ClassicIncomingMessage classicMessage = (ClassicIncomingMessage)message;
            string subscriptionName = classicMessage.PopPrefixedString();

            // Only "club_habbo" is valid for this client.
            if (subscriptionName != "club_habbo")
            {
                return;
            }


            SubscriptionData data = sender.Subscriptions[subscriptionName];

            new MSubscriptionData
            {
                SubscriptionName = subscriptionName,
                CurrentDay       = data.Expired.Days % 31,
                ElapsedMonths    = data.Expired.Days / 31,
                PrepaidMonths    = data.Remaining.Days / 31,
                IsActive         = data.IsActive
            }.Send(sender);
        }
コード例 #2
0
        internal static void ProcessSSOTicket(Habbo sender, IncomingMessage message)
        {
            ClassicIncomingMessage classicMessage = (ClassicIncomingMessage)message;

            Habbo fullHabbo = CoreManager.ServerCore.HabboDistributor.GetHabboFromSSOTicket(classicMessage.PopPrefixedString());

            if (fullHabbo == null)
            {
                new MConnectionClosed
                {
                    Reason = ConnectionClosedReason.InvalidSSOTicket
                }.Send(sender);

                sender.Socket.Disconnect("Invalid SSO Ticket");
            }
            else
            {
                // If this Habbo is already logged in...
                if (fullHabbo.LoggedIn)
                {
                    // Disconnect them.
                    new MConnectionClosed
                    {
                        Reason = ConnectionClosedReason.ConcurrentLogin
                    }.Send(fullHabbo);
                    fullHabbo.Socket.Disconnect("Concurrent Login");
                }

                LoginMerge(fullHabbo, sender);
            }
        }
コード例 #3
0
        internal static void ProcessSSOTicket(Habbo sender, IncomingMessage message)
        {
            ClassicIncomingMessage classicMessage = (ClassicIncomingMessage)message;

            Habbo loggedInHabbo = CoreManager.ServerCore.HabboDistributor.GetHabboFromSSOTicket(classicMessage.PopPrefixedString());

            if (loggedInHabbo == null)
            {
                new MConnectionClosed
                {
                    Reason = ConnectionClosedReason.InvalidSSOTicket
                }.Send(sender);

                // TODO: Is delay needed?

                sender.Socket.Disconnect("Invalid SSO Ticket!"); // Invalid SSO Ticket
            }
            else
            {
                HabboEventArgs eventArgs = new HabboEventArgs(loggedInHabbo);
                R36StandardStuff.EventFirer.Fire("habbo_login:before", eventArgs);

                if (eventArgs.IsCancelled)
                {
                    if (sender.Socket != null)
                    {
                        sender.Socket.Disconnect(eventArgs.CancelReason);
                    }
                    return;
                }

                // If this Habbo is already connected...
                if (loggedInHabbo.LoggedIn)
                {
                    // Disconnect them.
                    new MConnectionClosed
                    {
                        Reason = ConnectionClosedReason.ConcurrentLogin
                    }.Send(loggedInHabbo);
                    loggedInHabbo.Socket.Disconnect("Concurrent Login!");
                }

                sender.Socket.LinkHabbo(loggedInHabbo);
                loggedInHabbo.LoggedIn   = true;
                loggedInHabbo.LastAccess = DateTime.Now;

                R36StandardStuff.EventFirer.Fire("habbo_login:after", eventArgs);
            }
        }