[BCSTORM] Staffpicks 99%

Results 1 to 12 of 12
  1. #1
    Proficient Member CrEcEp is offline
    MemberRank
    Oct 2011 Join Date
    166Posts

    ! [BCSTORM] Staffpicks 99%

    Hi, I've fixed Staffpicks for BCStorm.

    Add to GameClientMessageHandler.cs:
    Code:
    internal void Staffpick()
            {
                uint num = this.Request.PopWiredUInt();
    
                if (this.Session.GetHabbo().Rank < 5u)
                {
                this.Session.SendNotif("You can´t do that!");
                }
                if (this.Session.GetHabbo().Rank > 5u)
                {
                    Room room = ButterflyEnvironment.GetGame().GetRoomManager().GetRoom(num);
                    int num2 = 0;
                    using (IQueryAdapter queryreactor = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
                    {
                        queryreactor.setQuery("SELECT * FROM navigator_publics_new WHERE room_id = '" + num + "'");
                        if (queryreactor.getRow() != null)
                        {
                            num2 = 1;
                        }
                    }
                    if (num2 == 0)
                    {
                        this.Session.SendNotif("This Room was added to Staff Picked Rooms!");
                        room.staff_pick = true;
                        using (IQueryAdapter queryreactor = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
                        {
                            queryreactor.runFastQuery(string.Concat(new object[]
    						{
    							"INSERT INTO `navigator_publics_new` (`bannertype`, `caption`, `room_id`, `category_id`, `category_parent_id`, `image`, `image_type`, `typeofdata`) VALUES ('1', '",
    							room.Name,
    							"', '",
    							num,
    							"', '",
    							ButterflyEnvironment.staff_pick_category,
    							"', '",
    							ButterflyEnvironment.staff_pick_category,
    							"', 'officialrooms_hq/staffpickfolder.gif', 'internal', '3')"
    						}));
                            queryreactor.runFastQuery(string.Concat(new object[]
    						{
    							"UPDATE rooms SET is_picked = '1' WHERE id = ", num, ""
    						}));
                            queryreactor.runFastQuery(string.Concat(new object[]
    						{
    							"UPDATE users SET staffpicks = staffpicks +1 WHERE id = ", room.OwnerId, ""
    						}));
                            ButterflyEnvironment.GetGame().GetNavigator().Initialize(queryreactor);
                        }
                    }
                    else
                    {
                        this.Session.SendNotif("This Room was removed from Staff Picked Rooms!");
                        room.staff_pick = false;
                        using (IQueryAdapter queryreactor = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
                        {
                            queryreactor.runFastQuery("DELETE FROM `navigator_publics_new` WHERE (`room_id`='" + num + "')");
                            queryreactor.runFastQuery(string.Concat(new object[]
    						{
    							"UPDATE rooms SET is_picked = '0' WHERE id = ", num, ""
    						}));
                            ButterflyEnvironment.GetGame().GetNavigator().Initialize(queryreactor);
                        }
                    }
                    ServerMessage message = new ServerMessage(3116);
                    message.AppendBoolean(false);
                    message.AppendInt32(room.Id);
                    message.AppendString(room.Name);
                    message.AppendBoolean(true);
                    message.AppendInt32(room.OwnerId);
                    message.AppendString(room.Owner);
                    message.AppendInt32(room.State);
                    message.AppendInt32(room.UsersNow);
                    message.AppendInt32(room.UsersMax);
                    message.AppendString(room.Description);
                    message.AppendInt32(0);
                    message.AppendInt32((room.Category == 52) ? 2 : 0);
                    message.AppendInt32(room.Score);
                    message.AppendInt32(0);
                    message.AppendInt32(room.Category);
                    if (room.GroupId == 0)
                    {
                        message.AppendInt32(0);
                        message.AppendInt32(0);
                    }
                    else
                    {
                        MyGuild guild = ButterflyEnvironment.GetGame().GetGuilds().GetGuild(room.GroupId);
                        message.AppendInt32(guild.Id);
                        message.AppendString(guild.Name);
                        message.AppendString(guild.Image);
                    }
                    message.AppendString("");
                    message.AppendInt32(room.TagCount);
                    foreach (string string_ in room.Tags)
                    {
                        message.AppendString(string_);
                    }
                    message.AppendInt32(0);
                    message.AppendInt32(0);
                    message.AppendInt32(0);
                    message.AppendBoolean(true);
                    message.AppendBoolean(true);
                    message.AppendInt32(0);
                    message.AppendInt32(0);
                    message.AppendBoolean(false);
                    message.AppendBoolean(room.staff_pick);
                    message.AppendBoolean(false);
                    message.AppendInt32(0);
                    message.AppendInt32(0);
                    message.AppendInt32(0);
                    message.AppendBoolean(false);
                    message.AppendBoolean(true);
                    this.Session.SendMessage(message);
                    room.SendMessage(message);
                }
         
            }
    Insert in to SharedPacketLib.cs:
    Code:
    internal static void Staffpick(GameClientMessageHandler handler)
            {
                handler.Staffpick();
            }
    Insert in to StaticClientMessageHandler.cs:
    Code:
    handlers.Add(Incoming.Staffpick, new StaticRequestHandler(SharedPacketLib.Staffpick));
    Insert in to Incoming.cs over "static Incoming()":
    Code:
    public static int Staffpick;
    Insert in to Incoming.cs under "Incoming.unknown = 3870;":
    Code:
    Incoming.Staffpick = 2708;
    Go to Navigator.cs Initialize():
    Add
    Code:
    this.PrivateCategories.Clear();
    this.PublicItems.Clear();
    Under
    Code:
    dbClient.setQuery("SELECT id,caption,min_rank FROM navigator_flatcats WHERE enabled = 2");
                DataTable table = dbClient.getTable();
                dbClient.setQuery("SELECT * FROM navigator_publics_new ORDER BY ordernum ASC");
                DataTable table2 = dbClient.getTable();
    Go to ButterflyEnvironment:
    Add
    Code:
    internal static int staff_pick_category = 3;// Your Navigator Publics Category
    Under
    Code:
    internal static bool useSSO;
    Go to ButterflyEnvironment:
    Add
    Code:
    internal static int staff_pick_category = 3;// Your Navigator Publics Category
    Under
    Code:
    internal static bool useSSO;
    Go to Rooms.cs:
    Add
    Code:
    internal bool staff_pick;
    Under
    Code:
    private List<RoomBot> Bots;
    Go to your Database and insert these Queries:
    Code:
    ALTER TABLE `rooms` ADD `is_picked` int(3) NOT NULL DEFAULT '0';
    ALTER TABLE `users` ADD `staffpicks` int(15) NOT NULL DEFAULT '0';
    Please tell me if i forgot something.

    99% because the Button shows after a restart the wrong text

    Feel free to post a comment or like it ;)
    Last edited by CrEcEp; 19-05-13 at 10:19 PM.


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

    Re: [BCSTORM] Staffpicks 99%

    Does this work for SwiftEMU ? but also +1

  3. #3
    Proficient Member CrEcEp is offline
    MemberRank
    Oct 2011 Join Date
    166Posts

    Re: [BCSTORM] Staffpicks 99%

    i think you must change the packets - I don´t have them
    or maybe

    Replace
    ServerMessage message = new ServerMessage(3116);
    With
    ServerMessage message = new ServerMessage(2456);//I think this is the right ID
    Last edited by CrEcEp; 19-05-13 at 06:33 PM.

  4. #4
    Valued Member smasher1994 is offline
    MemberRank
    Sep 2008 Join Date
    122Posts

    Re: [BCSTORM] Staffpicks 99%

    Quote Originally Posted by CrEcEp View Post
    i think you must change the packets - I don´t have them
    or maybe

    Replace
    ServerMessage message = new ServerMessage(3116);
    With
    ServerMessage message = new ServerMessage(2456);//I think this is the right ID
    I would find the right ID for SwiftEMU fou you, when I'm at home.

    To your Release: Nice I would test it for SwiftEMU and give u then a feedback of that.

  5. #5
    Proficient Member CrEcEp is offline
    MemberRank
    Oct 2011 Join Date
    166Posts

    Re: [BCSTORM] Staffpicks 99%

    Quote Originally Posted by smasher1994 View Post
    I would find the right ID for SwiftEMU fou you, when I'm at home.

    To your Release: Nice I would test it for SwiftEMU and give u then a feedback of that.
    Can you fix the button too? that there is on a restart not only add to staff picks?

  6. #6
    Valued Member smasher1994 is offline
    MemberRank
    Sep 2008 Join Date
    122Posts

    Re: [BCSTORM] Staffpicks 99%

    Quote Originally Posted by CrEcEp View Post
    Can you fix the button too? that there is on a restart not only add to staff picks?
    Which button? Image or something like this.

  7. #7
    Proficient Member CrEcEp is offline
    MemberRank
    Oct 2011 Join Date
    166Posts

    Re: [BCSTORM] Staffpicks 99%

    The Add to Staffpicks Button on RoomInfo Window

    ------------------------------------------------
    And i can´t add more than 65535 Furnis - Why?

  8. #8
    C# | C++ Emerica is offline
    MemberRank
    Oct 2010 Join Date
    GermanyLocation
    437Posts

    Re: [BCSTORM] Staffpicks 99%

    Already released,
    http://forum.ragezone.com/f353/staff-picks-c-930042/

    You forgot the bool, which checks if the room is already staff picked or not.

  9. #9
    Proficient Member CrEcEp is offline
    MemberRank
    Oct 2011 Join Date
    166Posts

    Re: [BCSTORM] Staffpicks 99%

    Quote Originally Posted by Emerica View Post
    Already released,
    http://forum.ragezone.com/f353/staff-picks-c-930042/

    You forgot the bool, which checks if the room is already staff picked or not.
    Sry and where should the bool go?
    + What is with HabboLC?

    "this.staff_pick = ButterflyEnvironment.EnumToBool(Row["is_picked"].ToString());" - RoomData.cs?
    Last edited by CrEcEp; 20-05-13 at 04:40 PM.

  10. #10
    Developer Quackster is offline
    DeveloperRank
    Dec 2010 Join Date
    AustraliaLocation
    3,479Posts

    Re: [BCSTORM] Staffpicks 99%

    Quote Originally Posted by Emerica View Post
    Already released,
    http://forum.ragezone.com/f353/staff-picks-c-930042/

    You forgot the bool, which checks if the room is already staff picked or not.
    No you just released code from your own server.
    Last edited by Quackster; 21-05-13 at 03:48 AM.

  11. #11
    Valued Member jordyhouben is offline
    MemberRank
    Aug 2009 Join Date
    EuropaLocation
    111Posts

    Re: [BCSTORM] Staffpicks 99%

    Got this error.
    'Butterfly.HabboHotel.Rooms.Room.Id' is inaccessible due to its protection level

    How to fix (Room.Id' is inaccessible due to its protection level)
    Replace
    Private uint Id;
    With
    public uint Id;
    Last edited by jordyhouben; 21-05-13 at 10:08 PM.

  12. #12
    Zephyr Studios PRIZM is offline
    MemberRank
    Feb 2012 Join Date
    DenmarkLocation
    2,291Posts

    Re: [BCSTORM] Staffpicks 99%

    This is nice. Thank you!



Advertisement