#1Minatos™Qua Jan 02, 2013 1:48 pm
Minatos™
Ex-Administrador
4º Créditos# Ordem das utilidade do Tópico.
0º Imagem do Erro.
1º Explicação do tutorial
2º Tutorial de Como ageita o erro
3º Download.
>>>>> 0# <<<<<
>>>>> 01# <<<<<
Olá esse erro e basicamente um erro no seu emulador com conectividade com a DB, mais calma ele pode ser resolvido.
>>>>> 02# <<<<<
>1< Primeiro baixe um emulador Open Soucer, pós ele contem todas as pasta do emulador.
>2< Após baixar o emulador vá ate \Util\Users\UserData\UserDataFactory.cs
>3< abra o arquivo UserDataFactory.cs em bloco de notas.
>4< apague tudo que tem dentro dele, é adicione o código do 3º passo.
>5< Feche é salve.
>>>>> 03# <<<<<
- Código:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using atom;
using atom.HabboHotel.Catalogs;
using atom.HabboHotel.Items;
using atom.HabboHotel.Pets;
using atom.HabboHotel.Rooms;
using atom.HabboHotel.Users.Badges;
using atom.HabboHotel.Users.Inventory;
using atom.HabboHotel.Users.Messenger;
using atom.HabboHotel.Users.Subscriptions;
using Database_Manager.Database.Session_Details.Interfaces;
using atom.HabboHotel.Users;
using atom.HabboHotel.Users.Authenticator;
using atom.Core;
using atom.HabboHotel.Achievements;
namespace atom.HabboHotel.Users.UserDataManagement
{
class UserDataFactory
{
internal static UserData GetUserData(string sessionTicket, string ip, out byte errorCode)
{
DataRow dUserInfo;
DataTable dAchievements;
DataTable dFavouriteRooms;
DataTable dRecentedRooms;
DataTable dGuildRooms;
DataTable dIgnores;
DataTable dTags;
DataTable dSubscriptions;
DataTable dBadges;
DataTable dInventory;
DataTable dEffects;
DataTable dFriends;
DataTable dRequests;
DataTable dRooms;
DataTable dPets;
DataTable dQuests;
//DataTable dSongs;
DataRow dGroups = null;
UInt32 userID;
using (IQueryAdapter dbClient = atomEnvironment.GetDatabaseManager().getQueryreactor())
{
if (atomEnvironment.useSSO)
{
dbClient.setQuery("SELECT * " +
"FROM users " +
"WHERE auth_ticket = @sso ");
}
else
{
dbClient.setQuery("SELECT * " +
"FROM users " +
"WHERE auth_ticket = @sso ");
}
dbClient.addParameter("sso", sessionTicket);
[Tens de ter uma conta e sessão iniciada para poderes visualizar este link] ip);
dUserInfo = dbClient.getRow();
if (dUserInfo == null)
{
errorCode = 1;
return null;
[Tens de ter uma conta e sessão iniciada para poderes visualizar este link] user found. Debug data: [" + sessionTicket + "], [" + ip + "]");
//throw new UserDataNotFoundException(string.Format("No user found with ip {0} and sso {1}. Use SSO: {2} ", ip, sessionTicket, ButterflyEnvironment.useSSO.ToString()));
}
userID = Convert.ToUInt32(dUserInfo["id"]);
if (atomEnvironment.GetGame().GetClientManager().GetClientByUserID(userID) != null)
{
errorCode = 2;
return null;
[Tens de ter uma conta e sessão iniciada para poderes visualizar este link] user found. Debug data: [" + sessionTicket + "], [" + ip + "]");
//throw new UserDataNotFoundException(string.Format("No user found with ip {0} and sso {1}. Use SSO: {2} ", ip, sessionTicket, ButterflyEnvironment.useSSO.ToString()));
}
userID = Convert.ToUInt32(dUserInfo["id"]);
if (atomEnvironment.GetGame().GetClientManager().GetClientByUserID(userID) != null)
{
errorCode = 2;
return null;
}
string creditsTimestamp = (string)dUserInfo["lastdailycredits"];
string todayTimestamp = DateTime.Today.ToString("MM/dd");
if (creditsTimestamp != todayTimestamp)
{
dbClient.runFastQuery("UPDATE users SET credits = credits + 3000, daily_respect_points = 3, lastdailycredits = '" + todayTimestamp + "' WHERE id = " + userID);
dUserInfo["credits"] = (int)dUserInfo["credits"] + 3000;
}
dbClient.setQuery("SELECT * FROM user_achievement WHERE userid = " + userID);
dAchievements = dbClient.getTable();
dbClient.setQuery("SELECT id FROM rooms WHERE owner = '" + (string)dUserInfo["username"] + "' AND groupID = '0'");
dGuildRooms = dbClient.getTable();
dbClient.setQuery("SELECT room_id FROM user_roomvisits WHERE user_id = '" + userID + "'");
dRecentedRooms = dbClient.getTable();
dbClient.setQuery("SELECT room_id FROM user_favorites WHERE user_id = " + userID);
dFavouriteRooms = dbClient.getTable();
dbClient.setQuery("SELECT ignore_id FROM user_ignores WHERE user_id = " + userID);
dIgnores = dbClient.getTable();
dbClient.setQuery("SELECT tag FROM user_tags WHERE user_id = " + userID);
dTags = dbClient.getTable();
dbClient.setQuery("SELECT * FROM user_subscriptions WHERE user_id = " + userID);
dSubscriptions = dbClient.getTable();
dbClient.setQuery("SELECT * FROM user_badges WHERE user_id = " + userID);
dBadges = dbClient.getTable();
if (dbClient.dbType == Database_Manager.Database.DatabaseType.MySQL)
dbClient.setQuery("CALL getuseritems(" + userID + ")");
else
dbClient.setQuery("EXECUTE getuseritems " + userID + "");
dInventory = dbClient.getTable();
dbClient.setQuery("SELECT * FROM user_effects WHERE user_id = " + userID);
dEffects = dbClient.getTable();
dbClient.setQuery("SELECT users.id,users.username,users.motto,users.look,users.last_online " +
"FROM users " +
"JOIN messenger_friendships " +
"ON users.id = messenger_friendships.sender " +
"WHERE messenger_friendships.receiver = " + userID + " " +
"UNION ALL " +
"SELECT users.id,users.username,users.motto,users.look,users.last_online " +
"FROM users " +
"JOIN messenger_friendships " +
"ON users.id = messenger_friendships.receiver " +
"WHERE messenger_friendships.sender = " + userID);
dFriends = dbClient.getTable();
dbClient.setQuery("SELECT messenger_requests.sender,messenger_requests.receiver,users.username " +
"FROM users " +
"JOIN messenger_requests " +
"ON users.id = messenger_requests.sender " +
"WHERE messenger_requests.receiver = " + userID);
dRequests = dbClient.getTable();
dbClient.setQuery("SELECT rooms.*, room_active.active_users FROM rooms LEFT JOIN room_active ON (room_active.roomid = rooms.id) WHERE owner = @name");
dbClient.addParameter("name", (string)dUserInfo["username"]);
dRooms = dbClient.getTable();
dbClient.setQuery("SELECT * FROM user_pets WHERE user_id = " + userID + " AND room_id = 0");
dPets = dbClient.getTable();
dbClient.setQuery("SELECT * FROM user_quests WHERE user_id = " + userID + "");
dQuests = dbClient.getTable();
/* dbClient.setQuery("SELECT groups_memberships.*, groups_details.* FROM groups_memberships " +
"LEFT JOIN groups_details " +
"ON groups_memberships.groupid = groups_details.id " +
"WHERE groups_memberships.userid = " + userID + " AND groups_memberships.is_current = '1'");*/
dbClient.setQuery("SELECT GroupHome FROM users WHERE id = " + userID + "");
dGroups = dbClient.getRow();
[Tens de ter uma conta e sessão iniciada para poderes visualizar este link] item_id, song_id FROM user_items_songs WHERE user_id = " + userID);
//dSongs = dbClient.getTable();
/* dbClient.setQuery("UPDATE users SET ip_last = @ip WHERE id = " + userID + " LIMIT 1; " +
"UPDATE user_info SET login_timestamp = '" + ButterflyEnvironment.GetUnixTimestamp() + "' WHERE user_id = " + userID + " LIMIT 1; " +
"REPLACE INTO user_online VALUES (" + userID + "); " +
"DELETE FROM user_tickets WHERE userid = " + userID + ";");*/
dbClient.setQuery("UPDATE users SET ip_last = @ip WHERE id = " + userID + "; " +
"UPDATE user_info SET login_timestamp = '" + atomEnvironment.GetUnixTimestamp() + "' WHERE user_id = " + userID + " ; " +
"");
dbClient.addParameter("ip", ip);
dbClient.runQuery();
if (dbClient.dbType == Database_Manager.Database.DatabaseType.MySQL)
dbClient.runFastQuery("REPLACE INTO user_online VALUES (" + userID + ")");
else
dbClient.runFastQuery("IF NOT EXISTS (SELECT userid FROM user_online WHERE userid = " + userID + ") " +
"INSERT INTO user_online VALUES (" + userID + ")");
}
Dictionary<string, UserAchievement> achievements = new Dictionary<string, UserAchievement>();
string achievementGroup;
int achievementLevel;
int achievementProgress;
foreach (DataRow dRow in dAchievements.Rows)
{
achievementGroup = (string)dRow["group"];
achievementLevel = (int)dRow["level"];
achievementProgress = (int)dRow["progress"];
UserAchievement achievement = new UserAchievement(achievementGroup, achievementLevel, achievementProgress);
achievements.Add(achievementGroup, achievement);
}
List<uint> favouritedRooms = new List<uint>();
uint favoritedRoomID;
foreach (DataRow dRow in dFavouriteRooms.Rows)
{
favoritedRoomID = Convert.ToUInt32(dRow["room_id"]);
favouritedRooms.Add(favoritedRoomID);
}
List<uint> ignores = new List<uint>();
uint ignoredUserID;
foreach (DataRow dRow in dIgnores.Rows)
{
ignoredUserID = Convert.ToUInt32(dRow["ignore_id"]);
ignores.Add(ignoredUserID);
}
List<string> tags = new List<string>();
string tag;
foreach (DataRow dRow in dTags.Rows)
{
tag = (string)dRow["tag"];
tags.Add(tag);
}
List<uint> RecentedRooms = new List<uint>();
uint RecentedRoomsID;
foreach (DataRow dRow in dRecentedRooms.Rows)
{
RecentedRoomsID = Convert.ToUInt32(dRow["room_id"]);
RecentedRooms.Add(RecentedRoomsID);
}
List<uint> GuildRooms = new List<uint>();
uint GuildRoomsID;
foreach (DataRow dRow in dGuildRooms.Rows)
{
GuildRoomsID = Convert.ToUInt32(dRow["id"]);
GuildRooms.Add(GuildRoomsID);
}
Dictionary<string, Subscription> subscriptions = new Dictionary<string, Subscription>();
string subscriptionID;
int expireTimestamp;
foreach (DataRow dRow in dSubscriptions.Rows)
{
subscriptionID = (string)dRow["subscription_id"];
expireTimestamp = (int)dRow["timestamp_expire"];
subscriptions.Add(subscriptionID, new Subscription(subscriptionID, expireTimestamp));
}
List<Badge> badges = new List<Badge>();
string badgeID;
int slotID;
foreach (DataRow dRow in dBadges.Rows)
{
badgeID = (string)dRow["badge_id"];
slotID = (int)dRow["badge_slot"];
badges.Add(new Badge(badgeID, slotID));
}
List<UserItem> inventory = new List<UserItem>();
uint itemID;
uint baseItem;
string extraData;
foreach (DataRow dRow in dInventory.Rows)
{
itemID = Convert.ToUInt32(dRow[0]);
baseItem = Convert.ToUInt32(dRow[1]);
if (!DBNull.Value.Equals(dRow[2]))
extraData = (string)dRow[2];
else
extraData = string.Empty;
inventory.Add(new UserItem(itemID, baseItem, extraData));
}
List<AvatarEffect> effects = new List<AvatarEffect>();
int effectID;
int duration;
bool isActivated;
double activatedTimeStamp;
foreach (DataRow dRow in dEffects.Rows)
{
effectID = (int)dRow["effect_id"];
duration = (int)dRow["total_duration"];
isActivated = atomEnvironment.EnumToBool((string)dRow["is_activated"]);
activatedTimeStamp = (double)dRow["activated_stamp"];
effects.Add(new AvatarEffect(effectID, duration, isActivated, activatedTimeStamp));
}
Dictionary<uint, MessengerBuddy> friends = new Dictionary<uint, MessengerBuddy>();
string username = (string)dUserInfo["username"];
UInt32 friendID;
string friendName;
string friendLook;
string friendMotto;
string friendLastOnline;
foreach (DataRow dRow in dFriends.Rows)
{
friendID = Convert.ToUInt32(dRow["id"]);
friendName = (string)dRow["username"];
friendLook = (string)dRow["look"];
friendMotto = (string)dRow["motto"];
friendLastOnline = (string)dRow["last_online"];
if (friendID == userID)
continue;
if (!friends.ContainsKey(friendID))
friends.Add(friendID, new MessengerBuddy(friendID, friendName, friendLook, friendMotto, friendLastOnline));
}
Dictionary<uint, MessengerRequest> requests = new Dictionary<uint, MessengerRequest>();
uint receiverID;
uint senderID;
string requestUsername;
foreach (DataRow dRow in dRequests.Rows)
{
receiverID = Convert.ToUInt32(dRow["sender"]);
senderID = Convert.ToUInt32(dRow["receiver"]);
requestUsername = (string)dRow["username"];
if (receiverID != userID)
{
if (!requests.ContainsKey(receiverID))
requests.Add(receiverID, new MessengerRequest(userID, receiverID, requestUsername));
}
else
{
if (!requests.ContainsKey(senderID))
requests.Add(senderID, new MessengerRequest(userID, senderID, requestUsername));
}
}
List<RoomData> rooms = new List<RoomData>();
uint roomID;
foreach (DataRow dRow in dRooms.Rows)
{
roomID = Convert.ToUInt32(dRow["id"]);
rooms.Add(atomEnvironment.GetGame().GetRoomManager().FetchRoomData(roomID, dRow));
}
Dictionary<uint, Pet> pets = new Dictionary<uint, Pet>();
Pet pet;
foreach (DataRow dRow in dPets.Rows)
{
pet = Catalog.GeneratePetFromRow(dRow);
pets.Add(pet.PetId, pet);
}
Dictionary<uint, int> quests = new Dictionary<uint, int>();
uint questId;
int progress;
foreach (DataRow dRow in dQuests.Rows)
{
questId = Convert.ToUInt32(dRow["quest_id"]);
progress = (int)dRow["progress"];
quests.Add(questId, progress);
}
Hashtable songs = new Hashtable();
//uint songItemID;
//uint songID;
//foreach (DataRow dRow in dSongs.Rows)
//{
// songItemID = (uint)dRow[0];
// songID = (uint)dRow[1];
// SongItem song = new SongItem(songItemID, songID);
// songs.Add(songItemID, song);
//}
Habbo user = HabboFactory.GenerateHabbo(dUserInfo, dGroups);
dUserInfo = null;
dAchievements = null;
dFavouriteRooms = null;
dIgnores = null;
dTags = null;
dRecentedRooms = null;
dGuildRooms = null;
dSubscriptions = null;
dBadges = null;
dInventory = null;
dEffects = null;
dFriends = null;
dRequests = null;
dRooms = null;
dPets = null;
errorCode = 0;
return new UserData(userID, achievements, favouritedRooms, RecentedRooms, GuildRooms, ignores, tags, subscriptions, badges, inventory, effects, friends, requests, rooms, pets, quests, songs, user);
}
internal static UserData GetUserData(int UserId)
{
byte errorCode;
DataRow dUserInfo;
DataTable dAchievements;
DataTable dFavouriteRooms;
DataTable dRecentedRooms;
DataTable dGuildRooms;
DataTable dIgnores;
DataTable dTags;
DataTable dSubscriptions;
DataTable dBadges;
DataTable dInventory;
DataTable dEffects;
DataTable dFriends;
DataTable dRequests;
DataTable dRooms;
DataTable dPets;
DataTable dQuests;
//DataTable dSongs;
DataRow dGroups = null;
UInt32 userID;
using (IQueryAdapter dbClient = atomEnvironment.GetDatabaseManager().getQueryreactor())
{
dbClient.setQuery("SELECT users.* FROM users WHERE users.id = @id");
dbClient.addParameter("id", UserId);
dUserInfo = dbClient.getRow();
if (dUserInfo == null)
{
errorCode = 1;
return null;
[Tens de ter uma conta e sessão iniciada para poderes visualizar este link] user found. Debug data: [" + sessionTicket + "], [" + ip + "]");
//throw new UserDataNotFoundException(string.Format("No user found with ip {0} and sso {1}. Use SSO: {2} ", ip, sessionTicket, ButterflyEnvironment.useSSO.ToString()));
}
userID = Convert.ToUInt32(dUserInfo["id"]);
if (atomEnvironment.GetGame().GetClientManager().GetClientByUserID(userID) != null)
{
errorCode = 2;
return null;
}
/**
string creditsTimestamp = (string)dUserInfo["lastdailycredits"];
string todayTimestamp = DateTime.Today.ToString("MM/dd");
if (creditsTimestamp != todayTimestamp)
{
dbClient.runFastQuery("UPDATE users SET credits = credits + 3000, daily_respect_points = 3, lastdailycredits = '" + todayTimestamp + "' WHERE id = " + userID);
dUserInfo["credits"] = (int)dUserInfo["credits"] + 3000;
}
* ***/
/**
dbClient.setQuery("SELECT * FROM user_achievement WHERE userid = " + userID);
dAchievements = dbClient.getTable();
dbClient.setQuery("SELECT room_id FROM user_favorites WHERE user_id = " + userID);
dFavouriteRooms = dbClient.getTable();
dbClient.setQuery("SELECT ignore_id FROM user_ignores WHERE user_id = " + userID);
dIgnores = dbClient.getTable();
dbClient.setQuery("SELECT tag FROM user_tags WHERE user_id = " + userID);
dTags = dbClient.getTable();
dbClient.setQuery("SELECT * FROM user_subscriptions WHERE user_id = " + userID);
dSubscriptions = dbClient.getTable();
dbClient.setQuery("SELECT * FROM user_badges WHERE user_id = " + userID);
dBadges = dbClient.getTable();
if (dbClient.dbType == Database_Manager.Database.DatabaseType.MySQL)
dbClient.setQuery("CALL getuseritems(" + userID + ")");
else
dbClient.setQuery("EXECUTE getuseritems " + userID + "");
dInventory = dbClient.getTable();
dbClient.setQuery("SELECT * FROM user_effects WHERE user_id = " + userID);
dEffects = dbClient.getTable();
dbClient.setQuery("SELECT users.id,users.username,users.motto,users.look,users.last_online " +
"FROM users " +
"JOIN messenger_friendships " +
"ON users.id = messenger_friendships.sender " +
"WHERE messenger_friendships.receiver = " + userID + " " +
"UNION ALL " +
"SELECT users.id,users.username,users.motto,users.look,users.last_online " +
"FROM users " +
"JOIN messenger_friendships " +
"ON users.id = messenger_friendships.receiver " +
"WHERE messenger_friendships.sender = " + userID);
dFriends = dbClient.getTable();
dbClient.setQuery("SELECT messenger_requests.sender,messenger_requests.receiver,users.username " +
"FROM users " +
"JOIN messenger_requests " +
"ON users.id = messenger_requests.sender " +
"WHERE messenger_requests.receiver = " + userID);
dRequests = dbClient.getTable();
dbClient.setQuery("SELECT rooms.*, room_active.active_users FROM rooms LEFT JOIN room_active ON (room_active.roomid = rooms.id) WHERE owner = @name");
dbClient.addParameter("name", (string)dUserInfo["username"]);
dRooms = dbClient.getTable();
dbClient.setQuery("SELECT * FROM user_pets WHERE user_id = " + userID + " AND room_id = 0");
dPets = dbClient.getTable();
dbClient.setQuery("SELECT * FROM user_quests WHERE user_id = " + userID + "");
dQuests = dbClient.getTable();
**/
dbClient.setQuery("SELECT groups_memberships.*, groups_details.* FROM groups_memberships " +
"LEFT JOIN groups_details " +
"ON groups_memberships.groupid = groups_details.id " +
"WHERE groups_memberships.userid = " + userID + " AND groups_memberships.is_current = '1'");
dGroups = dbClient.getRow();
}
Dictionary<string, UserAchievement> achievements = new Dictionary<string, UserAchievement>();
/**
* string achievementGroup;
int achievementLevel;
int achievementProgress;
foreach (DataRow dRow in dAchievements.Rows)
{
achievementGroup = (string)dRow["group"];
achievementLevel = (int)dRow["level"];
achievementProgress = (int)dRow["progress"];
UserAchievement achievement = new UserAchievement(achievementGroup, achievementLevel, achievementProgress);
achievements.Add(achievementGroup, achievement);
}
**/
List<uint> favouritedRooms = new List<uint>();
/**
uint favoritedRoomID;
foreach (DataRow dRow in dFavouriteRooms.Rows)
{
favoritedRoomID = Convert.ToUInt32(dRow["room_id"]);
favouritedRooms.Add(favoritedRoomID);
}
**/
List<uint> RecentedRooms = new List<uint>();
/**
uint favoritedRoomID;
foreach (DataRow dRow in dFavouriteRooms.Rows)
{
favoritedRoomID = Convert.ToUInt32(dRow["room_id"]);
favouritedRooms.Add(favoritedRoomID);
}
**/
List<uint> GuildRooms = new List<uint>();
List<uint> ignores = new List<uint>();
/**
uint ignoredUserID;
foreach (DataRow dRow in dIgnores.Rows)
{
ignoredUserID = Convert.ToUInt32(dRow["ignore_id"]);
ignores.Add(ignoredUserID);
}
**/
List<string> tags = new List<string>();
/**
string tag;
foreach (DataRow dRow in dTags.Rows)
{
tag = (string)dRow["tag"];
tags.Add(tag);
}
*/
Dictionary<string, Subscription> subscriptions = new Dictionary<string, Subscription>();
/**
string subscriptionID;
int expireTimestamp;
foreach (DataRow dRow in dSubscriptions.Rows)
{
subscriptionID = (string)dRow["subscription_id"];
expireTimestamp = (int)dRow["timestamp_expire"];
subscriptions.Add(subscriptionID, new Subscription(subscriptionID, expireTimestamp));
}
**/
List<Badge> badges = new List<Badge>();
/**
string badgeID;
int slotID;
foreach (DataRow dRow in dBadges.Rows)
{
badgeID = (string)dRow["badge_id"];
slotID = (int)dRow["badge_slot"];
badges.Add(new Badge(badgeID, slotID));
}
**/
List<UserItem> inventory = new List<UserItem>();
/**
uint itemID;
uint baseItem;
string extraData;
foreach (DataRow dRow in dInventory.Rows)
{
itemID = Convert.ToUInt32(dRow[0]);
baseItem = Convert.ToUInt32(dRow[1]);
if (!DBNull.Value.Equals(dRow[2]))
extraData = (string)dRow[2];
else
extraData = string.Empty;
inventory.Add(new UserItem(itemID, baseItem, extraData));
}
**/
List<AvatarEffect> effects = new List<AvatarEffect>();
/**
int effectID;
int duration;
bool isActivated;
double activatedTimeStamp;
foreach (DataRow dRow in dEffects.Rows)
{
effectID = (int)dRow["effect_id"];
duration = (int)dRow["total_duration"];
isActivated = ButterflyEnvironment.EnumToBool((string)dRow["is_activated"]);
activatedTimeStamp = (double)dRow["activated_stamp"];
effects.Add(new AvatarEffect(effectID, duration, isActivated, activatedTimeStamp));
}
**/
Dictionary<uint, MessengerBuddy> friends = new Dictionary<uint, MessengerBuddy>();
string username = (string)dUserInfo["username"];
/**
UInt32 friendID;
string friendName;
string friendLook;
string friendMotto;
string friendLastOnline;
foreach (DataRow dRow in dFriends.Rows)
{
friendID = Convert.ToUInt32(dRow["id"]);
friendName = (string)dRow["username"];
friendLook = (string)dRow["look"];
friendMotto = (string)dRow["motto"];
friendLastOnline = (string)dRow["last_online"];
if (friendID == userID)
continue;
if (!friends.ContainsKey(friendID))
friends.Add(friendID, new MessengerBuddy(friendID, friendName, friendLook, friendMotto, friendLastOnline));
}
**/
Dictionary<uint, MessengerRequest> requests = new Dictionary<uint, MessengerRequest>();
/**
uint receiverID;
uint senderID;
string requestUsername;
foreach (DataRow dRow in dRequests.Rows)
{
receiverID = Convert.ToUInt32(dRow["sender"]);
senderID = Convert.ToUInt32(dRow["receiver"]);
requestUsername = (string)dRow["username"];
if (receiverID != userID)
{
if (!requests.ContainsKey(receiverID))
requests.Add(receiverID, new MessengerRequest(userID, receiverID, requestUsername));
}
else
{
if (!requests.ContainsKey(senderID))
requests.Add(senderID, new MessengerRequest(userID, senderID, requestUsername));
}
}
**/
List<RoomData> rooms = new List<RoomData>();
/**
uint roomID;
foreach (DataRow dRow in dRooms.Rows)
{
roomID = Convert.ToUInt32(dRow["id"]);
rooms.Add(ButterflyEnvironment.GetGame().GetRoomManager().FetchRoomData(roomID, dRow));
}
**/
Dictionary<uint, Pet> pets = new Dictionary<uint, Pet>();
/**
Pet pet;
foreach (DataRow dRow in dPets.Rows)
{
pet = Catalog.GeneratePetFromRow(dRow);
pets.Add(pet.PetId, pet);
}
**/
Dictionary<uint, int> quests = new Dictionary<uint, int>();
/**
uint questId;
int progress;
foreach (DataRow dRow in dQuests.Rows)
{
questId = Convert.ToUInt32(dRow["quest_id"]);
progress = (int)dRow["progress"];
quests.Add(questId, progress);
}
**/
Hashtable songs = new Hashtable();
/**
//uint songItemID;
//uint songID;
//foreach (DataRow dRow in dSongs.Rows)
//{
// songItemID = (uint)dRow[0];
// songID = (uint)dRow[1];
// SongItem song = new SongItem(songItemID, songID);
// songs.Add(songItemID, song);
//}
**/
Habbo user = HabboFactory.GenerateHabbo(dUserInfo, dGroups);
dUserInfo = null;
dAchievements = null;
dFavouriteRooms = null;
dRecentedRooms = null;
dGuildRooms = null;
dIgnores = null;
dTags = null;
dSubscriptions = null;
dBadges = null;
dInventory = null;
dEffects = null;
dFriends = null;
dRequests = null;
dRooms = null;
dPets = null;
errorCode = 0;
return new UserData(userID, achievements, favouritedRooms, RecentedRooms, GuildRooms, ignores, tags, subscriptions, badges, inventory, effects, friends, requests, rooms, pets, quests, songs, user);
}
}
}
>>>>> 4º <<<<<
Créditos:
LøTøS (PELA CÓDIGO)
Minatos™ (PELO TUTORIAL)