I think a fix for search:ownername was released a few pages back and I have no need for marketplace anyway.
Printable View
Search owner: expliot
1. Open Butterfly/HabboHotel/Navigators/Navigator.cs
2. Find internal ServerMessage SerializeSearchResults(string SearchQuery)
3. Replace with
Marketplace search expliot:PHP Code:internal ServerMessage SerializeSearchResults(string SearchQuery)
{
DataTable table = new DataTable();
using (IQueryAdapter adapter = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
{
if (SearchQuery.Length > 0)
{
if (SearchQuery.StartsWith("owner:"))
{
adapter.setQuery("SELECT * FROM rooms WHERE owner LIKE @query ORDER BY id DESC LIMIT 50");
}
else if (adapter.dbType == DatabaseType.MySQL)
{
adapter.setQuery("SELECT rooms.*, room_active.active_users FROM rooms LEFT JOIN room_active ON (room_active.roomid = rooms.id) WHERE owner = @query AND roomtype = 'private' UNION ALL SELECT rooms.*, room_active.active_users FROM rooms LEFT JOIN room_active ON (room_active.roomid = rooms.id) WHERE caption = @query AND roomtype = 'private' ORDER BY active_users DESC LIMIT 50");
}
else
{
adapter.setQuery("SELECT TOP 50 rooms.*, room_active.active_users FROM rooms LEFT JOIN room_active ON (room_active.roomid = rooms.id) WHERE owner = @query AND roomtype = 'private' UNION ALL SELECT rooms.*, room_active.active_users FROM rooms LEFT JOIN room_active ON (room_active.roomid = rooms.id) WHERE caption = @query AND roomtype = 'private' ORDER BY active_users DESC");
}
if (SearchQuery.StartsWith("owner:"))
{
adapter.addParameter("query", SearchQuery.Replace("owner:", ""));
}
else
{
adapter.addParameter("query", SearchQuery);
}
table = adapter.getTable();
}
}
List<RoomData> list = new List<RoomData>();
if (table != null)
{
foreach (DataRow row in table.Rows)
{
RoomData item = ButterflyEnvironment.GetGame().GetRoomManager().FetchRoomData(Convert.ToUInt32(row["id"]), row);
list.Add(item);
}
}
ServerMessage message = new ServerMessage(Outgoing.NavigatorPacket);
message.AppendInt32(8);
message.AppendString(SearchQuery);
message.AppendInt32(list.Count);
foreach (RoomData data2 in list)
{
data2.Serialize(message, false);
}
message.AppendBoolean(false);
return message;
}
1. Open Butterfly/HabboHotel/Catalogs/Marketplace.cs
2. Fine internal static ServerMessage SerializeOffers(int MinCost, int MaxCost, string SearchQuery, int FilterMode)
3. Replace with
I didn't find another other expliots in search or mp.PHP Code:internal static ServerMessage SerializeOffers(int MinCost, int MaxCost, string SearchQuery, int FilterMode)
{
StringBuilder builder = new StringBuilder();
builder.Append("WHERE state = '1' AND timestamp >= " + FormatTimestampString());
if (MinCost >= 0)
{
builder.Append(" AND total_price > @minCost");
}
if (MaxCost >= 0)
{
builder.Append(" AND total_price < @maxCost");
}
if (SearchQuery.Length >= 1)
{
builder.Append(" AND public_name LIKE @query");
}
switch (FilterMode)
{
case 1:
builder.Append(" ORDER BY asking_price DESC");
break;
case 2:
builder.Append(" ORDER BY asking_price ASC");
break;
}
using (IQueryAdapter adapter = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
{
adapter.setQuery("SELECT * FROM catalog_marketplace_offers " + builder.ToString());
if (MinCost >= 0)
{
adapter.addParameter("minCost", MinCost);
}
if (MaxCost >= 0)
{
adapter.addParameter("minCost", MaxCost);
}
if (SearchQuery.Length >= 1)
{
adapter.addParameter("query", "%" + SearchQuery + "%");
}
DataTable table = adapter.getTable();
adapter.setQuery("SELECT COUNT(DISTINCT sprite_id) FROM catalog_marketplace_offers " + builder.ToString() + " LIMIT 250");
int i = adapter.getInteger();
int num2 = 0;
List<int> list = new List<int>();
ServerMessage message = new ServerMessage(Outgoing.GetOffers);
message.AppendInt32(i);
foreach (DataRow row in table.Rows)
{
if (!list.Contains((int) row["sprite_id"]))
{
list.Add((int) row["sprite_id"]);
int[] avarage = GetAvarage((int) row["sprite_id"]);
message.AppendInt32(int.Parse(row["offer_id"].ToString()));
message.AppendInt32(1);
message.AppendInt32(1);
message.AppendInt32((int) row["sprite_id"]);
message.AppendInt32(0);
message.AppendString("");
message.AppendInt32((int) row["total_price"]);
message.AppendInt32(0);
message.AppendInt32(avarage[0]);
message.AppendInt32(avarage[1]);
num2 += avarage[1];
}
}
message.AppendInt32(num2);
return message;
}
}
Enjoy.
There is one exploit in that Redeem credits function in the catalogue, I guess. If you type: ' OR 1=1-- in it you will get disconnected :p
Where? I don't see it:
PHP Code:internal class VoucherHandler
{
internal static int GetVoucherValue(string Code)
{
DataRow row;
using (IQueryAdapter adapter = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
{
adapter.setQuery("SELECT value FROM credit_vouchers WHERE code = @code");
adapter.addParameter("code", Code);
row = adapter.getRow();
}
if (row != null)
{
return (int) row[0];
}
return 0;
}
private static bool IsValidCode(string Code)
{
using (IQueryAdapter adapter = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
{
adapter.setQuery("SELECT null FROM credit_vouchers WHERE code = @code");
adapter.addParameter("code", Code);
if (adapter.getRow() != null)
{
return true;
}
}
return false;
}
private static void TryDeleteVoucher(string Code)
{
using (IQueryAdapter adapter = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
{
adapter.setQuery("DELETE FROM credit_vouchers WHERE code = @code");
adapter.addParameter("code", Code);
adapter.runQuery();
}
}
internal static void TryRedeemVoucher(GameClient Session, string Code)
{
if (!IsValidCode(Code))
{
ServerMessage message = new ServerMessage(0xd5);
message.AppendString("1");
Session.SendMessage(message);
}
else
{
int voucherValue = GetVoucherValue(Code);
TryDeleteVoucher(Code);
Habbo habbo = Session.GetHabbo();
habbo.Credits += voucherValue;
Session.GetHabbo().UpdateCreditsBalance();
Session.SendMessage(new ServerMessage(0xd4));
}
}
}
I've managed to fix the generation of the coins by the codes. But I did not realize this exploit, and I have no idea how to fix it but I'll see if I find a way here!
What do you think is not an exploit, anything you write will give disconnect.
For fix this use this fix: http://forum.ragezone.com/f353/swift...ml#post7728234
Ya I see now. It's not an exploit, just a non-updated header conflict.
Session.SendMessage(new ServerMessage(0xd4));
ServerMessage message = new ServerMessage(0xd5);
Should be (Didn't test):
Session.SendMessage(new ServerMessage(3089));
ServerMessage message = new ServerMessage(2442);
Crystals fix doesnt work here:
On line 742: clientByUsername.GetHabbo().UpdateDiamondsBalance();Code:Error 2 'Butterfly.HabboHotel.Habbo.Users.Habbo' does not contain a definition for 'UpdateDiamondsBalance' and no extension method 'UpdateDiamondsBalance' accepting a first argument of type 'Butterfly.HabboHotel.Habbo.Users.Habbo' could be found (are you missing a using directive or an assembly reference?) C:\Users\Administrator\Downloads\Revision 5 - Alpha 3\Butterfly\HabboHotel\Misc\ChatCommandHandler.cs 742 49 Butterfly Emulator
Also, if i type :givecrystal in my room, it doesnt work (rank 100)
more fixes thanks!
Fixing button: Mute all (Preferences of Room):
In Incoming.cs, add this:
andPHP Code:public static int RoomMuteAll;
In Outgoing.cs, add this:PHP Code:Incoming.RoomMuteAll = 574;//b
andPHP Code:public static int RoomMuteAllOut;
In GameClientMessageHandler.cs, search by: public void MarketplaceTakeBack()PHP Code:Outgoing.RoomMuteAllOut = 2132;//b
Above that, add:
In SharedPacketLib.cs, add this:PHP Code:internal void RoomMuteAll()
{
Room currentRoom = this.Session.GetHabbo().CurrentRoom;
if ((currentRoom != null) && currentRoom.CheckRights(this.Session))
{
if (this.Session.GetHabbo().CurrentRoom.RoomMuted)
{
this.Session.GetHabbo().CurrentRoom.RoomMuted = false;
ServerMessage Message = new ServerMessage(Outgoing.RoomMuteAllOut);
Message.AppendBoolean(false);
Session.SendMessage(Message);
return;
}
else
{
this.Session.GetHabbo().CurrentRoom.RoomMuted = true;
ServerMessage Message = new ServerMessage(Outgoing.RoomMuteAllOut);
Message.AppendBoolean(true);
Session.SendMessage(Message);
return;
}
}
else
{
this.Session.SendNotif("You need rights to this!");
}
}
In StaticClientMessageHandler.cs, search by:PHP Code:internal static void RoomMuteAll(GameClientMessageHandler handler)
{
handler.RoomMuteAll();
}
After that, add:PHP Code:handlers.Add(Incoming.CatalogGetRace, new StaticRequestHandler(SharedPacketLib.PetRaces));
Done!PHP Code:handlers.Add(Incoming.RoomMuteAll, new StaticRequestHandler(SharedPacketLib.RoomMuteAll));
Image to proof:
http://i.imgur.com/fV5zMZR.png
Like? :D
Good job! Legend<3
Please can you fix this :
- decorate the apartment in options
- animals disappearing at each unload
- a user ingnorer in options
and finish the fix for Chatlogs started but incomplete
Hello someone posted that a fix for users are up
Thanks for fix Marlon!
Can someone upload all fixes?