SHARE
TWEET

Untitled

a guest Feb 14th, 2020 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using Butterfly.Core;
  2. using Butterfly.HabboHotel.Achievements;
  3. using Butterfly.HabboHotel.ChatMessageStorage;
  4. using Butterfly.HabboHotel.GameClients;
  5. using Butterfly.HabboHotel.Rooms;
  6. using Butterfly.HabboHotel.Users.Badges;
  7. using Butterfly.HabboHotel.Users.Inventory;
  8. using Butterfly.HabboHotel.Users.Messenger;
  9. using Butterfly.Communication.Packets.Outgoing;
  10. using Butterfly.Database.Interfaces;
  11.  
  12. using System;
  13. using System.Collections.Generic;
  14. using System.Data;
  15. using System.Linq;
  16. using Butterfly.Communication.Packets.Outgoing.Structure;
  17. using Butterfly.HabboHotel.Roleplay;
  18. using Butterfly.HabboHotel.Roleplay.Player;
  19. using Butterfly.HabboHotel.WebClients;
  20.  
  21. namespace Butterfly.HabboHotel.Users
  22. {
  23.     public class Habbo
  24.     {
  25.         public int forceRot = -1;
  26.         public int ChatColor = -1;
  27.         public int Id;
  28.         public string Username;
  29.         public int Rank;
  30.         public string Motto;
  31.         public string Look;
  32.         public string BackupLook;
  33.         public string Gender;
  34.         public string BackupGender;
  35.         public bool LastMovFGate;
  36.         public int Credits;
  37.         public int WibboPoints;
  38.         public int AccountCreated;
  39.         public int AchievementPoints;
  40.         public int Duckets;
  41.         public double LastActivityPointsUpdate;
  42.         public int Respect;
  43.         public int DailyRespectPoints;
  44.         public int DailyPetRespectPoints;
  45.         public int CurrentRoomId;
  46.         public int LoadingRoomId;
  47.         public int HomeRoom;
  48.         public int LastOnline;
  49.         public bool IsTeleporting;
  50.         public int TeleportingRoomID;
  51.         public int TeleporterId;
  52.         public int FloodCount;
  53.         public DateTime FloodTime;
  54.         public List<int> ClientVolume;
  55.         public string MachineId;
  56.         public Language Langue;
  57.  
  58.         public List<RoomData> RoomRightsList;
  59.         public List<RoomData> FavoriteRooms;
  60.         public List<RoomData> UsersRooms;
  61.  
  62.         public List<int> MutedUsers;
  63.         public Dictionary<string, UserAchievement> Achievements;
  64.         public List<int> RatedRooms;
  65.         private HabboMessenger Messenger;
  66.         private BadgeComponent BadgeComponent;
  67.         private InventoryComponent InventoryComponent;
  68.         private ChatMessageManager chatMessageManager;
  69.         private GameClient mClient;
  70.         public bool SpectatorMode;
  71.         public bool Disconnected;
  72.         public bool HasFriendRequestsDisabled;
  73.         public int FavouriteGroupId;
  74.         public List<int> MyGroups;
  75.  
  76.         public bool spamEnable;
  77.         public int spamProtectionTime;
  78.         public DateTime spamFloodTime;
  79.  
  80.         public Dictionary<int, int> quests;
  81.         public int CurrentQuestId;
  82.         public int LastCompleted;
  83.         public int LastQuestId;
  84.         private bool HabboinfoSaved;
  85.         public bool AcceptTrading;
  86.         public bool HideInRoom;
  87.         public int PubDectectCount = 0;
  88.         public DateTime OnlineTime;
  89.         public bool PremiumProtect;
  90.         public int ControlUserId;
  91.         public string IP;
  92.         public bool ViewMurmur = true;
  93.         public bool HideOnline;
  94.  
  95.         public int GuideOtherUserId;
  96.         public bool OnDuty;
  97.  
  98.         public int Mazo;
  99.         public int MazoHighScore;
  100.  
  101.         public bool NewUser;
  102.         public bool Nuxenable;
  103.         public int PassedNuxCount;
  104.  
  105.         public bool AllowDoorBell;
  106.         public bool CanChangeName;
  107.         public int GiftPurchasingWarnings;
  108.         public bool SessionGiftBlocked;
  109.  
  110.         public int RolePlayId;
  111.  
  112.         public bool IgnoreAll;
  113.  
  114.         public string LookBeforeWorking;
  115.         // Zombie System
  116.         public bool IsZombie;
  117.         public bool IsZombieKing;
  118.         public int HitPoints;
  119.         public int MaxHitPoints;
  120.  
  121.         public DateTime LastGiftPurchaseTime { get; set; }
  122.  
  123.         public bool InRoom
  124.         {
  125.             get
  126.             {
  127.                 return this.CurrentRoomId >= 1;
  128.             }
  129.         }
  130.  
  131.         public Room CurrentRoom
  132.         {
  133.             get
  134.             {
  135.                 if (this.CurrentRoomId <= 0)
  136.                     return (Room)null;
  137.                 else
  138.                     return ButterflyEnvironment.GetGame().GetRoomManager().GetRoom(this.CurrentRoomId);
  139.             }
  140.         }
  141.  
  142.         public bool SendWebPacket(IServerPacket Message)
  143.         {
  144.             WebClient ClientWeb = ButterflyEnvironment.GetGame().GetClientWebManager().GetClientByUserID(this.Id);
  145.             if (ClientWeb != null)
  146.             {
  147.                 ClientWeb.SendPacket(Message);
  148.                 return true;
  149.             }
  150.             return false;
  151.         }
  152.  
  153.         public string GetQueryString
  154.         {
  155.             get
  156.             {
  157.                 TimeSpan TimeOnline = DateTime.Now - this.OnlineTime;
  158.                 int TimeOnlineSec = (int)TimeOnline.TotalSeconds;
  159.                 this.HabboinfoSaved = true;
  160.                 return "UPDATE users SET users.online = '0', users.last_online = '" + ButterflyEnvironment.GetUnixTimestamp() + "', activity_points = '" + this.Duckets + "', activity_points_lastupdate = '" + this.LastActivityPointsUpdate + "', credits = '" + this.Credits + "' WHERE id = '" + this.Id + "'; " +
  161.                     "UPDATE user_stats SET groupid = " + this.FavouriteGroupId + ", OnlineTime = OnlineTime + " + TimeOnlineSec + ", quest_id = '" + this.CurrentQuestId + "', Respect = '" + this.Respect + "', DailyRespectPoints = '" + this.DailyRespectPoints + "', DailyPetRespectPoints = '" + this.DailyPetRespectPoints + "' WHERE id = " + this.Id + ";";
  162.             }
  163.         }
  164.  
  165.         public Habbo(int Id, string Username, int Rank, string Motto, string Look, string Gender, int Credits,
  166.             int WPoint, int ActivityPoints, double LastActivityPointsUpdate, int HomeRoom, int Respect, int DailyRespectPoints,
  167.             int DailyPetRespectPoints, bool HasFriendRequestsDisabled, int currentQuestID, int achievementPoints,
  168.             int LastOnline, int FavoriteGroup, int accountCreated, bool accepttrading, string ip, bool HideInroom,
  169.             bool HideOnline, int MazoHighScore, int Mazo, string clientVolume, bool nuxenable, string MachineId, bool ChangeName, Language Langue, bool IgnoreAll)
  170.         {
  171.             this.Id = Id;
  172.             this.Username = Username;
  173.             this.Rank = Rank;
  174.             this.Motto = Motto;
  175.             this.MachineId = MachineId;
  176.             this.Look = ButterflyEnvironment.GetFigureManager().ProcessFigure(Look, Gender, true);
  177.             this.Gender = Gender.ToLower();
  178.             this.Credits = Credits;
  179.             this.WibboPoints = WPoint;
  180.             this.Duckets = ActivityPoints;
  181.             this.AchievementPoints = achievementPoints;
  182.             this.LastActivityPointsUpdate = LastActivityPointsUpdate;
  183.             this.CurrentRoomId = 0;
  184.             this.LoadingRoomId = 0;
  185.             this.HomeRoom = (HomeRoom == 0) ? 0 : HomeRoom;
  186.             this.FavoriteRooms = new List<RoomData>();
  187.             this.MutedUsers = new List<int>();
  188.             this.Achievements = new Dictionary<string, UserAchievement>();
  189.             this.RatedRooms = new List<int>();
  190.             this.Respect = Respect;
  191.             this.DailyRespectPoints = DailyRespectPoints;
  192.             this.DailyPetRespectPoints = DailyPetRespectPoints;
  193.             this.IsTeleporting = false;
  194.             this.TeleporterId = 0;
  195.             this.UsersRooms = new List<RoomData>();
  196.             this.HasFriendRequestsDisabled = HasFriendRequestsDisabled;
  197.             this.ClientVolume = new List<int>(3);
  198.             this.CanChangeName = ChangeName;
  199.             this.Langue = Langue;
  200.             this.IgnoreAll = IgnoreAll;
  201.  
  202.             if (clientVolume.Contains(','))
  203.             {
  204.                 foreach (string Str in clientVolume.Split(','))
  205.                 {
  206.                     int Val = 0;
  207.                     if (int.TryParse(Str, out Val))
  208.                         this.ClientVolume.Add(int.Parse(Str));
  209.                     else
  210.                         this.ClientVolume.Add(100);
  211.                 }
  212.             }
  213.             else
  214.             {
  215.                 this.ClientVolume.Add(100);
  216.                 this.ClientVolume.Add(100);
  217.                 this.ClientVolume.Add(100);
  218.             }
  219.  
  220.             this.LastOnline = LastOnline;
  221.             this.MyGroups = new List<int>();
  222.             this.FavouriteGroupId = FavoriteGroup;
  223.  
  224.             this.AccountCreated = accountCreated;
  225.            
  226.             this.CurrentQuestId = currentQuestID;
  227.             this.AcceptTrading = accepttrading;
  228.            
  229.             this.OnlineTime = DateTime.Now;
  230.             this.PremiumProtect = (this.Rank > 1);
  231.  
  232.             this.ControlUserId = 0;
  233.             this.IP = ip;
  234.             this.SpectatorMode = false;
  235.             this.Disconnected = false;
  236.             this.HideInRoom = HideInroom;
  237.             this.HideOnline = HideOnline;
  238.             this.MazoHighScore = MazoHighScore;
  239.             this.Mazo = Mazo;
  240.  
  241.             this.LastGiftPurchaseTime = DateTime.Now;
  242.  
  243.             this.Nuxenable = nuxenable;
  244.             this.NewUser = nuxenable;
  245.         }
  246.  
  247.         public void Init(GameClient client, UserData.UserData data)
  248.         {
  249.             this.mClient = client;
  250.             this.BadgeComponent = new BadgeComponent(this.Id, data.badges);
  251.             this.InventoryComponent = new InventoryComponent(this.Id, client);
  252.             this.InventoryComponent.SetActiveState(client);
  253.             this.quests = data.quests;
  254.             this.chatMessageManager = new ChatMessageManager();
  255.             this.chatMessageManager.LoadUserChatlogs(this.Id);
  256.             this.Messenger = new HabboMessenger(this.Id);
  257.             this.Messenger.AppearOffline = this.HideOnline;
  258.             this.Messenger.Init(data.friends, data.requests, data.Relationships);
  259.             this.MyGroups = data.MyGroups;
  260.             this.UpdateRooms();
  261.         }
  262.  
  263.  
  264.         public void UpdateRooms()
  265.         {
  266.             try
  267.             {
  268.                 this.UsersRooms.Clear();
  269.  
  270.                 DataTable table;
  271.                 using (IQueryAdapter queryreactor = ButterflyEnvironment.GetDatabaseManager().GetQueryReactor())
  272.                 {
  273.                     queryreactor.SetQuery("SELECT * FROM rooms WHERE owner = @name ORDER BY id ASC");
  274.                     queryreactor.AddParameter("name", this.Username);
  275.                     table = queryreactor.GetTable();
  276.                 }
  277.                 foreach (DataRow dRow in table.Rows)
  278.                     this.UsersRooms.Add(ButterflyEnvironment.GetGame().GetRoomManager().FetchRoomData(Convert.ToInt32(dRow["id"]), dRow));
  279.             }
  280.             catch (Exception ex)
  281.             {
  282.                 Logging.LogCriticalException("Bug while updating own rooms: " + (ex).ToString());
  283.             }
  284.         }
  285.  
  286.         public void PrepareRoom(int Id, string Password = "", bool override_doorbell = false)
  287.         {
  288.             if (this.GetClient() == null || this.GetClient().GetHabbo() == null)
  289.                 return;
  290.  
  291.             if (this.GetClient().GetHabbo().InRoom)
  292.             {
  293.                 Room OldRoom = ButterflyEnvironment.GetGame().GetRoomManager().GetRoom(this.GetClient().GetHabbo().CurrentRoomId);
  294.  
  295.                 if (OldRoom != null)
  296.                 {
  297.                     OldRoom.GetRoomUserManager().RemoveUserFromRoom(this.GetClient(), false, false);
  298.                 }
  299.             }
  300.  
  301.             Room room = ButterflyEnvironment.GetGame().GetRoomManager().LoadRoom(Id);
  302.             if (room == null)
  303.             {
  304.                 this.GetClient().SendPacket(new CloseConnectionComposer());
  305.                 return;
  306.             }
  307.             if (room.mIsIdle)
  308.                 return;
  309.  
  310.             if (this.GetClient().GetHabbo().IsTeleporting && this.GetClient().GetHabbo().TeleportingRoomID != Id)
  311.             {
  312.                 this.GetClient().GetHabbo().TeleportingRoomID = 0;
  313.                 this.GetClient().GetHabbo().IsTeleporting = false;
  314.                 this.GetClient().GetHabbo().TeleporterId = 0;
  315.                 this.GetClient().SendPacket(new CloseConnectionComposer());
  316.                 return;
  317.             }
  318.  
  319.             if (!this.GetClient().GetHabbo().HasFuse("fuse_mod") && room.UserIsBanned(this.GetClient().GetHabbo().Id))
  320.             {
  321.                 if (room.HasBanExpired(this.GetClient().GetHabbo().Id))
  322.                 {
  323.                     room.RemoveBan(this.GetClient().GetHabbo().Id);
  324.                 }
  325.                 else
  326.                 {
  327.                     this.GetClient().SendPacket(new CantConnectComposer(1));
  328.  
  329.                     this.GetClient().SendPacket(new CloseConnectionComposer());
  330.                     return;
  331.                 }
  332.             }
  333.  
  334.             if (room.RoomData.UsersNow >= room.RoomData.UsersMax && !this.GetClient().GetHabbo().HasFuse("fuse_enter_full_rooms") && !ButterflyEnvironment.GetGame().GetRoleManager().RankHasRight(this.GetClient().GetHabbo().Rank, "fuse_enter_full_rooms"))
  335.             {
  336.                 if (room.CloseFullRoom)
  337.                 {
  338.                     room.RoomData.State = 1;
  339.                     room.CloseFullRoom = false;
  340.                 }
  341.  
  342.                 if (this.GetClient().GetHabbo().Id != room.RoomData.OwnerId)
  343.                 {
  344.                     this.GetClient().SendPacket(new CantConnectComposer(1));
  345.  
  346.                     this.GetClient().SendPacket(new CloseConnectionComposer());
  347.                     return;
  348.                 }
  349.             }
  350.  
  351.             if (!this.GetClient().GetHabbo().HasFuse("fuse_enter_any_room") && !room.CheckRights(this.GetClient(), true) && !(this.GetClient().GetHabbo().IsTeleporting && this.GetClient().GetHabbo().TeleportingRoomID == room.Id))
  352.             {
  353.                 if (room.RoomData.State == 1 && (!override_doorbell && !room.CheckRights(this.GetClient())))
  354.                 {
  355.                     if (room.UserCount == 0)
  356.                     {
  357.                         ServerPacket message = new ServerPacket(ServerPacketHeader.FlatAccessDeniedMessageComposer);
  358.                         this.GetClient().SendPacket(message);
  359.                     }
  360.                     else
  361.                     {
  362.                         this.GetClient().SendPacket(new DoorbellComposer(""));
  363.                         room.SendPacket(new DoorbellComposer(this.GetClient().GetHabbo().Username), true);
  364.                         this.GetClient().GetHabbo().LoadingRoomId = Id;
  365.                         this.GetClient().GetHabbo().AllowDoorBell = false;
  366.                     }
  367.  
  368.                     return;
  369.                 }
  370.                 else if (room.RoomData.State == 2 && Password.ToLower() != room.RoomData.Password.ToLower())
  371.                 {
  372.                     this.GetClient().SendPacket(new GenericErrorComposer(-100002));
  373.                     this.GetClient().SendPacket(new CloseConnectionComposer());
  374.                     return;
  375.                 }
  376.             }
  377.  
  378.             if (!EnterRoom(room))
  379.                 this.GetClient().SendPacket(new CloseConnectionComposer());
  380.             else
  381.             {
  382.                 this.GetClient().GetHabbo().LoadingRoomId = Id;
  383.                 this.GetClient().GetHabbo().AllowDoorBell = true;
  384.             }
  385.  
  386.         }
  387.  
  388.         public bool EnterRoom(Room Room)
  389.         {
  390.             GameClient Session = this.GetClient();
  391.             if (Session == null)
  392.                 return false;
  393.             if (Room == null)
  394.                 return false;
  395.  
  396.             Session.SendPacket(new RoomReadyComposer(Room.Id, Room.RoomData.ModelName));
  397.  
  398.             if (Room.RoomData.Wallpaper != "0.0")
  399.                 Session.SendPacket(new RoomPropertyComposer("wallpaper", Room.RoomData.Wallpaper));
  400.             if (Room.RoomData.Floor != "0.0")
  401.                 Session.SendPacket(new RoomPropertyComposer("floor", Room.RoomData.Floor));
  402.  
  403.             Session.SendPacket(new RoomPropertyComposer("landscape", Room.RoomData.Landscape));
  404.             Session.SendPacket(new RoomRatingComposer(Room.RoomData.Score, !(Session.GetHabbo().RatedRooms.Contains(Room.Id) || Room.RoomData.OwnerId == Session.GetHabbo().Id)));
  405.  
  406.  
  407.             return true;
  408.         }
  409.  
  410.         public void LoadData(UserData.UserData data)
  411.         {
  412.             this.LoadAchievements(data.achievements);
  413.             this.LoadFavorites(data.favouritedRooms);
  414.             this.LoadRoomRights(data.RoomRightsList);
  415.             //this.LoadTags(data.tags);
  416.         }
  417.  
  418.         public bool HasFuse(string Fuse)
  419.         {
  420.             if (ButterflyEnvironment.GetGame().GetRoleManager().RankHasRight(this.Rank, Fuse))
  421.                 return true;
  422.  
  423.             return false;
  424.         }
  425.  
  426.         public void LoadRoomRights(List<int> roomID)
  427.         {
  428.             this.RoomRightsList = new List<RoomData>();
  429.             foreach (int num in roomID)
  430.             {
  431.                 RoomData roomdata = ButterflyEnvironment.GetGame().GetRoomManager().GenerateRoomData(num);
  432.                 this.RoomRightsList.Add(roomdata);
  433.             }
  434.         }
  435.  
  436.         public void LoadFavorites(List<int> roomID)
  437.         {
  438.             this.FavoriteRooms = new List<RoomData>();
  439.             foreach (int num in roomID)
  440.             {
  441.                 RoomData roomdata = ButterflyEnvironment.GetGame().GetRoomManager().GenerateRoomData(num);
  442.                 this.FavoriteRooms.Add(roomdata);
  443.             }
  444.         }
  445.  
  446.         /*public void LoadTags(List<string> tags)
  447.         {
  448.             this.Tags = tags;
  449.         }*/
  450.  
  451.         public void LoadAchievements(Dictionary<string, UserAchievement> achievements)
  452.         {
  453.             this.Achievements = achievements;
  454.         }
  455.  
  456.         public void OnDisconnect()
  457.         {
  458.             if (this.Disconnected)
  459.                 return;
  460.  
  461.             this.Disconnected = true;
  462.  
  463.             ButterflyEnvironment.GetGame().GetClientManager().UnregisterClient(this.Id, this.Username);
  464.  
  465.             if (this.Langue == Language.FRANCAIS)
  466.                 ButterflyEnvironment.onlineUsersFr--;
  467.             else if (this.Langue == Language.ANGLAIS)
  468.                 ButterflyEnvironment.onlineUsersEn--;
  469.             else if (this.Langue == Language.PORTUGAIS)
  470.                 ButterflyEnvironment.onlineUsersBr--;
  471.  
  472.             if (this.HasFuse("fuse_mod"))
  473.                 ButterflyEnvironment.GetGame().GetClientManager().RemoveUserStaff(this.Id);
  474.  
  475.             Logging.WriteLine(this.Username + " has logged out.");
  476.  
  477.             if (!this.HabboinfoSaved)
  478.             {
  479.                 this.HabboinfoSaved = true;
  480.                 TimeSpan TimeOnline = DateTime.Now - this.OnlineTime;
  481.                 int TimeOnlineSec = (int)TimeOnline.TotalSeconds;
  482.                 using (IQueryAdapter queryreactor = ButterflyEnvironment.GetDatabaseManager().GetQueryReactor())
  483.                 {
  484.                     queryreactor.RunQuery("UPDATE users SET online = '0', last_online = '" + ButterflyEnvironment.GetUnixTimestamp() + "', activity_points = " + this.Duckets + ", activity_points_lastupdate = '" + this.LastActivityPointsUpdate + "', credits = " + this.Credits + " WHERE id = " + this.Id + " ;");
  485.                     queryreactor.RunQuery("UPDATE user_stats SET groupid = " + this.FavouriteGroupId + ",  OnlineTime = OnlineTime + " + TimeOnlineSec + ", quest_id = '"+ this.CurrentQuestId + "', Respect = '"+ this.Respect + "', DailyRespectPoints = '"+this.DailyRespectPoints+ "', DailyPetRespectPoints = '"+this.DailyPetRespectPoints+"' WHERE id = " + this.Id + " ;");
  486.                 }
  487.             }
  488.  
  489.             if (this.InRoom && this.CurrentRoom != null)
  490.             {
  491.                 this.CurrentRoom.GetRoomUserManager().RemoveUserFromRoom(this.mClient, false, false);
  492.             }
  493.  
  494.             if (this.RolePlayId > 0)
  495.             {
  496.                 RolePlayerManager RPManager = ButterflyEnvironment.GetGame().GetRoleplayManager().GetRolePlay(this.RolePlayId);
  497.                 if (RPManager != null)
  498.                 {
  499.                     RolePlayer Rp = RPManager.GetPlayer(this.Id);
  500.                     if (Rp != null)
  501.                         RPManager.RemovePlayer(this.Id);
  502.                 }
  503.                 this.RolePlayId = 0;
  504.             }
  505.  
  506.             if (this.GuideOtherUserId != 0)
  507.             {
  508.                 GameClient requester = ButterflyEnvironment.GetGame().GetClientManager().GetClientByUserID(this.GuideOtherUserId);
  509.                 if (requester != null)
  510.                 {
  511.                     ServerPacket message = new ServerPacket(ServerPacketHeader.OnGuideSessionEnded);
  512.                     message.WriteInteger(1);
  513.                     requester.SendPacket(message);
  514.  
  515.                     requester.GetHabbo().GuideOtherUserId = 0;
  516.                 }
  517.             }
  518.             if (this.OnDuty)
  519.                 ButterflyEnvironment.GetGame().GetGuideManager().RemoveGuide(this.Id);
  520.  
  521.             if (this.Messenger != null)
  522.             {
  523.                 this.Messenger.AppearOffline = true;
  524.                 this.Messenger.Destroy();
  525.             }
  526.  
  527.             if (this.InventoryComponent != null)
  528.             {
  529.                 this.InventoryComponent.Destroy();
  530.                 this.InventoryComponent = null;
  531.             }
  532.  
  533.             if (this.BadgeComponent != null)
  534.             {
  535.                 this.BadgeComponent.Destroy();
  536.                 this.BadgeComponent = null;
  537.             }
  538.  
  539.             if(this.UsersRooms != null)
  540.                 this.UsersRooms.Clear();
  541.  
  542.             if(this.RoomRightsList != null)
  543.             this.RoomRightsList.Clear();
  544.  
  545.             if (this.FavoriteRooms != null)
  546.                 this.FavoriteRooms.Clear();
  547.  
  548.             this.mClient = (GameClient)null;
  549.         }
  550.  
  551.         public void UpdateCreditsBalance()
  552.         {
  553.             GameClient client = this.GetClient();
  554.             if (client == null)
  555.                 return;
  556.  
  557.             ServerPacket Message = new ServerPacket(ServerPacketHeader.CreditBalanceMessageComposer);
  558.             Message.WriteString(this.Credits + ".0");
  559.             client.SendPacket(Message);
  560.         }
  561.  
  562.         public void UpdateDiamondsBalance()
  563.         {
  564.             GameClient client = this.GetClient();
  565.             if (client == null)
  566.                 return;
  567.             ServerPacket Message = new ServerPacket(ServerPacketHeader.ActivityPointsMessageComposer);
  568.             Message.WriteInteger(1);
  569.             Message.WriteInteger(105);
  570.             Message.WriteInteger(this.WibboPoints);
  571.             client.SendPacket(Message);
  572.         }
  573.  
  574.         public void UpdateActivityPointsBalance()
  575.         {
  576.             GameClient client = this.GetClient();
  577.             if (client == null)
  578.                 return;
  579.             client.SendPacket(new HabboActivityPointNotificationComposer(this.Duckets, 1));
  580.         }
  581.  
  582.         private GameClient GetClient()
  583.         {
  584.             return ButterflyEnvironment.GetGame().GetClientManager().GetClientByUserID(this.Id);
  585.         }
  586.  
  587.         public HabboMessenger GetMessenger()
  588.         {
  589.             return this.Messenger;
  590.         }
  591.  
  592.         public BadgeComponent GetBadgeComponent()
  593.         {
  594.             return this.BadgeComponent;
  595.         }
  596.  
  597.         public InventoryComponent GetInventoryComponent()
  598.         {
  599.             return this.InventoryComponent;
  600.         }
  601.  
  602.         public ChatMessageManager GetChatMessageManager()
  603.         {
  604.             return this.chatMessageManager;
  605.         }
  606.  
  607.         public int GetQuestProgress(int p)
  608.         {
  609.             int num = 0;
  610.             this.quests.TryGetValue(p, out num);
  611.             return num;
  612.         }
  613.  
  614.         public UserAchievement GetAchievementData(string p)
  615.         {
  616.             UserAchievement userAchievement = (UserAchievement)null;
  617.             this.Achievements.TryGetValue(p, out userAchievement);
  618.             return userAchievement;
  619.         }
  620.     }
  621. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top