[Update] New Structures to Plus emu r2 [New Room create etc]

ptimmaq2

We all make mistakes
Aug 7, 2013
283
33
I'm just re-releasing this from rival forum.
All credits go to : - AKIIX- Twan- Sledmore- Spot ify- MrPudding.

New Structure - PlusR2 [Updated]
Haii,

Bugs & Known Issues
Spoiler:

- User Profile *Fixed*
- Floor Editor (the fix throws error)
- All the other fixed posted by the guy who posted most of the Fixes
- Pets in catalogue dont show up ( idk if u can place em either)
- Hc Disconnects when buying (when u get back on client days are added)
-
-


Cracked Habbo.swf for this release

This will look like this :

First update your emulator to this :
Spoiler:

ServerPacketHeader. cs

ClientPacketHeader. cs

Events.cs

Composers.cs

Create Room:Replace the CreateRoom() void with this one:

Spoiler:

internal void CreateRoom()
{
// New structure fixed by Finn

string Name = this.Request.PopFixedString();
string Description = this.Request.PopFixedString();
string RoomModel = this.Request.PopFixedString();
int Category = this.Request.PopWiredInt32();
int MaxVisitors = this.Request.PopWiredInt32();
int TradeState = this.Request.PopWiredInt32();


RoomData Data = SilverwaveEnvironment.GetGame().GetRoomManager().CreateRoom(this.Session, Name, Description, RoomModel, Category, MaxVisitors);
if (Data != null)
{
this.Response.Init(Outgoing.OnCreateRoomInfo);
this.Response.AppendInt32(Data.Id);
this.Response.AppendString(Data.Name);
this.SendResponse();
}
}


