-
[UBEREMU] Change Name 99%
This code change name, but name not refresh in-game
Find:
Code:
private void GetPetsInventory()
{
if (Session.GetHabbo().GetInventoryComponent() == null)
{
return;
}
Session.SendMessage(Session.GetHabbo().GetInventoryComponent().SerializePetInventory());
}
Add after:
Code:
public ServerMessage SerializeNameTaken(string Username)
{
DataTable Data = null;
using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
{
Data = dbClient.ReadDataTable("SELECT SQL_NO_CACHE * FROM user_tags ORDER BY rand() LIMIT 6");
}
ServerMessage Message = new ServerMessage(571);
Message.AppendInt32(5);
foreach (DataRow Row in Data.Rows)
{
Message.AppendInt32(Data.Rows.Count);
Message.AppendStringWithBreak(Username + (string)Row["tag"]);
}
return Message;
}
private void CheckName()
{
string username = Request.PopFixedString();
using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
{
if (dbClient.ReadDataRow("SELECT username FROM users WHERE username='" + username + "' LIMIT 1") != null)
{
Session.SendMessage(SerializeNameTaken(username));
}
else
{
ServerMessage Message = new ServerMessage(571);
Message.AppendInt32(0);
Message.AppendStringWithBreak(username);
Message.AppendInt32(0);
Session.SendMessage(Message);
dbClient.ExecuteQuery("UPDATE rooms SET owner='" + username + "' WHERE owner='" + Session.GetHabbo().Username + "'");
dbClient.ExecuteQuery("UPDATE users SET username='" + username + "' WHERE id='" + Session.GetHabbo().Id + "'");
Session.GetHabbo().Username = username;
ServerMessage ChangeName1 = new ServerMessage(570);
ChangeName1.AppendInt32(0);
ChangeName1.AppendStringWithBreak(username);
ChangeName1.AppendInt32(0);
Session.SendMessage(ChangeName1);
UberEnvironment.GetGame().GetAchievementManager().UnlockAchievement(Session, 20, 1);
}
}
Find:
Code:
RequestHandlers[404] = new RequestHandler(GetInventory);
Add after:
Code:
RequestHandlers[471] = new RequestHandler(CheckName);
Find:
Code:
foreach (RoomUser Usr in UserList)
{
if (!Usr.IsBot)
{
continue;
}
Usr.BotAI.OnUserEnterRoom(User);
}
Add After:
Code:
if (Owner == Session.GetHabbo().Username)
{
ServerMessage Welcome = new ServerMessage(575);
Welcome.AppendInt32(1);
Welcome.AppendInt32(0);
Welcome.AppendInt32(0);
SendMessage(Welcome);
}
SQL:
Code:
INSERT INTO achievements VALUES ('20', '1', '1', 'ACH_Name', '100', '1.25');
-
Re: [UBEREMU] Change Name 99%
Finally! Uber is getting more updates every day :D
-
Re: [UBEREMU] Change Name 99%
How you can change name in the client? :S
-
Re: [UBEREMU] Change Name 99%
The Code change name, New name requires client reload
-
Re: [UBEREMU] Change Name 99%
-
Re: [UBEREMU] Change Name 99%
How would it be triggered?
-
Re: [UBEREMU] Change Name 99%
seems like something that would end up causing issues to the database
-
Re: [UBEREMU] Change Name 99%
Looks good, I think just for "ease" reasons make it so that it limits how many times one user can change their name. Or add a table in db which will log their change name time stamp and make it so they need to stick with that name for at least 7 days. None the less, looks neat.
-
Re: [UBEREMU] Change Name 99%
some screenies would be nice and were do i find code at.....
-
Re: [UBEREMU] Change Name 99%
-
Re: [UBEREMU] Change Name 99%
Quote:
Originally Posted by
TheJacob
Looks good, I think just for "ease" reasons make it so that it limits how many times one user can change their name. Or add a table in db which will log their change name time stamp and make it so they need to stick with that name for at least 7 days. None the less, looks neat.
Or just if their user ID has changed their name once not to allow the option again, because we're emulating habbo... :)
Honestly, you could always just do it in PHP and tell the user to log off the hotel, send a disconnect packet to server to disconnect the user if they're connected. :)
There's many ways to do one thing really.
ttfn
-
Re: [UBEREMU] Change Name 99%
it's nice how does it works :)
-
Re: [UBEREMU] Change Name 99%
-
Re: [UBEREMU] Change Name 99%
Nice release ;D
But if I enter to the client this appears again D:
PD: Sorry for my English, I'm Spanish
-
Re: [UBEREMU] Change Name 99%
Why not continue on with this and add a handler for the Guide Bot button? Also; this should only be triggered until the user changes his name or turns off the alert, not every single fucking time they go into their own room. An interesting idea, but shitty implementation. I'll rewrite this later when I get backups from my dedicated server (which just went down from a datacenter fire. :|)
-
Re: [UBEREMU] Change Name 99%
I added this, but aint adding the full name changing part. I dont think they should beable to change their names more then once.
-
Re: [UBEREMU] Change Name 99%
Nice ! but tell me were to add this
-
Re: [UBEREMU] Change Name 99%
Quote:
Originally Posted by
imJay
Nice ! but tell me were to add this
Yes, tell it me too :)
-
Re: [UBEREMU] Change Name 99%
-
Re: [UBEREMU] Change Name 99%
Wer to add this ??
Please tell me :D
---------- Post added at 08:35 PM ---------- Previous post was at 07:08 PM ----------
*push*
Wer to add this ??
Please tell me :D
-
Re: [UBEREMU] Change Name 99%
-
Re: [UBEREMU] Change Name 99%
Quote:
Originally Posted by
scottstamp851
Why not continue on with this and add a handler for the Guide Bot button? Also; this should only be triggered until the user changes his name or turns off the alert, not every single fucking time they go into their own room. An interesting idea, but shitty implementation. I'll rewrite this later when I get backups from my dedicated server (which just went down from a datacenter fire. :|)
how is the rewrite coming along?
-
Re: [UBEREMU] Change Name 99%
Where to add this :O ??????
-
Re: [UBEREMU] Change Name 99%
read the thread? and you need a c# editor.. visual basic C# i recomand for you
-
Re: [UBEREMU] Change Name 99%
I know..
But I mean...
HabboHotel/GameClient etc...