Todos Fixes para PlusEmu

2 participantes

Anonymous Convidado  • 15.03.14 16:33

Todos Fixes para PlusEmu Empty Todos Fixes para PlusEmu 15.03.14 16:33

Olá este topico vai fixar meio BAGUNÇADO mas depois irei arrumar, estará em inglês por enquanto. E depois estará melhor explicado, peguei os itens e fixes direto do RZ. ATENÇÃO O PLUS DO DANIEL NÃO POSSUI TODOS OS FIXES COLOCADOS AQUI.

Lá vai.


GetCatalogIndexEvents.cs

//////////

using Silverwave.Communication.Packets.Outgoing.Catalog;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Silverwave.Communication.Packets.Incoming.Catalog
{
    class GetCatalogIndexEvent : IPacketEvent
    {
        public void Parse(HabboHotel.GameClients.GameClient Session, Messages.ClientMessage Packet)
        {
            string check = Packet.PopFixedString();
            int Sub = 0;
            if (check != "BUILDERS_CLUB")
            {
                if (Session.GetHabbo().GetSubscriptionManager().HasSubscription)
                {
                    Sub = Session.GetHabbo().GetSubscriptionManager().GetSubscription().SubscriptionId;
                }

                Session.SendMessage(new CatalogIndexComposer(Session, SilverwaveEnvironment.GetGame().GetCatalog().GetPages(), Sub));
            }
        }  
    }
}  

///////////

ads_background

HabboHotel/Items/RoomItem.cs

Find:
Code:
else if (this.GetBaseItem().InteractionType == InteractionType.mannequin)
Paste above:
Code:
else if (this.GetBaseItem().Name == "ads_mpu_720" || this.GetBaseItem().Name == "ads_background" || this.GetBaseItem().Name == "ads_mpu_300" || this.GetBaseItem().Name == "ads_mpu_160")
                {
 
                    Message.AppendInt32(0);
                    Message.AppendInt32(1);
                    if (ExtraData != "")
                    {
                        Message.AppendInt32(ExtraData.Split(Convert.ToChar(9)).Length / 2);
 
                        for (int i = 0; i <= ExtraData.Split(Convert.ToChar(9)).Length - 1; i++)
                        {
                            Message.AppendString(ExtraData.Split(Convert.ToChar(9))[i]);
                        }
                    }
                    else
                    {
                        Message.AppendInt32(0);
                    }
 
                }

/////////////

Fix for the question mark next to the chat bubble not doing anything.

Step 1: Go to your htaccess file (Or web.config what ever you use) and add RewriteRule ^game/habbopages/chat/commands(|/)$ commands.php If you use htacess file (If you use a web.config then change it yourself)

Step 2: You can either download my pre-made file from here https://www.mediafire.com/?ivlqed19cymvw0b then place it directly into your htdocs or wwwroot folder OR you can just make your own file and call it commands.php and then save it to your main CMS directory and you're done. Just reload your client.

//////////

Fix for Limited Items:

Run this:

Code:
CREATE TABLE IF NOT EXISTS `items_limited` (
  `item_id` int(55) NOT NULL,
  `LimitedNo` int(55) NOT NULL,
  `LimitedTot` int(55) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Go to: HabboHotel/Items/RoomItem.cs

Find -> items_limited 
Remove the // and /* and */


Go to: HabboHotel/Items/UserItem.cs

Find -> items_limited
Remove the // and /* and */


Go to: HabboHotel/Users/Inventory/InventoryComponent.cs

Find -> items_limited
Remove the // and /* and */


Go to: HabboHotel/Items/UserItem.cs

Find:
Code:
internal void SerializeFloor(ServerMessage Message, Boolean Inventory)
Put:
Code:
else if (LimitedNo > 0)
            {
                Message.AppendInt32(1);
                Message.AppendInt32(256);
                Message.AppendString(this.ExtraData);
                Message.AppendInt32(this.LimitedNo);
                Message.AppendInt32(this.LimitedTot);
            }
After:

Code:
else
                {
                    Message.AppendInt32(1);
                    Message.AppendInt32(0);
                    Message.AppendString(ExtraData);
                }
            }

