Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Releases
Server Releases
[Release] :ui (changing between old and new ui) command for Plus emu r2 [Release]
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="ptimmaq2" data-source="post: 282948" data-attributes="member: 36323"><p>Just to start off, all credits go to [USER=37541]@13rad[/USER] who gave me it on my request post for this command, i just thought (re)releasing it so you others see it.</p><p></p><p><strong>Step 1 - Table alteration</strong></p><p></p><p>Firstly, run the following MySQL query:</p><p></p><p></p><p>ALTER TABLE users</p><p>ADD use_newui enum('1','0') DEFAULT '1';</p><p><strong>Step 2 - Modifying the Habbo class</strong></p><p></p><p>Firstly, open Habbo.cs and find:</p><p></p><p></p><p>internal bool IsGuardian;</p><p>and add below it:</p><p></p><p>Code:</p><p>internal bool NewUI;</p><p></p><p>then, find:</p><p></p><p></p><p>internal Habbo(UInt32 Id, string Username, string RealName, uint Rank, string Motto, string Look, string Gender, Int32 Credits,</p><p>Int32 ActivityPoints, Double LastActivityPointsUpdate, bool Muted,</p><p>UInt32 HomeRoom, Int32 Respect, Int32 DailyRespectPoints, Int32 DailyPetRespectPoints,</p><p>bool MutantPenalty, bool HasFriendRequestsDisabled, uint currentQuestID, int currentQuestProgress,</p><p>int achievementPoints, int LastOnline, bool AppearOffline, bool HideInRoom, bool VIP, double CreateDate,</p><p>bool Online, bool isguide, bool Blockwhisper, int SCurrency, bool mysbox, int key, List<GroupUser> Groups, uint FavId, int LastChange)</p><p></p><p>and add bool NewUI or replace it with this:</p><p></p><p>Code:</p><p>internal Habbo(UInt32 Id, string Username, string RealName, uint Rank, string Motto, string Look, string Gender, Int32 Credits,</p><p>Int32 ActivityPoints, Double LastActivityPointsUpdate, bool Muted,</p><p>UInt32 HomeRoom, Int32 Respect, Int32 DailyRespectPoints, Int32 DailyPetRespectPoints,</p><p>bool MutantPenalty, bool HasFriendRequestsDisabled, uint currentQuestID, int currentQuestProgress,</p><p>int achievementPoints, int LastOnline, bool AppearOffline, bool HideInRoom, bool VIP, double CreateDate,</p><p>bool Online, bool isguide, bool Blockwhisper, int SCurrency, bool mysbox, int key, List<GroupUser> Groups, uint FavId, int LastChange, bool NewUI)</p><p></p><p>and then find:</p><p></p><p></p><p>this.IsGuardian = true;</p><p>and add this directly below:</p><p></p><p>Code:</p><p>this.NewUI = NewUI;</p><p></p><p>then you need to add this at the bottom of the Habbo.cs file:</p><p></p><p>Code:</p><p>internal void NewUISwitcher() {</p><p>if (NewUI)</p><p>{</p><p>using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())</p><p>{</p><p>dbClient.runFastQuery("UPDATE users SET use_newui='0' WHERE id='" + this.Id + "'");</p><p>this.NewUI = false;</p><p>GetClient().SendNotif("New UI disabled!\n\nYour changes will be applied when you reload.");</p><p>}</p><p>}</p><p>else</p><p>{</p><p>using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())</p><p>{</p><p>dbClient.runFastQuery("UPDATE users SET use_newui='1' WHERE id='" + this.Id + "'");</p><p>this.NewUI = true;</p><p>GetClient().SendNotif("New UI enabled!\n\nYour changes will be applied when you reload.");</p><p>}</p><p>}</p><p>}</p><p></p><p><strong>Step 3 - modifying the Authenticator class</strong></p><p><strong>Firstly, open Authenticator.cs and find:</strong></p><p></p><p></p><p><strong>int LastChange = (int)dRow["last_change"];</strong></p><p><strong>add this directly below:</strong></p><p></p><p>Code:</p><p><strong>bool NewUI = SilverwaveEnvironment.EnumToBool(dRow["use_newui"].ToString());</strong></p><p></p><p><strong>then, find: </strong></p><p></p><p></p><p style="margin-left: 20px"><strong>return new Habbo(id, username, realname, rank, motto, look, gender, credits, activityPoints, activityPointsLastUpdate, isMuted, homeRoom, respect, dailyRespect, dailyPetRespect, mtantPenalty, blockFriends, questID, questProgress, achiecvementPoints, </strong></p> <p style="margin-left: 20px"><strong>lastonline, AppearOffline, HideFromRoom, vip, Createtime, online, isguide, Blockwhisper, Sc, mys, key, group, favid, LastChange);</strong></p><p><strong>and add the NewUI bool or replace it with this:</strong></p><p></p><p>Code:</p><p><strong>return new Habbo(id, username, realname, rank, motto, look, gender, credits, activityPoints, activityPointsLastUpdate, isMuted, homeRoom, respect, dailyRespect, dailyPetRespect, mtantPenalty, blockFriends, questID, questProgress, achiecvementPoints,</strong></p><p><strong>lastonline, AppearOffline, HideFromRoom, vip, Createtime, online, isguide, Blockwhisper, Sc, mys, key, group, favid, LastChange, NewUI);</strong></p><p></p><p><strong>Step 4 - Adding the command</strong></p><p><strong>Open ChatCommandHandler.cs and add this:</strong></p><p></p><p>Code:</p><p><strong>#region UI <img src="/styles/default/xenforo/smilies/emojione/smile.png" class="smilie" loading="lazy" alt=":)" title="Smile :)" data-shortname=":)" />ui) case "ui":</strong></p><p><strong>{</strong></p><p><strong>Session.GetHabbo().NewUISwitcher();</strong></p><p><strong>return true;</strong></p><p><strong>}</strong></p><p><strong>#endregion</strong></p><p></p><p><strong>Step 5 - Final steps</strong></p><p><strong>Firstly open InfoRetrieveEvent.cs and find:</strong></p><p></p><p></p><p style="margin-left: 20px"><strong>Session.SendMessage(new UserPerksComposer());</strong></p><p><strong>replace it with this:</strong></p><p></p><p>Code:</p><p><strong>Session.SendMessage(new UserPerksComposer(Session.GetHabbo()));</strong></p><p></p><p><strong>then, open up UserPerksComposer.cs and add the following reference:</strong></p><p>Code:</p><p><strong>using Silverwave.HabboHotel.Users;</strong></p><p></p><p><strong>then, find: </strong></p><p></p><p></p><p style="margin-left: 20px"><strong>public UserPerksComposer()</strong></p><p><strong>and replace it with: </strong></p><p></p><p>Code:</p><p><strong>public UserPerksComposer(Habbo Habbo)</strong></p><p></p><p><strong>then, find: </strong></p><p></p><p></p><p style="margin-left: 20px"><strong>base.WriteString("NEW_UI");</strong></p> <p style="margin-left: 20px"><strong>base.WriteString("");</strong></p> <p style="margin-left: 20px"><strong>base.WriteBoolean(true);</strong></p><p><strong>and replace with with this:</strong></p><p></p><p>Code:</p><p><strong>base.WriteString("NEW_UI"); base.WriteString("");</strong></p><p><strong>if (Habbo.NewUI)</strong></p><p><strong>{</strong></p><p><strong>base.WriteBoolean(true);</strong></p><p><strong>}</strong></p><p><strong>else</strong></p><p><strong>{</strong></p><p><strong>base.WriteBoolean(false);</strong></p><p><strong>}</strong></p><p></p><p></p><p><strong>Step 5 - Adding the command to :command list (optional)</strong></p><p><strong>INSERT INTO `fuse_cmds` (`command`, `rank`, `params`, `description`) VALUES ('ui', '1', NULL, 'Change back to the old version of the hotel.');</strong></p><p><strong></strong></p><p><strong>Your welcome!</strong></p><p><strong>Once again all credits for making/founding this to [USER=37541]@13rad[/USER]</strong></p><p></p><p>NOTE: Remember to debug silverwave (the project file). <img src="/styles/default/xenforo/smilies/emojione/smile.png" class="smilie" loading="lazy" alt=":)" title="Smile :)" data-shortname=":)" /></p><p></p><p><img src="http://i.imgur.com/HC6NQTJ.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p><img src="/styles/default/xenforo/smilies/emojione/thumbsup.png" class="smilie" loading="lazy" alt=":up:" title="Thumbs Up :up:" data-shortname=":up:" /></p></blockquote><p></p>
[QUOTE="ptimmaq2, post: 282948, member: 36323"] Just to start off, all credits go to [USER=37541]@13rad[/USER] who gave me it on my request post for this command, i just thought (re)releasing it so you others see it. [B]Step 1 - Table alteration[/B] Firstly, run the following MySQL query: ALTER TABLE users ADD use_newui enum('1','0') DEFAULT '1'; [B]Step 2 - Modifying the Habbo class[/B] 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."); } } } [B]Step 3 - modifying the Authenticator class Firstly, open Authenticator.cs and find:[/B] [B]int LastChange = (int)dRow["last_change"]; add this directly below:[/B] Code: [B]bool NewUI = SilverwaveEnvironment.EnumToBool(dRow["use_newui"].ToString());[/B] [B]then, find: [/B] [INDENT][B]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);[/B][/INDENT] [B]and add the NewUI bool or replace it with this:[/B] Code: [B]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);[/B] [B]Step 4 - Adding the command Open ChatCommandHandler.cs and add this:[/B] Code: [B]#region UI :)ui) case "ui": { Session.GetHabbo().NewUISwitcher(); return true; } #endregion[/B] [B]Step 5 - Final steps Firstly open InfoRetrieveEvent.cs and find:[/B] [INDENT][B]Session.SendMessage(new UserPerksComposer());[/B][/INDENT] [B]replace it with this:[/B] Code: [B]Session.SendMessage(new UserPerksComposer(Session.GetHabbo()));[/B] [B]then, open up UserPerksComposer.cs and add the following reference:[/B] Code: [B]using Silverwave.HabboHotel.Users;[/B] [B]then, find: [/B] [INDENT][B]public UserPerksComposer()[/B][/INDENT] [B]and replace it with: [/B] Code: [B]public UserPerksComposer(Habbo Habbo)[/B] [B]then, find: [/B] [INDENT][B]base.WriteString("NEW_UI"); base.WriteString(""); base.WriteBoolean(true);[/B][/INDENT] [B]and replace with with this:[/B] Code: [B]base.WriteString("NEW_UI"); base.WriteString(""); if (Habbo.NewUI) { base.WriteBoolean(true); } else { base.WriteBoolean(false); }[/B] [B]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 [USER=37541]@13rad[/USER][/B] NOTE: Remember to debug silverwave (the project file). :) [IMG]http://i.imgur.com/HC6NQTJ.png[/IMG] :up: [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Releases
Server Releases
[Release] :ui (changing between old and new ui) command for Plus emu r2 [Release]
Top