public Character(DataRow Row) { using (RowAdapter Adapter = new RowAdapter(Row)) { this.Id = Adapter.PopInt32("id"); this.Username = Adapter.PopString("username"); this.Motto = Adapter.PopString("motto"); this.Figure = Adapter.PopString("figure"); this.Registered = Adapter.PopString("registered_stamp"); this.LastSeen = Adapter.PopString("last_seen"); this.Gender = Adapter.PopEnum<Gender>("gender"); this.Muted = Adapter.PopBoolean("muted"); this.AllowNewFriends = Adapter.PopBoolean("allow_new_friends"); this.Rank = System.HabboSystem.CharacterManager.GetRank(Adapter.PopInt32("rank")); this.Credits = Adapter.PopInt32("credits"); this.ActivityPoints = Adapter.PopInt32("activity_points"); this.SoundSettings = Adapter.PopInt32("sound_settings"); this.TimeOnline = Adapter.PopInt32("time_online"); this.HomeRoom = Adapter.PopInt32("home_room"); this.RespectEarned = Adapter.PopInt32("respect_earned"); this.RespectGiven = Adapter.PopInt32("respect_given"); this.RespectLeftHuman = Adapter.PopInt32("respect_left_human"); this.RespectLeftAnimal = Adapter.PopInt32("respect_left_animal"); this.LoadingRoom = 0; this.ConnectedRoom = 0; } }
public RoomModel(DataRow Row) { using (RowAdapter Adapter = new RowAdapter(Row)) { this.Id = Adapter.PopInt32("id"); this.Caption = Adapter.PopString("caption"); this.Map = Adapter.PopString("map").Replace(((char)10).ToString(),string.Empty); this.LocationDoorX = Adapter.PopInt32("location_door_x"); this.LocationDoorY = Adapter.PopInt32("location_door_y"); this.LocationDoorZ = Adapter.PopInt32("location_door_z"); this.LocationDoorRotation = Adapter.PopInt32("location_door_rotation"); this.MaximalUnits = Adapter.PopInt32("maximal_units"); this.RequiredMembership = Adapter.PopEnum<Membership>("required_membership"); } this.Nodes = new List<TileNode>(); for (int y = 0; y < this.Map.Split((char)13).Length; y++) { var Line = this.Map.Split((char)13)[y]; for (int x = 0; x < Line.Length; x++) { char Item = Line[x]; TileNode Node = new TileNode(Item, x, y); Nodes.Add(Node); } } this.ParametersWithDoor = GetParametersWithDoor(); this.ParametersWithOutDoor = GetParametersWithOutDoor(); }
public Room(DataRow Row) { using (RowAdapter Adapter = new RowAdapter(Row)) { this.Id = Adapter.PopInt32("id"); this.Caption = Adapter.PopString("caption"); this.Description = Adapter.PopString("description"); this.CharacterId = Adapter.PopInt32("character_id"); this.ModelId = Adapter.PopInt32("model_id"); this.DoorState = Adapter.PopEnum<DoorState>("door_state"); this.Password = Adapter.PopString("password"); } }
public BadgeInformation(DataRow Row) { using (RowAdapter Adapter = new RowAdapter(Row)) { Id = Adapter.PopInt32("id"); BadgeCode = Adapter.PopString("badge_code"); } }
public CharacterRank(DataRow Row) { using (RowAdapter Adapter = new RowAdapter(Row)) { this.Id = Adapter.PopInt32("id"); this.Caption = Adapter.PopString("caption"); this.ShowCaptionInGame = Adapter.PopBoolean("show_caption_ingame"); } }
public AchievementCategory(DataRow Row) { using (RowAdapter Adapter = new RowAdapter(Row)) { Id = Adapter.PopInt32("id"); Caption = Adapter.PopString("caption"); } Achievements = new Dictionary<int, Achievement>(); foreach (DataRow AchievementRow in System.MySQLManager.GetObject(new AchievementsQuery(Id)).GetOutput<DataTable>().Rows) { Achievement Achievement = new Achievement(AchievementRow); if (!Achievements.ContainsKey(Achievement.Id)) { Achievements.Add(Achievement.Id, Achievement); } } }
public MessengerGroup(DataRow Row) { using (RowAdapter Adapter = new RowAdapter(Row)) { this.Id = Adapter.PopInt32("id"); this.CharacterId = Adapter.PopInt32("character_id"); this.Caption = Adapter.PopString("caption"); } Members = new List<int>(); foreach (DataRow Member in System.MySQLManager.GetObject(new MessengerGroupMembersQuery(Id)).GetOutput<DataTable>().Rows) { using (RowAdapter Adapter = new RowAdapter(Member)) { int MemberId = Adapter.PopInt32("character_id"); if (!Members.Contains(MemberId)) { Members.Add(MemberId); } } } }
/// <summary> /// Returns an collection of characterlogs. /// </summary> /// <param name="CharacterId"></param> /// <returns></returns> public ICollection<DateTime> GetCharacterLogs(int CharacterId) { ICollection<DateTime> Output = new List<DateTime>(); foreach (DataRow Row in System.MySQLManager.GetObject(new CharacterLogsQuery(CharacterId)).GetOutput<DataTable>().Rows) { using (RowAdapter Adapter = new RowAdapter(Row)) { string Stamp = Adapter.PopString("login_stamp"); using (DateTimeAdapter dtAdapter = new DateTimeAdapter(Stamp)) { if (!Output.Contains(dtAdapter.PopDateTime())) { Output.Add(dtAdapter.PopDateTime()); } } } } return Output; }