Find (internal void SerializeFloor): 
Code:
Message.AppendBoolean(GetBaseItem().AllowInventoryStack);
Replace:
Code:
if (LimitedNo > 0)
            {
                Message.AppendBoolean(false);
            }
            else
            {
                Message.AppendBoolean(GetBaseItem().AllowInventoryStack);
            }
Inventory Stack repaired with the help of Receiver :)



/////////////

Crystals/Diamonds Command Fix [ 100% ]

Add this code to your ChatCommandHandler.cs

Code:
                                    #region Give Crystals (:belcredits)
                case "crystals":
                case "givecrystals":
                    {
                        if (Session.GetHabbo().HasCmd("crystals"))
                        {


                            GameClient TargetClient = null;
                            Room TargetRoom = Session.GetHabbo().CurrentRoom;


                            TargetClient = SilverwaveEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);
                            if (TargetClient != null)
                            {
                                int creditsToAdd;
                                if (int.TryParse(Params[2], out creditsToAdd))
                                {
                                    TargetClient.GetHabbo().BelCredits = TargetClient.GetHabbo().BelCredits + creditsToAdd;
                                    Session.GetHabbo().NotifyNewCrystals(creditsToAdd);
                                    TargetClient.GetHabbo().UpdateActivityPointsBalance();
                                    TargetClient.SendNotif(Session.GetHabbo().Username + (" has awarded you ") + creditsToAdd.ToString() + (" Crystals!"));
                                    Session.SendNotif(("Crystals balance updated successfully."));
                                    return true;
                                }
                                else
                                {
Then on Habbo.cs Find :

Code:
HabboinfoSaved = true;
Replace the line under it

Code:
                return "UPDATE users SET online='0', last_online = '" + SilverwaveEnvironment.GetUnixTimestamp() + "', activity_points = '" + ActivityPoints + "', credits = '" + Credits + "', belcredits = '" + BelCredits + "' WHERE id = '" + Id + "'; UPDATE user_stats SET AchievementScore = " + AchievementPoints + " WHERE id=" + Id + " LIMIT 1; ";
            }

Run this SQL :

Code:
INSERT INTO `fuse_cmds` (`id`, `command`, `rank`, `params`, `description`) VALUES
(86, 'crystals', 8, '%user% %amount', 'Give diamonds to a user');

In your Habbo.cs Find
Code:
Code:
internal void NotifyNewPixels(int Change)

Add below 
Code:
Code:
        internal void NotifyNewCrystals(int Change)
        {
            if (mClient == null || mClient.GetMessageHandler() == null || mClient.GetMessageHandler().GetResponse() == null)
                return;
            mClient.GetMessageHandler().GetResponse().Init(Outgoing.AlertDucketAmount);
            mClient.GetMessageHandler().GetResponse().AppendInt32(BelCredits); //amount
            mClient.GetMessageHandler().GetResponse().AppendInt32(Change); //change
            mClient.GetMessageHandler().GetResponse().AppendInt32(0); //type
            mClient.GetMessageHandler().SendResponse();
        }

//////////

Just replace your whole Chatlog.cs with this :
Code:
using Database_Manager.Database.Session_Details.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace Silverwave.HabboHotel.Rooms
{
    class Chatlog
    {
        internal uint UserId;
        internal string Message;
        internal double Timestamp;
        internal bool IsSaved;


        internal Chatlog(uint User, string Msg, double Time, bool FromDatabase = false)
        {
            UserId = User;
            Message = Msg;
            Timestamp = Time;
            IsSaved = FromDatabase;
        }


        internal void Save(uint RoomId)
        {
            using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
            {
                dbClient.runFastQuery("DELETE FROM `chatlogs` WHERE `user_id` = '" + UserId + "', `room_id` = '" + RoomId + "', `message` = '" + Message + "', `timestamp` = '" + Timestamp + "'"); 


                dbClient.runFastQuery("INSERT INTO chatlogs (user_id, room_id, message, timestamp) VALUES ('" + UserId + "', '" + RoomId + "', '" + Message + "', '" + Timestamp + "')"); 
            }
        }
    }
}

////////////

Here is the fix for the chatlogs double in the database:

Replace your whole Chatlog.cs with this :

Code:
using Database_Manager.Database.Session_Details.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace Silverwave.HabboHotel.Rooms
{
    class Chatlog
    {
        internal uint UserId;
        internal string Message;
        internal double Timestamp;
        internal bool IsSaved;


        internal Chatlog(uint User, string Msg, double Time, bool FromDatabase = true)
        {
            UserId = User;
            Message = Msg;
            Timestamp = Time;
            IsSaved = FromDatabase;
        }


        internal void Save(uint RoomId)
        {
            using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
            {
                dbClient.setQuery("INSERT INTO chatlogs (user_id, room_id, message, timestamp) VALUES (@user, @room, @message, @time)");
                dbClient.addParameter("user", UserId);
                dbClient.addParameter("room", RoomId);
                dbClient.addParameter("message", Message);
                dbClient.addParameter("time", Timestamp);
                dbClient.runQuery();
            }
        }
    }
}
Proof: 


Make sure you change this line :

Code:
internal static int UserChatlog = 0x777FF;//disabled


Replace with :

Code:
internal static int UserChatlog = 3791;//akl
Note this is not 100% because i found out why the chatlogs is always doubling its on shutdown if you shut nop the Emulator it will double all the chatlogs in your database ill will find the solution for it


////////////






Go to \Silverwave Emulator\Messages\Headers\Composers.cs

Replace:

Code:
internal static int AchievementList = 2328;//akl
With:

Code:
 internal static int AchievementList = 2134;//akl

///////////

Fix for IDLE :
Find :
Code:
public const int SleepMessageComposer = 3474;
Replace with:
Code:
public const int SleepMessageComposer = 1644;
Proof :



/////////////

#1 - Bot speech bubble.
Spoiler: 

Find in RoomUser.cs :
Code:
messageB = new InvokedChatMessage(this, Message, Shout, 0,count);
Replace with:
Code:
messageB = new InvokedChatMessage(this, Message, Shout, (IsPet ? 0 : 2),count);
Proof:
Spoiler: 




By: HillBilly


#2 - Alert command
Spoiler: 

In ChatCommandHandler.cs in #region Moderation Commands add:
Code:
case "alert":
                    {
                        if (Session.GetHabbo().HasCmd("alert"))
                        {
                            if (Params[1] == null || Params[2] == null)
                            {
                                Session.SendNotif("You left something empty.");
                                return true;
                            }
                            string TargetUser = null;
                            GameClient TargetClient = null;

                            TargetUser = Params[1];
                            TargetClient = SilverwaveEnvironment.GetGame().GetClientManager().GetClientByUsername(TargetUser);
                            Room TargetRoom = TargetClient.GetHabbo().CurrentRoom;

                            if (TargetClient == null)
                            {
                                Session.SendNotif("User could not be found.");
                                return true;
                            }

                            TargetClient.SendNotif(Params[2] + " -" + Session.GetHabbo().Username);
                        }
                        return true;
                    }
Run:
Code:
INSERT INTO .`fuse_cmds` (`id`, `command`, `rank`, `params`, `description`) VALUES ('82', 'alert', '5', '%name% %message%', 'Alert a user with a specific message');
Proof of working:
Spoiler: 


By: HillBilly


#3 - Minimail
Spoiler: 

Find in GameClient.cs:
Code:
MiniMail.AppendInt32(1);
Replace with: 
Code:
MiniMail.AppendInt32(0);
Proof:
Spoiler: 


By: BloodRaven


#4 -Pets Fix
Spoiler: 

Go to Messages -> Requests -> Rooms.cs.
Find:
Code:
internal void PlacePet()
Replace:
Spoiler: 


Find:
Code:
dbClient.setQuery("SELECT * FROM bots WHERE room_id = " + RoomId);
Replace: 
Code:
dbClient.setQuery("SELECT * FROM bots WHERE room_id = " + RoomId + " AND ai_type = 'generic'");
Go to HabboHotel -> Rooms -> RoomUser.cs
Find:
Code:
internal void Serialize(ServerMessage Message, bool gotPublicRoom)
Replace:
Spoiler: 


Find CheckPetNameMessageEvent = and change it to public const int CheckPetNameMessageEvent = 3913; //akl
Find GetSellablePetBreedsMessageEvent = and change it to public const int GetSellablePetBreedsMessageEvent = 3780; //akl


Headers by Bloodraven

Proof:
Spoiler: 



#5 - Unfavorite Room
Spoiler: 

Find:
Code:
public const int RemoveFavouriteRoomMessageEvent = 0;
Replace:
Code:
public const int RemoveFavouriteRoomMessageEvent = 81;
By: albertwitwerts


#6 - MOD Tools Displaying
Spoiler: 

Change:
Code:
this.SendMessage(SilverwaveEnvironment.GetGame().GetModerationTool().SerializeTool());
To:
Code:
response.appendResponse(SilverwaveEnvironment.GetGame().GetModerationTool().SerializeTool());
By: AWA


#7 - User Chatlog:
Spoiler: 

Find:
Code:
internal static int UserChatlog = 0x777FF;//disabled
Replace with:
Code:
internal static int UserChatlog = 3791;


#8 - Idle Fix
Spoiler: 

Find:
Code:
public const int SleepMessageComposer = 3474;
Replace With:
Code:
public const int SleepMessageComposer = 1644;


#9 - Achievements Window
Spoiler: 

Find:
Code:
internal static int AchievementList = 2328;//akl
Replace With:
Code:
internal static int AchievementList = 2134;//akl


#10 - Moodlight SQL Error
Spoiler: 

Code:
case InteractionType.dimmer: 
                                { 
                                    UserItem it = Session.GetHabbo().GetInventoryComponent().AddNewItem(0, Item.ItemId, ExtraData, 0, true, false, 0,0,0); 
                                    uint id = it.Id; 
                                    result.Add(it); 
                                    using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor()) 
                                    { 
                                        dbClient.runFastQuery("INSERT INTO room_items_moodlight (item_id,enabled,current_preset,preset_one,preset_two,preset_three) VALUES (" + id + ",'0',1,'#000000,255,0','#000000,255,0','#000000,255,0')"); 
                                        // 0 changed to '0' 
                                    } 
                                }


#11 - Fix for Limited Items:
Spoiler: 

Run this:

Code:
CREATE TABLE IF NOT EXISTS `items_limited` (
  `item_id` int(55) NOT NULL,
  `LimitedNo` int(55) NOT NULL,
  `LimitedTot` int(55) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Go to: HabboHotel/Items/RoomItem.cs

Find -> items_limited 
Remove the // and /* and */


Go to: HabboHotel/Items/UserItem.cs

Find -> items_limited
Remove the // and /* and */


Go to: HabboHotel/Users/Inventory/InventoryComponent.cs

Find -> items_limited
Remove the // and /* and */


Go to: HabboHotel/Items/UserItem.cs

Find:
Code:
internal void SerializeFloor(ServerMessage Message, Boolean Inventory)
Put:
Code:
else if (LimitedNo > 0)
            {
                Message.AppendInt32(1);
                Message.AppendInt32(256);
                Message.AppendString(this.ExtraData);
                Message.AppendInt32(this.LimitedNo);
                Message.AppendInt32(this.LimitedTot);
            }
Before:

Code:
else
                {
                    Message.AppendInt32(1);
                    Message.AppendInt32(0);
                    Message.AppendString(ExtraData);
                }
            }

Find (internal void SerializeFloor): 
Code:
Message.AppendBoolean(GetBaseItem().AllowInventoryStack);
Replace:
Code:
if (LimitedNo > 0)
            {
                Message.AppendBoolean(false);
            }
            else
            {
                Message.AppendBoolean(GetBaseItem().AllowInventoryStack);
            }
Inventory Stack repaired with the help of Receiver :)

Fim.

Rayant Rayant  • 15.03.14 16:40

Todos Fixes para PlusEmu Empty Re: Todos Fixes para PlusEmu 15.03.14 16:40

Cade os créditos? E eu já tenho os mesmos, peguei no rz também, mas obrigado por compartilhar.

xjoao xjoao  • 15.03.14 17:05

Todos Fixes para PlusEmu Empty Re: Todos Fixes para PlusEmu 15.03.14 17:05

eu ja vi mais bios ira ajudar muitos usuarios do power vlw

Anonymous Convidado  • 15.03.14 20:09

Todos Fixes para PlusEmu Empty Re: Todos Fixes para PlusEmu 15.03.14 20:09

Nao botei creditos por que já falei que é do RZ.
Irei fazer melhor depois, estou no iPad.
Permissões neste sub-fórum
Não podes responder a tópicos

BH Servers

Recomendamos a BH Servers com proteção DDOS gratuita em Cloud Server de alta performance. Entrega imediata.