BCStorm - Show Join Date of Group Members

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

    BCStorm - Show Join Date of Group Members

    This is a little fix that was requested by someone.
    It will show the group members join dates.



    First in MyGuilds.cs find:
    PHP Code:
    public List<intMembers
    Ater that put:
    PHP Code:
    public List<stringJoinDates
    Now find:
    PHP Code:
    public MyGuild(int idstring nameint owneridstring ownernamestring descriptionint roomidstring imageint customcolor1int customcolor2int guildbaseint guildbasecolor, List<intguildstatesstring htmlcolor1string htmlcolor2string datecreated, List<intmembers, List<intpetitionsint typeint rightstypeDictionary<intintguildranks 

    Replace that entire void with:
    PHP Code:
    public MyGuild(int idstring nameint owneridstring ownernamestring descriptionint roomidstring imageint customcolor1int customcolor2int guildbaseint guildbasecolor, List<intguildstatesstring htmlcolor1string htmlcolor2string datecreated, List<intmembers, List<intpetitionsint typeint rightstypeDictionary<intintguildranks, List<stringjoindates)
            {
                
    this.Id id;
                
    this.Name name;
                
    this.OwnerId ownerid;
                
    this.OwnerName ownername;
                
    this.Description description;
                
    this.RoomId roomid;
                
    this.Image image;
                
    this.CustomColor1 customcolor1;
                
    this.CustomColor2 customcolor2;
                
    this.GuildBase guildbase;
                
    this.GuildBaseColor guildbasecolor;
                
    this.GuildStates guildstates;
                
    this.HtmlColor1 htmlcolor1;
                
    this.HtmlColor2 htmlcolor2;
                
    this.DateCreated datecreated;
                
    this.Members members;
                
    this.Petitions petitions;
                
    this.Type type;
                
    this.RightsType rightstype;
                
    this.GuildRanks guildranks;
                
    this.JoinDates joindates;
            } 

    Now open Guilds.cs
    Replace the content with
    PHP Code:
    namespace Butterfly.HabboHotel.Habbo.Guilds
    {
        
    using Butterfly;
        
    using Butterfly.HabboHotel;
        
    using Database_Manager.Database.Session_Details.Interfaces;
        
    using System;
        
    using System.Collections;
        
    using System.Collections.Generic;
        
    using System.Data;

        
    internal class Guilds
        
    {
            public 
    Queue deleteGuild = new Queue();
            public 
    Dictionary<intMyGuildloadedGuilds = new Dictionary<intMyGuild>();
            public 
    Queue loadGuild = new Queue();

            public 
    MyGuild AddGuild(int idstring nameint owneridstring ownernamestring descriptionint roomidstring imageint customcolor1int customcolor2int guildbaseint guildbasecolor, List<intguildstatesstring htmlcolor1string htmlcolor2string datecreated, List<intmembers, List<intpetitionsint typeint rightstype, List<stringjoindates)
            {
                
    Game game ButterflyEnvironment.GetGame();
                
    game.LastGuildId++;
                
    id ButterflyEnvironment.GetGame().LastGuildId;
                
    MyGuild g = new MyGuild(idButterflyEnvironment.FilterInjectionChars(name), owneridownernameButterflyEnvironment.FilterInjectionChars(description), roomidimagecustomcolor1customcolor2guildbaseguildbasecolorguildstateshtmlcolor1htmlcolor2datecreatedmemberspetitionstyperightstype, new Dictionary<intint>(), joindates);
                
    string str "";
                foreach (
    int num in guildstates)
                {
                    
    str str num ";";
                }
                
    str str.Substring(0str.Length 1);
                
    using (IQueryAdapter adapter ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
                {
                    
    adapter.setQuery("INSERT INTO groups (Id, Name, OwnerId, OwnerName, Description, RoomId, Image, CustomColor1, CustomColor2, GuildBase, GuildBaseColor, GuildStates, HtmlColor1, HtmlColor2, DateCreated) VALUES (@id, @name, @ownerid, @ownername, @description, @roomid, @image, @color1, @color2, @guildbase, @guildbasecolor, @guildstates, @htmlcolor1, @htmlcolor2, @datecreated)");
                    
    adapter.addParameter("id"id);
                    
    adapter.addParameter("name"ButterflyEnvironment.FilterInjectionChars(name));
                    
    adapter.addParameter("ownerid"ownerid);
                    
    adapter.addParameter("ownername"ownername);
                    
    adapter.addParameter("description"ButterflyEnvironment.FilterInjectionChars(description));
                    
    adapter.addParameter("roomid"roomid);
                    
    adapter.addParameter("image"image);
                    
    adapter.addParameter("color1"customcolor1);
                    
    adapter.addParameter("color2"customcolor2);
                    
    adapter.addParameter("guildbase"guildbase);
                    
    adapter.addParameter("guildbasecolor"guildbasecolor);
                    
    adapter.addParameter("guildstates"str);
                    
    adapter.addParameter("htmlcolor1"htmlcolor1);
                    
    adapter.addParameter("htmlcolor2"htmlcolor2);
                    
    adapter.addParameter("datecreated"datecreated);
                    
    adapter.runQuery();

                    
    adapter.runFastQuery(string.Concat(new object[] { "UPDATE rooms SET GroupId = '"id"' WHERE Id = '"roomid"'" }));


                }
                
    this.QueueAddGuild(g);
                return 
    g;
            }

            public 
    string GenerateGuildImage(int GuildBaseint GuildBaseColor, List<intGStates)
            {
                List<
    int> list = GStates;
                
    string str "";
                
    int num 0;
                
    string str2 "b";
                if (
    GuildBase.ToString().Length >= 2)
                {
                    
    str2 str2 GuildBase;
                }
                else
                {
                    
    str2 str2 "0" GuildBase;
                }
                
    str GuildBaseColor.ToString();
                if (
    str.Length >= 2)
                {
                    
    str2 str2 str;
                }
                else if (
    str.Length <= 1)
                {
                    
    str2 str2 "0" str;
                }
                
    int num2 0;
                if (list[
    9] != 0)
                {
                    
    num2 4;
                }
                else if (list[
    6] != 0)
                {
                    
    num2 3;
                }
                else if (list[
    3] != 0)
                {
                    
    num2 2;
                }
                else if (list[
    0] != 0)
                {
                    
    num2 1;
                }
                
    int num3 0;
                for (
    int i 0num2i++)
                {
                    
    str2 str2 "s";
                    
    num = list[num3] - 20;
                    if (
    num.ToString().Length >= 2)
                    {
                        
    str2 str2 num;
                    }
                    else
                    {
                        
    str2 str2 "0" num;
                    }
                    
    int num5 = list[num3];
                    
    str num5.ToString();
                    if (
    str.Length >= 2)
                    {
                        
    str2 str2 str;
                    }
                    else if (
    str.Length <= 1)
                    {
                        
    str2 str2 "0" str;
                    }
                    
    str2 str2 + list[num3].ToString();
                    switch (
    num3)
                    {
                        case 
    0:
                            
    num3 3;
                            break;

                        case 
    3:
                            
    num3 6;
                            break;

                        case 
    6:
                            
    num3 9;
                            break;
                    }
                }
                return 
    str2;
            }

            public 
    MyGuild GetGuild(int GuildId)
            {
                if (
    this.loadedGuilds.ContainsKey(GuildId))
                {
                    return 
    this.loadedGuilds[GuildId];
                }
                return 
    this.LoadGuild(GuildId);
            }

            public 
    string GetHtmlColor(int Color)
            {
                
    using (IQueryAdapter adapter ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
                {
                    
    adapter.setQuery("SELECT ExtraData1 FROM groups_elements WHERE Id = '" Color "' AND Type = 'Color3'");
                    return 
    adapter.getString();
                }
            }

            public 
    MyGuild LoadGuild(int GuildId)
            {
                
    using (IQueryAdapter adapter ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
                {
                    
    adapter.setQuery("SELECT * FROM groups WHERE Id = '" GuildId "' LIMIT 1");
                    
    DataRow row adapter.getRow();
                    if (
    row == null)
                    {
                        return 
    null;
                    }
                    List<
    intguildstates = new List<int>();
                    foreach (
    string str in row["GuildStates"].ToString().Split(new char[] { ';' }))
                    {
                        try
                        {
                            
    guildstates.Add(int.Parse(str));
                        }
                        catch
                        {
                        }
                    }
                    List<
    intpetitions = new List<int>();
                    foreach (
    string str2 in row["Petitions"].ToString().Split(new char[] { ';' }))
                    {
                        try
                        {
                            
    petitions.Add(int.Parse(str2));
                        }
                        catch
                        {
                        }
                    }
                    
    Dictionary<intintguildranks = new Dictionary<intint>();
                    List<
    intmembers = new List<int>();
                    List<
    stringjoindates = new List<string>();
                    
    adapter.setQuery("SELECT * FROM user_groups WHERE GroupId = '" GuildId "'");
                    
    DataTable table adapter.getTable();
                    foreach (
    DataRow row2 in table.Rows)
                    {
                        
    members.Add((int)row2["UserId"]);
                        
    guildranks.Add((int)row2["UserId"], (int)row2["Rank"]);
                        
    joindates.Add((string)row2["GroupDate"]);
                    }
                    
    MyGuild g = new MyGuild(GuildIdButterflyEnvironment.FilterInjectionChars(row["Name"].ToString()), (int)row["OwnerId"], row["OwnerName"].ToString(), ButterflyEnvironment.FilterInjectionChars(row["Description"].ToString()), (int)row["RoomId"], row["Image"].ToString(), (int)row["CustomColor1"], (int)row["CustomColor2"], (int)row["GuildBase"], (int)row["GuildBaseColor"], guildstatesrow["HtmlColor1"].ToString(), row["HtmlColor2"].ToString(), row["DateCreated"].ToString(), memberspetitions, (int)row["Typee"], (int)row["RightsType"], guildranks,joindates);
                    
    this.QueueAddGuild(g);
                    return 
    g;
                }
            }

            public 
    void OnCycle()
            {
                
    this.WorkAddGuildQueue();
                
    this.WorkGuildRemoveQueue();
            }

            public 
    void QueueAddGuild(MyGuild G)
            {
                
    lock (this.loadGuild.SyncRoot)
                {
                    
    this.loadGuild.Enqueue(G);
                }
            }

            public 
    void QueueDeleteGuild(MyGuild G)
            {
                
    lock (this.deleteGuild.SyncRoot)
                {
                    
    this.deleteGuild.Enqueue(G);
                }
            }

            public 
    void UnloadGuild(int GuildId)
            {
                
    MyGuild g this.GetGuild(GuildId);
                if (
    != null)
                {
                    
    this.QueueDeleteGuild(g);
                }
            }

            private 
    void WorkAddGuildQueue()
            {
                try
                {
                    if (
    this.loadGuild.Count 0)
                    {
                        
    lock (this.loadGuild.SyncRoot)
                        {
                            while (
    this.loadGuild.Count 0)
                            {
                                
    MyGuild guild = (MyGuild)this.loadGuild.Dequeue();
                                if (!
    this.loadedGuilds.ContainsValue(guild))
                                {
                                    
    this.loadedGuilds.Add(guild.Idguild);
                                }
                                else
                                {
                                    
    this.loadedGuilds[guild.Id] = guild;
                                }
                            }
                        }
                    }
                }
                catch
                {
                }
            }

            private 
    void WorkGuildRemoveQueue()
            {
                if (
    this.deleteGuild.Count 0)
                {
                    
    lock (this.deleteGuild.SyncRoot)
                    {
                        while (
    this.deleteGuild.Count 0)
                        {
                            
    MyGuild guild = (MyGuild)this.deleteGuild.Dequeue();
                            
    this.loadedGuilds.Remove(guild.Id);
                        }
                    }
                }
            }
        }

    Open GameClientMessageHandler.cs

    Find
    PHP Code:
    List<intmembers = new List<int> {
                        (int) 
    this.Session.GetHabbo().Id
                    
    }; 
    After that put
    PHP Code:
    List<stringjoindates = new List<string> {
                        
    DateTime.Now.Day " - " DateTime.Now.Month " -  " DateTime.Now.Year
                    
    }; 
    Find
    PHP Code:
    MyGuild guild ButterflyEnvironment.GetGame().GetGuilds().AddGuild(0nameidusernamedescriptionroomidimagecolornum3guildBaseguildBaseColorgStateshtmlColorstr5datecreatedmembers, new List<int>(), 00); 
    Replace that with
    PHP Code:
    MyGuild guild ButterflyEnvironment.GetGame().GetGuilds().AddGuild(0nameidusernamedescriptionroomidimagecolornum3guildBaseguildBaseColorgStateshtmlColorstr5datecreatedmembers, new List<int>(), 00joindates); 
    Find
    PHP Code:
    public void LoadMembersPetitions() 
    Replace that entire method with this one
    PHP Code:
    public void LoadMembersPetitions()
            {
                
    int guildId this.Request.PopWiredInt32();
                
    int num2 this.Request.PopWiredInt32();
                
    string str this.Request.PopFixedString();
                
    int num3 this.Request.PopWiredInt32();
                
    MyGuild guild ButterflyEnvironment.GetGame().GetGuilds().GetGuild(guildId);
                if (
    guild != null)
                {
                    
    ServerMessage message;
                    
    Habbo habbo;
                    
    int memberCounter 0;
                    if (
    num3 == 0)
                    {
                        
    message = new ServerMessage(Outgoing.SendMembersAndPetitions);
                        
    message.AppendInt32(guild.Id);
                        
    message.AppendString(guild.Name);
                        
    message.AppendInt32(guild.RoomId);
                        
    message.AppendString(guild.Image);
                        
    message.AppendInt32(guild.Members.Count);
                        
    message.AppendInt32((guild.Members.Count 13) ? 14 guild.Members.Count);
                        
                        foreach (
    int num4 in guild.Members)
                        {
                            
    habbo ButterflyEnvironment.getHabboForId((uint)num4);
                            if (
    guild.OwnerId == habbo.Id)
                            {
                                
    message.AppendInt32(0);
                            }
                            else
                            {
                                
    message.AppendInt32((guild.GuildRanks.ContainsKey(num4) && guild.GuildRanks.ContainsValue(1)) ? 2);
                            }
                            
    message.AppendInt32(num4);
                            
    message.AppendString(habbo.Username);
                            
    message.AppendString(habbo.Look);
                            
    message.AppendString(guild.JoinDates[memberCounter]);
                            
    memberCounter++;
                        }
                        
    message.AppendBoolean(false);
                        
    message.AppendInt32(14);
                        
    message.AppendInt32(0);
                        
    message.AppendInt32(0);
                        
    message.AppendString("");
                        
    this.Session.SendMessage(message);
                    }
                    else
                    {
                        
    message = new ServerMessage(Outgoing.SendMembersAndPetitions);
                        
    message.AppendInt32(guild.Id);
                        
    message.AppendString(guild.Name);
                        
    message.AppendInt32(guild.RoomId);
                        
    message.AppendString(guild.Image);
                        
    message.AppendInt32(guild.Petitions.Count);
                        
    message.AppendInt32((guild.Petitions.Count 13) ? 14 guild.Petitions.Count);
                        foreach (
    int num4 in guild.Petitions)
                        {
                            
    habbo ButterflyEnvironment.getHabboForId((uint)num4);
                            
    message.AppendInt32(3);
                            
    message.AppendInt32(num4);
                            
    message.AppendString(habbo.Username);
                            
    message.AppendString(habbo.Look);
                            
    message.AppendString(guild.JoinDates[memberCounter]);
                            
    memberCounter++;
                        }
                        
    message.AppendBoolean(true);
                        
    message.AppendInt32(14);
                        
    message.AppendInt32(0);
                        
    message.AppendInt32(2);
                        
    message.AppendString("");
                        
    this.Session.SendMessage(message);
                    }
                }
            } 

    That should do it.
    Last edited by leenster; 16-01-13 at 09:36 PM.


  2. #2
    Enthusiast Joshuwar is offline
    MemberRank
    Oct 2012 Join Date
    45Posts

    Re: BCStorm - Show Join Date of Group Members

    Thanks for this, would've got round to it myself if it wasn't for the endless amount of other bugs :)

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

    Re: BCStorm - Show Join Date of Group Members

    Quote Originally Posted by Joshuwar View Post
    Thanks for this, would've got round to it myself if it wasn't for the endless amount of other bugs :)
    I know... there are lots..... But its nice to see many people fixing them...

    What kind of bums me out is that I released all the snowstorm images. As soon as I did that a bunch of people stopped releasing fixes.... I'm sure there is a big race on the go. "Who will fix snowstorm first". I just hope the will share like they should.

  4. #4
    Banned rafa95123 is offline
    BannedRank
    May 2009 Join Date
    /home/RaphaLocation
    564Posts

    Re: BCStorm - Show Join Date of Group Members

    Soo leenster, why you don't fix the Petitions of Groups? And the buy too !

    @Sorry, You fixed too! Thanks ^^

  5. #5
    Enthusiast Joshuwar is offline
    MemberRank
    Oct 2012 Join Date
    45Posts

    Re: BCStorm - Show Join Date of Group Members

    Quote Originally Posted by leenster View Post
    I know... there are lots..... But its nice to see many people fixing them...

    What kind of bums me out is that I released all the snowstorm images. As soon as I did that a bunch of people stopped releasing fixes.... I'm sure there is a big race on the go. "Who will fix snowstorm first". I just hope the will share like they should.
    I'd rather the community work on fixing bugs then adding features such as Snowstorm etc. Just my personal opinion though.

    Btw, you got the packet id and structure for buying groups? If you make two rooms, you're in room 1 and make a group putting the homeroom as room 2, you can constantly spam the Purchase button.

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

    Re: BCStorm - Show Join Date of Group Members

    Quote Originally Posted by Joshuwar View Post
    I'd rather the community work on fixing bugs then adding features such as Snowstorm etc. Just my personal opinion though.

    Btw, you got the packet id and structure for buying groups? If you make two rooms, you're in room 1 and make a group putting the homeroom as room 2, you can constantly spam the Purchase button.
    Oh yeah ... almost forgot about that one. Yeah that needs to be fixed still.

  7. #7
    C# Developer neto737 is offline
    MemberRank
    Oct 2010 Join Date
    Environment.csLocation
    274Posts

    Re: BCStorm - Show Join Date of Group Members

    Thx :D

    It's Working!

  8. #8
    Just out there.. Flare is offline
    MemberRank
    Jun 2012 Join Date
    269Posts

    Re: BCStorm - Show Join Date of Group Members

    can someone please send me the files they are needed for this fix, the files with the fix aready in them ;p-im getting errors debugging, i asked leen but hes at work and i dont wanna wait ;s

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

    Re: BCStorm - Show Join Date of Group Members

    rafa95123 pointed out that there is a query missing in the group creation . This would cause the group not showing up after a server restart.

    in guilds.cs find

    PHP Code:
    public MyGuild AddGuild 
    Replace that entire method with
    PHP Code:
    public MyGuild AddGuild(int idstring nameint owneridstring ownernamestring descriptionint roomidstring imageint customcolor1int customcolor2int guildbaseint guildbasecolor, List<intguildstatesstring htmlcolor1string htmlcolor2string datecreated, List<intmembers, List<intpetitionsint typeint rightstype, List<stringjoindates)
            {
                
    Game game ButterflyEnvironment.GetGame();
                
    game.LastGuildId++;
                
    id ButterflyEnvironment.GetGame().LastGuildId;
                
    MyGuild g = new MyGuild(idButterflyEnvironment.FilterInjectionChars(name), owneridownernameButterflyEnvironment.FilterInjectionChars(description), roomidimagecustomcolor1customcolor2guildbaseguildbasecolorguildstateshtmlcolor1htmlcolor2datecreatedmemberspetitionstyperightstype, new Dictionary<intint>(), joindates);
                
    string str "";
                foreach (
    int num in guildstates)
                {
                    
    str str num ";";
                }
                
    str str.Substring(0str.Length 1);
                
    using (IQueryAdapter adapter ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
                {
                    
    adapter.setQuery("INSERT INTO groups (Id, Name, OwnerId, OwnerName, Description, RoomId, Image, CustomColor1, CustomColor2, GuildBase, GuildBaseColor, GuildStates, HtmlColor1, HtmlColor2, DateCreated) VALUES (@id, @name, @ownerid, @ownername, @description, @roomid, @image, @color1, @color2, @guildbase, @guildbasecolor, @guildstates, @htmlcolor1, @htmlcolor2, @datecreated)");
                    
    adapter.addParameter("id"id);
                    
    adapter.addParameter("name"ButterflyEnvironment.FilterInjectionChars(name));
                    
    adapter.addParameter("ownerid"ownerid);
                    
    adapter.addParameter("ownername"ownername);
                    
    adapter.addParameter("description"ButterflyEnvironment.FilterInjectionChars(description));
                    
    adapter.addParameter("roomid"roomid);
                    
    adapter.addParameter("image"image);
                    
    adapter.addParameter("color1"customcolor1);
                    
    adapter.addParameter("color2"customcolor2);
                    
    adapter.addParameter("guildbase"guildbase);
                    
    adapter.addParameter("guildbasecolor"guildbasecolor);
                    
    adapter.addParameter("guildstates"str);
                    
    adapter.addParameter("htmlcolor1"htmlcolor1);
                    
    adapter.addParameter("htmlcolor2"htmlcolor2);
                    
    adapter.addParameter("datecreated"datecreated);
                    
    adapter.runQuery();

                    
    adapter.runFastQuery(string.Concat(new object[] { "UPDATE rooms SET GroupId = '"id"' WHERE Id = '"roomid"'" }));


                }
                
    this.QueueAddGuild(g);
                return 
    g;
            } 
    I updated the main post.
    Last edited by leenster; 16-01-13 at 09:46 PM.

  10. #10
    Enthusiast Dovis is offline
    MemberRank
    Jan 2011 Join Date
    42Posts

    Re: BCStorm - Show Join Date of Group Members

    if group members are superior 14 client disconnection ??
    Last edited by Dovis; 17-01-13 at 09:31 PM.

  11. #11
    Enthusiast Dovis is offline
    MemberRank
    Jan 2011 Join Date
    42Posts

    Re: BCStorm - Show Join Date of Group Members

    there is a bug if group members are superior 14 client disconnection ??

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

    BCStorm - Show Join Date of Group Members

    Quote Originally Posted by Dovis View Post
    there is a bug if group members are superior 14 client disconnection ??
    I know where the bug is and know how to fix it. I am fixing the group windows. Show all members/ show all admins and show all requests. Give rights / remove rights and what ever else is on there. Ill probably have this done tonight.

    Sent from my BlackBerry 9800 using Tapatalk

  13. #13
    Run, but I'll find you. Ddos Attack is offline
    MemberRank
    Jan 2011 Join Date
    AustraliaLocation
    908Posts

    Re: BCStorm - Show Join Date of Group Members

    Quote Originally Posted by leenster View Post
    I know where the bug is and know how to fix it. I am fixing the group windows. Show all members/ show all admins and show all requests. Give rights / remove rights and what ever else is on there. Ill probably have this done tonight.

    Sent from my BlackBerry 9800 using Tapatalk
    Would that mean you can give users admin rights? ;)

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

    BCStorm - Show Join Date of Group Members

    Yes

    Sent from my BlackBerry 9800 using Tapatalk

  15. #15
    Enthusiast Dovis is offline
    MemberRank
    Jan 2011 Join Date
    42Posts

    Re: BCStorm - Show Join Date of Group Members

    Thanks Good job



Advertisement