Now find internal RoomData CreateRoom(
and replace the whole function with:

Spoiler:
internal RoomData CreateRoom(GameClient Session, string Name, string Desc, string Model, int Category, int MaxVisitors)
{
// New structure fixed by Finn

if (!this.roomModels.ContainsKey(Model))
{
Session.SendNotif("Room Model was not found.");
return null;
}
if (Name.Length < 3)
{
Session.SendNotif("The Room name is too short...");
return null;
}


uint RoomId = 0;
using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
{
dbClient.setQuery("INSERT INTO rooms (roomtype,caption,description,owner,model_name,category,users_max) VALUES ('private', @ , @ c , @ , @ , @ , @usmax)");
dbClient.addParameter("caption", Name);
dbClient.addParameter("desc", Desc);
dbClient.addParameter("username", Session.GetHabbo().Username);
dbClient.addParameter("model", Model);
dbClient.addParameter("cat", Category);
dbClient.addParameter("usmax", MaxVisitors);
RoomId = (uint)dbClient.insertQuery();
}
RoomData Data = this.GenerateRoomData(RoomId);
Session.GetHabbo().UsersRooms.Add(Data);
return Data;
}



Now, how to fix room entering?

Search for:
Spoiler:
ServerMessage Message = new ServerMessage(Outgoing.HeightMap);
Message.AppendBoolean(false);


And below that you put:
Spoiler:
Message.AppendInt32(-1); // Walls height, new structure fixed by Finn


MAKE SURE
Outgoing.SerializeWallItems IS 395

Fix for chatlogsFind: internal static ServerMessage SerializeRoomChatlogReplace the whole function with:
Spoiler:

internal static ServerMessage SerializeRoomChatlog(uint roomID)
{
// NEW CHATLOGS [March 2014] Coded by Finn
// Please don't remove credits, this took me some time to do... :(
// Credits to Itachi for the structure's "context" enigma :D




ServerMessage Message = new ServerMessage();
RoomData Room = SilverwaveEnvironment.GetGame().GetRoomManager().GenerateRoomData(roomID);
if (Room == null)
{
throw new NullReferenceException("No room found.");
}




Message.Init(Outgoing.RoomChatlog);
Message.AppendByte(1);
Message.AppendShort(2);
Message.AppendString("roomName");
Message.AppendByte(2);
Message.AppendString(Room.Name);
Message.AppendString("roomId");
Message.AppendByte(1);
Message.AppendInt32(Room.Id);




Message.AppendShort(Room.RoomChat.Count);
Room.RoomChat.Reverse();
foreach (Chatlog Log in Room.RoomChat)
{
Habbo Habbo = SilverwaveEnvironment.getHabboForId(Log.UserId);
DateTime Date = SilverwaveEnvironment.UnixToDateTime(Log.Timestamp);
if (Habbo == null)
{
Message.AppendInt32((DateTime.Now - Date).Seconds);
Message.AppendInt32(Log.UserId);
Message.AppendString("*User not found*");
Message.AppendString(Log.Message);
Message.AppendBoolean(true);
}
else
{
Message.AppendInt32((DateTime.Now - Date).Seconds);
Message.AppendInt32(Habbo.Id);
Message.AppendString(Habbo.Username);
Message.AppendString(Log.Message);
Message.AppendBoolean(false); // Text is bold
}
}
Room.RoomChat.Reverse();
return Message;
}


Add to ServerMessage.cs :

Spoiler:

public void AppendByte(int i)
{
this.AppendBytes(new byte[] { (byte)i }, false);
}


Screen :


Fix for User Profile:
Spoiler:
Replace your UserProfile()
with this one:



Fix for sending tickets:
Spoiler:

Replace SubmitHelpTicket() with this one:



Replace the entire internal void SendNewTicket with this one:





Support Ticket Fix :
Spoiler:

Find:
internal double Timestamp;

add below:

internal List<string> ReportedChats;


Now Find:
internal SupportTicket(uint Id
and just after this double Timestamp,
add:

List<string> ReportedChats

Now find :
this.Timestamp = Timestamp;

And add after:

this.ReportedChats = ReportedChats;

Finally, replace the Serialize function in SupportTicket.cs with this one:




Enable the Floor Plan Save button
Spoiler:
Replace the whole
public UserPerksComposer(GameClient Client) :base(ServerPacketHeader.UserPerksMessageComposer)with this one (updated for the new build):public UserPerksComposer(GameClient Client) : base(ServerPacketHeader.UserPerksMessageComposer)
{
base.WriteInteger(10);
base.WriteString("EXPERIMENTAL_CHAT_BETA");
base.WriteString("");
base.WriteBoolean(true);
base.WriteString("CITIZEN");
base.WriteString("");
base.WriteBoolean(true);
base.WriteString("VOTE_IN_COMPETITIONS");
base.WriteString("requirement.unfulfilled.helper_level_2");
base.WriteBoolean(false);
base.WriteString("NEW_UI");
base.WriteString("");
base.WriteBoolean(true);
base.WriteString("USE_GUIDE_TOOL");
base.WriteString("requirement.unfulfilled.helper_level_4");
base.WriteBoolean(false);
base.WriteString("BUILDER_AT_WORK");
base.WriteString("");
base.WriteBoolean(true);
base.WriteString("JUDGE_CHAT_REVIEWS");
base.WriteString("requirement.unfulfilled.helper_level_6");
base.WriteBoolean(false);
base.WriteString("EXPERIMENTAL_TOOLBAR");
base.WriteString("requirement.unfulfilled.group_membership");
base.WriteBoolean(false);
base.WriteString("CALL_ON_HELPERS");
base.WriteString("");
base.WriteBoolean(true);
base.WriteString("TRADE");
base.WriteString("");
base.WriteBoolean(true);
}

Note : Now if you want to disable the button you just set "BUILDER_AT_WORK" to false.



Fix for Habbo Club Rights:
Spoiler:

Find:
public UserRightsComposer(uint Rank)
: base(ServerPacketHeader.UserRightsMessageComposer)
{
base.WriteInteger(2);
base.WriteInteger(Rank);
}


Replace it with:


public UserRightsComposer(uint Rank)
: base(ServerPacketHeader.UserRightsMessageComposer)
{
base.WriteInteger(2);
base.WriteInteger(Rank);
base.WriteInteger(0); // Unknown ~Finn
}


Now search for:
ServerMessage fuserights = new ServerMessage(Outgoing.Fuserights);
//if (GetSubscriptionManager().HasSubscription("habbo_vip")) // VIP
fuserights.AppendInt32(2);
//else if (GetSubscriptionManager().HasSubscription("habbo_club")) // HC
//fuserights.AppendInt32(1);
//else
//fuserights.AppendInt32(0);
fuserights.AppendInt32(Rank);


Replace it with:

ServerMessage fuserights = new ServerMessage(Outgoing.Fuserights);
fuserights.AppendInt32(2);
fuserights.AppendInt32(Rank);
fuserights.AppendInt32(0);//Unknown. ~Finn



Credits

- AKIIX
- Twan
- Sledmore
- Spot ify
- MrPudding


All credits to people mentioned above, this is just a re-release, since i didnt see this anywhere on devbest and thought this might help some people.
 

Javasex

On Instagram str8 Flexin
Dec 21, 2013
128
24
Where to find the Create Room Void , mod tools etc....?
Include that in ur thread m8
 

Users who are viewing this thread

Top