[BcStorm][Add-On] Preferred speech bubble

Results 1 to 22 of 22
  1. #1
    Developer PremiumEye is offline
    MemberRank
    Nov 2011 Join Date
    NetherlandsLocation
    550Posts

    [BcStorm][Add-On] Preferred speech bubble

    Hey people!
    I'm coming with a cute add-on for your BcStorm emulator!
    It's a add-on for you cms and client.

    You have to script the settings page on you own to set the preferred speech bubble style! (Make this page only available for vip users)

    First you have to do something in you database.
    Add in the table users a field called: speech_bubble_prefer with type = int and length = 5 (for sure)

    Go to you emulator source. Go to RoomUser.cs
    We're going to replace a hole internal void.

    Search for the void:
    PHP Code:
    internal void Chat(GameClient Sessionstring Messagebool Shoutint TextColor 0
    Replace the hole void with:
    PHP Code:
    internal void Chat(GameClient Sessionstring Messagebool Shoutint TextColor 0)
            {
                if (
    TextColor && !Session.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_vip") || TextColor 22)
                {
                    
    TextColor 0;
                    
    Session.SendNotif("You must be vip to use this chat bubble styles.");
                }

                if (((
    Session == null) || (Session.GetHabbo().Rank >= 5)) || !this.GetRoom().RoomMuted)
                {

                    
    this.Unidle();
                    if (!
    this.IsPet && !this.IsBot)
                    {

                        
    ServerMessage message;
                        
    Habbo habbo this.GetClient().GetHabbo();

                        if (
    TextColor == 0)
                        {
                            if (!
    habbo.GetSubscriptionManager().HasSubscription("habbo_vip"))
                            {
                                if (
    habbo.Rank 5)
                                {
                                    
    TextColor 2;
                                }
                                else
                                {
                                    
    TextColor 0;
                                }
                            }
                            else
                            {
                                
    using (IQueryAdapter adapter ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
                                {
                                    
    adapter.setQuery("SELECT speech_bubble_prefer FROM users WHERE username = '" habbo.Username "'");
                                    
    DataRow row adapter.getRow();
                                    if ((int)
    row[0] == 0)
                                    {
                                        if (
    habbo.Rank 5)
                                        {
                                            
    TextColor 2;
                                        }
                                        else
                                        {
                                            
    TextColor 0;
                                        }
                                    }
                                    else
                                    {
                                        
    TextColor = (int)row["speech_bubble_prefer"];
                                    }
                                }
                            }
                        }

                        if (
    habbo.Muted)
                        {
                            
    this.GetClient().SendNotif("Jij bent gemuted.");
                            return;
                        }
                        if ((
    Message.StartsWith(":") && (Session != null)) && ChatCommandRegister.IsChatCommand(Message.Split(new char[] { ' ' })[0].ToLower().Substring(1)))
                        {
                            
    ChatCommandHandler handler = new ChatCommandHandler(Message.Split(new char[] { ' ' }), Session);
                            if (
    handler.WasExecuted())
                            {
                                
    Logging.LogMessage(string.Format("User {0} issued command {1}"this.GetUsername(), Message));
                                if (
    Session.GetHabbo().Rank 5)
                                {
                                    
    ButterflyEnvironment.GetGame().GetModerationTool().LogStaffEntry(Session.GetHabbo().Usernamestring.Empty, "Chat command"string.Format("Issued chat command {0}"Message));
                                }
                                return;
                            }
                        }
                        
    uint rank 1;
                        
    Message LanguageLocale.FilterSwearwords(Message);
                        if ((
    Session != null) && (Session.GetHabbo() != null))
                        {
                            
    rank Session.GetHabbo().Rank;
                        }
                        
    TimeSpan span = (TimeSpan)(DateTime.Now habbo.spamFloodTime);
                        if ((
    span.TotalSeconds habbo.spamProtectionTime) && habbo.spamProtectionBol)
                        {
                            
    this.FloodCount 0;
                            
    habbo.spamProtectionBol false;
                            
    habbo.spamProtectionAbuse 0;
                        }
                        else if (
    span.TotalSeconds 4.0)
                        {
                            
    this.FloodCount 0;
                        }
                        if ((
    span.TotalSeconds habbo.spamProtectionTime) && habbo.spamProtectionBol)
                        {
                            
    message = new ServerMessage(Outgoing.FloodFilter);
                            
    int i habbo.spamProtectionTime span.Seconds;
                            
    message.AppendInt32(i);
                            
    this.GetClient().SendMessage(message);
                            if (
    ButterflyEnvironment.spamBans)
                            {
                                
    habbo.spamProtectionAbuse++;
                                
    GameClient clientByUsername ButterflyEnvironment.GetGame().GetClientManager().GetClientByUsername(Session.GetHabbo().Username);
                                if (
    habbo.spamProtectionAbuse >= ButterflyEnvironment.spamBans_limit)
                                {
                                    
    ButterflyEnvironment.GetGame().GetBanManager().BanUser(clientByUsername"SPAM*ABUSE"800.0LanguageLocale.GetValue("flood.banmessage"), false);
                                }
                                else
                                {
                                    
    clientByUsername.SendNotif(LanguageLocale.GetValue("flood.pleasewait").Replace("%secs%"Convert.ToString(i)));
                                }
                            }
                            return;
                        }
                        if (((
    span.TotalSeconds 4.0) && (this.FloodCount 5)) && (rank 5))
                        {
                            
    message = new ServerMessage(Outgoing.FloodFilter);
                            
    habbo.spamProtectionCount++;
                            if ((
    habbo.spamProtectionCount 2) == 0)
                            {
                                
    habbo.spamProtectionTime 10 habbo.spamProtectionCount;
                            }
                            else
                            {
                                
    habbo.spamProtectionTime 10 * (habbo.spamProtectionCount 1);
                            }
                            
    habbo.spamProtectionBol true;
                            
    message.AppendInt32((int)(habbo.spamProtectionTime span.Seconds));
                            
    this.GetClient().SendMessage(message);
                            return;
                        }
                        
    habbo.spamFloodTime DateTime.Now;
                        
    this.FloodCount++;
                        if (!
    this.IsBot)
                        {
                            
    ChatMessage message2 = new ChatMessage(Session.GetHabbo().IdSession.GetHabbo().Usernamethis.mRoom.RoomIdthis.mRoom.Namethis.mRoom.IsPublicMessageDateTime.Now);
                            
    Session.GetHabbo().GetChatMessageManager().AddMessage(message2);
                            
    this.mRoom.GetChatMessageManager().AddMessage(message2);
                        }
                    }

                    
    InvokedChatMessage message3 = new InvokedChatMessage(thisMessageShoutTextColor);
                    
    this.GetRoom().QueueChatMessage(message3);
                }
            } 
    And you're done!

    Little list of the added functions in it:

    - If you aren't vip you can't use chat bubble styles (for people who are having these by accident)
    - If your TextColor is 0, you have no vip and your rank is above the 5, you'll get TextColor 2. If your rank is below the 5 you'll get TextColor 0.
    - If your TextColor is 0, you have vip, your chosen TextColor is 0 and your rank is above the 5. You'll get 2. If your rank is below the 5 you'll get TextColor 0.
    - If you TextColor is 0, you have vip, your chosen TextColor isn't 0. You'll get your chosen TextColor.

    This little thing is very easy to edit.

    You'll get more add-on's! Even I will look for some fixes :)


  2. #2
    Eye Eye Capt'n Spheral is offline
    MemberRank
    May 2010 Join Date
    TumptonshireLocation
    2,488Posts

    Re: [BcStorm][Add-On] Preferred speech bubble

    Cool :)

  3. #3
    Live Ocottish Sverlord Joopie is offline
    LegendRank
    Jun 2010 Join Date
    The NetherlandsLocation
    2,773Posts

    Re: [BcStorm][Add-On] Preferred speech bubble

    You should cache it LOL but nice job :P

  4. #4
    Developer PremiumEye is offline
    MemberRank
    Nov 2011 Join Date
    NetherlandsLocation
    550Posts
    Quote Originally Posted by joopie View Post
    You should cache it LOL but nice job :P
    I think it's quite enough like this ;)

  5. #5
    [̲̅$̲̅(̲̅1̲̅)̲̅$ ̲̅] leenster is offline
    MemberRank
    May 2008 Join Date
    KanaadaLocation
    992Posts

    [BcStorm][Add-On] Preferred speech bubble

    Didn't look at it real close but does it do that query every time someone says something?

    Sent from my BlackBerry 9800 using Tapatalk

  6. #6
    Developer PremiumEye is offline
    MemberRank
    Nov 2011 Join Date
    NetherlandsLocation
    550Posts

    Re: [BcStorm][Add-On] Preferred speech bubble

    Quote Originally Posted by leenster View Post
    Didn't look at it real close but does it do that query every time someone says something?

    Sent from my BlackBerry 9800 using Tapatalk
    No. Only when you loaded the room ;).

  7. #7
    Member Sheenieboy is offline
    MemberRank
    Jan 2012 Join Date
    66Posts

    Re: [BcStorm][Add-On] Preferred speech bubble

    Can you not do other ones, and not only pet chat and Bot chat, cant you do one of the chats that you can choose when your VIP ?
    Last edited by Sheenieboy; 29-01-13 at 12:17 AM.

  8. #8
    Developer Quackster is offline
    DeveloperRank
    Dec 2010 Join Date
    AustraliaLocation
    3,484Posts

    Re: [BcStorm][Add-On] Preferred speech bubble

    Quote Originally Posted by PremiumEye View Post
    No. Only when you loaded the room ;).
    Every time someone chats. Not when the room is loaded.


  9. #9
    [̲̅$̲̅(̲̅1̲̅)̲̅$ ̲̅] leenster is offline
    MemberRank
    May 2008 Join Date
    KanaadaLocation
    992Posts

    [BcStorm][Add-On] Preferred speech bubble

    That's what I thought. It would be better to load this with the user data when a user logs in. If you want a user to be able to change it while they are logged in you could write a rcon command for them to be able to do that.

    I like the idea but the way you did it is hard on your db when there are many users online.

    Sent from my BlackBerry 9800 using Tapatalk

  10. #10
    Developer PremiumEye is offline
    MemberRank
    Nov 2011 Join Date
    NetherlandsLocation
    550Posts

    Re: [BcStorm][Add-On] Preferred speech bubble

    Hmm.. I thought it would load when you it's loading the room..

    I will fix that ;).

    Verstuurd van mijn GT-I9000 met Tapatalk

    Quote Originally Posted by leenster View Post
    That's what I thought. It would be better to load this with the user data when a user logs in. If you want a user to be able to change it while they are logged in you could write a rcon command for them to be able to do that.

    I like the idea but the way you did it is hard on your db when there are many users online.

    Sent from my BlackBerry 9800 using Tapatalk
    I like your idea too. But if I should make a new command than it's again in the client. Why should people use a command to change their preferred speech bubble if they also can click on it? Nobody would use it.

    I made this little cute add-on for you settingspage on your cms to fill the page. I thought most of the settingspages are quite empty.

    And this add-on is coded very fast. So I didn't looked at it very close. I will fix it and release it. Then it loads when you are loging in.

    Verstuurd van mijn GT-I9000 met Tapatalk

  11. #11
    Account Upgraded | Title Enabled! BoomHotel is offline
    MemberRank
    Oct 2008 Join Date
    In a box.Location
    372Posts

    Re: [BcStorm][Add-On] Preferred speech bubble

    Will this make chat bubbles only selectable to VIP?

  12. #12
    Developer PremiumEye is offline
    MemberRank
    Nov 2011 Join Date
    NetherlandsLocation
    550Posts

    Re: [BcStorm][Add-On] Preferred speech bubble

    Quote Originally Posted by BoomHotel View Post
    Will this make chat bubbles only selectable to VIP?
    That's ready coded in the swf's :)

    Verstuurd van mijn GT-I9000 met Tapatalk

  13. #13
    Account Upgraded | Title Enabled! BoomHotel is offline
    MemberRank
    Oct 2008 Join Date
    In a box.Location
    372Posts

    Re: [BcStorm][Add-On] Preferred speech bubble

    Quote Originally Posted by PremiumEye View Post
    That's ready coded in the swf's :)

    Verstuurd van mijn GT-I9000 met Tapatalk
    I mean to the other type of VIP the people who purchased it?

  14. #14
    Developer PremiumEye is offline
    MemberRank
    Nov 2011 Join Date
    NetherlandsLocation
    550Posts

    Re: [BcStorm][Add-On] Preferred speech bubble

    Quote Originally Posted by BoomHotel View Post
    I mean to the other type of VIP the people who purchased it?
    Oh no.. than you have to add the gethabbo().rank call

    Verstuurd van mijn GT-I9000 met Tapatalk

  15. #15
    Ask me about Daoism FullmetalPride is offline
    MemberRank
    Nov 2010 Join Date
    2,172Posts

    Re: [BcStorm][Add-On] Preferred speech bubble

    Great release. Will use if you fix it up.

  16. #16
    [̲̅$̲̅(̲̅1̲̅)̲̅$ ̲̅] leenster is offline
    MemberRank
    May 2008 Join Date
    KanaadaLocation
    992Posts

    Re: [BcStorm][Add-On] Preferred speech bubble

    Quote Originally Posted by PremiumEye View Post

    I like your idea too. But if I should make a new command than it's again in the client. Why should people use a command to change their preferred speech bubble if they also can click on it? Nobody would use it.

    What I mean that if people change their preferred speech bubble through the website than you could could use a mus/rcon command to update it the client.

  17. #17
    Developer PremiumEye is offline
    MemberRank
    Nov 2011 Join Date
    NetherlandsLocation
    550Posts

    Re: [BcStorm][Add-On] Preferred speech bubble

    Quote Originally Posted by leenster View Post
    What I mean that if people change their preferred speech bubble through the website than you could could use a mus/rcon command to update it the client.
    Never thought about it. I like it ;). I keep it in mind.

  18. #18
    Account Upgraded | Title Enabled! BoomHotel is offline
    MemberRank
    Oct 2008 Join Date
    In a box.Location
    372Posts

    Re: [BcStorm][Add-On] Preferred speech bubble

    Quote Originally Posted by PremiumEye View Post
    Oh no.. than you have to add the gethabbo().rank call

    Verstuurd van mijn GT-I9000 met Tapatalk
    What is the full thing I would put?

  19. #19
    Developer PremiumEye is offline
    MemberRank
    Nov 2011 Join Date
    NetherlandsLocation
    550Posts

    Re: [BcStorm][Add-On] Preferred speech bubble

    Quote Originally Posted by BoomHotel View Post
    What is the full thing I would put?
    I don't understand you ?

    From my mobile on Tapatalk

  20. #20
    Account Upgraded | Title Enabled! BoomHotel is offline
    MemberRank
    Oct 2008 Join Date
    In a box.Location
    372Posts

    Re: [BcStorm][Add-On] Preferred speech bubble

    Quote Originally Posted by PremiumEye View Post
    I don't understand you ?

    From my mobile on Tapatalk
    How do I edit it for that in my SWF?

  21. #21
    Ask me about Daoism FullmetalPride is offline
    MemberRank
    Nov 2010 Join Date
    2,172Posts

    Re: [BcStorm][Add-On] Preferred speech bubble

    Quote Originally Posted by BoomHotel View Post
    How do I edit it for that in my SWF?
    You really shouldn't own a hotel.

    You add that to your emulator.

  22. #22
    Developer PremiumEye is offline
    MemberRank
    Nov 2011 Join Date
    NetherlandsLocation
    550Posts

    Re: [BcStorm][Add-On] Preferred speech bubble

    Quote Originally Posted by BoomHotel View Post
    How do I edit it for that in my SWF?
    No. You don't understand me. You have to edit that in the emulator to show it in the swfs.

    From my mobile on Tapatalk



Advertisement