ptimmaq2
We all make mistakes
- Aug 7, 2013
- 283
- 33
Just to start off, all credits go to @13rad who gave me it on my request post for this command, i just thought (re)releasing it so you others see it.
Step 1 - Table alteration
Firstly, run the following MySQL query:
ALTER TABLE users
ADD use_newui enum('1','0') DEFAULT '1';
Step 2 - Modifying the Habbo class
Firstly, open Habbo.cs and find:
internal bool IsGuardian;
and add below it:
Code:
internal bool NewUI;
then, find:
internal Habbo(UInt32 Id, string Username, string RealName, uint Rank, string Motto, string Look, string Gender, Int32 Credits,
Int32 ActivityPoints, Double LastActivityPointsUpdate, bool Muted,
UInt32 HomeRoom, Int32 Respect, Int32 DailyRespectPoints, Int32 DailyPetRespectPoints,
bool MutantPenalty, bool HasFriendRequestsDisabled, uint currentQuestID, int currentQuestProgress,
int achievementPoints, int LastOnline, bool AppearOffline, bool HideInRoom, bool VIP, double CreateDate,
bool Online, bool isguide, bool Blockwhisper, int SCurrency, bool mysbox, int key, List<GroupUser> Groups, uint FavId, int LastChange)
and add bool NewUI or replace it with this:
Code:
internal Habbo(UInt32 Id, string Username, string RealName, uint Rank, string Motto, string Look, string Gender, Int32 Credits,
Int32 ActivityPoints, Double LastActivityPointsUpdate, bool Muted,
UInt32 HomeRoom, Int32 Respect, Int32 DailyRespectPoints, Int32 DailyPetRespectPoints,
bool MutantPenalty, bool HasFriendRequestsDisabled, uint currentQuestID, int currentQuestProgress,
int achievementPoints, int LastOnline, bool AppearOffline, bool HideInRoom, bool VIP, double CreateDate,
bool Online, bool isguide, bool Blockwhisper, int SCurrency, bool mysbox, int key, List<GroupUser> Groups, uint FavId, int LastChange, bool NewUI)
and then find:
this.IsGuardian = true;
and add this directly below:
Code:
this.NewUI = NewUI;
then you need to add this at the bottom of the Habbo.cs file:
Code:
internal void NewUISwitcher() {
if (NewUI)
{
using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
{
dbClient.runFastQuery("UPDATE users SET use_newui='0' WHERE id='" + this.Id + "'");
this.NewUI = false;
GetClient().SendNotif("New UI disabled!\n\nYour changes will be applied when you reload.");
}
}
else
{
using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
{
dbClient.runFastQuery("UPDATE users SET use_newui='1' WHERE id='" + this.Id + "'");
this.NewUI = true;
GetClient().SendNotif("New UI enabled!\n\nYour changes will be applied when you reload.");
}
}
}
Step 3 - modifying the Authenticator class
Firstly, open Authenticator.cs and find:
int LastChange = (int)dRow["last_change"];
add this directly below:
Code:
bool NewUI = SilverwaveEnvironment.EnumToBool(dRow["use_newui"].ToString());
then, find:
Code:
return new Habbo(id, username, realname, rank, motto, look, gender, credits, activityPoints, activityPointsLastUpdate, isMuted, homeRoom, respect, dailyRespect, dailyPetRespect, mtantPenalty, blockFriends, questID, questProgress, achiecvementPoints,
lastonline, AppearOffline, HideFromRoom, vip, Createtime, online, isguide, Blockwhisper, Sc, mys, key, group, favid, LastChange, NewUI);
Step 4 - Adding the command
Open ChatCommandHandler.cs and add this:
Code:
#region UI ui) case "ui":
{
Session.GetHabbo().NewUISwitcher();
return true;
}
#endregion
Step 5 - Final steps
Firstly open InfoRetrieveEvent.cs and find:
Code:
Session.SendMessage(new UserPerksComposer(Session.GetHabbo()));
then, open up UserPerksComposer.cs and add the following reference:
Code:
using Silverwave.HabboHotel.Users;
then, find:
Code:
public UserPerksComposer(Habbo Habbo)
then, find:
Code:
base.WriteString("NEW_UI"); base.WriteString("");
if (Habbo.NewUI)
{
base.WriteBoolean(true);
}
else
{
base.WriteBoolean(false);
}
Step 5 - Adding the command to :command list (optional)
INSERT INTO `fuse_cmds` (`command`, `rank`, `params`, `description`) VALUES ('ui', '1', NULL, 'Change back to the old version of the hotel.');
Your welcome!
Once again all credits for making/founding this to @13rad
NOTE: Remember to debug silverwave (the project file).
Step 1 - Table alteration
Firstly, run the following MySQL query:
ALTER TABLE users
ADD use_newui enum('1','0') DEFAULT '1';
Step 2 - Modifying the Habbo class
Firstly, open Habbo.cs and find:
internal bool IsGuardian;
and add below it:
Code:
internal bool NewUI;
then, find:
internal Habbo(UInt32 Id, string Username, string RealName, uint Rank, string Motto, string Look, string Gender, Int32 Credits,
Int32 ActivityPoints, Double LastActivityPointsUpdate, bool Muted,
UInt32 HomeRoom, Int32 Respect, Int32 DailyRespectPoints, Int32 DailyPetRespectPoints,
bool MutantPenalty, bool HasFriendRequestsDisabled, uint currentQuestID, int currentQuestProgress,
int achievementPoints, int LastOnline, bool AppearOffline, bool HideInRoom, bool VIP, double CreateDate,
bool Online, bool isguide, bool Blockwhisper, int SCurrency, bool mysbox, int key, List<GroupUser> Groups, uint FavId, int LastChange)
and add bool NewUI or replace it with this:
Code:
internal Habbo(UInt32 Id, string Username, string RealName, uint Rank, string Motto, string Look, string Gender, Int32 Credits,
Int32 ActivityPoints, Double LastActivityPointsUpdate, bool Muted,
UInt32 HomeRoom, Int32 Respect, Int32 DailyRespectPoints, Int32 DailyPetRespectPoints,
bool MutantPenalty, bool HasFriendRequestsDisabled, uint currentQuestID, int currentQuestProgress,
int achievementPoints, int LastOnline, bool AppearOffline, bool HideInRoom, bool VIP, double CreateDate,
bool Online, bool isguide, bool Blockwhisper, int SCurrency, bool mysbox, int key, List<GroupUser> Groups, uint FavId, int LastChange, bool NewUI)
and then find:
this.IsGuardian = true;
and add this directly below:
Code:
this.NewUI = NewUI;
then you need to add this at the bottom of the Habbo.cs file:
Code:
internal void NewUISwitcher() {
if (NewUI)
{
using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
{
dbClient.runFastQuery("UPDATE users SET use_newui='0' WHERE id='" + this.Id + "'");
this.NewUI = false;
GetClient().SendNotif("New UI disabled!\n\nYour changes will be applied when you reload.");
}
}
else
{
using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
{
dbClient.runFastQuery("UPDATE users SET use_newui='1' WHERE id='" + this.Id + "'");
this.NewUI = true;
GetClient().SendNotif("New UI enabled!\n\nYour changes will be applied when you reload.");
}
}
}
Step 3 - modifying the Authenticator class
Firstly, open Authenticator.cs and find:
int LastChange = (int)dRow["last_change"];
add this directly below:
Code:
bool NewUI = SilverwaveEnvironment.EnumToBool(dRow["use_newui"].ToString());
then, find:
return new Habbo(id, username, realname, rank, motto, look, gender, credits, activityPoints, activityPointsLastUpdate, isMuted, homeRoom, respect, dailyRespect, dailyPetRespect, mtantPenalty, blockFriends, questID, questProgress, achiecvementPoints,
lastonline, AppearOffline, HideFromRoom, vip, Createtime, online, isguide, Blockwhisper, Sc, mys, key, group, favid, LastChange);
and add the NewUI bool or replace it with this:lastonline, AppearOffline, HideFromRoom, vip, Createtime, online, isguide, Blockwhisper, Sc, mys, key, group, favid, LastChange);
Code:
return new Habbo(id, username, realname, rank, motto, look, gender, credits, activityPoints, activityPointsLastUpdate, isMuted, homeRoom, respect, dailyRespect, dailyPetRespect, mtantPenalty, blockFriends, questID, questProgress, achiecvementPoints,
lastonline, AppearOffline, HideFromRoom, vip, Createtime, online, isguide, Blockwhisper, Sc, mys, key, group, favid, LastChange, NewUI);
Step 4 - Adding the command
Open ChatCommandHandler.cs and add this:
Code:
#region UI ui) case "ui":
{
Session.GetHabbo().NewUISwitcher();
return true;
}
#endregion
Step 5 - Final steps
Firstly open InfoRetrieveEvent.cs and find:
Session.SendMessage(new UserPerksComposer());
replace it with this:Code:
Session.SendMessage(new UserPerksComposer(Session.GetHabbo()));
then, open up UserPerksComposer.cs and add the following reference:
Code:
using Silverwave.HabboHotel.Users;
then, find:
public UserPerksComposer()
and replace it with: Code:
public UserPerksComposer(Habbo Habbo)
then, find:
base.WriteString("NEW_UI");
base.WriteString("");
base.WriteBoolean(true);
and replace with with this:base.WriteString("");
base.WriteBoolean(true);
Code:
base.WriteString("NEW_UI"); base.WriteString("");
if (Habbo.NewUI)
{
base.WriteBoolean(true);
}
else
{
base.WriteBoolean(false);
}
Step 5 - Adding the command to :command list (optional)
INSERT INTO `fuse_cmds` (`command`, `rank`, `params`, `description`) VALUES ('ui', '1', NULL, 'Change back to the old version of the hotel.');
Your welcome!
Once again all credits for making/founding this to @13rad
NOTE: Remember to debug silverwave (the project file).
Last edited: