C# Help

Status
Not open for further replies.
May 1, 2015
470
154
I'm still fairly new to c# coding, anyways.
I'm creating a RP emulator, the client does load and let me access it when i just add something into habbo.cs such as weed or health however, once i add it into the authenticator,
Code:
Convert.ToInt32(Row["health"]),
The client stops loading and gets stuck at 76 %
The emulator also says one user online when i'm not really inside the client.
I appreciate any kind of help, thanks.
 
@Jaden
 
May 1, 2015
470
154
Any emulator logs?
And can I see the structure/columns of your users table?
It has said the following,
Code:
Bug during user login: System.ArgumentException: Column 'weed' does not belong to table Table.
   at System.Data.DataRow.GetDataColumn(String columnName)
   at System.Data.DataRow.get_Item(String columnName)
   at Plus.HabboHotel.Users.Authenticator.HabboFactory.GenerateHabbo(DataRow Row, DataRow UserInfo) in C:\Users\Administrator\Desktop\RP Shit\RP Emulator\HabboHotel\Users\Authenticator\Authenticator.cs:line 10
   at Plus.HabboHotel.Users.UserDataManagement.UserDataFactory.GetUserData(String SessionTicket, Byte& errorCode) in C:\Users\Administrator\Desktop\RP Shit\RP Emulator\HabboHotel\Users\UserData\UserDataFactory.cs:line 203
   at Plus.HabboHotel.GameClients.GameClient.TryAuthenticate(String AuthTicket) in C:\Users\Administrator\Desktop\RP Shit\RP Emulator\HabboHotel\GameClients\GameClient.cs:line 108
I've just added it at the bottom & it is still staying at 76% does it have to be in order like under credits?
users table:

Thanks,
 
It has said the following,
Code:
Bug during user login: System.ArgumentException: Column 'weed' does not belong to table Table.
   at System.Data.DataRow.GetDataColumn(String columnName)
   at System.Data.DataRow.get_Item(String columnName)
   at Plus.HabboHotel.Users.Authenticator.HabboFactory.GenerateHabbo(DataRow Row, DataRow UserInfo) in C:\Users\Administrator\Desktop\RP Shit\RP Emulator\HabboHotel\Users\Authenticator\Authenticator.cs:line 10
   at Plus.HabboHotel.Users.UserDataManagement.UserDataFactory.GetUserData(String SessionTicket, Byte& errorCode) in C:\Users\Administrator\Desktop\RP Shit\RP Emulator\HabboHotel\Users\UserData\UserDataFactory.cs:line 203
   at Plus.HabboHotel.GameClients.GameClient.TryAuthenticate(String AuthTicket) in C:\Users\Administrator\Desktop\RP Shit\RP Emulator\HabboHotel\GameClients\GameClient.cs:line 108
I've just added it at the bottom & it is still staying at 76% does it have to be in order like under credits?
users table:

Thanks,
I've put it under credits & it's still staying at 76
 

Jaden

not so active
Aug 24, 2014
886
263
Your SQL is looking for the column "weed" in the table "Table"? Make sure you wrote it correctly.

It should look in the users table?
 
May 1, 2015
470
154
Your SQL is looking for the column "weed" in the table "Table"? Make sure you wrote it correctly.

It should look in the users table?
I did the following,
went to habbo.cs and added private int _weed under private int _credits,
I put it in the habbo constructor, I then added it under there again under credits,
I also added this,
Code:
public int Weed
        {
            get { return this._weed; }
            set { this._weed = value; }
        }
then i added it into the authenticator, I have no idea why it isn't looking into the users table, did i do something wrong or miss something?
Thanks,
 
May 1, 2015
470
154
See the UserDataFactory class.
I've added it into there where it has,
Code:
bClient.SetQuery("SELECT `id`,`username`,`rank`,`motto`,`look`,`gender`,`last_online`,`credits`,`weed`,`activity_points`,`home_room`,`block_newfriends`,`hide_online`,`hide_inroom`,`vip`,`account_created`,`vip_points`,`machine_id`,`volume`,`chat_preference`, `focus_preference`, `pets_muted`,`bots_muted`,`advertising_report_blocked`,`last_change`,`gotw_points`,`ignore_invites`,`time_muted`,`allow_gifts`,`friend_bar_state`,`disable_forced_effects`,`allow_mimic`,`rank_vip` FROM `users` WHERE `id` = @id LIMIT 1");
                dbClient.AddParameter("id", UserId);
It now has the following,
Code:
Bug during user login: System.InvalidCastException: Object cannot be cast from DBNull to other types.
   at System.DBNull.System.IConvertible.ToInt32(IFormatProvider provider)
   at Plus.HabboHotel.Users.Authenticator.HabboFactory.GenerateHabbo(DataRow Row, DataRow UserInfo) in C:\Users\Administrator\Desktop\RP Shit\RP Emulator\HabboHotel\Users\Authenticator\Authenticator.cs:line 10
   at Plus.HabboHotel.Users.UserDataManagement.UserDataFactory.GetUserData(String SessionTicket, Byte& errorCode) in C:\Users\Administrator\Desktop\RP Shit\RP Emulator\HabboHotel\Users\UserData\UserDataFactory.cs:line 203
   at Plus.HabboHotel.GameClients.GameClient.TryAuthenticate(String AuthTicket) in C:\Users\Administrator\Desktop\RP Shit\RP Emulator\HabboHotel\GameClients\GameClient.cs:line 108
Thanks, sorry to be a pest just have been trying to get this working for awhile.
 
I've added it into there where it has,
Code:
bClient.SetQuery("SELECT `id`,`username`,`rank`,`motto`,`look`,`gender`,`last_online`,`credits`,`weed`,`activity_points`,`home_room`,`block_newfriends`,`hide_online`,`hide_inroom`,`vip`,`account_created`,`vip_points`,`machine_id`,`volume`,`chat_preference`, `focus_preference`, `pets_muted`,`bots_muted`,`advertising_report_blocked`,`last_change`,`gotw_points`,`ignore_invites`,`time_muted`,`allow_gifts`,`friend_bar_state`,`disable_forced_effects`,`allow_mimic`,`rank_vip` FROM `users` WHERE `id` = @id LIMIT 1");
                dbClient.AddParameter("id", UserId);
It now has the following,
Code:
Bug during user login: System.InvalidCastException: Object cannot be cast from DBNull to other types.
   at System.DBNull.System.IConvertible.ToInt32(IFormatProvider provider)
   at Plus.HabboHotel.Users.Authenticator.HabboFactory.GenerateHabbo(DataRow Row, DataRow UserInfo) in C:\Users\Administrator\Desktop\RP Shit\RP Emulator\HabboHotel\Users\Authenticator\Authenticator.cs:line 10
   at Plus.HabboHotel.Users.UserDataManagement.UserDataFactory.GetUserData(String SessionTicket, Byte& errorCode) in C:\Users\Administrator\Desktop\RP Shit\RP Emulator\HabboHotel\Users\UserData\UserDataFactory.cs:line 203
   at Plus.HabboHotel.GameClients.GameClient.TryAuthenticate(String AuthTicket) in C:\Users\Administrator\Desktop\RP Shit\RP Emulator\HabboHotel\GameClients\GameClient.cs:line 108
Thanks, sorry to be a pest just have been trying to get this working for awhile.
This has now been solved, I just changed it from null to 0 in the database.
Thank you both for your help.
 
Status
Not open for further replies.

Users who are viewing this thread

Top