Advertisement
Guest User

Untitled

a guest
Jun 28th, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 355.52 KB | None | 0 0
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Data;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Text.RegularExpressions;
  8. using System.Threading;
  9. using System.Globalization;
  10.  
  11. using HighSoft.Core;
  12. using HighSoft.HabboHotel.Misc;
  13. using HighSoft.HabboHotel.GameClients;
  14. using HighSoft.HabboHotel.Rooms;
  15. using HighSoft.HabboHotel.Items;
  16. using HighSoft.HabboHotel.Pets;
  17. using HighSoft.HabboHotel.Pathfinding;
  18. using HighSoft.Util;
  19. using HighSoft.Messages;
  20. using HighSoft.HabboHotel.RoomBots;
  21. using HighSoft.HabboHotel.Navigators;
  22. using HighSoft.Storage;
  23. using HighSoft.HabboHotel.Users;
  24. using HighSoft.HabboHotel.SoundMachine;
  25. using HighSoft.Source.HabboHotel.SoundMachine;
  26. using HighSoft.HabboHotel.Rooms.Games;
  27.  
  28. namespace HighSoft.HabboHotel.Rooms
  29. {
  30. internal sealed class Room
  31. {
  32. public delegate void Delegate2(int Team);
  33.  
  34. public uint Id;
  35.  
  36. public uint Achievement;
  37.  
  38. public string Name;
  39. public string Description;
  40. public string Type;
  41. public string Owner;
  42.  
  43. public string Password;
  44.  
  45. public int Category;
  46. public int State;
  47.  
  48. public int UsersNow;
  49. public int UsersMax;
  50.  
  51. public string ModelName;
  52. public string CCTs;
  53.  
  54. public int Score;
  55.  
  56. public List<string> Tags;
  57.  
  58. public bool AllowPet;
  59. public bool AllowPetsEating;
  60. public bool AllowWalkthrough;
  61.  
  62. public bool Hidewall;
  63.  
  64. public int Wallthick;
  65. public int Floorthick;
  66.  
  67. internal bool bool_4;
  68. internal bool bool_5;
  69.  
  70. private Timer timer_0;
  71.  
  72. private bool bool_6;
  73. private bool bool_7;
  74.  
  75. internal RoomUser[] RoomUsers;
  76.  
  77. public int int_7 = 0;
  78. private int int_8;
  79.  
  80. public RoomIcon RoomIcon;
  81.  
  82. public List<uint> UsersWithRights;
  83.  
  84. internal bool bool_8;
  85.  
  86. private Dictionary<uint, double> dictionary_0;
  87.  
  88. public RoomEvent Event;
  89.  
  90. public string Wallpaper;
  91. public string Floor;
  92. public string Landscape;
  93.  
  94. private Hashtable hashtable_0;
  95. private Hashtable hashtable_1;
  96. private Hashtable hashtable_2;
  97. private Hashtable hashtable_3;
  98. private Hashtable hashtable_4;
  99.  
  100. public MoodlightData MoodlightData;
  101.  
  102. public List<Trade> list_2;
  103.  
  104. public bool bool_9;
  105.  
  106. public List<RoomItem> list_3;
  107.  
  108. public List<uint> list_4;
  109.  
  110. public List<RoomItem> list_5;
  111. public List<RoomItem> list_6;
  112. public List<RoomItem> list_7;
  113. public List<RoomItem> list_8;
  114. public List<RoomItem> list_9;
  115. public List<RoomItem> list_10;
  116. public List<RoomItem> list_11;
  117. public List<RoomItem> list_12;
  118. public List<RoomItem> list_13;
  119.  
  120. public int int_9;
  121. public int int_10;
  122. public int int_11;
  123. public int int_12;
  124.  
  125. private bool bool_10;
  126.  
  127. public List<RoomItem> list_14;
  128. public List<RoomItem> list_15;
  129. public List<RoomItem> list_16;
  130.  
  131. public List<GroupsManager> list_17;
  132.  
  133. public double[,] double_0;
  134. private byte[,] byte_0;
  135. public ThreeDCoord[,] gstruct1_0;
  136. private byte[,] byte_1;
  137. private byte[,] byte_2;
  138. private double[,] double_1;
  139. private double[,] double_2;
  140.  
  141. private RoomModel class28_0;
  142.  
  143. private bool bool_11;
  144. private int int_14;
  145. private int int_15;
  146.  
  147. private RoomData class27_0;
  148.  
  149. private int int_16;
  150. private bool bool_12;
  151.  
  152. private bool[,] HeightOverride;
  153.  
  154. public int CurrentPollId;
  155.  
  156. private RoomMusicController MusicController;
  157.  
  158. public bool frzTimer = false;
  159.  
  160. internal TeamManager TeamManager;
  161. private GameManager GameManager;
  162. private Freeze freeze;
  163.  
  164. public List<int> InfobusAnswers;
  165.  
  166. internal bool isCycling = false;
  167.  
  168. public bool HasEvent
  169. {
  170. get
  171. {
  172. return this.Event != null;
  173. }
  174. }
  175.  
  176. internal bool Boolean_1
  177. {
  178. get
  179. {
  180. return this.bool_11;
  181. }
  182. set
  183. {
  184. this.bool_11 = value;
  185. }
  186. }
  187.  
  188. internal bool GotMusicController()
  189. {
  190. return (this.MusicController != null);
  191. }
  192.  
  193. public int UserCount
  194. {
  195. get
  196. {
  197. int num = 0;
  198. int result;
  199. if (this.RoomUsers == null)
  200. {
  201. result = 0;
  202. }
  203. else
  204. {
  205. for (int i = 0; i < this.RoomUsers.Length; i++)
  206. {
  207. if (this.RoomUsers[i] != null && !this.RoomUsers[i].IsBot && !this.RoomUsers[i].IsPet)
  208. {
  209. num++;
  210. }
  211. }
  212. result = num;
  213. }
  214. return result;
  215. }
  216. }
  217.  
  218. public int Int32_1
  219. {
  220. get
  221. {
  222. return this.Tags.Count;
  223. }
  224. }
  225.  
  226. public RoomModel RoomModel
  227. {
  228. get
  229. {
  230. return this.class28_0;
  231. }
  232. }
  233.  
  234. public Hashtable Hashtable_0
  235. {
  236. get
  237. {
  238. Hashtable result;
  239. if (this.hashtable_0 != null)
  240. {
  241. result = (this.hashtable_0.Clone() as Hashtable);
  242. }
  243. else
  244. {
  245. result = null;
  246. }
  247. return result;
  248. }
  249. }
  250.  
  251. public Hashtable Hashtable_1
  252. {
  253. get
  254. {
  255. return this.hashtable_4.Clone() as Hashtable;
  256. }
  257. }
  258.  
  259. public bool CanTrade
  260. {
  261. get
  262. {
  263. if (this.IsPublic)
  264. return false;
  265. else
  266. {
  267. FlatCat category = HighSoft.GetGame().GetNavigator().method_2(this.Category);
  268. return (category != null && category.CanTrade);
  269. }
  270. }
  271. }
  272.  
  273. public bool IsPublic
  274. {
  275. get
  276. {
  277. return this.Type == "public";
  278. }
  279. }
  280.  
  281. public int PetCount
  282. {
  283. get
  284. {
  285. int num = 0;
  286. for (int i = 0; i < this.RoomUsers.Length; i++)
  287. {
  288. RoomUser @class = this.RoomUsers[i];
  289. if (@class != null && @class.IsPet)
  290. {
  291. num++;
  292. }
  293. }
  294. return num;
  295. }
  296. }
  297.  
  298. internal RoomData RoomData
  299. {
  300. get
  301. {
  302. this.class27_0.Fill(this);
  303. return this.class27_0;
  304. }
  305. }
  306.  
  307. public byte[,] Byte_0
  308. {
  309. get
  310. {
  311. return this.byte_0;
  312. }
  313. }
  314.  
  315. internal bool Boolean_4
  316. {
  317. get
  318. {
  319. return this.GetPets().Count > 0;
  320. }
  321. }
  322.  
  323. internal RoomMusicController GetRoomMusicController()
  324. {
  325. if (this.MusicController == null)
  326. {
  327. this.MusicController = new RoomMusicController();
  328. }
  329. return this.MusicController;
  330. }
  331.  
  332. internal void LoadMusic()
  333. {
  334. DataTable table;
  335. DataTable table2;
  336. using (DatabaseClient @class = HighSoft.GetDatabase().GetClient())
  337. {
  338. table = @class.ReadDataTable("SELECT * FROM items_rooms_songs WHERE roomid = '" + Id + "'"); // <-- old
  339. table2 = @class.ReadDataTable("SELECT * FROM items_jukebox_songs WHERE jukeboxid = '" + this.GetRoomMusicController().LinkedItemId + "'"); // <-- new
  340. }
  341.  
  342. foreach (DataRow row in table.Rows)
  343. {
  344. int songID = (int)row["songid"];
  345. uint num2 = (uint)row["itemid"];
  346. int baseItem = (int)row["baseitem"];
  347. SongItem diskItem = new SongItem((int)num2, songID, baseItem);
  348. diskItem.RemoveFromDatabase();
  349. diskItem.SaveToDatabase(this.GetRoomMusicController().LinkedItemId);
  350. this.GetRoomMusicController().AddDisk(diskItem);
  351. }
  352.  
  353. foreach (DataRow row in table2.Rows)
  354. {
  355. int songID = (int)row["songid"];
  356. uint num2 = (uint)row["itemid"];
  357. int baseItem = (int)row["baseitem"];
  358. SongItem diskItem = new SongItem((int)num2, songID, baseItem);
  359. this.GetRoomMusicController().AddDisk(diskItem);
  360. }
  361. }
  362.  
  363. public Room(uint uint_2, string name, string description, string type, string string_13, int int_17, int int_18, int int_19, string string_14, string string_15, int int_20, List<string> list_18, bool bool_13, bool bool_14, bool bool_15, bool bool_16, RoomIcon class29_1, string string_16, string string_17, string string_18, string string_19, RoomData class27_1, bool bool_17, int int_21, int int_22, uint uint_3)
  364. {
  365. this.bool_12 = false;
  366. this.Id = uint_2;
  367. this.Name = name;
  368. this.Description = description;
  369. this.Owner = string_13;
  370. this.Category = int_17;
  371. this.Type = type;
  372. this.State = int_18;
  373. this.UsersNow = 0;
  374. this.UsersMax = int_19;
  375. this.ModelName = string_14;
  376. this.CCTs = string_15;
  377. this.Score = int_20;
  378. this.Tags = list_18;
  379. this.AllowPet = bool_13;
  380. this.AllowPetsEating = bool_14;
  381. this.AllowWalkthrough = bool_15;
  382. this.Hidewall = bool_16;
  383. this.Wallthick = int_21;
  384. this.Floorthick = int_22;
  385. this.int_7 = 0;
  386. this.RoomUsers = new RoomUser[500];
  387. this.RoomIcon = class29_1;
  388. this.Password = string_16;
  389. this.dictionary_0 = new Dictionary<uint, double>();
  390. this.Event = null;
  391. this.Wallpaper = string_17;
  392. this.Floor = string_18;
  393. this.Landscape = string_19;
  394. this.hashtable_4 = new Hashtable();
  395. this.hashtable_0 = new Hashtable();
  396. this.list_2 = new List<Trade>();
  397. this.class28_0 = HighSoft.GetGame().GetRoomManager().GetModel(this.ModelName, this.Id);
  398. this.bool_6 = false;
  399. this.bool_7 = false;
  400. this.bool_5 = true;
  401. this.class27_0 = class27_1;
  402. this.bool_8 = bool_17;
  403. this.list_17 = new List<GroupsManager>();
  404. this.list_4 = new List<uint>();
  405. this.list_5 = new List<RoomItem>();
  406. this.list_9 = new List<RoomItem>();
  407. this.list_7 = new List<RoomItem>();
  408. this.list_6 = new List<RoomItem>();
  409. this.list_8 = new List<RoomItem>();
  410. this.list_10 = new List<RoomItem>();
  411. this.list_11 = new List<RoomItem>();
  412. this.list_12 = new List<RoomItem>();
  413. this.list_13 = new List<RoomItem>();
  414. this.int_10 = 0;
  415. this.int_11 = 0;
  416. this.int_9 = 0;
  417. this.int_12 = 0;
  418. this.list_3 = new List<RoomItem>();
  419. this.list_14 = new List<RoomItem>();
  420. this.list_15 = new List<RoomItem>();
  421. this.list_16 = new List<RoomItem>();
  422. this.byte_0 = new byte[this.RoomModel.int_4, this.RoomModel.int_5];
  423. this.double_1 = new double[this.RoomModel.int_4, this.RoomModel.int_5];
  424. this.double_2 = new double[this.RoomModel.int_4, this.RoomModel.int_5];
  425. //this.timer_0 = new Timer(new TimerCallback(this.method_32), null, 480, 480);
  426. this.int_8 = 0;
  427. this.bool_4 = false;
  428. this.bool_9 = true;
  429. this.bool_11 = false;
  430. this.int_16 = 0;
  431. this.int_15 = 4;
  432. this.Achievement = uint_3;
  433. this.bool_10 = false;
  434. this.hashtable_1 = new Hashtable();
  435. this.hashtable_2 = new Hashtable();
  436. this.hashtable_3 = new Hashtable();
  437. this.method_23();
  438. this.method_25();
  439. this.method_22();
  440. this.LoadMusic();
  441. this.InfobusAnswers = new List<int>();
  442. }
  443.  
  444. public void method_0()
  445. {
  446. List<RoomBot> list = HighSoft.GetGame().GetBotManager().method_2(this.Id);
  447. foreach (RoomBot current in list)
  448. {
  449. this.BotToRoomUser(current);
  450. }
  451. }
  452.  
  453. public void method_1()
  454. {
  455. new List<Pet>();
  456. using (DatabaseClient @class = HighSoft.GetDatabase().GetClient())
  457. {
  458. @class.AddParamWithValue("roomid", this.Id);
  459. DataTable dataTable = @class.ReadDataTable("SELECT Id, user_id, room_id, name, type, race, color, expirience, energy, nutrition, respect, createstamp, x, y, z FROM user_pets WHERE room_id = @roomid;");
  460. if (dataTable != null)
  461. {
  462. foreach (DataRow dataRow_ in dataTable.Rows)
  463. {
  464. Pet class2 = HighSoft.GetGame().GetCatalog().method_12(dataRow_);
  465. List<RandomSpeech> list = new List<RandomSpeech>();
  466. List<BotResponse> list2 = new List<BotResponse>();
  467. this.method_4(new RoomBot(class2.PetId, this.Id, AIType.const_0, "freeroam", class2.Name, "", class2.Look, class2.X, class2.Y, (int)class2.Z, 0, 0, 0, 0, 0, ref list, ref list2, 0), class2);
  468. }
  469. }
  470. }
  471. }
  472.  
  473. internal List<Pet> GetPets()
  474. {
  475. List<Pet> list = new List<Pet>();
  476.  
  477. for (int i = 0; i < this.RoomUsers.Length; i++)
  478. {
  479. if (this.RoomUsers[i] != null && this.RoomUsers[i].IsPet)
  480. {
  481. list.Add(this.RoomUsers[i].PetData);
  482. }
  483. }
  484.  
  485. return list;
  486. }
  487.  
  488. public RoomUser BotToRoomUser(RoomBot class34_0)
  489. {
  490. return this.method_4(class34_0, null);
  491. }
  492.  
  493. public RoomUser method_4(RoomBot Bot, Pet PetData)
  494. {
  495. int num = this.method_5();
  496.  
  497. RoomUser user = new RoomUser(Convert.ToUInt32(num + 100000), this.Id, this.int_7++, true);
  498.  
  499. user.int_20 = num;
  500.  
  501. this.RoomUsers[num] = user;
  502. if (Bot.x > 0 && Bot.y > 0 && Bot.x < this.RoomModel.int_4 && Bot.y < this.RoomModel.int_5)
  503. {
  504. user.method_7(Bot.x, Bot.y, Bot.z);
  505. user.method_9(Bot.Rotation);
  506. }
  507. else
  508. {
  509. Bot.x = this.RoomModel.int_0;
  510. Bot.y = this.RoomModel.int_1;
  511. user.method_7(this.RoomModel.int_0, this.RoomModel.int_1, this.RoomModel.double_0);
  512. user.method_9(this.RoomModel.int_2);
  513. }
  514.  
  515. user.RoomBot = Bot;
  516. user.BotAI = Bot.method_4(user.VirtualId);
  517.  
  518. if (user.IsPet)
  519. {
  520. user.BotAI.Init((int)Bot.Id, user.VirtualId, this.Id);
  521. user.PetData = PetData;
  522. user.PetData.VirtualId = user.VirtualId;
  523. }
  524. else
  525. {
  526. user.BotAI.Init(-1, user.VirtualId, this.Id);
  527. }
  528. this.method_87(user, true, true);
  529. user.UpdateNeeded = true;
  530. ServerMessage Message = new ServerMessage(28u);
  531. Message.AppendInt32(1);
  532. user.method_14(Message);
  533. this.SendMessage(Message, null);
  534. user.BotAI.OnSelfEnterRoom();
  535. return user;
  536. }
  537.  
  538. private int method_5()
  539. {
  540. return Array.IndexOf<RoomUser>(this.RoomUsers, null);
  541. }
  542.  
  543. public void method_6(int int_17, bool bool_13)
  544. {
  545. RoomUser @class = this.method_52(int_17);
  546. if (@class != null && @class.IsBot)
  547. {
  548. @class.BotAI.OnSelfLeaveRoom(bool_13);
  549. ServerMessage Message = new ServerMessage(29u);
  550. Message.AppendRawInt32(@class.VirtualId);
  551. this.SendMessage(Message, null);
  552. uint num = @class.UId;
  553. for (int i = 0; i < this.RoomUsers.Length; i++)
  554. {
  555. RoomUser class2 = this.RoomUsers[i];
  556. if (class2 != null && class2.UId == num)
  557. {
  558. this.RoomUsers[i] = null;
  559. }
  560. }
  561. }
  562. }
  563. public void method_7(RoomUser RoomUser_1, string string_10, bool bool_13)
  564. {
  565. for (int i = 0; i < this.RoomUsers.Length; i++)
  566. {
  567. RoomUser @class = this.RoomUsers[i];
  568. if (@class != null && @class.IsBot)
  569. {
  570. if (bool_13)
  571. {
  572. @class.BotAI.OnUserShout(RoomUser_1, string_10);
  573. }
  574. else
  575. {
  576. @class.BotAI.OnUserSay(RoomUser_1, string_10);
  577. }
  578. }
  579. }
  580. }
  581. public void method_8(RoomUser RoomUser_1)
  582. {
  583. try
  584. {
  585. foreach (RoomItem current in this.list_14)
  586. {
  587. if (current.GetBaseItem().InteractionType.ToLower() == "wf_trg_enterroom")
  588. {
  589. this.method_21(RoomUser_1, current, "");
  590. }
  591. }
  592. }
  593. catch
  594. {
  595. }
  596. }
  597. public bool method_9(RoomUser RoomUser_1, string string_10)
  598. {
  599. bool result = false;
  600. try
  601. {
  602. foreach (RoomItem current in this.list_14)
  603. {
  604. if (current.GetBaseItem().InteractionType.ToLower() == "wf_trg_onsay" && this.method_21(RoomUser_1, current, string_10.ToLower()))
  605. {
  606. result = true;
  607. }
  608. }
  609. }
  610. catch
  611. {
  612. }
  613. return result;
  614. }
  615. public void method_10(RoomUser RoomUser_1, RoomItem RoomItem_0)
  616. {
  617. try
  618. {
  619. foreach (RoomItem current in this.list_14)
  620. {
  621. if (current.GetBaseItem().InteractionType.ToLower() == "wf_trg_furnistate")
  622. {
  623. this.method_21(RoomUser_1, current, Convert.ToString(RoomItem_0.uint_0));
  624. }
  625. }
  626. }
  627. catch
  628. {
  629. }
  630. }
  631. public void method_11(RoomUser RoomUser_1, RoomItem RoomItem_0)
  632. {
  633. try
  634. {
  635. foreach (RoomItem current in this.list_14)
  636. {
  637. if (current.GetBaseItem().InteractionType.ToLower() == "wf_trg_onfurni")
  638. {
  639. this.method_21(RoomUser_1, current, Convert.ToString(RoomItem_0.uint_0));
  640. }
  641. }
  642. }
  643. catch
  644. {
  645. }
  646. }
  647. public void method_12(RoomUser RoomUser_1, RoomItem RoomItem_0)
  648. {
  649. try
  650. {
  651. foreach (RoomItem current in this.list_14)
  652. {
  653. if (current.GetBaseItem().InteractionType.ToLower() == "wf_trg_offfurni")
  654. {
  655. this.method_21(RoomUser_1, current, Convert.ToString(RoomItem_0.uint_0));
  656. }
  657. }
  658. }
  659. catch
  660. {
  661. }
  662. }
  663. public void method_13()
  664. {
  665. try
  666. {
  667. foreach (RoomItem current in this.list_14)
  668. {
  669. if (current.GetBaseItem().InteractionType.ToLower() == "wf_trg_gameend")
  670. {
  671. this.method_21(null, current, "GameEnded");
  672. }
  673. }
  674. }
  675. catch
  676. {
  677. }
  678. }
  679. public void method_14(RoomUser RoomUser_1)
  680. {
  681. try
  682. {
  683. foreach (RoomItem current in this.list_14)
  684. {
  685. if (current.GetBaseItem().InteractionType.ToLower() == "wf_trg_gamestart")
  686. {
  687. this.method_21(RoomUser_1, current, "GameBegun");
  688. }
  689. }
  690. }
  691. catch
  692. {
  693. }
  694. }
  695. public void method_15(RoomItem RoomItem_0)
  696. {
  697. this.method_21(null, RoomItem_0, "Timer");
  698. }
  699. public void method_16(RoomItem RoomItem_0)
  700. {
  701. try
  702. {
  703. foreach (RoomItem current in this.list_14)
  704. {
  705. if (current.GetBaseItem().InteractionType.ToLower() == "wf_trg_attime" && current.WiredAtTimeTimer >= double.Parse(current.string_2, CultureInfo.InvariantCulture))
  706. {
  707. this.method_21(null, current, "AtTime");
  708. current.WiredAtTimeTimer = 0;
  709. current.WiredAtTimeNeedReset = true;
  710. }
  711. }
  712. }
  713. catch
  714. {
  715. }
  716. }
  717. public void method_17(int int_17)
  718. {
  719. try
  720. {
  721. foreach (RoomItem current in this.list_14)
  722. {
  723. if (current.GetBaseItem().InteractionType.ToLower() == "wf_trg_atscore" && current.string_2 != "" && Convert.ToDouble(current.string_2) == (double)int_17)
  724. {
  725. this.method_21(null, current, "TheScore");
  726. }
  727. }
  728. }
  729. catch
  730. {
  731. }
  732. }
  733. public bool method_18(RoomUser RoomUser_1, string string_10, string string_11)
  734. {
  735. string_11 = this.method_20(RoomUser_1, string_11);
  736. bool result;
  737. if (string_10 != null)
  738. {
  739. if (MusCommands.dictionary_4 == null)
  740. {
  741. MusCommands.dictionary_4 = new Dictionary<string, int>(39)
  742. {
  743.  
  744. {
  745. "roomuserseq",
  746. 0
  747. },
  748.  
  749. {
  750. "roomuserslt",
  751. 1
  752. },
  753.  
  754. {
  755. "roomusersmt",
  756. 2
  757. },
  758.  
  759. {
  760. "roomusersmte",
  761. 3
  762. },
  763.  
  764. {
  765. "roomuserslte",
  766. 4
  767. },
  768.  
  769. {
  770. "userhasachievement",
  771. 5
  772. },
  773.  
  774. {
  775. "userhasntachievement",
  776. 6
  777. },
  778.  
  779. {
  780. "userhasbadge",
  781. 7
  782. },
  783.  
  784. {
  785. "userhasntbadge",
  786. 8
  787. },
  788.  
  789. {
  790. "userhasvip",
  791. 9
  792. },
  793.  
  794. {
  795. "userhasntvip",
  796. 10
  797. },
  798.  
  799. {
  800. "userhaseffect",
  801. 11
  802. },
  803.  
  804. {
  805. "userhasnteffect",
  806. 12
  807. },
  808.  
  809. {
  810. "userrankeq",
  811. 13
  812. },
  813.  
  814. {
  815. "userrankmt",
  816. 14
  817. },
  818.  
  819. {
  820. "userrankmte",
  821. 15
  822. },
  823.  
  824. {
  825. "userranklt",
  826. 16
  827. },
  828.  
  829. {
  830. "userranklte",
  831. 17
  832. },
  833.  
  834. {
  835. "usercreditseq",
  836. 18
  837. },
  838.  
  839. {
  840. "usercreditsmt",
  841. 19
  842. },
  843.  
  844. {
  845. "usercreditsmte",
  846. 20
  847. },
  848.  
  849. {
  850. "usercreditslt",
  851. 21
  852. },
  853.  
  854. {
  855. "usercreditslte",
  856. 22
  857. },
  858.  
  859. {
  860. "userpixelseq",
  861. 23
  862. },
  863.  
  864. {
  865. "userpixelsmt",
  866. 24
  867. },
  868.  
  869. {
  870. "userpixelsmte",
  871. 25
  872. },
  873.  
  874. {
  875. "userpixelslt",
  876. 26
  877. },
  878.  
  879. {
  880. "userpixelslte",
  881. 27
  882. },
  883.  
  884. {
  885. "userpointseq",
  886. 28
  887. },
  888.  
  889. {
  890. "userpointsmt",
  891. 29
  892. },
  893.  
  894. {
  895. "userpointsmte",
  896. 30
  897. },
  898.  
  899. {
  900. "userpointslt",
  901. 31
  902. },
  903.  
  904. {
  905. "userpointslte",
  906. 32
  907. },
  908.  
  909. {
  910. "usergroupeq",
  911. 33
  912. },
  913.  
  914. {
  915. "userisingroup",
  916. 34
  917. },
  918.  
  919. {
  920. "wearing",
  921. 35
  922. },
  923.  
  924. {
  925. "notwearing",
  926. 36
  927. },
  928.  
  929. {
  930. "carrying",
  931. 37
  932. },
  933.  
  934. {
  935. "notcarrying",
  936. 38
  937. },
  938.  
  939. {
  940. "wiredactived",
  941. 39
  942. },
  943.  
  944. {
  945. "notwiredactived",
  946. 40
  947. }
  948. };
  949. }
  950. int num;
  951. if (MusCommands.dictionary_4.TryGetValue(string_10, out num))
  952. {
  953. switch (num)
  954. {
  955. case 0:
  956. if (this.UserCount == Convert.ToInt32(string_11))
  957. {
  958. result = true;
  959. return result;
  960. }
  961. goto IL_89E;
  962. case 1:
  963. if (this.UserCount < Convert.ToInt32(string_11))
  964. {
  965. result = true;
  966. return result;
  967. }
  968. goto IL_89E;
  969. case 2:
  970. if (this.UserCount > Convert.ToInt32(string_11))
  971. {
  972. result = true;
  973. return result;
  974. }
  975. goto IL_89E;
  976. case 3:
  977. if (this.UserCount >= Convert.ToInt32(string_11))
  978. {
  979. result = true;
  980. return result;
  981. }
  982. goto IL_89E;
  983. case 4:
  984. if (this.UserCount <= Convert.ToInt32(string_11))
  985. {
  986. result = true;
  987. return result;
  988. }
  989. goto IL_89E;
  990. case 5:
  991. result = HighSoft.GetGame().GetAchievementManager().method_1(RoomUser_1.GetClient(), (uint)Convert.ToUInt16(string_11), 1);
  992. return result;
  993. case 6:
  994. if (!HighSoft.GetGame().GetAchievementManager().method_1(RoomUser_1.GetClient(), (uint)Convert.ToUInt16(string_11), 1))
  995. {
  996. result = true;
  997. return result;
  998. }
  999. goto IL_89E;
  1000. case 7:
  1001. result = RoomUser_1.GetClient().GetHabbo().GetBadgeComponent().HasBadge(string_11);
  1002. return result;
  1003. case 8:
  1004. if (!RoomUser_1.GetClient().GetHabbo().GetBadgeComponent().HasBadge(string_11))
  1005. {
  1006. result = true;
  1007. return result;
  1008. }
  1009. goto IL_89E;
  1010. case 9:
  1011. result = RoomUser_1.GetClient().GetHabbo().IsVIP;
  1012. return result;
  1013. case 10:
  1014. if (!RoomUser_1.GetClient().GetHabbo().IsVIP)
  1015. {
  1016. result = true;
  1017. return result;
  1018. }
  1019. goto IL_89E;
  1020. case 11:
  1021. if (RoomUser_1.GetClient().GetHabbo().GetEffectsInventoryComponent().int_0 == Convert.ToInt32(string_11))
  1022. {
  1023. result = true;
  1024. return result;
  1025. }
  1026. goto IL_89E;
  1027. case 12:
  1028. if (RoomUser_1.GetClient().GetHabbo().GetEffectsInventoryComponent().int_0 != Convert.ToInt32(string_11))
  1029. {
  1030. result = true;
  1031. return result;
  1032. }
  1033. goto IL_89E;
  1034. case 13:
  1035. if ((ulong)RoomUser_1.GetClient().GetHabbo().Rank == (ulong)((long)Convert.ToInt32(string_11)))
  1036. {
  1037. result = true;
  1038. return result;
  1039. }
  1040. goto IL_89E;
  1041. case 14:
  1042. if ((ulong)RoomUser_1.GetClient().GetHabbo().Rank > (ulong)((long)Convert.ToInt32(string_11)))
  1043. {
  1044. result = true;
  1045. return result;
  1046. }
  1047. goto IL_89E;
  1048. case 15:
  1049. if ((ulong)RoomUser_1.GetClient().GetHabbo().Rank >= (ulong)((long)Convert.ToInt32(string_11)))
  1050. {
  1051. result = true;
  1052. return result;
  1053. }
  1054. goto IL_89E;
  1055. case 16:
  1056. if ((ulong)RoomUser_1.GetClient().GetHabbo().Rank < (ulong)((long)Convert.ToInt32(string_11)))
  1057. {
  1058. result = true;
  1059. return result;
  1060. }
  1061. goto IL_89E;
  1062. case 17:
  1063. if ((ulong)RoomUser_1.GetClient().GetHabbo().Rank <= (ulong)((long)Convert.ToInt32(string_11)))
  1064. {
  1065. result = true;
  1066. return result;
  1067. }
  1068. goto IL_89E;
  1069. case 18:
  1070. if (RoomUser_1.GetClient().GetHabbo().Credits == Convert.ToInt32(string_11))
  1071. {
  1072. result = true;
  1073. return result;
  1074. }
  1075. goto IL_89E;
  1076. case 19:
  1077. if (RoomUser_1.GetClient().GetHabbo().Credits > Convert.ToInt32(string_11))
  1078. {
  1079. result = true;
  1080. return result;
  1081. }
  1082. goto IL_89E;
  1083. case 20:
  1084. if (RoomUser_1.GetClient().GetHabbo().Credits >= Convert.ToInt32(string_11))
  1085. {
  1086. result = true;
  1087. return result;
  1088. }
  1089. goto IL_89E;
  1090. case 21:
  1091. if (RoomUser_1.GetClient().GetHabbo().Credits < Convert.ToInt32(string_11))
  1092. {
  1093. result = true;
  1094. return result;
  1095. }
  1096. goto IL_89E;
  1097. case 22:
  1098. if (RoomUser_1.GetClient().GetHabbo().Credits <= Convert.ToInt32(string_11))
  1099. {
  1100. result = true;
  1101. return result;
  1102. }
  1103. goto IL_89E;
  1104. case 23:
  1105. if (RoomUser_1.GetClient().GetHabbo().ActivityPoints == Convert.ToInt32(string_11))
  1106. {
  1107. result = true;
  1108. return result;
  1109. }
  1110. goto IL_89E;
  1111. case 24:
  1112. if (RoomUser_1.GetClient().GetHabbo().ActivityPoints > Convert.ToInt32(string_11))
  1113. {
  1114. result = true;
  1115. return result;
  1116. }
  1117. goto IL_89E;
  1118. case 25:
  1119. if (RoomUser_1.GetClient().GetHabbo().ActivityPoints >= Convert.ToInt32(string_11))
  1120. {
  1121. result = true;
  1122. return result;
  1123. }
  1124. goto IL_89E;
  1125. case 26:
  1126. if (RoomUser_1.GetClient().GetHabbo().ActivityPoints < Convert.ToInt32(string_11))
  1127. {
  1128. result = true;
  1129. return result;
  1130. }
  1131. goto IL_89E;
  1132. case 27:
  1133. if (RoomUser_1.GetClient().GetHabbo().ActivityPoints <= Convert.ToInt32(string_11))
  1134. {
  1135. result = true;
  1136. return result;
  1137. }
  1138. goto IL_89E;
  1139. case 28:
  1140. if (RoomUser_1.GetClient().GetHabbo().VipPoints == Convert.ToInt32(string_11))
  1141. {
  1142. result = true;
  1143. return result;
  1144. }
  1145. goto IL_89E;
  1146. case 29:
  1147. if (RoomUser_1.GetClient().GetHabbo().VipPoints > Convert.ToInt32(string_11))
  1148. {
  1149. result = true;
  1150. return result;
  1151. }
  1152. goto IL_89E;
  1153. case 30:
  1154. if (RoomUser_1.GetClient().GetHabbo().VipPoints >= Convert.ToInt32(string_11))
  1155. {
  1156. result = true;
  1157. return result;
  1158. }
  1159. goto IL_89E;
  1160. case 31:
  1161. if (RoomUser_1.GetClient().GetHabbo().VipPoints < Convert.ToInt32(string_11))
  1162. {
  1163. result = true;
  1164. return result;
  1165. }
  1166. goto IL_89E;
  1167. case 32:
  1168. if (RoomUser_1.GetClient().GetHabbo().VipPoints <= Convert.ToInt32(string_11))
  1169. {
  1170. result = true;
  1171. return result;
  1172. }
  1173. goto IL_89E;
  1174. case 33:
  1175. if (RoomUser_1.GetClient().GetHabbo().int_0 == Convert.ToInt32(string_11))
  1176. {
  1177. result = true;
  1178. return result;
  1179. }
  1180. goto IL_89E;
  1181. case 34:
  1182. {
  1183. IEnumerator enumerator = RoomUser_1.GetClient().GetHabbo().dataTable_0.Rows.GetEnumerator();
  1184. try
  1185. {
  1186. while (enumerator.MoveNext())
  1187. {
  1188. DataRow dataRow = (DataRow)enumerator.Current;
  1189. if ((int)dataRow["groupid"] == Convert.ToInt32(string_11))
  1190. {
  1191. result = true;
  1192. return result;
  1193. }
  1194. }
  1195. goto IL_89E;
  1196. }
  1197. finally
  1198. {
  1199. IDisposable disposable = enumerator as IDisposable;
  1200. if (disposable != null)
  1201. {
  1202. disposable.Dispose();
  1203. }
  1204. }
  1205. }
  1206. case 35:
  1207. break;
  1208. case 36:
  1209. if (!RoomUser_1.GetClient().GetHabbo().Figure.Contains(string_11))
  1210. {
  1211. result = true;
  1212. return result;
  1213. }
  1214. goto IL_89E;
  1215. case 37:
  1216. if (this.GetRoomUserByHabbo(RoomUser_1.GetClient().GetHabbo().Id).CarryItemID == (int)Convert.ToInt16(string_11))
  1217. {
  1218. result = true;
  1219. return result;
  1220. }
  1221. goto IL_89E;
  1222. case 38:
  1223. if (this.GetRoomUserByHabbo(RoomUser_1.GetClient().GetHabbo().Id).CarryItemID != (int)Convert.ToInt16(string_11))
  1224. {
  1225. result = true;
  1226. return result;
  1227. }
  1228. goto IL_89E;
  1229. case 39:
  1230. {
  1231. using (DatabaseClient @class = HighSoft.GetDatabase().GetClient())
  1232. {
  1233. @class.AddParamWithValue("itemid", string_11);
  1234. @class.AddParamWithValue("userid", RoomUser_1.GetClient().GetHabbo().Id);
  1235.  
  1236. DataRow dataRow2 = @class.ReadDataRow("SELECT wiredid FROM user_wiredactived WHERE wiredid = @itemid AND userid = @userid");
  1237. if (dataRow2 != null)
  1238. {
  1239. result = true;
  1240. return result;
  1241. }
  1242. }
  1243. }
  1244. goto IL_89E;
  1245. case 40:
  1246. {
  1247. using (DatabaseClient @class = HighSoft.GetDatabase().GetClient())
  1248. {
  1249. @class.AddParamWithValue("itemid", string_11);
  1250. @class.AddParamWithValue("userid", RoomUser_1.GetClient().GetHabbo().Id);
  1251.  
  1252. DataRow dataRow2 = @class.ReadDataRow("SELECT wiredid FROM user_wiredactived WHERE wiredid = @itemid AND userid = @userid");
  1253. if (dataRow2 == null)
  1254. {
  1255. result = true;
  1256. return result;
  1257. }
  1258. }
  1259. }
  1260. goto IL_89E;
  1261. default:
  1262. goto IL_89E;
  1263. }
  1264. if (RoomUser_1.GetClient().GetHabbo().Figure.Contains(string_11))
  1265. {
  1266. result = true;
  1267. return result;
  1268. }
  1269. }
  1270. }
  1271. IL_89E:
  1272. result = false;
  1273. return result;
  1274. }
  1275. public void method_19(RoomUser RoomUser_1, string string_10, string string_11, uint Item)
  1276. {
  1277. string_11 = this.method_20(RoomUser_1, string_11);
  1278. if (string_10 != null)
  1279. {
  1280. if (MusCommands.dictionary_5 == null)
  1281. {
  1282. MusCommands.dictionary_5 = new Dictionary<string, int>(13)
  1283. {
  1284.  
  1285. {
  1286. "sql",
  1287. 0
  1288. },
  1289.  
  1290. {
  1291. "badge",
  1292. 1
  1293. },
  1294.  
  1295. {
  1296. "effect",
  1297. 2
  1298. },
  1299.  
  1300. {
  1301. "award",
  1302. 3
  1303. },
  1304.  
  1305. {
  1306. "dance",
  1307. 4
  1308. },
  1309.  
  1310. {
  1311. "send",
  1312. 5
  1313. },
  1314.  
  1315. {
  1316. "credits",
  1317. 6
  1318. },
  1319. {
  1320. "lpt",
  1321. 66
  1322. },
  1323.  
  1324. {
  1325. "pixels",
  1326. 7
  1327. },
  1328.  
  1329. {
  1330. "points",
  1331. 8
  1332. },
  1333.  
  1334. {
  1335. "rank",
  1336. 9
  1337. },
  1338.  
  1339. {
  1340. "respect",
  1341. 10
  1342. },
  1343.  
  1344. {
  1345. "handitem",
  1346. 11
  1347. },
  1348.  
  1349. {
  1350. "alert",
  1351. 12
  1352. },
  1353.  
  1354. {
  1355. "wiredactived",
  1356. 13
  1357. }
  1358. };
  1359. }
  1360. int num;
  1361. if (MusCommands.dictionary_5.TryGetValue(string_10, out num))
  1362. {
  1363. switch (num)
  1364. {
  1365. case 0:
  1366. using (DatabaseClient @class = HighSoft.GetDatabase().GetClient())
  1367. {
  1368. @class.ExecuteQuery(string_11);
  1369. return;
  1370. }
  1371. case 1:
  1372. break;
  1373. case 2:
  1374. if (RoomUser_1.GetClient() != null)
  1375. {
  1376. RoomUser_1.GetClient().GetHabbo().GetEffectsInventoryComponent().method_0(Convert.ToInt32(string_11), 3600);
  1377. RoomUser_1.GetClient().GetHabbo().GetEffectsInventoryComponent().method_3(Convert.ToInt32(string_11));
  1378. return;
  1379. }
  1380. return;
  1381. case 3:
  1382. if (RoomUser_1.GetClient() != null)
  1383. {
  1384. HighSoft.GetGame().GetAchievementManager().addAchievement(RoomUser_1.GetClient(), Convert.ToUInt32(string_11));
  1385. return;
  1386. }
  1387. return;
  1388. case 4:
  1389. if (RoomUser_1.GetClient() != null)
  1390. {
  1391. RoomUser class2 = this.GetRoomUserByHabbo(RoomUser_1.GetClient().GetHabbo().Id);
  1392. class2.DanceId = Convert.ToInt32(string_11);
  1393. ServerMessage Message = new ServerMessage(480u);
  1394. Message.AppendInt32(class2.VirtualId);
  1395. Message.AppendInt32(Convert.ToInt32(string_11));
  1396. this.SendMessage(Message, null);
  1397. return;
  1398. }
  1399. return;
  1400. case 5:
  1401. {
  1402. if (RoomUser_1.GetClient() == null)
  1403. {
  1404. return;
  1405. }
  1406. uint num2 = Convert.ToUInt32(string_11);
  1407. Room class3;
  1408. if (HighSoft.GetGame().GetRoomManager().method_13(num2) || HighSoft.GetGame().GetRoomManager().method_14(num2))
  1409. {
  1410. class3 = HighSoft.GetGame().GetRoomManager().GetRoom(num2);
  1411. }
  1412. else
  1413. {
  1414. class3 = HighSoft.GetGame().GetRoomManager().method_15(num2);
  1415. }
  1416. if (RoomUser_1 == null)
  1417. {
  1418. return;
  1419. }
  1420. if (class3 == null)
  1421. {
  1422. this.method_47(RoomUser_1.GetClient(), true, false);
  1423. return;
  1424. }
  1425. ServerMessage Message2 = new ServerMessage(286u);
  1426. Message2.AppendBoolean(class3.IsPublic);
  1427. Message2.AppendUInt(Convert.ToUInt32(string_11));
  1428. RoomUser_1.GetClient().SendMessage(Message2);
  1429. return;
  1430. }
  1431. case 6:
  1432. if (RoomUser_1.GetClient() != null)
  1433. {
  1434. RoomUser_1.GetClient().GetHabbo().Credits = RoomUser_1.GetClient().GetHabbo().Credits + Convert.ToInt32(string_11);
  1435. RoomUser_1.GetClient().GetHabbo().UpdateCredits(true);
  1436. return;
  1437. }
  1438. return;
  1439. case 66:
  1440. if (RoomUser_1.GetClient() != null)
  1441. {
  1442. RoomUser_1.GetClient().GetHabbo().Credits = RoomUser_1.GetClient().GetHabbo().Credits + Convert.ToInt32(string_11);
  1443. RoomUser_1.GetClient().GetHabbo().UpdateActivityPoints(true);
  1444. return;
  1445. }
  1446. return;
  1447. case 7:
  1448. if (RoomUser_1.GetClient() != null)
  1449. {
  1450. RoomUser_1.GetClient().GetHabbo().ActivityPoints = RoomUser_1.GetClient().GetHabbo().ActivityPoints + Convert.ToInt32(string_11);
  1451. RoomUser_1.GetClient().GetHabbo().UpdateActivityPoints(true);
  1452. return;
  1453. }
  1454. return;
  1455. case 8:
  1456. if (RoomUser_1.GetClient() != null)
  1457. {
  1458. RoomUser_1.GetClient().GetHabbo().VipPoints = RoomUser_1.GetClient().GetHabbo().VipPoints + Convert.ToInt32(string_11);
  1459. RoomUser_1.GetClient().GetHabbo().UpdateVipPoints(false, true);
  1460. return;
  1461. }
  1462. return;
  1463. case 9:
  1464. if (RoomUser_1.GetClient() != null && (int)Convert.ToUInt16(string_11) < HighSoft.GetGame().GetRoleManager().method_9())
  1465. {
  1466. using (DatabaseClient @class = HighSoft.GetDatabase().GetClient())
  1467. {
  1468. @class.ExecuteQuery(string.Concat(new object[]
  1469. {
  1470. "UPDATE users SET rank = '",
  1471. Convert.ToUInt16(string_11),
  1472. "' WHERE Id = ",
  1473. RoomUser_1.GetClient().GetHabbo().Id,
  1474. " LIMIT 1;"
  1475. }));
  1476. }
  1477. RoomUser_1.GetClient().method_12();
  1478. return;
  1479. }
  1480. return;
  1481. case 10:
  1482. {
  1483. if (RoomUser_1.GetClient() == null)
  1484. {
  1485. return;
  1486. }
  1487. RoomUser_1.GetClient().GetHabbo().Respect++;
  1488. using (DatabaseClient @class = HighSoft.GetDatabase().GetClient())
  1489. {
  1490. @class.ExecuteQuery("UPDATE user_stats SET Respect = respect + 1 WHERE Id = '" + RoomUser_1.GetClient().GetHabbo().Id + "' LIMIT 1");
  1491. }
  1492. ServerMessage Message3 = new ServerMessage(440u);
  1493. Message3.AppendUInt(RoomUser_1.GetClient().GetHabbo().Id);
  1494. Message3.AppendInt32(RoomUser_1.GetClient().GetHabbo().Respect);
  1495. this.SendMessage(Message3, null);
  1496. RoomUser_1.GetClient().GetHabbo().CheckRespectReceivedAchievements();
  1497. return;
  1498. }
  1499. case 11:
  1500. if (RoomUser_1.GetClient() != null)
  1501. {
  1502. this.GetRoomUserByHabbo(RoomUser_1.GetClient().GetHabbo().Id).CarryItem((int)Convert.ToInt16(string_11));
  1503. return;
  1504. }
  1505. return;
  1506. case 12:
  1507. if (RoomUser_1.GetClient() != null)
  1508. {
  1509. RoomUser_1.GetClient().SendNotification(string_11);
  1510. return;
  1511. }
  1512. return;
  1513. case 13:
  1514. if (RoomUser_1.GetClient() != null)
  1515. {
  1516. using (DatabaseClient @class = HighSoft.GetDatabase().GetClient())
  1517. {
  1518. @class.AddParamWithValue("itemid", Convert.ToInt32(Item));
  1519. @class.AddParamWithValue("userid", RoomUser_1.GetClient().GetHabbo().Id);
  1520.  
  1521. DataRow dataRow2 = @class.ReadDataRow("SELECT wiredid FROM user_wiredactived WHERE wiredid = @itemid AND userid = @userid");
  1522. if (dataRow2 == null)
  1523. {
  1524. @class.ExecuteQuery("INSERT INTO user_wiredactived (wiredid, userid) VALUES (@itemid, @userid)");
  1525. }
  1526. }
  1527. return;
  1528. }
  1529. return;
  1530. default:
  1531. return;
  1532. }
  1533. if (RoomUser_1.GetClient() != null)
  1534. {
  1535. RoomUser_1.GetClient().GetHabbo().GetBadgeComponent().SendBadge(RoomUser_1.GetClient(), HighSoft.FilterString(string_11), true);
  1536. RoomUser_1.GetClient().SendMessage(RoomUser_1.GetClient().GetHabbo().GetBadgeComponent().ComposeBadgeListMessage());
  1537. }
  1538. }
  1539. }
  1540. }
  1541. public string method_20(RoomUser RoomUser_1, string string_10)
  1542. {
  1543. if (RoomUser_1 != null)
  1544. {
  1545. if (string_10.ToUpper().Contains("#USERNAME#"))
  1546. {
  1547. string_10 = Regex.Replace(string_10, "#USERNAME#", RoomUser_1.GetClient().GetHabbo().Username, RegexOptions.IgnoreCase);
  1548. }
  1549. if (string_10.ToUpper().Contains("#USERID#"))
  1550. {
  1551. string_10 = Regex.Replace(string_10, "#USERID#", RoomUser_1.GetClient().GetHabbo().Id.ToString(), RegexOptions.IgnoreCase);
  1552. }
  1553. if (string_10.ToUpper().Contains("#USERRANK#"))
  1554. {
  1555. string_10 = Regex.Replace(string_10, "#USERRANK#", RoomUser_1.GetClient().GetHabbo().Rank.ToString(), RegexOptions.IgnoreCase);
  1556. }
  1557. }
  1558. if (string_10.ToUpper().Contains("#ROOMNAME#"))
  1559. {
  1560. string_10 = Regex.Replace(string_10, "#ROOMNAME#", this.Name, RegexOptions.IgnoreCase);
  1561. }
  1562. if (string_10.ToUpper().Contains("#ROOMID#"))
  1563. {
  1564. string_10 = Regex.Replace(string_10, "#ROOMID#", this.Id.ToString(), RegexOptions.IgnoreCase);
  1565. }
  1566. int num = HighSoft.GetGame().GetClientManager().ClientCount + -1;
  1567. int int32_ = HighSoft.GetGame().GetRoomManager().LoadedRoomsCount;
  1568. if (string_10.ToUpper().Contains("#ONLINECOUNT#"))
  1569. {
  1570. string_10 = Regex.Replace(string_10, "#ONLINECOUNT#", num.ToString(), RegexOptions.IgnoreCase);
  1571. }
  1572. if (string_10.ToUpper().Contains("#ROOMSLOADED#"))
  1573. {
  1574. string_10 = Regex.Replace(string_10, "#ROOMSLOADED#", int32_.ToString(), RegexOptions.IgnoreCase);
  1575. }
  1576. return string_10;
  1577. }
  1578. public bool method_21(RoomUser RoomUser_1, RoomItem RoomItem_0, string string_10)
  1579. {
  1580. bool result;
  1581. try
  1582. {
  1583. if (this.bool_6 || this.bool_7)
  1584. {
  1585. result = false;
  1586. }
  1587. else
  1588. {
  1589. bool flag = false;
  1590. int num = 0;
  1591. int num2 = 0;
  1592. bool flag2 = false;
  1593. string text = RoomItem_0.GetBaseItem().InteractionType.ToLower();
  1594. switch (text)
  1595. {
  1596. case "wf_trg_onsay":
  1597. if (string_10.Contains(RoomItem_0.string_2.ToLower()))
  1598. {
  1599. flag = true;
  1600. }
  1601. break;
  1602. case "wf_trg_enterroom":
  1603. if (RoomItem_0.string_2 == "" || RoomItem_0.string_2 == RoomUser_1.GetClient().GetHabbo().Username)
  1604. {
  1605. flag = true;
  1606. }
  1607. break;
  1608. case "wf_trg_furnistate":
  1609. if (RoomItem_0.string_3.Length > 0)
  1610. {
  1611. string[] collection = RoomItem_0.string_3.Split(new char[]
  1612. {
  1613. ','
  1614. });
  1615. List<string> list = new List<string>(collection);
  1616. foreach (string current in list)
  1617. {
  1618. if (current == string_10)
  1619. {
  1620. flag = true;
  1621. }
  1622. }
  1623. }
  1624. break;
  1625. case "wf_trg_onfurni":
  1626. if (RoomItem_0.string_3.Length > 0)
  1627. {
  1628. string[] collection = RoomItem_0.string_3.Split(new char[]
  1629. {
  1630. ','
  1631. });
  1632. List<string> list = new List<string>(collection);
  1633. List<string> list2 = list;
  1634. foreach (string current in list)
  1635. {
  1636. if (!(current != string_10))
  1637. {
  1638. RoomItem @class = this.method_28(Convert.ToUInt32(string_10));
  1639. if (@class != null)
  1640. {
  1641. flag = true;
  1642. }
  1643. else
  1644. {
  1645. list2.Remove(current);
  1646. }
  1647. }
  1648. }
  1649. RoomItem_0.string_3 = string.Join(",", list2.ToArray());
  1650. }
  1651. break;
  1652. case "wf_trg_offfurni":
  1653. if (RoomItem_0.string_3.Length > 0)
  1654. {
  1655. string[] collection = RoomItem_0.string_3.Split(new char[]
  1656. {
  1657. ','
  1658. });
  1659. List<string> list = new List<string>(collection);
  1660. List<string> list2 = list;
  1661. foreach (string current in list)
  1662. {
  1663. if (!(current != string_10))
  1664. {
  1665. RoomItem @class = this.method_28(Convert.ToUInt32(string_10));
  1666. if (@class != null)
  1667. {
  1668. flag = true;
  1669. }
  1670. else
  1671. {
  1672. list2.Remove(current);
  1673. }
  1674. }
  1675. }
  1676. RoomItem_0.string_3 = string.Join(",", list2.ToArray());
  1677. }
  1678. break;
  1679. case "wf_trg_gameend":
  1680. if (string_10 == "GameEnded")
  1681. {
  1682. flag = true;
  1683. }
  1684. break;
  1685. case "wf_trg_gamestart":
  1686. if (string_10 == "GameBegun")
  1687. {
  1688. flag = true;
  1689. }
  1690. break;
  1691. case "wf_trg_timer":
  1692. if (string_10 == "Timer")
  1693. {
  1694. flag = true;
  1695. }
  1696. break;
  1697. case "wf_trg_attime":
  1698. if (string_10 == "AtTime")
  1699. {
  1700. flag = true;
  1701. }
  1702. break;
  1703. case "wf_trg_atscore":
  1704. if (string_10 == "TheScore")
  1705. {
  1706. flag = true;
  1707. }
  1708. break;
  1709. }
  1710. try
  1711. {
  1712. List<RoomItem> list3 = this.method_93(RoomItem_0.Int32_0, RoomItem_0.Int32_1);
  1713. if (list3 == null)
  1714. {
  1715. result = false;
  1716. return result;
  1717. }
  1718. foreach (RoomItem current2 in list3)
  1719. {
  1720. text = current2.GetBaseItem().InteractionType.ToLower();
  1721. if (text != null)
  1722. {
  1723. int num4;
  1724. if (!(text == "wf_cnd_phx"))
  1725. {
  1726. if (!(text == "wf_cnd_trggrer_on_frn"))
  1727. {
  1728. string[] collection;
  1729. List<string> list;
  1730. List<RoomItem> list4;
  1731. if (!(text == "wf_cnd_furnis_hv_avtrs"))
  1732. {
  1733. if (!(text == "wf_cnd_has_furni_on"))
  1734. {
  1735. if (text == "wf_cnd_time_more_than")
  1736. {
  1737. num++;
  1738. current2.ExtraData = "1";
  1739. current2.UpdateState(false, true);
  1740. current2.ReqUpdate(1);
  1741. if (current2.WiredCounter >= double.Parse(current2.string_2, CultureInfo.InvariantCulture))
  1742. {
  1743. num2++;
  1744. break;
  1745. }
  1746. }
  1747. else if (text == "wf_cnd_time_less_than")
  1748. {
  1749. num++;
  1750. current2.ExtraData = "1";
  1751. current2.UpdateState(false, true);
  1752. current2.ReqUpdate(1);
  1753. if (current2.WiredCounter <= double.Parse(current2.string_2, CultureInfo.InvariantCulture))
  1754. {
  1755. num2++;
  1756. break;
  1757. }
  1758. }
  1759. else
  1760. continue;
  1761. }
  1762. num4 = num2;
  1763. num++;
  1764. current2.ExtraData = "1";
  1765. current2.UpdateState(false, true);
  1766. current2.ReqUpdate(1);
  1767. current2.method_10();
  1768. if (current2.string_3.Length <= 0)
  1769. {
  1770. continue;
  1771. }
  1772. collection = current2.string_3.Split(new char[]
  1773. {
  1774. ','
  1775. });
  1776. list = new List<string>(collection);
  1777. list4 = new List<RoomItem>();
  1778. foreach (string current3 in list)
  1779. {
  1780. list4.Add(this.method_28(Convert.ToUInt32(current3)));
  1781. }
  1782. using (List<RoomItem>.Enumerator enumerator3 = list4.GetEnumerator())
  1783. {
  1784. while (enumerator3.MoveNext())
  1785. {
  1786. RoomItem current4 = enumerator3.Current;
  1787. if (current4 != null)
  1788. {
  1789. Dictionary<int, AffectedTile> dictionary = current4.Dictionary_0;
  1790. if (dictionary == null)
  1791. {
  1792. dictionary = new Dictionary<int, AffectedTile>();
  1793. }
  1794. RoomItem TopItem = this.GetTopItem(current4.Int32_0, current4.Int32_1);
  1795. if (TopItem != null && TopItem != current4 && TopItem.Double_0 >= current4.Double_0 && num4 + 1 != num2)
  1796. {
  1797. num2++;
  1798. break;
  1799. }
  1800. foreach (AffectedTile current5 in dictionary.Values)
  1801. {
  1802. TopItem = this.GetTopItem(current5.Int32_0, current5.Int32_1);
  1803. if (TopItem != null && TopItem != current4 && TopItem.Double_0 >= current4.Double_0 && num4 + 1 != num2)
  1804. {
  1805. num2++;
  1806. break;
  1807. }
  1808. }
  1809.  
  1810. }
  1811. }
  1812. continue;
  1813. }
  1814. }
  1815. num++;
  1816. current2.ExtraData = "1";
  1817. current2.UpdateState(false, true);
  1818. current2.ReqUpdate(1);
  1819. current2.method_10();
  1820. if (current2.string_3.Length <= 0)
  1821. {
  1822. continue;
  1823. }
  1824. collection = current2.string_3.Split(new char[]
  1825. {
  1826. ','
  1827. });
  1828. list = new List<string>(collection);
  1829. list4 = new List<RoomItem>();
  1830. foreach (string current3 in list)
  1831. {
  1832. list4.Add(this.method_28(Convert.ToUInt32(current3)));
  1833. }
  1834. bool flag3 = true;
  1835. foreach (RoomItem current4 in list4)
  1836. {
  1837. if (current4 != null)
  1838. {
  1839. bool flag4 = false;
  1840. Dictionary<int, AffectedTile> dictionary = current4.Dictionary_0;
  1841. if (dictionary == null)
  1842. {
  1843. dictionary = new Dictionary<int, AffectedTile>();
  1844. }
  1845. if (this.method_96(current4.Int32_0, current4.Int32_1))
  1846. {
  1847. flag4 = true;
  1848. }
  1849. foreach (AffectedTile current5 in dictionary.Values)
  1850. {
  1851. if (this.method_96(current5.Int32_0, current5.Int32_1))
  1852. {
  1853. flag4 = true;
  1854. break;
  1855. }
  1856. }
  1857. if (!flag4)
  1858. {
  1859. flag3 = false;
  1860. }
  1861. }
  1862. }
  1863. if (flag3)
  1864. {
  1865. num2++;
  1866. continue;
  1867. }
  1868. continue;
  1869. }
  1870. else
  1871. {
  1872. num4 = num2;
  1873. num++;
  1874. current2.ExtraData = "1";
  1875. current2.UpdateState(false, true);
  1876. current2.ReqUpdate(1);
  1877. current2.method_10();
  1878. if (current2.string_3.Length <= 0)
  1879. {
  1880. continue;
  1881. }
  1882. string[] collection = current2.string_3.Split(new char[]
  1883. {
  1884. ','
  1885. });
  1886. List<string> list = new List<string>(collection);
  1887. List<RoomItem> list4 = new List<RoomItem>();
  1888. foreach (string current3 in list)
  1889. {
  1890. list4.Add(this.method_28(Convert.ToUInt32(current3)));
  1891. }
  1892. if (RoomUser_1 == null)
  1893. {
  1894. continue;
  1895. }
  1896. using (List<RoomItem>.Enumerator enumerator3 = list4.GetEnumerator())
  1897. {
  1898. while (enumerator3.MoveNext())
  1899. {
  1900. RoomItem current4 = enumerator3.Current;
  1901. if (current4 != null)
  1902. {
  1903. Dictionary<int, AffectedTile> dictionary = current4.Dictionary_0;
  1904. if (dictionary == null)
  1905. {
  1906. dictionary = new Dictionary<int, AffectedTile>();
  1907. }
  1908. if (RoomUser_1.X == current4.Int32_0 && RoomUser_1.Y == current4.Int32_1 && num4 + 1 != num2)
  1909. {
  1910. num2++;
  1911. break;
  1912. }
  1913. foreach (AffectedTile current5 in dictionary.Values)
  1914. {
  1915. if (RoomUser_1.X == current5.Int32_0 && RoomUser_1.Y == current5.Int32_1 && num4 + 1 != num2)
  1916. {
  1917. num2++;
  1918. break;
  1919. }
  1920. }
  1921. }
  1922. }
  1923. continue;
  1924. }
  1925. }
  1926. }
  1927. num4 = num2;
  1928. num++;
  1929. current2.ExtraData = "1";
  1930. current2.UpdateState(false, true);
  1931. current2.ReqUpdate(1);
  1932. if (current2.string_2.Length > 0)
  1933. {
  1934. string string_11 = current2.string_2.Split(new char[]
  1935. {
  1936. ':'
  1937. })[0].ToLower();
  1938. string string_12 = current2.string_2.Split(new char[]
  1939. {
  1940. ':'
  1941. })[1];
  1942. if (RoomUser_1 != null)
  1943. {
  1944. if (!RoomUser_1.IsBot && this.method_18(RoomUser_1, string_11, string_12))
  1945. {
  1946. num2++;
  1947. }
  1948. }
  1949. else
  1950. {
  1951. RoomUser[] array = this.RoomUsers;
  1952. for (int i = 0; i < array.Length; i++)
  1953. {
  1954. RoomUser class2 = array[i];
  1955. if (class2 != null && !class2.IsBot && this.method_18(class2, string_11, string_12) && num4 + 1 != num2)
  1956. {
  1957. num2++;
  1958. break;
  1959. }
  1960. }
  1961. }
  1962. }
  1963. }
  1964. }
  1965. if (num != num2)
  1966. {
  1967. result = false;
  1968. return result;
  1969. }
  1970. }
  1971. catch
  1972. {
  1973. }
  1974. if (flag && num == num2)
  1975. {
  1976. RoomItem_0.ExtraData = "1";
  1977. RoomItem_0.UpdateState(false, true);
  1978. RoomItem_0.ReqUpdate(1);
  1979. List<RoomItem> list6 = this.method_93(RoomItem_0.Int32_0, RoomItem_0.Int32_1);
  1980. if (list6 == null)
  1981. {
  1982. result = false;
  1983. return result;
  1984. }
  1985. bool flag5 = false;
  1986. foreach (RoomItem current2 in list6)
  1987. {
  1988. if (current2.GetBaseItem().InteractionType.ToLower() == "wf_xtra_random")
  1989. {
  1990. flag5 = true;
  1991. break;
  1992. }
  1993. }
  1994. if (flag5)
  1995. {
  1996. List<RoomItem> list7 = new List<RoomItem>();
  1997. Random random = new Random();
  1998. while (list6.Count != 0)
  1999. {
  2000. int index = random.Next(0, list6.Count);
  2001. list7.Add(list6[index]);
  2002. list6.RemoveAt(index);
  2003. }
  2004. list6 = list7;
  2005. }
  2006. foreach (RoomItem current2 in list6)
  2007. {
  2008. if (flag5 && flag2)
  2009. {
  2010. break;
  2011. }
  2012. text = current2.GetBaseItem().InteractionType.ToLower();
  2013. switch (text)
  2014. {
  2015. case "wf_act_give_phx":
  2016. current2.ExtraData = "1";
  2017. current2.UpdateState(false, true);
  2018. current2.ReqUpdate(1);
  2019. if (current2.string_2.Length > 0)
  2020. {
  2021. string string_11 = current2.string_2.Split(new char[]
  2022. {
  2023. ':'
  2024. })[0].ToLower();
  2025. string string_12 = current2.string_2.Split(new char[]
  2026. {
  2027. ':'
  2028. })[1];
  2029. if (RoomUser_1 != null)
  2030. {
  2031. if (!RoomUser_1.IsBot)
  2032. {
  2033. this.method_19(RoomUser_1, string_11, string_12, current2.uint_0);
  2034. }
  2035. }
  2036. else
  2037. {
  2038. RoomUser[] array = this.RoomUsers;
  2039. for (int i = 0; i < array.Length; i++)
  2040. {
  2041. RoomUser class2 = array[i];
  2042. if (class2 != null && !class2.IsBot)
  2043. {
  2044. this.method_19(class2, string_11, string_12, current2.uint_0);
  2045. }
  2046. }
  2047. }
  2048. flag2 = true;
  2049. }
  2050. break;
  2051. case "wf_act_saymsg":
  2052. current2.ExtraData = "1";
  2053. current2.UpdateState(false, true);
  2054. current2.ReqUpdate(1);
  2055. if (current2.string_2.Length > 0)
  2056. {
  2057. string text2 = current2.string_2;
  2058. text2 = ChatCommandHandler.smethod_4(text2);
  2059. if (text2.Length > 100)
  2060. {
  2061. text2 = text2.Substring(0, 100);
  2062. }
  2063. if (RoomUser_1 != null)
  2064. {
  2065. if (!RoomUser_1.IsBot)
  2066. {
  2067. RoomUser_1.GetClient().GetHabbo().Whisper(text2);
  2068. }
  2069. }
  2070. else
  2071. {
  2072. RoomUser[] array = this.RoomUsers;
  2073. for (int i = 0; i < array.Length; i++)
  2074. {
  2075. RoomUser class2 = array[i];
  2076. if (class2 != null && !class2.IsBot)
  2077. {
  2078. class2.GetClient().GetHabbo().Whisper(text2);
  2079. }
  2080. }
  2081. }
  2082. flag2 = true;
  2083. }
  2084. break;
  2085. case "wf_act_moveuser":
  2086. current2.ExtraData = "1";
  2087. current2.UpdateState(false, true);
  2088. current2.ReqUpdate(1);
  2089. current2.method_10();
  2090. if (current2.string_3.Length > 0)
  2091. {
  2092. string[] collection = current2.string_3.Split(new char[]
  2093. {
  2094. ','
  2095. });
  2096. List<string> list = new List<string>(collection);
  2097. Random random2 = new Random();
  2098. int num5 = random2.Next(0, list.Count - 1);
  2099. RoomItem class3 = this.method_28(Convert.ToUInt32(list[num5]));
  2100. if (class3 != null)
  2101. {
  2102. if (RoomUser_1 != null)
  2103. {
  2104. this.byte_0[RoomUser_1.X, RoomUser_1.Y] = 1;
  2105. this.byte_0[RoomUser_1.int_12, RoomUser_1.int_13] = 1;
  2106. this.byte_0[class3.Int32_0, class3.Int32_1] = 1;
  2107. RoomUser_1.bool_6 = false;
  2108. RoomUser_1.int_12 = class3.Int32_0;
  2109. RoomUser_1.int_13 = class3.Int32_1;
  2110. RoomUser_1.double_1 = class3.Double_0;
  2111. RoomUser_1.method_7(class3.Int32_0, class3.Int32_1, class3.Double_0);
  2112. RoomUser_1.UpdateNeeded = true;
  2113. if (!current2.dictionary_1.ContainsKey(RoomUser_1))
  2114. {
  2115. current2.dictionary_1.Add(RoomUser_1, 10);
  2116. }
  2117. if (RoomUser_1.class34_1 != null)
  2118. {
  2119. RoomUser_1.class34_1.RoomUser_0 = null;
  2120. RoomUser_1.RoomUser_0 = null;
  2121. RoomUser_1.class34_1 = null;
  2122. }
  2123. this.method_87(RoomUser_1, true, false);
  2124. }
  2125. else
  2126. {
  2127. RoomUser[] array = this.RoomUsers;
  2128. for (int i = 0; i < array.Length; i++)
  2129. {
  2130. RoomUser class2 = array[i];
  2131. if (class2 != null)
  2132. {
  2133. this.byte_0[class2.X, class2.Y] = 1;
  2134. this.byte_0[class3.Int32_0, class3.Int32_1] = 1;
  2135. class2.method_7(class3.Int32_0, class3.Int32_1, class3.Double_0);
  2136. class2.UpdateNeeded = true;
  2137. if (!current2.dictionary_1.ContainsKey(class2))
  2138. {
  2139. current2.dictionary_1.Add(class2, 10);
  2140. }
  2141. }
  2142. }
  2143. }
  2144. flag2 = true;
  2145. }
  2146. }
  2147. break;
  2148. case "wf_act_togglefurni":
  2149. current2.ExtraData = "1";
  2150. current2.UpdateState(false, true);
  2151. current2.ReqUpdate(1);
  2152. if (current2.string_3.Length > 0)
  2153. {
  2154. string[] collection = current2.string_3.Split(new char[]
  2155. {
  2156. ','
  2157. });
  2158. IEnumerable<string> enumerable = new List<string>(collection);
  2159. List<string> list2 = enumerable.ToList<string>();
  2160. foreach (string current in enumerable)
  2161. {
  2162. RoomItem class3 = this.method_28(Convert.ToUInt32(current));
  2163. if (class3 != null)
  2164. {
  2165. if (class3.GetBaseItem().InteractionType == "counter")
  2166. {
  2167. class3.Class69_0.OnTrigger(null, class3, 1, true);
  2168. }
  2169. else
  2170. {
  2171. class3.Class69_0.OnTrigger(null, class3, 0, true);
  2172. }
  2173. }
  2174. else
  2175. {
  2176. list2.Remove(current);
  2177. }
  2178. }
  2179. flag2 = true;
  2180. }
  2181. break;
  2182. case "wf_act_kick_user":
  2183. current2.ExtraData = "1";
  2184. current2.UpdateState(false, true);
  2185. current2.ReqUpdate(1);
  2186. GameClient GetPlayerSession = HighSoft.GetGame().GetClientManager().GetClientByHabbo(RoomUser_1.GetClient().GetHabbo().Username);
  2187. if (GetPlayerSession != null)
  2188. {
  2189. Room class2 = RoomUser_1.GetClient().GetHabbo().CurrentRoom;
  2190. if (!(class2.Owner == GetPlayerSession.GetHabbo().Username || GetPlayerSession.GetHabbo().HasFuse("acc_unkickable")))
  2191. {
  2192. class2.method_47(GetPlayerSession, true, false);
  2193. if (current2.string_2.Length > 0)
  2194. {
  2195. GetPlayerSession.SendNotification(current2.string_2);
  2196. }
  2197. else
  2198. {
  2199. GetPlayerSession.SendNotification("Wired: Potki käyttäjä wired-tavara on potkinut sinut huoneesta!");
  2200. }
  2201. }
  2202. flag2 = true;
  2203. }
  2204. break;
  2205. case "wf_act_reset_timers":
  2206. current2.ExtraData = "1";
  2207. current2.UpdateState(false, true);
  2208. current2.ReqUpdate(1);
  2209. foreach (RoomItem current in this.list_14)
  2210. {
  2211. if (current.GetBaseItem().InteractionType.ToLower() == "wf_trg_attime")
  2212. {
  2213. current.WiredAtTimeNeedReset = false;
  2214. current.WiredAtTimeTimer = 0;
  2215. current.ReqUpdate(1);
  2216. }
  2217. flag2 = true;
  2218. }
  2219.  
  2220. foreach (RoomItem current in this.list_16)
  2221. {
  2222. if (current.GetBaseItem().InteractionType.ToLower() == "wf_cnd_time_more_than")
  2223. {
  2224. current.WiredCounter = 0;
  2225. current.WiredNeedReset = false;
  2226. current.ReqUpdate(1);
  2227. }
  2228. else if (current.GetBaseItem().InteractionType.ToLower() == "wf_cnd_time_less_than")
  2229. {
  2230. current.WiredCounter = 0;
  2231. current.WiredNeedReset = false;
  2232. current.ReqUpdate(1);
  2233. }
  2234. flag2 = true;
  2235. }
  2236. break;
  2237. case "wf_act_givepoints":
  2238. current2.ExtraData = "1";
  2239. current2.UpdateState(false, true);
  2240. current2.ReqUpdate(1);
  2241. if (RoomUser_1 != null && current2.string_2.Length > 0)
  2242. {
  2243. int team = 0;
  2244. if (RoomUser_1.team == Team.Yellow)
  2245. {
  2246. team = 12;
  2247. }
  2248. else if (RoomUser_1.team == Team.Red)
  2249. {
  2250. team = 3;
  2251. }
  2252. else if (RoomUser_1.team == Team.Green)
  2253. {
  2254. team = 6;
  2255. }
  2256. else if (RoomUser_1.team == Team.Blue)
  2257. {
  2258. team = 9;
  2259. }
  2260. this.method_88(team, Convert.ToInt32(current2.string_2), current2);
  2261. flag2 = true;
  2262. }
  2263. break;
  2264. case "wf_act_moverotate":
  2265. current2.ExtraData = "1";
  2266. current2.UpdateState(false, true);
  2267. current2.ReqUpdate(1);
  2268. current2.method_9();
  2269. if (current2.string_4.Length > 0)
  2270. {
  2271. string[] collection = current2.string_4.Split(new char[]
  2272. {
  2273. ','
  2274. });
  2275. IEnumerable<string> enumerable2 = new List<string>(collection);
  2276. foreach (string current in enumerable2)
  2277. {
  2278. RoomItem class3 = this.method_28(Convert.ToUInt32(current));
  2279. if (class3 != null)
  2280. {
  2281. if (current2.string_2 != "0" && current2.string_2 != "")
  2282. {
  2283. ThreeDCoord gstruct1_ = class3.GStruct1_1;
  2284. int num5 = 0;
  2285. int num6 = 0;
  2286. int num7 = 0;
  2287. if (current2.string_2 == "1")
  2288. {
  2289. Random random3 = new Random();
  2290. num5 = random3.Next(1, 5);
  2291. }
  2292. else
  2293. {
  2294. if (current2.string_2 == "2")
  2295. {
  2296. Random random3 = new Random();
  2297. num6 = random3.Next(1, 3);
  2298. }
  2299. else
  2300. {
  2301. if (current2.string_2 == "3")
  2302. {
  2303. Random random3 = new Random();
  2304. num7 = random3.Next(1, 3);
  2305. }
  2306. }
  2307. }
  2308. if (current2.string_2 == "4" || num5 == 1 || num7 == 1)
  2309. {
  2310. gstruct1_ = class3.method_1(4);
  2311. }
  2312. else
  2313. {
  2314. if (current2.string_2 == "5" || num5 == 2 || num6 == 1)
  2315. {
  2316. gstruct1_ = class3.method_1(6);
  2317. }
  2318. else
  2319. {
  2320. if (current2.string_2 == "6" || num5 == 3 || num7 == 2)
  2321. {
  2322. gstruct1_ = class3.method_1(0);
  2323. }
  2324. else
  2325. {
  2326. if (current2.string_2 == "7" || num5 == 4 || num6 == 2)
  2327. {
  2328. gstruct1_ = class3.method_1(2);
  2329. }
  2330. }
  2331. }
  2332. }
  2333. if (this.method_37(gstruct1_.x, gstruct1_.y, true, true, true, false, false, true, true) && class3.GetBaseItem().InteractionType != "wf_trg_timer")
  2334. {
  2335. this.method_41(class3, gstruct1_, current2.uint_0, this.GetTopItemHeight(gstruct1_.x, gstruct1_.y));
  2336. }
  2337. }
  2338. if (current2.string_3.Length > 0 && current2.string_3 != "0" && current2.string_3 != "")
  2339. {
  2340. int num5 = 0;
  2341. if (current2.string_3 == "1")
  2342. {
  2343. num5 = class3.int_3 + 2;
  2344. if (num5 > 6)
  2345. {
  2346. num5 = 0;
  2347. }
  2348. }
  2349. else
  2350. {
  2351. if (current2.string_3 == "2")
  2352. {
  2353. num5 = class3.int_3 - 2;
  2354. if (num5 < 0)
  2355. {
  2356. num5 = 6;
  2357. }
  2358. }
  2359. else
  2360. {
  2361. if (current2.string_3 == "3")
  2362. {
  2363. Random random3 = new Random();
  2364. num5 = random3.Next(1, 5);
  2365. if (num5 == 1)
  2366. {
  2367. num5 = 0;
  2368. }
  2369. else
  2370. {
  2371. if (num5 == 2)
  2372. {
  2373. num5 = 2;
  2374. }
  2375. else
  2376. {
  2377. if (num5 == 3)
  2378. {
  2379. num5 = 4;
  2380. }
  2381. else
  2382. {
  2383. if (num5 == 4)
  2384. {
  2385. num5 = 6;
  2386. }
  2387. }
  2388. }
  2389. }
  2390. }
  2391. }
  2392. }
  2393. if (current2.method_8().method_79(null, class3, class3.Int32_0, class3.Int32_1, num5, false, false, false))
  2394. {
  2395. flag2 = true;
  2396. }
  2397. }
  2398. }
  2399. }
  2400. flag2 = true;
  2401. }
  2402. break;
  2403. case "wf_act_matchfurni":
  2404. current2.ExtraData = "1";
  2405. current2.UpdateState(false, true);
  2406. current2.ReqUpdate(1);
  2407. current2.method_9();
  2408. if (current2.string_4.Length > 0 && current2.string_2.Length > 0)
  2409. {
  2410. string[] collection = current2.string_4.Split(new char[]
  2411. {
  2412. ','
  2413. });
  2414. IEnumerable<string> enumerable = new List<string>(collection);
  2415. string[] collection2 = current2.string_2.Split(new char[]
  2416. {
  2417. ';'
  2418. });
  2419. List<string> list8 = new List<string>(collection2);
  2420. int num8 = 0;
  2421. foreach (string current in enumerable)
  2422. {
  2423. RoomItem class3 = this.method_28(Convert.ToUInt32(current));
  2424. if (class3 != null && !(class3.GetBaseItem().InteractionType.ToLower() == "dice") && !(class3.GetBaseItem().InteractionType.ToLower() == "bb_patch"))
  2425. {
  2426. string[] collection3 = list8[num8].Split(new char[]
  2427. {
  2428. ','
  2429. });
  2430. List<string> list9 = new List<string>(collection3);
  2431. bool flag6 = false;
  2432. bool flag7 = false;
  2433. if (current2.string_3 != "" && class3 != null)
  2434. {
  2435. int int_ = class3.Int32_0;
  2436. int int_2 = class3.Int32_1;
  2437. if (current2.string_3.StartsWith("I"))
  2438. {
  2439. class3.ExtraData = list9[4];
  2440. flag7 = true;
  2441. }
  2442. if (current2.string_3.Substring(1, 1) == "I")
  2443. {
  2444. class3.int_3 = Convert.ToInt32(list9[3]);
  2445. flag6 = true;
  2446. }
  2447. if (current2.string_3.EndsWith("I"))
  2448. {
  2449. int_ = Convert.ToInt32(list9[0]);
  2450. int_2 = Convert.ToInt32(list9[1]);
  2451. flag6 = true;
  2452. }
  2453. if (flag6)
  2454. {
  2455. this.method_40(class3, int_, int_2, current2.uint_0, class3.Double_0);
  2456. }
  2457. if (flag7)
  2458. {
  2459. class3.UpdateState(false, true);
  2460. }
  2461. this.method_22();
  2462. }
  2463. num8++;
  2464. }
  2465. }
  2466. }
  2467. flag2 = true;
  2468. break;
  2469. }
  2470. }
  2471. }
  2472. result = flag2;
  2473. }
  2474. }
  2475. catch
  2476. {
  2477. result = false;
  2478. }
  2479. return result;
  2480. }
  2481. internal void method_22()
  2482. {
  2483. this.gstruct1_0 = new ThreeDCoord[this.RoomModel.int_4, this.RoomModel.int_5];
  2484. this.double_0 = new double[this.RoomModel.int_4, this.RoomModel.int_5];
  2485. this.byte_2 = new byte[this.RoomModel.int_4, this.RoomModel.int_5];
  2486. this.byte_1 = new byte[this.RoomModel.int_4, this.RoomModel.int_5];
  2487. this.HeightOverride = new bool[this.RoomModel.int_4, this.RoomModel.int_5];
  2488. this.byte_0 = new byte[this.RoomModel.int_4, this.RoomModel.int_5];
  2489. this.double_1 = new double[this.RoomModel.int_4, this.RoomModel.int_5];
  2490. this.double_2 = new double[this.RoomModel.int_4, this.RoomModel.int_5];
  2491. for (int i = 0; i < this.RoomModel.int_5; i++)
  2492. {
  2493. for (int j = 0; j < this.RoomModel.int_4; j++)
  2494. {
  2495. this.double_0[j, i] = 0.0;
  2496. this.byte_0[j, i] = 0;
  2497. this.byte_2[j, i] = 0;
  2498. this.byte_1[j, i] = 0;
  2499. this.HeightOverride[j, i] = false;
  2500. this.gstruct1_0[j, i] = new ThreeDCoord(j, i);
  2501. if (j == this.RoomModel.int_0 && i == this.RoomModel.int_1)
  2502. {
  2503. this.byte_0[j, i] = 3;
  2504. }
  2505. else
  2506. {
  2507. if (this.RoomModel.squareState[j, i] == SquareState.OPEN)
  2508. {
  2509. this.byte_0[j, i] = 1;
  2510. }
  2511. else
  2512. {
  2513. if (this.RoomModel.squareState[j, i] == SquareState.SEAT)
  2514. {
  2515. this.byte_0[j, i] = 3;
  2516. }
  2517. }
  2518. }
  2519. }
  2520. }
  2521. foreach (RoomItem @class in this.Hashtable_0.Values)
  2522. {
  2523. try
  2524. {
  2525. if (@class.GetBaseItem().Type == 's')
  2526. {
  2527. if (@class.Int32_0 >= this.RoomModel.int_4 || @class.Int32_1 >= this.RoomModel.int_5 || @class.Int32_1 < 0 || @class.Int32_0 < 0)
  2528. {
  2529. this.method_29(null, @class.uint_0, true, false);
  2530. GameClient class2 = HighSoft.GetGame().GetClientManager().GetClientByHabbo(this.Owner);
  2531. if (class2 != null)
  2532. {
  2533. class2.GetHabbo().GetInventoryComponent().method_11(@class.uint_0, @class.uint_2, @class.ExtraData, true);
  2534. }
  2535. }
  2536. else
  2537. {
  2538. if (@class.Double_1 > this.double_1[@class.Int32_0, @class.Int32_1])
  2539. {
  2540. this.double_1[@class.Int32_0, @class.Int32_1] = @class.Double_1;
  2541. }
  2542. if (@class.GetBaseItem().IsSeat)
  2543. {
  2544. this.double_2[@class.Int32_0, @class.Int32_1] = @class.Double_1;
  2545. }
  2546. if (@class.GetBaseItem().HeightOverride)
  2547. {
  2548. this.HeightOverride[@class.Int32_0, @class.Int32_1] = true;
  2549. }
  2550. if (@class.GetBaseItem().Height > 0.0 || @class.GetBaseItem().EffectF != 0 || @class.GetBaseItem().EffectM != 0 || @class.GetBaseItem().IsSeat || !(@class.GetBaseItem().InteractionType.ToLower() != "bed"))
  2551. {
  2552. if (this.double_0[@class.Int32_0, @class.Int32_1] <= @class.Double_0)
  2553. {
  2554. this.double_0[@class.Int32_0, @class.Int32_1] = @class.Double_0;
  2555. if (@class.GetBaseItem().EffectF > 0)
  2556. {
  2557. this.byte_2[@class.Int32_0, @class.Int32_1] = @class.GetBaseItem().EffectF;
  2558. }
  2559. else
  2560. {
  2561. if (this.byte_1[@class.Int32_0, @class.Int32_1] != 0)
  2562. {
  2563. this.byte_2[@class.Int32_0, @class.Int32_1] = 0;
  2564. }
  2565. }
  2566. if (@class.GetBaseItem().EffectM > 0)
  2567. {
  2568. this.byte_1[@class.Int32_0, @class.Int32_1] = @class.GetBaseItem().EffectM;
  2569. }
  2570. else
  2571. {
  2572. if (this.byte_1[@class.Int32_0, @class.Int32_1] != 0)
  2573. {
  2574. this.byte_1[@class.Int32_0, @class.Int32_1] = 0;
  2575. }
  2576. }
  2577. if (@class.GetBaseItem().Walkable)
  2578. {
  2579. if (this.byte_0[@class.Int32_0, @class.Int32_1] != 3)
  2580. {
  2581. this.byte_0[@class.Int32_0, @class.Int32_1] = 1;
  2582. }
  2583. }
  2584. else
  2585. {
  2586. if (@class.Double_0 <= this.RoomModel.double_1[@class.Int32_0, @class.Int32_1] + 0.1 && @class.GetBaseItem().InteractionType.ToLower() == "gate" && @class.ExtraData == "1")
  2587. {
  2588. if (this.byte_0[@class.Int32_0, @class.Int32_1] != 3)
  2589. {
  2590. this.byte_0[@class.Int32_0, @class.Int32_1] = 1;
  2591. }
  2592. }
  2593. else
  2594. {
  2595. if (@class.GetBaseItem().IsSeat || @class.GetBaseItem().InteractionType.ToLower() == "bed")
  2596. {
  2597. this.byte_0[@class.Int32_0, @class.Int32_1] = 3;
  2598. }
  2599. else
  2600. {
  2601. if (this.byte_0[@class.Int32_0, @class.Int32_1] != 3)
  2602. {
  2603. this.byte_0[@class.Int32_0, @class.Int32_1] = 0;
  2604. }
  2605. }
  2606. }
  2607. }
  2608. }
  2609. if (@class.GetBaseItem().IsSeat || @class.GetBaseItem().InteractionType.ToLower() == "bed")
  2610. {
  2611. this.byte_0[@class.Int32_0, @class.Int32_1] = 3;
  2612. }
  2613. Dictionary<int, AffectedTile> dictionary = @class.Dictionary_0;
  2614. if (dictionary == null)
  2615. {
  2616. dictionary = new Dictionary<int, AffectedTile>();
  2617. }
  2618. foreach (AffectedTile current in dictionary.Values)
  2619. {
  2620. if (@class.Double_1 > this.double_1[current.Int32_0, current.Int32_1])
  2621. {
  2622. this.double_1[current.Int32_0, current.Int32_1] = @class.Double_1;
  2623. }
  2624. if (@class.GetBaseItem().IsSeat)
  2625. {
  2626. this.double_2[current.Int32_0, current.Int32_1] = @class.Double_1;
  2627. }
  2628. if (@class.GetBaseItem().HeightOverride)
  2629. {
  2630. this.HeightOverride[current.Int32_0, current.Int32_1] = true;
  2631. }
  2632. if (this.double_0[current.Int32_0, current.Int32_1] <= @class.Double_0)
  2633. {
  2634. this.double_0[current.Int32_0, current.Int32_1] = @class.Double_0;
  2635. if (@class.GetBaseItem().EffectF > 0)
  2636. {
  2637. this.byte_2[current.Int32_0, current.Int32_1] = @class.GetBaseItem().EffectF;
  2638. }
  2639. else
  2640. {
  2641. if (this.byte_1[current.Int32_0, current.Int32_1] != 0)
  2642. {
  2643. this.byte_2[current.Int32_0, current.Int32_1] = 0;
  2644. }
  2645. }
  2646. if (@class.GetBaseItem().EffectM > 0)
  2647. {
  2648. this.byte_1[current.Int32_0, current.Int32_1] = @class.GetBaseItem().EffectM;
  2649. }
  2650. else
  2651. {
  2652. if (this.byte_1[current.Int32_0, current.Int32_1] != 0)
  2653. {
  2654. this.byte_1[current.Int32_0, current.Int32_1] = 0;
  2655. }
  2656. else
  2657. {
  2658. if (@class.GetBaseItem().Walkable)
  2659. {
  2660. if (this.byte_0[current.Int32_0, current.Int32_1] != 3)
  2661. {
  2662. this.byte_0[current.Int32_0, current.Int32_1] = 1;
  2663. }
  2664. }
  2665. else
  2666. {
  2667. if (@class.Double_0 <= this.RoomModel.double_1[@class.Int32_0, @class.Int32_1] + 0.1 && @class.GetBaseItem().InteractionType.ToLower() == "gate" && @class.ExtraData == "1")
  2668. {
  2669. if (this.byte_0[current.Int32_0, current.Int32_1] != 3)
  2670. {
  2671. this.byte_0[current.Int32_0, current.Int32_1] = 1;
  2672. }
  2673. }
  2674. else
  2675. {
  2676. if (@class.GetBaseItem().IsSeat || @class.GetBaseItem().InteractionType.ToLower() == "bed")
  2677. {
  2678. this.byte_0[current.Int32_0, current.Int32_1] = 3;
  2679. }
  2680. else
  2681. {
  2682. if (this.byte_0[current.Int32_0, current.Int32_1] != 3)
  2683. {
  2684. this.byte_0[current.Int32_0, current.Int32_1] = 0;
  2685. }
  2686. }
  2687. }
  2688. }
  2689. }
  2690. }
  2691. }
  2692. if (@class.GetBaseItem().IsSeat || @class.GetBaseItem().InteractionType.ToLower() == "bed")
  2693. {
  2694. this.byte_0[current.Int32_0, current.Int32_1] = 3;
  2695. }
  2696. if (@class.GetBaseItem().InteractionType.ToLower() == "bed")
  2697. {
  2698. this.byte_0[current.Int32_0, current.Int32_1] = 3;
  2699. if (@class.int_3 == 0 || @class.int_3 == 4)
  2700. {
  2701. this.gstruct1_0[current.Int32_0, current.Int32_1].y = @class.Int32_1;
  2702. }
  2703. if (@class.int_3 == 2 || @class.int_3 == 6)
  2704. {
  2705. this.gstruct1_0[current.Int32_0, current.Int32_1].x = @class.Int32_0;
  2706. }
  2707. }
  2708. }
  2709. }
  2710. }
  2711.  
  2712. if (@class.GetBaseItem().InteractionType.ToLower() == "freeze_ice_block" && (@class.ExtraData == "0" || string.IsNullOrEmpty(@class.ExtraData)))
  2713. {
  2714. @class.method_8().method_39(@class.Int32_0, @class.Int32_1);
  2715. }
  2716. else if (@class.GetBaseItem().InteractionType.ToLower() == "freeze_ice_block")
  2717. {
  2718. @class.method_8().method_38(@class.Int32_0, @class.Int32_1);
  2719. }
  2720. else if (@class.GetBaseItem().InteractionType.ToLower() == "freeze_tile")
  2721. {
  2722. @class.ExtraData = "";
  2723. }
  2724. }
  2725. }
  2726. catch
  2727. {
  2728. this.method_29(null, @class.uint_0, true, false);
  2729. GameClient class2 = HighSoft.GetGame().GetClientManager().GetClientByHabbo(this.Owner);
  2730. if (class2 != null)
  2731. {
  2732. class2.GetHabbo().GetInventoryComponent().method_11(@class.uint_0, @class.uint_2, @class.ExtraData, true);
  2733. }
  2734. }
  2735. }
  2736. if (!this.AllowWalkthrough)
  2737. {
  2738. for (int k = 0; k < this.RoomUsers.Length; k++)
  2739. {
  2740. RoomUser class3 = this.RoomUsers[k];
  2741. if (class3 != null)
  2742. {
  2743. this.byte_0[class3.X, class3.Y] = 0;
  2744. }
  2745. }
  2746. }
  2747. this.byte_0[this.RoomModel.int_0, this.RoomModel.int_1] = 3;
  2748. }
  2749. public void method_23()
  2750. {
  2751. this.UsersWithRights = new List<uint>();
  2752. DataTable dataTable = null;
  2753. using (DatabaseClient @class = HighSoft.GetDatabase().GetClient())
  2754. {
  2755. dataTable = @class.ReadDataTable("SELECT room_rights.user_id FROM room_rights WHERE room_id = '" + this.Id + "'");
  2756. }
  2757. if (dataTable != null)
  2758. {
  2759. foreach (DataRow dataRow in dataTable.Rows)
  2760. {
  2761. this.UsersWithRights.Add((uint)dataRow["user_id"]);
  2762. }
  2763. }
  2764. }
  2765. internal List<RoomItem> method_24(GameClient Session)
  2766. {
  2767. List<RoomItem> list = new List<RoomItem>();
  2768. foreach (RoomItem @class in this.Hashtable_0.Values)
  2769. {
  2770. @class.Class69_0.OnRemove(Session, @class);
  2771. ServerMessage Message = new ServerMessage(94u);
  2772. Message.AppendRawUInt(@class.uint_0);
  2773. Message.AppendStringWithBreak("");
  2774. Message.AppendBoolean(false);
  2775. this.SendMessage(Message, null);
  2776. list.Add(@class);
  2777. }
  2778. foreach (RoomItem @class in this.Hashtable_1.Values)
  2779. {
  2780. @class.Class69_0.OnRemove(Session, @class);
  2781. ServerMessage Message = new ServerMessage(84u);
  2782. Message.AppendRawUInt(@class.uint_0);
  2783. Message.AppendStringWithBreak("");
  2784. Message.AppendBoolean(false);
  2785. this.SendMessage(Message, null);
  2786. list.Add(@class);
  2787. }
  2788. this.hashtable_4.Clear();
  2789. this.hashtable_0.Clear();
  2790. this.hashtable_1.Clear();
  2791. this.hashtable_2.Clear();
  2792. this.hashtable_3.Clear();
  2793. using (DatabaseClient class2 = HighSoft.GetDatabase().GetClient())
  2794. {
  2795. class2.ExecuteQuery(string.Concat(new object[]
  2796. {
  2797. "UPDATE items SET room_id = 0, user_id = '",
  2798. Session.GetHabbo().Id,
  2799. "' WHERE room_id = '",
  2800. this.Id,
  2801. "'"
  2802. }));
  2803. }
  2804. this.method_22();
  2805. this.method_83();
  2806. return list;
  2807. }
  2808. public void method_25()
  2809. {
  2810. this.hashtable_0.Clear();
  2811. this.hashtable_4.Clear();
  2812. DataTable dataTable;
  2813. using (DatabaseClient @class = HighSoft.GetDatabase().GetClient())
  2814. {
  2815. dataTable = @class.ReadDataTable("SELECT Id, base_item, x, y, z, rot, wall_pos FROM items WHERE room_id = '" + this.Id + "' ORDER BY room_id DESC");
  2816. }
  2817. if (dataTable != null)
  2818. {
  2819. foreach (DataRow dataRow in dataTable.Rows)
  2820. {
  2821. DataRow DataRowExtraData;
  2822. string ExtraData;
  2823. using (DatabaseClient @class = HighSoft.GetDatabase().GetClient())
  2824. {
  2825. DataRowExtraData = @class.ReadDataRow("SELECT extra_data FROM items_extra_data WHERE item_id = '" + (uint)dataRow["Id"] + "'");
  2826. if (DataRowExtraData != null)
  2827. {
  2828. ExtraData = (string)DataRowExtraData["extra_data"];
  2829. }
  2830. else
  2831. {
  2832. ExtraData = "";
  2833. }
  2834. }
  2835. RoomItem class2 = new RoomItem((uint)dataRow["Id"], this.Id, (uint)dataRow["base_item"], ExtraData, (int)dataRow["x"], (int)dataRow["y"], (double)dataRow["z"], (int)dataRow["rot"], (string)dataRow["wall_pos"], this);
  2836. if (class2.Boolean_0)
  2837. {
  2838. this.bool_11 = true;
  2839. }
  2840. if (class2.GetBaseItem().InteractionType.ToLower().Contains("wf_") || class2.GetBaseItem().InteractionType.ToLower().Contains("fbgate"))
  2841. {
  2842. DataRow dataRow2;
  2843. using (DatabaseClient @class = HighSoft.GetDatabase().GetClient())
  2844. {
  2845. dataRow2 = @class.ReadDataRow("SELECT extra1,extra2,extra3,extra4,extra5 FROM wired_items WHERE item_id = '" + class2.uint_0 + "'");
  2846. }
  2847. if (dataRow2 != null)
  2848. {
  2849. class2.string_2 = (string)dataRow2["extra1"];
  2850. class2.string_3 = (string)dataRow2["extra2"];
  2851. class2.string_4 = (string)dataRow2["extra3"];
  2852. class2.string_5 = (string)dataRow2["extra4"];
  2853. class2.string_6 = (string)dataRow2["extra5"];
  2854. }
  2855. }
  2856. if (class2.GetBaseItem().InteractionType.ToLower() == "firework")
  2857. {
  2858. DataRow dataRow2;
  2859. using (DatabaseClient @class = HighSoft.GetDatabase().GetClient())
  2860. {
  2861. dataRow2 = @class.ReadDataRow("SELECT fw_count FROM items_firework WHERE item_id = '" + class2.uint_0 + "'");
  2862.  
  2863. if (dataRow2 != null)
  2864. {
  2865. class2.FireWorkCount = (int)dataRow2["fw_count"];
  2866. }
  2867. else
  2868. {
  2869. @class.ExecuteQuery("INSERT INTO items_firework(item_id, fw_count) VALUES ( '" + class2.uint_0 + "', '0')");
  2870. }
  2871. }
  2872. }
  2873.  
  2874. string text = class2.GetBaseItem().InteractionType.ToLower();
  2875. switch (text)
  2876. {
  2877. case "dice":
  2878. if (class2.ExtraData == "-1")
  2879. {
  2880. class2.ExtraData = "0";
  2881. }
  2882. break;
  2883. case "fbgate":
  2884. if (class2.ExtraData != "" && class2.ExtraData.Contains(','))
  2885. {
  2886. class2.string_2 = class2.ExtraData.Split(new char[]
  2887. {
  2888. ','
  2889. })[0];
  2890. class2.string_3 = class2.ExtraData.Split(new char[]
  2891. {
  2892. ','
  2893. })[1];
  2894. }
  2895. break;
  2896. case "dimmer":
  2897. if (this.MoodlightData == null)
  2898. {
  2899. this.MoodlightData = new MoodlightData(class2.uint_0);
  2900. }
  2901. break;
  2902. case "bb_patch":
  2903. this.list_5.Add(class2);
  2904. if (class2.ExtraData == "5")
  2905. {
  2906. this.list_6.Add(class2);
  2907. }
  2908. else
  2909. {
  2910. if (class2.ExtraData == "8")
  2911. {
  2912. this.list_7.Add(class2);
  2913. }
  2914. else
  2915. {
  2916. if (class2.ExtraData == "11")
  2917. {
  2918. this.list_9.Add(class2);
  2919. }
  2920. else
  2921. {
  2922. if (class2.ExtraData == "14")
  2923. {
  2924. this.list_8.Add(class2);
  2925. }
  2926. }
  2927. }
  2928. }
  2929. break;
  2930. case "blue_score":
  2931. this.list_12.Add(class2);
  2932. break;
  2933. case "green_score":
  2934. this.list_13.Add(class2);
  2935. break;
  2936. case "red_score":
  2937. this.list_10.Add(class2);
  2938. break;
  2939. case "yellow_score":
  2940. this.list_11.Add(class2);
  2941. break;
  2942. case "stickiepole":
  2943. this.list_3.Add(class2);
  2944. break;
  2945. case "wf_trg_onsay":
  2946. case "wf_trg_enterroom":
  2947. case "wf_trg_furnistate":
  2948. case "wf_trg_onfurni":
  2949. case "wf_trg_offfurni":
  2950. case "wf_trg_gameend":
  2951. case "wf_trg_gamestart":
  2952. if (!this.list_14.Contains(class2))
  2953. {
  2954. this.list_14.Add(class2);
  2955. }
  2956. break;
  2957. case "wf_trg_attime":
  2958. if (class2.string_2.Length <= 0)
  2959. {
  2960. class2.string_2 = "10";
  2961. }
  2962. if (!this.list_14.Contains(class2))
  2963. {
  2964. this.list_14.Add(class2);
  2965. }
  2966. class2.bool_0 = true;
  2967. class2.ReqUpdate(1);
  2968. break;
  2969. case "wf_trg_atscore":
  2970. if (!this.list_14.Contains(class2))
  2971. {
  2972. this.list_14.Add(class2);
  2973. }
  2974. class2.WiredAtTimeNeedReset = false;
  2975. class2.ReqUpdate(1);
  2976. break;
  2977. case "wf_trg_timer":
  2978. if (class2.string_2.Length <= 0)
  2979. {
  2980. class2.string_2 = "10";
  2981. }
  2982. if (!this.list_14.Contains(class2))
  2983. {
  2984. this.list_14.Add(class2);
  2985. }
  2986. class2.bool_0 = true;
  2987. class2.ReqUpdate(1);
  2988. break;
  2989. case "wf_act_saymsg":
  2990. case "wf_act_kick_user":
  2991. case "wf_act_moveuser":
  2992. case "wf_act_togglefurni":
  2993. case "wf_act_givepoints":
  2994. case "wf_act_moverotate":
  2995. case "wf_act_matchfurni":
  2996. case "wf_act_give_phx":
  2997. if (!this.list_15.Contains(class2))
  2998. {
  2999. this.list_15.Add(class2);
  3000. }
  3001. break;
  3002. case "wf_cnd_trggrer_on_frn":
  3003. case "wf_cnd_furnis_hv_avtrs":
  3004. case "wf_cnd_has_furni_on":
  3005. case "wf_cnd_match_snapshot":
  3006. case "wf_cnd_time_more_than":
  3007. case "wf_cnd_time_less_than":
  3008. case "wf_cnd_phx":
  3009. if (!this.list_16.Contains(class2))
  3010. {
  3011. this.list_16.Add(class2);
  3012. }
  3013. break;
  3014. case "jukebox":
  3015. RoomMusicController roomMusicController = this.GetRoomMusicController();
  3016. roomMusicController.LinkRoomOutputItemIfNotAlreadyExits(class2);
  3017. break;
  3018. case "freeze_tile":
  3019. this.GetFreeze().AddFreezeTile(class2);
  3020. break;
  3021. case "freeze_ice_block":
  3022. this.GetFreeze().AddFreezeBlock(class2);
  3023. break;
  3024. case "freeze_exit":
  3025. RoomItem exitTeleport = this.GetFreeze().ExitTeleport;
  3026. if (exitTeleport == null)
  3027. {
  3028. this.GetFreeze().ExitTeleport = class2;
  3029. }
  3030. break;
  3031. case "freeze_blue_gate":
  3032. this.GetGameManager().AddFreezeGate(class2);
  3033. break;
  3034. case "freeze_red_gate":
  3035. this.GetGameManager().AddFreezeGate(class2);
  3036. break;
  3037. case "freeze_green_gate":
  3038. this.GetGameManager().AddFreezeGate(class2);
  3039. break;
  3040. case "freeze_yellow_gate":
  3041. this.GetGameManager().AddFreezeGate(class2);
  3042. break;
  3043. case "freeze_blue_score":
  3044. this.GetGameManager().AddFreezeScoreboard(class2);
  3045. break;
  3046. case "freeze_red_score":
  3047. this.GetGameManager().AddFreezeScoreboard(class2);
  3048. break;
  3049. case "freeze_green_score":
  3050. this.GetGameManager().AddFreezeScoreboard(class2);
  3051. break;
  3052. case "freeze_yellow_score":
  3053. this.GetGameManager().AddFreezeScoreboard(class2);
  3054. break;
  3055. }
  3056. if (this.hashtable_0.Contains(class2.uint_0))
  3057. {
  3058. this.hashtable_0.Remove(class2.uint_0);
  3059. }
  3060. if (this.hashtable_4.Contains(class2.uint_0))
  3061. {
  3062. this.hashtable_4.Remove(class2.uint_0);
  3063. }
  3064. if (class2.Boolean_2)
  3065. {
  3066. this.hashtable_0.Add(class2.uint_0, class2);
  3067. }
  3068. else
  3069. {
  3070. this.hashtable_4.Add(class2.uint_0, class2);
  3071. }
  3072. }
  3073. }
  3074. }
  3075. public bool method_26(GameClient Session)
  3076. {
  3077. return this.CheckRights(Session, false);
  3078. }
  3079. public bool CheckRights(GameClient Session, bool bool_13)
  3080. {
  3081. bool result;
  3082. try
  3083. {
  3084. if (Session.GetHabbo().Username.ToLower() == this.Owner.ToLower())
  3085. {
  3086. result = true;
  3087. return result;
  3088. }
  3089. if (Session.GetHabbo().HasFuse("acc_anyroomowner") && bool_13)
  3090. {
  3091. result = true;
  3092. return result;
  3093. }
  3094. if (!bool_13)
  3095. {
  3096. if (Session.GetHabbo().HasFuse("acc_anyroomrights"))
  3097. {
  3098. result = true;
  3099. return result;
  3100. }
  3101. if (this.UsersWithRights.Contains(Session.GetHabbo().Id))
  3102. {
  3103. result = true;
  3104. return result;
  3105. }
  3106. if (this.bool_8)
  3107. {
  3108. result = true;
  3109. return result;
  3110. }
  3111. }
  3112. }
  3113. catch
  3114. {
  3115. }
  3116. result = false;
  3117. return result;
  3118. }
  3119. public RoomItem method_28(uint uint_2)
  3120. {
  3121. RoomItem result;
  3122. if ((this.hashtable_0 != null && this.hashtable_0.ContainsKey(uint_2)) || (this.hashtable_4 != null && this.hashtable_4.ContainsKey(uint_2)))
  3123. {
  3124. RoomItem @class = this.hashtable_0[uint_2] as RoomItem;
  3125. if (@class != null)
  3126. {
  3127. result = @class;
  3128. }
  3129. else
  3130. {
  3131. result = (this.hashtable_4[uint_2] as RoomItem);
  3132. }
  3133. }
  3134. else
  3135. {
  3136. result = null;
  3137. }
  3138. return result;
  3139. }
  3140. public void method_29(GameClient Session, uint uint_2, bool bool_13, bool bool_14)
  3141. {
  3142. RoomItem @class = this.method_28(uint_2);
  3143. if (@class != null)
  3144. {
  3145. Dictionary<int, AffectedTile> dictionary = this.method_94(@class.GetBaseItem().Length, @class.GetBaseItem().Width, @class.Int32_0, @class.Int32_1, @class.int_3);
  3146. @class.Class69_0.OnRemove(Session, @class);
  3147. if (@class.Boolean_1)
  3148. {
  3149. ServerMessage Message = new ServerMessage(84u);
  3150. Message.AppendRawUInt(@class.uint_0);
  3151. Message.AppendStringWithBreak("");
  3152. Message.AppendBoolean(false);
  3153. this.SendMessage(Message, null);
  3154. }
  3155. else
  3156. {
  3157. if (@class.Boolean_2)
  3158. {
  3159. ServerMessage Message = new ServerMessage(94u);
  3160. Message.AppendRawUInt(@class.uint_0);
  3161. Message.AppendStringWithBreak("");
  3162. Message.AppendBoolean(false);
  3163. this.SendMessage(Message, null);
  3164. string text = @class.GetBaseItem().InteractionType.ToLower();
  3165. switch (text)
  3166. {
  3167. case "bb_patch":
  3168. this.list_5.Remove(@class);
  3169. if (@class.ExtraData == "5")
  3170. {
  3171. this.list_6.Remove(@class);
  3172. }
  3173. else
  3174. {
  3175. if (@class.ExtraData == "8")
  3176. {
  3177. this.list_7.Remove(@class);
  3178. }
  3179. else
  3180. {
  3181. if (@class.ExtraData == "11")
  3182. {
  3183. this.list_9.Remove(@class);
  3184. }
  3185. else
  3186. {
  3187. if (@class.ExtraData == "14")
  3188. {
  3189. this.list_8.Remove(@class);
  3190. }
  3191. }
  3192. }
  3193. }
  3194. break;
  3195. case "blue_score":
  3196. this.list_12.Remove(@class);
  3197. break;
  3198. case "green_score":
  3199. this.list_13.Remove(@class);
  3200. break;
  3201. case "red_score":
  3202. this.list_10.Remove(@class);
  3203. break;
  3204. case "yellow_score":
  3205. this.list_11.Remove(@class);
  3206. break;
  3207. case "stickiepole":
  3208. this.list_3.Remove(@class);
  3209. break;
  3210. case "wf_trg_onsay":
  3211. case "wf_trg_enterroom":
  3212. case "wf_trg_furnistate":
  3213. case "wf_trg_onfurni":
  3214. case "wf_trg_offfurni":
  3215. case "wf_trg_gameend":
  3216. case "wf_trg_gamestart":
  3217. case "wf_trg_atscore":
  3218. this.list_14.Remove(@class);
  3219. break;
  3220. case "wf_trg_attime":
  3221. @class.bool_0 = false;
  3222. this.list_14.Remove(@class);
  3223. break;
  3224. case "wf_trg_timer":
  3225. @class.bool_0 = false;
  3226. this.list_14.Remove(@class);
  3227. break;
  3228. case "wf_act_saymsg":
  3229. case "wf_act_kick_user":
  3230. case "wf_act_moveuser":
  3231. case "wf_act_togglefurni":
  3232. case "wf_act_givepoints":
  3233. case "wf_act_moverotate":
  3234. case "wf_act_matchfurni":
  3235. case "wf_act_give_phx":
  3236. this.list_15.Remove(@class);
  3237. break;
  3238. case "wf_cnd_trggrer_on_frn":
  3239. case "wf_cnd_furnis_hv_avtrs":
  3240. case "wf_cnd_has_furni_on":
  3241. case "wf_cnd_match_snapshot":
  3242. case "wf_cnd_time_more_than":
  3243. case "wf_cnd_time_less_than":
  3244. case "wf_cnd_phx":
  3245. this.list_16.Remove(@class);
  3246. break;
  3247. case "freeze_tile":
  3248. this.GetFreeze().RemoveFreezeTile(@class);
  3249. break;
  3250. case "freeze_ice_block":
  3251. this.GetFreeze().RemoveFreezeBlock(@class);
  3252. break;
  3253. case "freeze_exit":
  3254. RoomItem exitTeleport = this.GetFreeze().ExitTeleport;
  3255. if ((exitTeleport != null) && (@class.uint_0 == exitTeleport.uint_0))
  3256. {
  3257. this.GetFreeze().ExitTeleport = null;
  3258. }
  3259. break;
  3260. case "freeze_blue_gate":
  3261. this.GetGameManager().RemoveFreezeGate(@class);
  3262. break;
  3263. case "freeze_red_gate":
  3264. this.GetGameManager().RemoveFreezeGate(@class);
  3265. break;
  3266. case "freeze_green_gate":
  3267. this.GetGameManager().RemoveFreezeGate(@class);
  3268. break;
  3269. case "freeze_yellow_gate":
  3270. this.GetGameManager().RemoveFreezeGate(@class);
  3271. break;
  3272. case "freeze_blue_score":
  3273. this.GetGameManager().RemoveFreezeScoreboard(@class);
  3274. break;
  3275. case "freeze_red_score":
  3276. this.GetGameManager().RemoveFreezeScoreboard(@class);
  3277. break;
  3278. case "freeze_green_score":
  3279. this.GetGameManager().RemoveFreezeScoreboard(@class);
  3280. break;
  3281. case "freeze_yellow_score":
  3282. this.GetGameManager().RemoveFreezeScoreboard(@class);
  3283. break;
  3284. }
  3285. }
  3286. }
  3287. if (@class.Boolean_1)
  3288. {
  3289. this.hashtable_4.Remove(@class.uint_0);
  3290. }
  3291. else
  3292. {
  3293. this.hashtable_0.Remove(@class.uint_0);
  3294. }
  3295. if (this.hashtable_3.Contains(@class.uint_0))
  3296. {
  3297. this.hashtable_3.Remove(@class.uint_0);
  3298. }
  3299. if (this.hashtable_2.Contains(@class.uint_0))
  3300. {
  3301. this.hashtable_2.Remove(@class.uint_0);
  3302. }
  3303. if (!this.hashtable_1.Contains(@class.uint_0))
  3304. {
  3305. this.hashtable_1.Add(@class.uint_0, @class);
  3306. }
  3307. if (bool_13)
  3308. {
  3309. using (DatabaseClient class2 = HighSoft.GetDatabase().GetClient())
  3310. {
  3311. class2.ExecuteQuery("DELETE FROM items WHERE Id = '" + uint_2 + "' LIMIT 1");
  3312. }
  3313. }
  3314. if (bool_14)
  3315. {
  3316. this.method_22();
  3317. }
  3318. this.method_87(this.method_43(@class.Int32_0, @class.Int32_1), true, true);
  3319. foreach (AffectedTile current in dictionary.Values)
  3320. {
  3321. this.method_87(this.method_43(current.Int32_0, current.Int32_1), true, true);
  3322. }
  3323. }
  3324. }
  3325. public bool method_30(int int_17, int int_18, double double_3, bool bool_13, bool bool_14)
  3326. {
  3327. return this.AllowWalkthrough || bool_14 || this.method_43(int_17, int_18) == null;
  3328. }
  3329. private void method_31(string string_10)
  3330. {
  3331. for (int i = 0; i < this.RoomUsers.Length; i++)
  3332. {
  3333. RoomUser @class = this.RoomUsers[i];
  3334. if (@class != null && !@class.IsBot)
  3335. {
  3336. @class.GetClient().SendNotification(string_10);
  3337. }
  3338. }
  3339. }
  3340.  
  3341. internal void method_32(object object_0)
  3342. {
  3343. this.method_33();
  3344. }
  3345. private void method_33()
  3346. {
  3347. isCycling = true;
  3348. int num = 0;
  3349. if (!this.bool_6 && !this.bool_7)
  3350. {
  3351. try
  3352. {
  3353. this.int_14++;
  3354. if (this.bool_10 && this.int_14 >= 30)
  3355. {
  3356. using (DatabaseClient @class = HighSoft.GetDatabase().GetClient())
  3357. {
  3358. @class.ExecuteQuery(string.Concat(new object[]
  3359. {
  3360. "UPDATE rooms SET users_now = '",
  3361. this.UserCount,
  3362. "' WHERE Id = '",
  3363. this.Id,
  3364. "' LIMIT 1"
  3365. }));
  3366. }
  3367. this.int_14 = 0;
  3368. }
  3369. this.method_35();
  3370. int num2 = 0;
  3371. try
  3372. {
  3373. if (this.hashtable_0 != null)
  3374. {
  3375. foreach (RoomItem class2 in this.Hashtable_0.Values)
  3376. {
  3377. if (class2.bool_1)
  3378. {
  3379. class2.method_2();
  3380. }
  3381. }
  3382. }
  3383. }
  3384. catch (Exception ex)
  3385. {
  3386. Logging.LogThreadException(ex.ToString(), "Room [ID: " + this.Id + "] cycle task -- Process Floor Items");
  3387. this.method_34();
  3388. }
  3389. try
  3390. {
  3391. if (this.hashtable_4 != null)
  3392. {
  3393. foreach (RoomItem class2 in this.Hashtable_1.Values)
  3394. {
  3395. if (class2.bool_1)
  3396. {
  3397. class2.method_2();
  3398. }
  3399. }
  3400. }
  3401. }
  3402. catch (Exception ex)
  3403. {
  3404. Logging.LogThreadException(ex.ToString(), "Room [ID: " + this.Id + "] cycle task -- Process Wall Items");
  3405. this.method_34();
  3406. }
  3407. List<uint> list = new List<uint>();
  3408. int num3 = 0;
  3409. if (this.RoomUsers != null)
  3410. {
  3411. try
  3412. {
  3413. for (int i = 0; i < this.RoomUsers.Length; i++)
  3414. {
  3415. RoomUser class3 = this.RoomUsers[i];
  3416. if (class3 != null)
  3417. {
  3418. num = 1;
  3419. if (!class3.IsBot && class3.GetClient() != null)
  3420. {
  3421. num3++;
  3422. if (class3.GetClient().GetHabbo() != null && class3.GetClient().GetHabbo().int_4 > 0)
  3423. {
  3424. class3.GetClient().GetHabbo().int_4--;
  3425. if (class3.GetClient().GetHabbo().int_4 == 0)
  3426. {
  3427. class3.GetClient().GetHabbo().IsMuted = false;
  3428. }
  3429. }
  3430. }
  3431. if (this.MusicController != null)
  3432. {
  3433. this.MusicController.Update(this);
  3434. }
  3435. class3.int_1++;
  3436. this.GetFreeze().CycleUser(class3);
  3437. num = 2;
  3438. if (!class3.bool_8 && class3.int_1 >= ServerConfiguration.SleepTimer)
  3439. {
  3440. class3.bool_8 = true;
  3441. ServerMessage Message = new ServerMessage(486u);
  3442. Message.AppendInt32(class3.VirtualId);
  3443. Message.AppendBoolean(true);
  3444. this.SendMessage(Message, null);
  3445. }
  3446. num = 3;
  3447. if (class3.GetClient() == null && !class3.IsBot)
  3448. {
  3449. this.RoomUsers[i] = null;
  3450. if (!class3.bool_1)
  3451. {
  3452. this.byte_0[class3.X, class3.Y] = class3.byte_0;
  3453. }
  3454. ServerMessage Message2 = new ServerMessage(29u);
  3455. Message2.AppendRawInt32(class3.VirtualId);
  3456. this.SendMessage(Message2, null);
  3457. this.method_50();
  3458. }
  3459. num = 4;
  3460. if (class3.Boolean_2 && !list.Contains(class3.UId))
  3461. {
  3462. list.Add(class3.UId);
  3463. }
  3464. num = 5;
  3465. if (class3.CarryItemID > 0)
  3466. {
  3467. class3.int_6--;
  3468. if (class3.int_6 <= 0)
  3469. {
  3470. class3.CarryItem(0);
  3471. }
  3472. }
  3473. num = 6;
  3474. if (class3.bool_4 && class3.class34_1 == null)
  3475. {
  3476. num = 7;
  3477. if (class3.IsBot && class3.RoomBot.RoomUser_0 != null && this.method_30(class3.int_12, class3.int_13, 0.0, true, true))
  3478. {
  3479. num = 8;
  3480. this.method_85(class3);
  3481. class3.X = class3.int_12;
  3482. class3.Y = class3.int_13;
  3483. class3.double_0 = class3.double_1;
  3484. class3.RoomBot.RoomUser_0.X = class3.int_12;
  3485. class3.RoomBot.RoomUser_0.Y = class3.int_13;
  3486. class3.RoomBot.RoomUser_0.double_0 = class3.double_1 + 1.0;
  3487. class3.RoomBot.RoomUser_0.bool_4 = false;
  3488. class3.RoomBot.RoomUser_0.RemoveStatus("mv");
  3489. if (class3.X == this.RoomModel.int_0 && class3.Y == this.RoomModel.int_1 && !list.Contains(class3.RoomBot.RoomUser_0.UId))
  3490. {
  3491. list.Add(class3.RoomBot.RoomUser_0.UId);
  3492. }
  3493. this.method_87(class3, true, true);
  3494. }
  3495. else
  3496. {
  3497. if (this.method_30(class3.int_12, class3.int_13, 0.0, true, class3.bool_1))
  3498. {
  3499. num = 8;
  3500.  
  3501. this.method_85(class3);
  3502. class3.X = class3.int_12;
  3503. class3.Y = class3.int_13;
  3504. class3.double_0 = class3.double_1;
  3505. if (class3.X == this.RoomModel.int_0 && class3.Y == this.RoomModel.int_1 && !list.Contains(class3.UId) && !class3.IsBot)
  3506. {
  3507. list.Add(class3.UId);
  3508. }
  3509. this.method_87(class3, true, true);
  3510. }
  3511. }
  3512. class3.bool_4 = false;
  3513. }
  3514. num = 9;
  3515. if (class3.bool_6 && !class3.bool_5 && class3.class34_1 == null)
  3516. {
  3517. num = 10;
  3518. SquarePoint @struct = DreamPathfinder.GetNextStep(class3.X, class3.Y, class3.int_10, class3.int_11, this.byte_0, this.double_1, this.class28_0.double_1, this.double_2, this.class28_0.int_4, this.class28_0.int_5, class3.bool_1, this.bool_5, this.HeightOverride);
  3519. num = 11;
  3520. if (@struct.X != class3.X || @struct.Y != class3.Y)
  3521. {
  3522. num = 12;
  3523. int int32_ = @struct.X;
  3524. int int32_2 = @struct.Y;
  3525. class3.RemoveStatus("mv");
  3526. double num4 = this.method_84(int32_, int32_2, this.method_93(int32_, int32_2));
  3527. class3.Statusses.Remove("lay");
  3528. class3.Statusses.Remove("sit");
  3529. class3.AddStatus("mv", string.Concat(new object[]
  3530. {
  3531. int32_,
  3532. ",",
  3533. int32_2,
  3534. ",",
  3535. num4.ToString().Replace(',', '.')
  3536. }));
  3537. num = 13;
  3538. if (class3.IsBot && class3.RoomBot.RoomUser_0 != null)
  3539. {
  3540. class3.RoomBot.RoomUser_0.AddStatus("mv", string.Concat(new object[]
  3541. {
  3542. int32_,
  3543. ",",
  3544. int32_2,
  3545. ",",
  3546. (num4 + 1.0).ToString().Replace(',', '.')
  3547. }));
  3548. }
  3549. int num5;
  3550. if (class3.bool_3)
  3551. {
  3552. num5 = Class107.smethod_1(class3.X, class3.Y, int32_, int32_2);
  3553. }
  3554. else
  3555. {
  3556. num5 = Class107.smethod_0(class3.X, class3.Y, int32_, int32_2);
  3557. }
  3558. class3.BodyRotation = num5;
  3559. class3.int_7 = num5;
  3560. class3.bool_4 = true;
  3561. class3.int_12 = int32_;
  3562. class3.int_13 = int32_2;
  3563. class3.double_1 = num4;
  3564. num = 14;
  3565. if (class3.IsBot && class3.RoomBot.RoomUser_0 != null)
  3566. {
  3567. class3.RoomBot.RoomUser_0.BodyRotation = num5;
  3568. class3.RoomBot.RoomUser_0.int_7 = num5;
  3569. class3.RoomBot.RoomUser_0.bool_4 = true;
  3570. class3.RoomBot.RoomUser_0.int_12 = int32_;
  3571. class3.RoomBot.RoomUser_0.int_13 = int32_2;
  3572. class3.RoomBot.RoomUser_0.double_1 = num4 + 1.0;
  3573. }
  3574. try
  3575. {
  3576. num = 15;
  3577. if (!class3.IsBot)
  3578. {
  3579. if (class3.GetClient().GetHabbo().Gender.ToLower() == "m" && this.byte_1[int32_, int32_2] > 0 && class3.byte_1 != this.byte_1[int32_, int32_2])
  3580. {
  3581. class3.GetClient().GetHabbo().GetEffectsInventoryComponent().method_2((int)this.byte_1[int32_, int32_2], true);
  3582. class3.byte_1 = this.byte_1[int32_, int32_2];
  3583. }
  3584. else
  3585. {
  3586. if (class3.GetClient().GetHabbo().Gender.ToLower() == "f" && this.byte_2[int32_, int32_2] > 0 && class3.byte_1 != this.byte_2[int32_, int32_2])
  3587. {
  3588. class3.GetClient().GetHabbo().GetEffectsInventoryComponent().method_2((int)this.byte_2[int32_, int32_2], true);
  3589. class3.byte_1 = this.byte_2[int32_, int32_2];
  3590. }
  3591. }
  3592. }
  3593. else
  3594. {
  3595. if (!class3.IsPet)
  3596. {
  3597. if (this.byte_1[int32_, int32_2] > 0)
  3598. {
  3599. class3.RoomBot.EffectId = (int)this.byte_1[int32_, int32_2];
  3600. class3.byte_1 = this.byte_1[int32_, int32_2];
  3601. }
  3602. ServerMessage Message3 = new ServerMessage(485u);
  3603. Message3.AppendInt32(class3.VirtualId);
  3604. Message3.AppendInt32(class3.RoomBot.EffectId);
  3605. this.SendMessage(Message3, null);
  3606. }
  3607. }
  3608. goto IL_CE1;
  3609. }
  3610. catch
  3611. {
  3612. goto IL_CE1;
  3613. }
  3614. IL_B8B:
  3615. this.method_87(class3, false, true);
  3616. class3.UpdateNeeded = true;
  3617. if (class3.IsBot && class3.RoomBot.RoomUser_0 != null)
  3618. {
  3619. this.method_87(class3.RoomBot.RoomUser_0, true, true);
  3620. class3.RoomBot.RoomUser_0.UpdateNeeded = true;
  3621. goto IL_BE0;
  3622. }
  3623. goto IL_BE0;
  3624. IL_CE1:
  3625. num = 16;
  3626. this.byte_0[class3.X, class3.Y] = class3.byte_0;
  3627. class3.byte_0 = this.byte_0[class3.int_12, class3.int_13];
  3628. if (this.AllowWalkthrough)
  3629. {
  3630. goto IL_B8B;
  3631. }
  3632. this.byte_0[int32_, int32_2] = 0;
  3633. goto IL_B8B;
  3634. }
  3635. num = 12;
  3636. class3.bool_6 = false;
  3637. class3.RemoveStatus("mv");
  3638. class3.bool_10 = false;
  3639. if (class3.IsBot && class3.RoomBot.RoomUser_0 != null)
  3640. {
  3641. class3.RoomBot.RoomUser_0.RemoveStatus("mv");
  3642. class3.RoomBot.RoomUser_0.bool_6 = false;
  3643. class3.RoomBot.RoomUser_0.bool_10 = false;
  3644. class3.RoomBot.RoomUser_0.UpdateNeeded = true;
  3645. }
  3646. IL_BE0:
  3647. class3.UpdateNeeded = true;
  3648. }
  3649. else
  3650. {
  3651. num = 17;
  3652. if (class3.Statusses.ContainsKey("mv") && class3.class34_1 == null)
  3653. {
  3654. num = 18;
  3655. class3.RemoveStatus("mv");
  3656. class3.UpdateNeeded = true;
  3657. if (class3.IsBot && class3.RoomBot.RoomUser_0 != null)
  3658. {
  3659. class3.RoomBot.RoomUser_0.RemoveStatus("mv");
  3660. class3.RoomBot.RoomUser_0.UpdateNeeded = true;
  3661. }
  3662. }
  3663. }
  3664. foreach (RoomItem item in method_45(class3.X, class3.Y))
  3665. {
  3666. if (class3.bool_6)
  3667. {
  3668. item.ExtraData = "11";
  3669. item.Posizione = "0";
  3670. }
  3671. else if (!class3.bool_6 && item.ExtraData == "11" && item.Posizione != "10")
  3672. {
  3673. item.ExtraData = "1222";
  3674. }
  3675. else if (item.GetBaseItem().InteractionType == "ballbug" && item.ExtraData == "1222" && item.Posizione != "10" && class3.X == item.Int32_0 && class3.Y == item.Int32_1 && !class3.bool_6)
  3676. {
  3677. KickBall(class3, item, true);
  3678. }
  3679. }
  3680. if (class3.IsBot || class3.IsPet)
  3681. {
  3682. try
  3683. {
  3684. class3.BotAI.OnTimerTick();
  3685. goto IL_C9F;
  3686. }
  3687. catch
  3688. {
  3689. goto IL_C9F;
  3690. }
  3691. }
  3692. goto IL_C9B;
  3693. IL_C9F:
  3694. if (class3.int_9 > 0)
  3695. {
  3696. if (class3.int_9 == 1)
  3697. {
  3698. this.method_87(class3, true, true);
  3699. }
  3700. class3.int_9--;
  3701. goto IL_CD6;
  3702. }
  3703. goto IL_CD6;
  3704. IL_C9B:
  3705. num2++;
  3706. goto IL_C9F;
  3707. }
  3708. IL_CD6: ;
  3709. }
  3710. }
  3711. catch (Exception ex)
  3712. {
  3713. Logging.LogThreadException(ex.ToString(), string.Concat(new object[]
  3714. {
  3715. "Room [ID: ",
  3716. this.Id,
  3717. "] [Part: ",
  3718. num,
  3719. " cycle task -- Process Users Updates"
  3720. }));
  3721. this.method_34();
  3722. }
  3723. }
  3724. try
  3725. {
  3726. foreach (uint current in list)
  3727. {
  3728. this.method_47(HighSoft.GetGame().GetClientManager().method_2(current), true, false);
  3729. }
  3730. }
  3731. catch (Exception ex)
  3732. {
  3733. Logging.LogThreadException(ex.ToString(), "Room [ID: " + this.Id + "] cycle task -- Remove Users");
  3734. this.method_34();
  3735. }
  3736. if (num2 >= 1)
  3737. {
  3738. this.int_8 = 0;
  3739. }
  3740. else
  3741. {
  3742. this.int_8++;
  3743. }
  3744. if (!this.bool_6 && !this.bool_7)
  3745. {
  3746. try
  3747. {
  3748. if (this.int_8 >= 60)
  3749. {
  3750. HighSoft.GetGame().GetRoomManager().method_16(this);
  3751. return;
  3752. }
  3753.  
  3754. ServerMessage Logging = this.method_67(false);
  3755. if (Logging != null)
  3756. {
  3757. this.SendMessage(Logging, null);
  3758. }
  3759. }
  3760. catch (Exception ex)
  3761. {
  3762. Logging.LogThreadException(ex.ToString(), "Room [ID: " + this.Id + "] cycle task -- Cycle End");
  3763. this.method_34();
  3764. }
  3765. }
  3766. this.class27_0.UsersNow = num3;
  3767. }
  3768. catch (Exception ex)
  3769. {
  3770. Logging.LogThreadException(ex.ToString(), "Room [ID: " + this.Id + "] cycle task");
  3771. }
  3772. }
  3773. isCycling = false;
  3774. }
  3775. internal void method_34()
  3776. {
  3777. if (!this.bool_7 && ServerConfiguration.UnloadCrashedRooms)
  3778. {
  3779. this.bool_7 = true;
  3780. try
  3781. {
  3782. this.method_31(HighSoftEnvironment.GetExternalText("error_roomunload"));
  3783. }
  3784. catch
  3785. {
  3786. }
  3787. HighSoft.GetGame().GetRoomManager().method_16(this);
  3788. }
  3789. }
  3790. private void method_35()
  3791. {
  3792. if (this.bool_11)
  3793. {
  3794. if (this.int_16 >= this.int_15 || this.int_15 == 0)
  3795. {
  3796. Hashtable hashtable = this.hashtable_0.Clone() as Hashtable;
  3797. List<uint> list = new List<uint>();
  3798. List<uint> list2 = new List<uint>();
  3799. foreach (RoomItem @class in hashtable.Values)
  3800. {
  3801. if (@class.Boolean_0)
  3802. {
  3803. ThreeDCoord gStruct1_ = @class.GStruct1_1;
  3804. if (gStruct1_.x >= this.RoomModel.int_4 || gStruct1_.y >= this.RoomModel.int_5 || gStruct1_.x < 0 || gStruct1_.y < 0)
  3805. {
  3806. return;
  3807. }
  3808. List<RoomItem> list3 = this.method_45(@class.Int32_0, @class.Int32_1);
  3809. RoomUser class2 = this.method_43(@class.Int32_0, @class.Int32_1);
  3810. if (list3.Count > 0 || class2 != null)
  3811. {
  3812. List<RoomItem> list4 = this.method_45(gStruct1_.x, gStruct1_.y);
  3813. double num = this.RoomModel.double_1[gStruct1_.x, gStruct1_.y];
  3814. int num2 = 0;
  3815. int num3 = 0;
  3816. bool flag = false;
  3817. foreach (RoomItem current in list4)
  3818. {
  3819. if (current.Double_1 > num)
  3820. {
  3821. num = current.Double_1;
  3822. }
  3823. if (!current.Boolean_0)
  3824. {
  3825. num2++;
  3826. }
  3827. else
  3828. {
  3829. num3++;
  3830. }
  3831. if (!flag && current.GetBaseItem().InteractionType.ToLower() == "wf_trg_timer")
  3832. {
  3833. flag = true;
  3834. }
  3835. }
  3836. bool flag2 = num2 > 0;
  3837. if (this.method_43(gStruct1_.x, gStruct1_.y) != null)
  3838. {
  3839. flag2 = true;
  3840. }
  3841. bool flag3 = num3 > 0;
  3842. foreach (RoomItem current in list3)
  3843. {
  3844. bool flag4 = current.GetBaseItem().InteractionType.ToLower() == "wf_trg_timer";
  3845. if (!current.Boolean_0 && !list.Contains(current.uint_0) && this.method_36(gStruct1_.x, gStruct1_.y) && (!flag2 || !flag3) && @class.Double_0 < current.Double_0 && this.method_43(gStruct1_.x, gStruct1_.y) == null && (!flag4 || !flag))
  3846. {
  3847. double double_;
  3848. if (flag3)
  3849. {
  3850. double_ = current.Double_0;
  3851. }
  3852. else
  3853. {
  3854. double_ = current.Double_0 - @class.Double_1 + this.RoomModel.double_1[gStruct1_.x, gStruct1_.y];
  3855. }
  3856. this.method_41(current, gStruct1_, @class.uint_0, double_);
  3857. list.Add(current.uint_0);
  3858. }
  3859. }
  3860. if (class2 != null && (!flag2 || !flag3) && this.method_37(gStruct1_.x, gStruct1_.y, false, true, false, true, true, false, false) && !list2.Contains(class2.UId) && !class2.bool_6)
  3861. {
  3862. if (this.double_2[gStruct1_.x, gStruct1_.y] > 0.0)
  3863. {
  3864. num = this.method_84(gStruct1_.x, gStruct1_.y, this.method_93(gStruct1_.x, gStruct1_.y));
  3865. }
  3866. if (class2.IsBot && class2.RoomBot.RoomUser_0 != null)
  3867. {
  3868. this.method_42(class2, gStruct1_, @class.uint_0, num);
  3869. list2.Add(class2.UId);
  3870. this.method_42(class2.RoomBot.RoomUser_0, gStruct1_, @class.uint_0, num + 1.0);
  3871. list2.Add(class2.RoomBot.RoomUser_0.UId);
  3872. }
  3873. else
  3874. {
  3875. if (class2.class34_1 == null)
  3876. {
  3877. this.method_42(class2, gStruct1_, @class.uint_0, num);
  3878. list2.Add(class2.UId);
  3879. }
  3880. }
  3881. }
  3882. }
  3883. }
  3884. }
  3885. hashtable.Clear();
  3886. hashtable = null;
  3887. list.Clear();
  3888. list2.Clear();
  3889. this.int_16 = 0;
  3890. }
  3891. else
  3892. {
  3893. this.int_16++;
  3894. }
  3895. }
  3896. }
  3897. public bool method_36(int int_17, int int_18)
  3898. {
  3899. bool result;
  3900. if (!this.method_92(int_17, int_18))
  3901. {
  3902. result = false;
  3903. }
  3904. else
  3905. {
  3906. if (this.RoomModel.squareState[int_17, int_18] == SquareState.BLOCKED)
  3907. {
  3908. result = false;
  3909. }
  3910. else
  3911. {
  3912. List<RoomItem> list = this.method_93(int_17, int_18);
  3913. if (list != null && list.Count > 1)
  3914. {
  3915. foreach (RoomItem current in list)
  3916. {
  3917. if (current.Boolean_0)
  3918. {
  3919. result = true;
  3920. return result;
  3921. }
  3922. }
  3923. }
  3924. result = true;
  3925. }
  3926. }
  3927. return result;
  3928. }
  3929. public bool method_37(int int_17, int int_18, bool bool_13, bool bool_14, bool bool_15, bool bool_16, bool bool_17, bool IsNotSeat, bool IsNotBed)
  3930. {
  3931. bool result;
  3932. if (!this.method_92(int_17, int_18))
  3933. {
  3934. result = false;
  3935. }
  3936. else
  3937. {
  3938. if (this.RoomModel.squareState[int_17, int_18] == SquareState.BLOCKED)
  3939. {
  3940. result = false;
  3941. }
  3942. else
  3943. {
  3944. if (bool_17 && this.double_2[int_17, int_18] > 0.0)
  3945. {
  3946. result = true;
  3947. }
  3948. else
  3949. {
  3950. if (bool_13 && this.method_97(int_17, int_18))
  3951. {
  3952. result = false;
  3953. }
  3954. else
  3955. {
  3956. if (bool_14)
  3957. {
  3958. List<RoomItem> list = this.method_93(int_17, int_18);
  3959. if (list != null && list.Count > 0)
  3960. {
  3961. if (!bool_15 && !bool_16 && !bool_17 && !IsNotSeat)
  3962. {
  3963. result = false;
  3964. return result;
  3965. }
  3966. if (bool_15)
  3967. {
  3968. foreach (RoomItem current in list)
  3969. {
  3970. if (!current.GetBaseItem().Stackable)
  3971. {
  3972. result = false;
  3973. return result;
  3974. }
  3975. }
  3976. }
  3977. if (bool_16 && bool_17)
  3978. {
  3979. using (List<RoomItem>.Enumerator enumerator = list.GetEnumerator())
  3980. {
  3981. while (enumerator.MoveNext())
  3982. {
  3983. RoomItem current = enumerator.Current;
  3984. if (!current.GetBaseItem().Walkable && !current.GetBaseItem().IsSeat)
  3985. {
  3986. result = false;
  3987. return result;
  3988. }
  3989. }
  3990. goto IL_1DD;
  3991. }
  3992. }
  3993. if (bool_16)
  3994. {
  3995. using (List<RoomItem>.Enumerator enumerator = list.GetEnumerator())
  3996. {
  3997. while (enumerator.MoveNext())
  3998. {
  3999. RoomItem current = enumerator.Current;
  4000. if (!current.GetBaseItem().Walkable)
  4001. {
  4002. result = false;
  4003. return result;
  4004. }
  4005. }
  4006. goto IL_1DD;
  4007. }
  4008. }
  4009. if (bool_17)
  4010. {
  4011. foreach (RoomItem current in list)
  4012. {
  4013. if (!current.GetBaseItem().IsSeat)
  4014. {
  4015. result = false;
  4016. return result;
  4017. }
  4018. }
  4019. }
  4020.  
  4021. if (IsNotSeat)
  4022. {
  4023. foreach (RoomItem current in list)
  4024. {
  4025. if (current.GetBaseItem().IsSeat)
  4026. {
  4027. result = false;
  4028. return result;
  4029. }
  4030. }
  4031. }
  4032.  
  4033. if (IsNotBed)
  4034. {
  4035. foreach (RoomItem current in list)
  4036. {
  4037. if (current.GetBaseItem().InteractionType.ToLower() == "bed")
  4038. {
  4039. result = false;
  4040. return result;
  4041. }
  4042. }
  4043. }
  4044. }
  4045. }
  4046. IL_1DD:
  4047. result = true;
  4048. }
  4049. }
  4050. }
  4051. }
  4052. return result;
  4053. }
  4054. internal void method_38(int int_17, int int_18)
  4055. {
  4056. this.byte_0[int_17, int_18] = 1;
  4057. }
  4058. internal void method_39(int int_17, int int_18)
  4059. {
  4060. this.byte_0[int_17, int_18] = 0;
  4061. }
  4062. internal void method_40(RoomItem RoomItem_0, int int_17, int int_18, uint uint_2, double double_3)
  4063. {
  4064. ServerMessage Message = new ServerMessage();
  4065. Message.Init(230u);
  4066. Message.AppendInt32(RoomItem_0.Int32_0);
  4067. Message.AppendInt32(RoomItem_0.Int32_1);
  4068. Message.AppendInt32(int_17);
  4069. Message.AppendInt32(int_18);
  4070. Message.AppendInt32(1);
  4071. Message.AppendUInt(RoomItem_0.uint_0);
  4072. Message.AppendStringWithBreak(RoomItem_0.Double_0.ToString().Replace(',', '.'));
  4073. Message.AppendStringWithBreak(double_3.ToString().Replace(',', '.'));
  4074. Message.AppendUInt(uint_2);
  4075. this.SendMessage(Message, null);
  4076. this.method_81(RoomItem_0, int_17, int_18, double_3);
  4077. }
  4078. private void method_41(RoomItem RoomItem_0, ThreeDCoord gstruct1_1, uint uint_2, double double_3)
  4079. {
  4080. this.method_40(RoomItem_0, gstruct1_1.x, gstruct1_1.y, uint_2, double_3);
  4081. }
  4082. private void method_42(RoomUser RoomUser_1, ThreeDCoord gstruct1_1, uint uint_2, double double_3)
  4083. {
  4084. ServerMessage Message = new ServerMessage();
  4085. Message.Init(230u);
  4086. Message.AppendInt32(RoomUser_1.X);
  4087. Message.AppendInt32(RoomUser_1.Y);
  4088. Message.AppendInt32(gstruct1_1.x);
  4089. Message.AppendInt32(gstruct1_1.y);
  4090. Message.AppendInt32(0);
  4091. Message.AppendUInt(uint_2);
  4092. Message.AppendString("J");
  4093. Message.AppendInt32(RoomUser_1.VirtualId);
  4094. Message.AppendStringWithBreak(RoomUser_1.double_0.ToString().Replace(',', '.'));
  4095. Message.AppendStringWithBreak(double_3.ToString().Replace(',', '.'));
  4096. this.SendMessage(Message, null);
  4097. this.byte_0[RoomUser_1.X, RoomUser_1.Y] = 1;
  4098. RoomUser_1.X = gstruct1_1.x;
  4099. RoomUser_1.Y = gstruct1_1.y;
  4100. RoomUser_1.double_0 = double_3;
  4101. RoomUser_1.int_12 = gstruct1_1.x;
  4102. RoomUser_1.int_13 = gstruct1_1.y;
  4103. RoomUser_1.double_1 = double_3;
  4104. RoomUser_1.int_9 = 2;
  4105. this.byte_0[RoomUser_1.X, RoomUser_1.Y] = 0;
  4106. this.method_87(RoomUser_1, false, true);
  4107. }
  4108. internal RoomUser method_43(int int_17, int int_18)
  4109. {
  4110. RoomUser result;
  4111. if (this.RoomUsers != null)
  4112. {
  4113. for (int i = 0; i < this.RoomUsers.Length; i++)
  4114. {
  4115. RoomUser @class = this.RoomUsers[i];
  4116. if (@class != null && (@class.X == int_17 && @class.Y == int_18))
  4117. {
  4118. result = @class;
  4119. return result;
  4120. }
  4121. }
  4122. }
  4123. result = null;
  4124. return result;
  4125. }
  4126. internal RoomUser method_44(int int_17, int int_18)
  4127. {
  4128. RoomUser result;
  4129. if (this.RoomUsers != null)
  4130. {
  4131. for (int i = 0; i < this.RoomUsers.Length; i++)
  4132. {
  4133. RoomUser @class = this.RoomUsers[i];
  4134. if (@class != null)
  4135. {
  4136. if (@class.X == int_17 && @class.Y == int_18)
  4137. {
  4138. result = @class;
  4139. return result;
  4140. }
  4141. if (@class.int_12 == int_17 && @class.int_13 == int_18)
  4142. {
  4143. result = @class;
  4144. return result;
  4145. }
  4146. }
  4147. }
  4148. }
  4149. result = null;
  4150. return result;
  4151. }
  4152. private List<RoomItem> method_45(int int_17, int int_18)
  4153. {
  4154. List<RoomItem> list = new List<RoomItem>();
  4155. foreach (RoomItem @class in this.Hashtable_0.Values)
  4156. {
  4157. if (@class.Int32_0 == int_17 && @class.Int32_1 == int_18)
  4158. {
  4159. list.Add(@class);
  4160. }
  4161. }
  4162. return list;
  4163. }
  4164. public void method_46(GameClient Session, bool bool_13)
  4165. {
  4166. RoomUser @class = new RoomUser(Session.GetHabbo().Id, this.Id, this.int_7++, Session.GetHabbo().IsVisible);
  4167. if (@class != null && @class.GetClient() != null && @class.GetClient().GetHabbo() != null)
  4168. {
  4169. if (bool_13 || !@class.bool_12)
  4170. {
  4171. @class.bool_11 = true;
  4172. }
  4173. else
  4174. {
  4175. @class.method_7(this.RoomModel.int_0, this.RoomModel.int_1, this.RoomModel.double_0);
  4176. @class.method_9(this.RoomModel.int_2);
  4177. if (this.CheckRights(Session, true))
  4178. {
  4179. @class.AddStatus("flatctrl", "useradmin");
  4180. }
  4181. else
  4182. {
  4183. if (this.method_26(Session))
  4184. {
  4185. @class.AddStatus("flatctrl", "");
  4186. }
  4187. }
  4188. if (!@class.IsBot && @class.GetClient().GetHabbo().bool_7)
  4189. {
  4190. RoomItem class2 = this.method_28(@class.GetClient().GetHabbo().uint_5);
  4191. if (class2 != null)
  4192. {
  4193. @class.method_7(class2.Int32_0, class2.Int32_1, class2.Double_0);
  4194. @class.method_9(class2.int_3);
  4195. class2.uint_4 = Session.GetHabbo().Id;
  4196. class2.ExtraData = "2";
  4197. class2.UpdateState(false, true);
  4198. }
  4199. }
  4200. @class.GetClient().GetHabbo().bool_7 = false;
  4201. @class.GetClient().GetHabbo().uint_5 = 0u;
  4202. ServerMessage Message = new ServerMessage(28u);
  4203. Message.AppendInt32(1);
  4204. @class.method_14(Message);
  4205. this.SendMessage(Message, null);
  4206. }
  4207. int num = this.method_5();
  4208. @class.int_20 = num;
  4209. this.RoomUsers[num] = @class;
  4210. if (!bool_13)
  4211. {
  4212. this.bool_10 = true;
  4213. }
  4214. Session.GetHabbo().CurrentRoomId = this.Id;
  4215. Session.GetHabbo().GetMessenger().method_5(false);
  4216. Session.GetHabbo().RoomVisits++;
  4217. Session.GetHabbo().CheckRoomEntryAchievements();
  4218. Session.GetHabbo().SendToRoom(this.Id);
  4219. if (Session.GetHabbo().int_0 > 0)
  4220. {
  4221. GroupsManager class3 = Groups.smethod_2(Session.GetHabbo().int_0);
  4222. if (class3 != null && !this.list_17.Contains(class3))
  4223. {
  4224. this.list_17.Add(class3);
  4225. ServerMessage Message2 = new ServerMessage(309u);
  4226. Message2.AppendInt32(this.list_17.Count);
  4227. foreach (GroupsManager current in this.list_17)
  4228. {
  4229. Message2.AppendInt32(current.int_0);
  4230. Message2.AppendStringWithBreak(current.string_2);
  4231. }
  4232. this.SendMessage(Message2, null);
  4233. }
  4234. }
  4235. if (!bool_13)
  4236. {
  4237. this.method_51();
  4238. for (int i = 0; i < this.RoomUsers.Length; i++)
  4239. {
  4240. RoomUser class4 = this.RoomUsers[i];
  4241. if (class4 != null && class4.IsBot)
  4242. {
  4243. class4.BotAI.OnUserEnterRoom(@class);
  4244. }
  4245. }
  4246. }
  4247.  
  4248. bool RoomHasPoll = false;
  4249. bool UserFilledPoll = false;
  4250. using (DatabaseClient dbClient = HighSoft.GetDatabase().GetClient())
  4251. {
  4252. if (dbClient.ReadDataRow("SELECT null FROM room_polls WHERE room_id = '" + Session.GetHabbo().CurrentRoomId + "' LIMIT 1") != null)
  4253. {
  4254. RoomHasPoll = true;
  4255. }
  4256. }
  4257.  
  4258. if (RoomHasPoll == true)
  4259. {
  4260.  
  4261. int PollId;
  4262. string PollDetails;
  4263.  
  4264. using (DatabaseClient dbClient = HighSoft.GetDatabase().GetClient())
  4265. {
  4266. PollId = dbClient.ReadInt32("SELECT id FROM room_polls WHERE room_id = '" + Session.GetHabbo().CurrentRoomId + "' LIMIT 1");
  4267. PollDetails = dbClient.ReadString("SELECT details FROM room_polls WHERE id = '" + PollId + "' LIMIT 1");
  4268.  
  4269.  
  4270. if (dbClient.ReadDataRow("SELECT null FROM room_poll_results WHERE user_id = '" + Session.GetHabbo().Id + "' AND poll_id = '" + PollId + "' LIMIT 1") != null)
  4271. {
  4272. UserFilledPoll = true;
  4273. }
  4274.  
  4275. }
  4276.  
  4277. if (UserFilledPoll == false)
  4278. {
  4279. Thread ShowPoll = new Thread(delegate() { Room.ShowPoll(Session, PollId, PollDetails); });
  4280. ShowPoll.Start();
  4281.  
  4282. }
  4283.  
  4284. }
  4285. }
  4286. }
  4287.  
  4288. public static void ShowPoll(GameClient Session, int PollId, string PollDetails)
  4289. {
  4290. Thread.Sleep(10000);
  4291.  
  4292. if (Session.GetConnection() != null)
  4293. {
  4294. if (Session.GetHabbo().InRoom)
  4295. {
  4296. Room Room = Session.GetHabbo().CurrentRoom;
  4297. if (Room == null)
  4298. {
  4299. return;
  4300. }
  4301. ServerMessage NewPoll = new ServerMessage(316);
  4302. NewPoll.AppendInt32(PollId);
  4303. NewPoll.AppendStringWithBreak(PollDetails);
  4304. Session.SendMessage(NewPoll);
  4305. }
  4306. }
  4307. }
  4308.  
  4309. public static void ShowResults(Room Room, int QuestionId, GameClient Session)
  4310. {
  4311. Thread.Sleep(30000);
  4312. string Question;
  4313. DataTable Data = null;
  4314. using (DatabaseClient dbClient = HighSoft.GetDatabase().GetClient())
  4315. {
  4316. Question = dbClient.ReadString("SELECT question FROM infobus_questions WHERE id = '" + QuestionId + "' LIMIT 1");
  4317. Data = dbClient.ReadDataTable("SELECT * FROM infobus_answers WHERE question_id = '" + QuestionId + "'");
  4318. }
  4319.  
  4320. /*ServerMessage InfobusQuestion = new ServerMessage(80);
  4321. InfobusQuestion.AppendStringWithBreak(Question);
  4322. InfobusQuestion.AppendInt32(Data.Rows.Count);
  4323. if (Data != null)
  4324. {
  4325. foreach (DataRow Row in Data.Rows)
  4326. {
  4327. int ResultCount;
  4328. InfobusQuestion.AppendInt32((int)Row["id"]);
  4329. InfobusQuestion.AppendStringWithBreak((string)Row["answer_text"]);
  4330. using (DatabaseClient dbClient = HighSoft.GetDatabase().GetClient())
  4331. {
  4332. ResultCount = dbClient.ReadInt32("SELECT COUNT(*) FROM infobus_results WHERE answer_id = '" + (int)Row["id"] + "' AND question_id = '" + QuestionId + "'");
  4333. }
  4334. InfobusQuestion.AppendInt32(ResultCount);
  4335. }
  4336. }
  4337. int AnswerUserCount;
  4338. using (DatabaseClient dbClient = HighSoft.GetDatabase().GetClient())
  4339. {
  4340. AnswerUserCount = dbClient.ReadInt32("SELECT COUNT(*) FROM infobus_results WHERE question_id = '" + QuestionId + "'");
  4341. }
  4342. InfobusQuestion.AppendInt32(AnswerUserCount);
  4343. Room.SendMessage(InfobusQuestion, null);
  4344.  
  4345. using (DatabaseClient dbClient = HighSoft.GetDatabase().GetClient())
  4346. {
  4347. dbClient.ExecuteQuery("DELETE FROM infobus_results WHERE question_id = '" + QuestionId + "'");
  4348. }*/
  4349.  
  4350. ServerMessage InfobusQuestion = new ServerMessage(80);
  4351. InfobusQuestion.AppendStringWithBreak(Question);
  4352. InfobusQuestion.AppendInt32(Data.Rows.Count);
  4353. if (Data != null)
  4354. {
  4355. foreach (DataRow Row in Data.Rows)
  4356. {
  4357. int ResultCount = Room.InfobusAnswers.Where(number => (int)Data.Rows[number - 1]["id"] == (int)Row["id"]).Count();
  4358. InfobusQuestion.AppendInt32((int)Row["id"]);
  4359. InfobusQuestion.AppendStringWithBreak((string)Row["answer_text"]);
  4360. InfobusQuestion.AppendInt32(ResultCount);
  4361. }
  4362. }
  4363. int AnswerUserCount = Room.InfobusAnswers.Count;
  4364. InfobusQuestion.AppendInt32(AnswerUserCount);
  4365. Room.SendMessage(InfobusQuestion, null);
  4366.  
  4367. Room.InfobusAnswers.Clear();
  4368. }
  4369.  
  4370. public void method_47(GameClient Session, bool bool_13, bool bool_14)
  4371. {
  4372. int num = 1;
  4373. if (Session != null && Session.GetHabbo() != null)
  4374. {
  4375. RoomUser @class = this.GetRoomUserByHabbo(Session.GetHabbo().Id);
  4376. if (@class != null)
  4377. {
  4378. this.GetRoomTeamManager().OnUserLeave(@class);
  4379. }
  4380. }
  4381. if (!bool_14 || !Session.GetHabbo().IsGhost05)
  4382. {
  4383. if (this.bool_12)
  4384. {
  4385. if (bool_13 && Session != null)
  4386. {
  4387. if (bool_14)
  4388. {
  4389. ServerMessage Message = new ServerMessage(33u);
  4390. Message.AppendInt32(4008);
  4391. Session.SendMessage(Message);
  4392. }
  4393. ServerMessage Message5_ = new ServerMessage(18u);
  4394. Session.SendMessage(Message5_);
  4395. }
  4396. }
  4397. else
  4398. {
  4399. try
  4400. {
  4401. if (Session != null && Session.GetHabbo() != null)
  4402. {
  4403. num = 2;
  4404. RoomUser @class = this.GetRoomUserByHabbo(Session.GetHabbo().Id);
  4405. if (@class != null)
  4406. {
  4407. this.RoomUsers[@class.int_20] = null;
  4408. @class.int_20 = -1;
  4409. this.byte_0[@class.X, @class.Y] = @class.byte_0;
  4410. }
  4411. num = 3;
  4412. if (bool_13)
  4413. {
  4414. if (bool_14)
  4415. {
  4416. ServerMessage Message = new ServerMessage(33u);
  4417. Message.AppendInt32(4008);
  4418. Session.SendMessage(Message);
  4419. }
  4420. ServerMessage Message5_ = new ServerMessage(18u);
  4421. Session.SendMessage(Message5_);
  4422. }
  4423. num = 4;
  4424. if (@class != null && !@class.bool_11)
  4425. {
  4426. if (@class.byte_1 > 0 && @class.GetClient() != null)
  4427. {
  4428. @class.GetClient().GetHabbo().GetEffectsInventoryComponent().int_0 = -1;
  4429. }
  4430. this.byte_0[@class.X, @class.Y] = @class.byte_0;
  4431. if (!this.IsPublic)
  4432. {
  4433. ServerMessage Message2 = new ServerMessage(700u);
  4434. Message2.AppendBoolean(false);
  4435. Session.SendMessage(Message2);
  4436. }
  4437. ServerMessage Message3 = new ServerMessage(29u);
  4438. Message3.AppendRawInt32(@class.VirtualId);
  4439. this.SendMessage(Message3, null);
  4440. if (this.method_74(Session.GetHabbo().Id))
  4441. {
  4442. this.method_78(Session.GetHabbo().Id);
  4443. }
  4444. num = 5;
  4445. if (Session.GetHabbo().Username.ToLower() == this.Owner.ToLower() && this.HasEvent)
  4446. {
  4447. this.Event = null;
  4448. ServerMessage Logging = new ServerMessage(370u);
  4449. Logging.AppendStringWithBreak("-1");
  4450. this.SendMessage(Logging, null);
  4451. }
  4452. num = 6;
  4453. if (@class.class34_1 != null)
  4454. {
  4455. @class.class34_1.RoomUser_0 = null;
  4456. @class.class34_1 = null;
  4457. Session.GetHabbo().GetEffectsInventoryComponent().int_0 = -1;
  4458. }
  4459. Session.GetHabbo().RemoveFromRoom();
  4460. this.bool_10 = true;
  4461. this.method_51();
  4462. List<RoomUser> list = new List<RoomUser>();
  4463. for (int i = 0; i < this.RoomUsers.Length; i++)
  4464. {
  4465. RoomUser class2 = this.RoomUsers[i];
  4466. if (class2 != null && class2.IsBot)
  4467. {
  4468. list.Add(class2);
  4469. }
  4470. }
  4471. num = 7;
  4472. foreach (RoomUser current in list)
  4473. {
  4474. current.BotAI.OnUserLeaveRoom(Session);
  4475. }
  4476. }
  4477. }
  4478. }
  4479. catch (Exception ex)
  4480. {
  4481. Logging.LogCriticalException(string.Concat(new object[]
  4482. {
  4483. "Error during removing user from room [Part: ",
  4484. num,
  4485. "]: ",
  4486. ex.ToString()
  4487. }));
  4488. }
  4489. }
  4490. }
  4491. }
  4492. public RoomUser method_48(uint uint_2)
  4493. {
  4494. RoomUser result;
  4495. for (int i = 0; i < this.RoomUsers.Length; i++)
  4496. {
  4497. RoomUser @class = this.RoomUsers[i];
  4498. if (@class != null && @class.IsBot && @class.IsPet && @class.PetData != null && @class.PetData.PetId == uint_2)
  4499. {
  4500. result = @class;
  4501. return result;
  4502. }
  4503. }
  4504. result = null;
  4505. return result;
  4506. }
  4507. public bool method_49(uint uint_2)
  4508. {
  4509. return this.method_48(uint_2) != null;
  4510. }
  4511. public void method_50()
  4512. {
  4513. this.UsersNow = this.UserCount;
  4514. using (DatabaseClient @class = HighSoft.GetDatabase().GetClient())
  4515. {
  4516. @class.ExecuteQuery(string.Concat(new object[]
  4517. {
  4518. "UPDATE rooms SET users_now = '",
  4519. this.UserCount,
  4520. "' WHERE Id = '",
  4521. this.Id,
  4522. "' LIMIT 1"
  4523. }));
  4524. }
  4525. }
  4526. public void method_51()
  4527. {
  4528. this.UsersNow = this.UserCount;
  4529. }
  4530. public RoomUser method_52(int int_17)
  4531. {
  4532. RoomUser result;
  4533. for (int i = 0; i < this.RoomUsers.Length; i++)
  4534. {
  4535. RoomUser @class = this.RoomUsers[i];
  4536. if (@class != null && @class.VirtualId == int_17)
  4537. {
  4538. result = @class;
  4539. return result;
  4540. }
  4541. }
  4542. result = null;
  4543. return result;
  4544. }
  4545.  
  4546. public RoomUser GetRoomUserByHabbo(uint uint_2)
  4547. {
  4548. RoomUser result;
  4549. for (int i = 0; i < this.RoomUsers.Length; i++)
  4550. {
  4551. RoomUser @class = this.RoomUsers[i];
  4552. if (@class != null && !@class.IsBot && @class.UId == uint_2)
  4553. {
  4554. result = @class;
  4555. return result;
  4556. }
  4557. }
  4558. result = null;
  4559. return result;
  4560. }
  4561.  
  4562. public void Rave()
  4563. {
  4564. for (int i = 0; i < this.RoomUsers.Length; i++)
  4565. {
  4566. RoomUser @class = this.RoomUsers[i];
  4567. if (@class != null && (!@class.IsBot && @class.class34_1 == null))
  4568. {
  4569. @class.DanceId = 1;
  4570. ServerMessage Message = new ServerMessage(480u);
  4571. Message.AppendInt32(@class.VirtualId);
  4572. Message.AppendInt32(1);
  4573. this.SendMessage(Message, null);
  4574. }
  4575. }
  4576. }
  4577. public void method_55()
  4578. {
  4579. for (int i = 0; i < this.RoomUsers.Length; i++)
  4580. {
  4581. RoomUser @class = this.RoomUsers[i];
  4582. if (@class != null && (!@class.IsBot && @class.class34_1 == null) && (!@class.Statusses.ContainsKey("sit") && !@class.Statusses.ContainsKey("lay") && @class.BodyRotation != 1 && @class.BodyRotation != 3 && @class.BodyRotation != 5 && @class.BodyRotation != 7))
  4583. {
  4584. @class.AddStatus("sit", ((@class.double_0 + 1.0) / 2.0 - @class.double_0 * 0.5).ToString().Replace(",", "."));
  4585. @class.UpdateNeeded = true;
  4586. }
  4587. }
  4588. }
  4589. public RoomUser method_56(string string_10)
  4590. {
  4591. RoomUser result;
  4592. for (int i = 0; i < this.RoomUsers.Length; i++)
  4593. {
  4594. RoomUser @class = this.RoomUsers[i];
  4595. if (@class != null && !@class.IsBot && @class.GetClient() != null && @class.GetClient().GetHabbo() != null && @class.GetClient().GetHabbo().Username.ToLower() == string_10.ToLower())
  4596. {
  4597. result = @class;
  4598. return result;
  4599. }
  4600. }
  4601. result = null;
  4602. return result;
  4603. }
  4604. public RoomUser method_57(string string_10)
  4605. {
  4606. RoomUser result;
  4607. for (int i = 0; i < this.RoomUsers.Length; i++)
  4608. {
  4609. RoomUser @class = this.RoomUsers[i];
  4610. if (@class != null && @class.IsBot && @class.RoomBot.Name.ToLower() == string_10.ToLower())
  4611. {
  4612. result = @class;
  4613. return result;
  4614. }
  4615. }
  4616. result = null;
  4617. return result;
  4618. }
  4619. internal void method_58(ServerMessage Message5_0, List<uint> list_18, uint uint_2)
  4620. {
  4621. List<uint> list = new List<uint>();
  4622. if (list_18 != null)
  4623. {
  4624. if (this.RoomUsers == null)
  4625. {
  4626. return;
  4627. }
  4628. for (int i = 0; i < this.RoomUsers.Length; i++)
  4629. {
  4630. RoomUser @class = this.RoomUsers[i];
  4631. if (@class != null && !@class.IsBot)
  4632. {
  4633. GameClient class2 = @class.GetClient();
  4634. if (class2 != null && class2.GetHabbo().Id != uint_2 && class2.GetHabbo().list_2.Contains(uint_2))
  4635. {
  4636. list.Add(class2.GetHabbo().Id);
  4637. }
  4638. }
  4639. }
  4640. }
  4641. this.SendMessage(Message5_0, list);
  4642. }
  4643. internal void SendMessage(ServerMessage Message5_0, List<uint> list_18)
  4644. {
  4645. try
  4646. {
  4647. if (this.RoomUsers != null)
  4648. {
  4649. byte[] array = Message5_0.GetBytes();
  4650. for (int i = 0; i < this.RoomUsers.Length; i++)
  4651. {
  4652. RoomUser @class = this.RoomUsers[i];
  4653. if (@class != null && !@class.IsBot)
  4654. {
  4655. GameClient class2 = @class.GetClient();
  4656. if (class2 != null && (list_18 == null || !list_18.Contains(class2.GetHabbo().Id)))
  4657. {
  4658. try
  4659. {
  4660. class2.GetConnection().SendData(array);
  4661. }
  4662. catch
  4663. {
  4664. }
  4665. }
  4666. }
  4667. }
  4668. }
  4669. }
  4670. catch (InvalidOperationException)
  4671. {
  4672. }
  4673. }
  4674. internal void method_60(ServerMessage Message5_0, int int_17)
  4675. {
  4676. try
  4677. {
  4678. byte[] array = Message5_0.GetBytes();
  4679. for (int i = 0; i < this.RoomUsers.Length; i++)
  4680. {
  4681. RoomUser @class = this.RoomUsers[i];
  4682. if (@class != null && !@class.IsBot)
  4683. {
  4684. GameClient class2 = @class.GetClient();
  4685. if (class2 != null && class2.GetHabbo() != null && (ulong)class2.GetHabbo().Rank >= (ulong)((long)int_17))
  4686. {
  4687. try
  4688. {
  4689. class2.GetConnection().SendData(array);
  4690. }
  4691. catch
  4692. {
  4693. }
  4694. }
  4695. }
  4696. }
  4697. }
  4698. catch (InvalidOperationException)
  4699. {
  4700. }
  4701. }
  4702. public void method_61(ServerMessage Message5_0)
  4703. {
  4704. try
  4705. {
  4706. byte[] array = Message5_0.GetBytes();
  4707. for (int i = 0; i < this.RoomUsers.Length; i++)
  4708. {
  4709. RoomUser @class = this.RoomUsers[i];
  4710. if (@class != null && !@class.IsBot)
  4711. {
  4712. GameClient class2 = @class.GetClient();
  4713. if (class2 != null && this.method_26(class2))
  4714. {
  4715. try
  4716. {
  4717. class2.GetConnection().SendData(array);
  4718. }
  4719. catch
  4720. {
  4721. }
  4722. }
  4723. }
  4724. }
  4725. }
  4726. catch (InvalidOperationException)
  4727. {
  4728. }
  4729. }
  4730. public void method_62()
  4731. {
  4732. this.SendMessage(new ServerMessage(18u), null);
  4733. this.method_63();
  4734. }
  4735. public void method_63()
  4736. {
  4737. this.method_66(true);
  4738. GC.SuppressFinalize(this);
  4739. }
  4740. internal void method_64()
  4741. {
  4742. StringBuilder stringBuilder = new StringBuilder();
  4743. Dictionary<uint, bool> dictionary = new Dictionary<uint, bool>();
  4744. try
  4745. {
  4746. try
  4747. {
  4748. using (DatabaseClient @class = HighSoft.GetDatabase().GetClient())
  4749. {
  4750. if (this.list_14.Count > 0)
  4751. {
  4752. lock (this.list_14)
  4753. {
  4754. foreach (RoomItem class2 in this.list_14)
  4755. {
  4756. try
  4757. {
  4758. if (!dictionary.ContainsKey(class2.uint_0))
  4759. {
  4760. @class.AddParamWithValue(class2.uint_0 + "Extra1", class2.string_2);
  4761. @class.AddParamWithValue(class2.uint_0 + "Extra2", class2.string_3);
  4762. @class.AddParamWithValue(class2.uint_0 + "Extra3", class2.string_4);
  4763. @class.AddParamWithValue(class2.uint_0 + "Extra4", class2.string_5);
  4764. @class.AddParamWithValue(class2.uint_0 + "Extra5", class2.string_6);
  4765. stringBuilder.Append(string.Concat(new object[]
  4766. {
  4767. "DELETE FROM wired_items WHERE item_id = '",
  4768. class2.uint_0,
  4769. "' LIMIT 1; INSERT INTO wired_items (item_id,extra1,extra2,extra3,extra4,extra5) VALUES ('",
  4770. class2.uint_0,
  4771. "',@",
  4772. class2.uint_0,
  4773. "Extra1,@",
  4774. class2.uint_0,
  4775. "Extra2,@",
  4776. class2.uint_0,
  4777. "Extra3,@",
  4778. class2.uint_0,
  4779. "Extra4,@",
  4780. class2.uint_0,
  4781. "Extra5); "
  4782. }));
  4783. }
  4784. dictionary.Add(class2.uint_0, true);
  4785.  
  4786. }
  4787. catch
  4788. {
  4789. }
  4790. }
  4791. }
  4792. }
  4793. if (this.list_15.Count > 0)
  4794. {
  4795. lock (this.list_15)
  4796. {
  4797. foreach (RoomItem class2 in this.list_15)
  4798. {
  4799. try
  4800. {
  4801. if (!dictionary.ContainsKey(class2.uint_0))
  4802. {
  4803. @class.AddParamWithValue(class2.uint_0 + "Extra1", class2.string_2);
  4804. @class.AddParamWithValue(class2.uint_0 + "Extra2", class2.string_3);
  4805. @class.AddParamWithValue(class2.uint_0 + "Extra3", class2.string_4);
  4806. @class.AddParamWithValue(class2.uint_0 + "Extra4", class2.string_5);
  4807. @class.AddParamWithValue(class2.uint_0 + "Extra5", class2.string_6);
  4808. stringBuilder.Append(string.Concat(new object[]
  4809. {
  4810. "DELETE FROM wired_items WHERE item_id = '",
  4811. class2.uint_0,
  4812. "' LIMIT 1; INSERT INTO wired_items (item_id,extra1,extra2,extra3,extra4,extra5) VALUES ('",
  4813. class2.uint_0,
  4814. "',@",
  4815. class2.uint_0,
  4816. "Extra1,@",
  4817. class2.uint_0,
  4818. "Extra2,@",
  4819. class2.uint_0,
  4820. "Extra3,@",
  4821. class2.uint_0,
  4822. "Extra4,@",
  4823. class2.uint_0,
  4824. "Extra5); "
  4825. }));
  4826. }
  4827. dictionary.Add(class2.uint_0, true);
  4828. }
  4829.  
  4830. catch
  4831. {
  4832. }
  4833. }
  4834. }
  4835. }
  4836. if (this.list_16.Count > 0)
  4837. {
  4838. lock (this.list_16)
  4839. {
  4840. foreach (RoomItem class2 in this.list_16)
  4841. {
  4842. try
  4843. {
  4844. if (!dictionary.ContainsKey(class2.uint_0))
  4845. {
  4846. @class.AddParamWithValue(class2.uint_0 + "Extra1", class2.string_2);
  4847. @class.AddParamWithValue(class2.uint_0 + "Extra2", class2.string_3);
  4848. @class.AddParamWithValue(class2.uint_0 + "Extra3", class2.string_4);
  4849. @class.AddParamWithValue(class2.uint_0 + "Extra4", class2.string_5);
  4850. @class.AddParamWithValue(class2.uint_0 + "Extra5", class2.string_6);
  4851. stringBuilder.Append(string.Concat(new object[]
  4852. {
  4853. "DELETE FROM wired_items WHERE item_id = '",
  4854. class2.uint_0,
  4855. "' LIMIT 1; INSERT INTO wired_items (item_id,extra1,extra2,extra3,extra4,extra5) VALUES ('",
  4856. class2.uint_0,
  4857. "',@",
  4858. class2.uint_0,
  4859. "Extra1,@",
  4860. class2.uint_0,
  4861. "Extra2,@",
  4862. class2.uint_0,
  4863. "Extra3,@",
  4864. class2.uint_0,
  4865. "Extra4,@",
  4866. class2.uint_0,
  4867. "Extra5); "
  4868. }));
  4869. }
  4870. dictionary.Add(class2.uint_0, true);
  4871. }
  4872.  
  4873. catch
  4874. {
  4875. }
  4876. }
  4877. }
  4878. }
  4879. if (stringBuilder.Length > 0)
  4880. {
  4881. @class.ExecuteQuery(stringBuilder.ToString());
  4882. }
  4883. dictionary.Clear();
  4884. }
  4885. }
  4886. catch (Exception ex)
  4887. {
  4888. Logging.LogCriticalException(string.Concat(new object[]
  4889. {
  4890. "Error during saving wired items for room ",
  4891. this.Id,
  4892. ". Stack: ",
  4893. ex.ToString(),
  4894. "\rQuery: ",
  4895. stringBuilder.ToString()
  4896. }));
  4897. }
  4898. if (this.hashtable_3.Count > 0 || this.hashtable_1.Count > 0 || this.hashtable_2.Count > 0 || this.Boolean_4)
  4899. {
  4900. using (DatabaseClient @class = HighSoft.GetDatabase().GetClient())
  4901. {
  4902. stringBuilder.Clear();
  4903. lock (this.hashtable_1)
  4904. {
  4905. foreach (RoomItem class2 in this.hashtable_1.Values)
  4906. {
  4907. stringBuilder.Append(string.Concat(new object[]
  4908. {
  4909. "UPDATE items SET room_id = '0' WHERE Id = '",
  4910. class2.uint_0,
  4911. "' AND room_id = '",
  4912. this.Id,
  4913. "' LIMIT 1; "
  4914. }));
  4915. }
  4916. }
  4917. this.hashtable_1.Clear();
  4918. lock (this.hashtable_3)
  4919. {
  4920. if (this.hashtable_3.Count > 0)
  4921. {
  4922. int num = 0;
  4923. int num2 = 0;
  4924. foreach (RoomItem class2 in this.hashtable_3.Values)
  4925. {
  4926. if (class2.Boolean_2)
  4927. {
  4928. num2++;
  4929. }
  4930. else
  4931. {
  4932. num++;
  4933. }
  4934. }
  4935. if (num2 > 0)
  4936. {
  4937. foreach (RoomItem class2 in this.hashtable_3.Values)
  4938. {
  4939. if (class2.Boolean_2)
  4940. {
  4941. stringBuilder.Append(string.Concat(new object[]
  4942. {
  4943. "UPDATE items SET room_id = '",
  4944. this.Id,
  4945. "', base_item = '",
  4946. class2.uint_2,
  4947. "', x = '",
  4948. class2.Int32_0,
  4949. "', y = '",
  4950. class2.Int32_1,
  4951. "', z = '",
  4952. class2.Double_0.ToString().Replace(",", "."),
  4953. "', rot = '",
  4954. class2.int_3,
  4955. "', wall_pos = '' WHERE Id = '",
  4956. class2.uint_0,
  4957. "' LIMIT 1; "
  4958. }));
  4959.  
  4960. if (!string.IsNullOrEmpty(class2.ExtraData))
  4961. {
  4962. @class.AddParamWithValue("extra_data" + class2.uint_0, class2.ExtraData);
  4963. stringBuilder.Append(string.Concat(new object[]
  4964. {
  4965. "DELETE FROM items_extra_data WHERE item_id = '" + class2.uint_0 + "'; ",
  4966. "INSERT INTO items_extra_data (item_id,extra_data) VALUES ('" + class2.uint_0 + "' , @extra_data" + class2.uint_0 + "); ",
  4967. }));
  4968. }
  4969. else
  4970. {
  4971. stringBuilder.Append(string.Concat(new object[]
  4972. {
  4973. "DELETE FROM items_extra_data WHERE item_id = '" + class2.uint_0 + "'; "
  4974. }));
  4975. }
  4976. }
  4977. }
  4978. }
  4979. if (num > 0)
  4980. {
  4981. foreach (RoomItem class2 in this.hashtable_3.Values)
  4982. {
  4983. if (class2.Boolean_1)
  4984. {
  4985. @class.AddParamWithValue("pos" + class2.uint_0, class2.string_7);
  4986. stringBuilder.Append(string.Concat(new object[]
  4987. {
  4988. "UPDATE items SET room_id = '",
  4989. this.Id,
  4990. "', base_item = '",
  4991. class2.uint_2,
  4992. "', x = '0', y = '0', z = '0', rot = '0', wall_pos = @pos",
  4993. class2.uint_0,
  4994. " WHERE Id = '",
  4995. class2.uint_0,
  4996. "' LIMIT 1; "
  4997. }));
  4998.  
  4999. if (!string.IsNullOrEmpty(class2.ExtraData))
  5000. {
  5001. @class.AddParamWithValue("extra_data" + class2.uint_0, class2.ExtraData);
  5002. stringBuilder.Append(string.Concat(new object[]
  5003. {
  5004. "DELETE FROM items_extra_data WHERE item_id = '" + class2.uint_0 + "'; ",
  5005. "INSERT INTO items_extra_data (item_id,extra_data) VALUES ('" + class2.uint_0 + "' , @extra_data" + class2.uint_0 + "); ",
  5006. }));
  5007. }
  5008. else
  5009. {
  5010. stringBuilder.Append(string.Concat(new object[]
  5011. {
  5012. "DELETE FROM items_extra_data WHERE item_id = '" + class2.uint_0 + "'; "
  5013. }));
  5014. }
  5015. }
  5016. }
  5017. }
  5018. }
  5019. }
  5020. this.hashtable_3.Clear();
  5021. lock (this.hashtable_2)
  5022. {
  5023. foreach (RoomItem class2 in this.hashtable_2.Values)
  5024. {
  5025. stringBuilder.Append(string.Concat(new object[]
  5026. {
  5027. "UPDATE items SET x = '",
  5028. class2.Int32_0,
  5029. "', y = '",
  5030. class2.Int32_1,
  5031. "', z = '",
  5032. class2.Double_0.ToString().Replace(",", "."),
  5033. "', rot = '",
  5034. class2.int_3,
  5035. "', wall_pos = '",
  5036. class2.string_7,
  5037. "' WHERE Id = '",
  5038. class2.uint_0,
  5039. "' LIMIT 1; "
  5040. }));
  5041.  
  5042. if (!string.IsNullOrEmpty(class2.ExtraData))
  5043. {
  5044. @class.AddParamWithValue("mextra_data" + class2.uint_0, class2.ExtraData);
  5045. stringBuilder.Append(string.Concat(new object[]
  5046. {
  5047. "DELETE FROM items_extra_data WHERE item_id = '" + class2.uint_0 + "'; ",
  5048. "INSERT INTO items_extra_data (item_id,extra_data) VALUES ('" + class2.uint_0 + "' , @mextra_data" + class2.uint_0 + "); ",
  5049. }));
  5050. }
  5051. else
  5052. {
  5053. stringBuilder.Append(string.Concat(new object[]
  5054. {
  5055. "DELETE FROM items_extra_data WHERE item_id = '" + class2.uint_0 + "'; "
  5056. }));
  5057. }
  5058. }
  5059. }
  5060. this.hashtable_2.Clear();
  5061. lock (this.GetPets())
  5062. {
  5063. foreach (Pet current in this.GetPets())
  5064. {
  5065. if (current.DBState == DatabaseUpdateState.NeedsInsert)
  5066. {
  5067. @class.AddParamWithValue("petname" + current.PetId, current.Name);
  5068. @class.AddParamWithValue("petcolor" + current.PetId, current.Color);
  5069. @class.AddParamWithValue("petrace" + current.PetId, current.Race);
  5070. stringBuilder.Append(string.Concat(new object[]
  5071. {
  5072. "INSERT INTO `user_pets` VALUES ('",
  5073. current.PetId,
  5074. "', '",
  5075. current.OwnerId,
  5076. "', '",
  5077. current.RoomId,
  5078. "', @petname",
  5079. current.PetId,
  5080. ", @petrace",
  5081. current.PetId,
  5082. ", @petcolor",
  5083. current.PetId,
  5084. ", '",
  5085. current.Type,
  5086. "', '",
  5087. current.Expirience,
  5088. "', '",
  5089. current.Energy,
  5090. "', '",
  5091. current.Nutrition,
  5092. "', '",
  5093. current.Respect,
  5094. "', '",
  5095. current.CreationStamp,
  5096. "', '",
  5097. current.X,
  5098. "', '",
  5099. current.Y,
  5100. "', '",
  5101. current.Z,
  5102. "'); "
  5103. }));
  5104. }
  5105. else
  5106. {
  5107. if (current.DBState == DatabaseUpdateState.NeedsUpdate)
  5108. {
  5109. stringBuilder.Append(string.Concat(new object[]
  5110. {
  5111. "UPDATE user_pets SET room_id = '",
  5112. current.RoomId,
  5113. "', expirience = '",
  5114. current.Expirience,
  5115. "', energy = '",
  5116. current.Energy,
  5117. "', nutrition = '",
  5118. current.Nutrition,
  5119. "', respect = '",
  5120. current.Respect,
  5121. "', x = '",
  5122. current.X,
  5123. "', y = '",
  5124. current.Y,
  5125. "', z = '",
  5126. current.Z.ToString().Replace(",", "."),
  5127. "' WHERE Id = '",
  5128. current.PetId,
  5129. "' LIMIT 1; "
  5130. }));
  5131. }
  5132. }
  5133. current.DBState = DatabaseUpdateState.Updated;
  5134. }
  5135. }
  5136. if (stringBuilder.Length > 0)
  5137. {
  5138. @class.ExecuteQuery(stringBuilder.ToString());
  5139. }
  5140. }
  5141. }
  5142. }
  5143. catch (Exception ex)
  5144. {
  5145. Logging.LogCriticalException(string.Concat(new object[]
  5146. {
  5147. "Error during saving furniture for room ",
  5148. this.Id,
  5149. ". Stack: ",
  5150. ex.ToString(),
  5151. "\r Query: ",
  5152. stringBuilder.ToString()
  5153. }));
  5154. }
  5155. }
  5156. internal void method_65(DatabaseClient class6_0)
  5157. {
  5158. try
  5159. {
  5160. Dictionary<uint, bool> dictionary = new Dictionary<uint, bool>();
  5161. StringBuilder stringBuilder = new StringBuilder();
  5162. if (this.list_14.Count > 0)
  5163. {
  5164. foreach (RoomItem @class in this.list_14)
  5165. {
  5166.  
  5167. try
  5168. {
  5169. if (!dictionary.ContainsKey(@class.uint_0))
  5170. {
  5171.  
  5172. class6_0.AddParamWithValue(@class.uint_0 + "Extra1", @class.string_2);
  5173. class6_0.AddParamWithValue(@class.uint_0 + "Extra2", @class.string_3);
  5174. class6_0.AddParamWithValue(@class.uint_0 + "Extra3", @class.string_4);
  5175. class6_0.AddParamWithValue(@class.uint_0 + "Extra4", @class.string_5);
  5176. class6_0.AddParamWithValue(@class.uint_0 + "Extra5", @class.string_6);
  5177. stringBuilder.Append(string.Concat(new object[]
  5178. {
  5179. "DELETE FROM wired_items WHERE item_id = '",
  5180. @class.uint_0,
  5181. "' LIMIT 1; INSERT INTO wired_items (item_id,extra1,extra2,extra3,extra4,extra5) VALUES ('",
  5182. @class.uint_0,
  5183. "',@",
  5184. @class.uint_0,
  5185. "Extra1,@",
  5186. @class.uint_0,
  5187. "Extra2,@",
  5188. @class.uint_0,
  5189. "Extra3,@",
  5190. @class.uint_0,
  5191. "Extra4,@",
  5192. @class.uint_0,
  5193. "Extra5); "
  5194. }));
  5195. }
  5196. dictionary.Add(@class.uint_0, true);
  5197.  
  5198. }
  5199. catch
  5200. {
  5201. }
  5202. }
  5203.  
  5204. }
  5205. if (this.list_15.Count > 0)
  5206. {
  5207. foreach (RoomItem @class in this.list_15)
  5208. {
  5209.  
  5210. try
  5211. {
  5212. if (!dictionary.ContainsKey(@class.uint_0))
  5213. {
  5214.  
  5215. class6_0.AddParamWithValue(@class.uint_0 + "Extra1", @class.string_2);
  5216. class6_0.AddParamWithValue(@class.uint_0 + "Extra2", @class.string_3);
  5217. class6_0.AddParamWithValue(@class.uint_0 + "Extra3", @class.string_4);
  5218. class6_0.AddParamWithValue(@class.uint_0 + "Extra4", @class.string_5);
  5219. class6_0.AddParamWithValue(@class.uint_0 + "Extra5", @class.string_6);
  5220. stringBuilder.Append(string.Concat(new object[]
  5221. {
  5222. "DELETE FROM wired_items WHERE item_id = '",
  5223. @class.uint_0,
  5224. "' LIMIT 1; INSERT INTO wired_items (item_id,extra1,extra2,extra3,extra4,extra5) VALUES ('",
  5225. @class.uint_0,
  5226. "',@",
  5227. @class.uint_0,
  5228. "Extra1,@",
  5229. @class.uint_0,
  5230. "Extra2,@",
  5231. @class.uint_0,
  5232. "Extra3,@",
  5233. @class.uint_0,
  5234. "Extra4,@",
  5235. @class.uint_0,
  5236. "Extra5); "
  5237. }));
  5238. }
  5239. dictionary.Add(@class.uint_0, true);
  5240.  
  5241. }
  5242. catch
  5243. {
  5244. }
  5245.  
  5246. }
  5247. }
  5248. if (this.list_16.Count > 0)
  5249. {
  5250. foreach (RoomItem @class in this.list_16)
  5251. {
  5252.  
  5253. try
  5254. {
  5255. if (!dictionary.ContainsKey(@class.uint_0))
  5256. {
  5257.  
  5258. class6_0.AddParamWithValue(@class.uint_0 + "Extra1", @class.string_2);
  5259. class6_0.AddParamWithValue(@class.uint_0 + "Extra2", @class.string_3);
  5260. class6_0.AddParamWithValue(@class.uint_0 + "Extra3", @class.string_4);
  5261. class6_0.AddParamWithValue(@class.uint_0 + "Extra4", @class.string_5);
  5262. class6_0.AddParamWithValue(@class.uint_0 + "Extra5", @class.string_6);
  5263. stringBuilder.Append(string.Concat(new object[]
  5264. {
  5265. "DELETE FROM wired_items WHERE item_id = '",
  5266. @class.uint_0,
  5267. "' LIMIT 1; INSERT INTO wired_items (item_id,extra1,extra2,extra3,extra4,extra5) VALUES ('",
  5268. @class.uint_0,
  5269. "',@",
  5270. @class.uint_0,
  5271. "Extra1,@",
  5272. @class.uint_0,
  5273. "Extra2,@",
  5274. @class.uint_0,
  5275. "Extra3,@",
  5276. @class.uint_0,
  5277. "Extra4,@",
  5278. @class.uint_0,
  5279. "Extra5); "
  5280. }));
  5281. }
  5282. dictionary.Add(@class.uint_0, true);
  5283. }
  5284.  
  5285. catch
  5286. {
  5287. }
  5288. }
  5289.  
  5290. }
  5291. dictionary.Clear();
  5292. if (this.hashtable_3.Count > 0 || this.hashtable_1.Count > 0 || this.hashtable_2.Count > 0 || this.Boolean_4)
  5293. {
  5294. foreach (RoomItem @class in this.hashtable_1.Values)
  5295. {
  5296. stringBuilder.Append(string.Concat(new object[]
  5297. {
  5298. "UPDATE items SET room_id = 0 WHERE Id = '",
  5299. @class.uint_0,
  5300. "' AND room_id = '",
  5301. this.Id,
  5302. "' LIMIT 1; "
  5303. }));
  5304. }
  5305. this.hashtable_1.Clear();
  5306. IEnumerator enumerator2;
  5307. if (this.hashtable_3.Count > 0)
  5308. {
  5309. enumerator2 = this.hashtable_3.Values.GetEnumerator();
  5310. try
  5311. {
  5312. while (enumerator2.MoveNext())
  5313. {
  5314. RoomItem @class = (RoomItem)enumerator2.Current;
  5315. stringBuilder.Append("UPDATE items SET room_id = 0 WHERE Id = '" + @class.uint_0 + "' LIMIT 1; ");
  5316. }
  5317. }
  5318. finally
  5319. {
  5320. IDisposable disposable = enumerator2 as IDisposable;
  5321. if (disposable != null)
  5322. {
  5323. disposable.Dispose();
  5324. }
  5325. }
  5326. int num = 0;
  5327. int num2 = 0;
  5328. enumerator2 = this.hashtable_3.Values.GetEnumerator();
  5329. try
  5330. {
  5331. while (enumerator2.MoveNext())
  5332. {
  5333. RoomItem @class = (RoomItem)enumerator2.Current;
  5334. if (@class.Boolean_2)
  5335. {
  5336. num2++;
  5337. }
  5338. else
  5339. {
  5340. num++;
  5341. }
  5342. }
  5343. }
  5344. finally
  5345. {
  5346. IDisposable disposable = enumerator2 as IDisposable;
  5347. if (disposable != null)
  5348. {
  5349. disposable.Dispose();
  5350. }
  5351. }
  5352. if (num2 > 0)
  5353. {
  5354. enumerator2 = this.hashtable_3.Values.GetEnumerator();
  5355. try
  5356. {
  5357. while (enumerator2.MoveNext())
  5358. {
  5359. RoomItem @class = (RoomItem)enumerator2.Current;
  5360. if (@class.Boolean_2)
  5361. {
  5362. stringBuilder.Append(string.Concat(new object[]
  5363. {
  5364. "UPDATE items SET room_id = '",
  5365. this.Id,
  5366. "', base_item = '",
  5367. @class.uint_2,
  5368. ", x = '",
  5369. @class.Int32_0,
  5370. "', y = '",
  5371. @class.Int32_1,
  5372. "', z = '",
  5373. @class.Double_0.ToString().Replace(",", "."),
  5374. "', rot = '",
  5375. @class.int_3,
  5376. "', wall_pos = '' WHERE Id = '",
  5377. @class.uint_0,
  5378. "' LIMIT 1; "
  5379. }));
  5380.  
  5381. if (!string.IsNullOrEmpty(@class.ExtraData))
  5382. {
  5383. class6_0.AddParamWithValue("extra_data" + @class.uint_0, @class.ExtraData);
  5384. stringBuilder.Append(string.Concat(new object[]
  5385. {
  5386. "DELETE FROM items_extra_data WHERE item_id = '" + @class.uint_0 + "'; ",
  5387. "INSERT INTO items_extra_data (item_id,extra_data) VALUES ('" + @class.uint_0 + "' , @extra_data" + @class.uint_0 + "); ",
  5388. }));
  5389. }
  5390. else
  5391. {
  5392. stringBuilder.Append(string.Concat(new object[]
  5393. {
  5394. "DELETE FROM items_extra_data WHERE item_id = '" + @class.uint_0 + "'; "
  5395. }));
  5396. }
  5397. }
  5398. }
  5399. }
  5400. finally
  5401. {
  5402. IDisposable disposable = enumerator2 as IDisposable;
  5403. if (disposable != null)
  5404. {
  5405. disposable.Dispose();
  5406. }
  5407. }
  5408. }
  5409. if (num > 0)
  5410. {
  5411. enumerator2 = this.hashtable_3.Values.GetEnumerator();
  5412. try
  5413. {
  5414. while (enumerator2.MoveNext())
  5415. {
  5416. RoomItem @class = (RoomItem)enumerator2.Current;
  5417. if (@class.Boolean_1)
  5418. {
  5419. class6_0.AddParamWithValue("pos" + @class.uint_0, @class.string_7);
  5420. stringBuilder.Append(string.Concat(new object[]
  5421. {
  5422. "UPDATE items SET room_id = '",
  5423. this.Id,
  5424. "', base_item = '",
  5425. @class.uint_2,
  5426. ", x = '0', y = '0', z = '0', rot = '0', wall_pos = @pos",
  5427. @class.uint_0,
  5428. " WHERE Id = '",
  5429. @class.uint_0,
  5430. "' LIMIT 1; "
  5431. }));
  5432.  
  5433. if (!string.IsNullOrEmpty(@class.ExtraData))
  5434. {
  5435. class6_0.AddParamWithValue("extra_data" + @class.uint_0, @class.ExtraData);
  5436. stringBuilder.Append(string.Concat(new object[]
  5437. {
  5438. "DELETE FROM items_extra_data WHERE item_id = '" + @class.uint_0 + "'; ",
  5439. "INSERT INTO items_extra_data (item_id,extra_data) VALUES ('" + @class.uint_0 + "' , @extra_data" + @class.uint_0 + "); ",
  5440. }));
  5441. }
  5442. else
  5443. {
  5444. stringBuilder.Append(string.Concat(new object[]
  5445. {
  5446. "DELETE FROM items_extra_data WHERE item_id = '" + @class.uint_0 + "'; "
  5447. }));
  5448. }
  5449. }
  5450. }
  5451. }
  5452. finally
  5453. {
  5454. IDisposable disposable = enumerator2 as IDisposable;
  5455. if (disposable != null)
  5456. {
  5457. disposable.Dispose();
  5458. }
  5459. }
  5460. }
  5461. this.hashtable_3.Clear();
  5462. }
  5463. enumerator2 = this.hashtable_2.Values.GetEnumerator();
  5464. try
  5465. {
  5466. while (enumerator2.MoveNext())
  5467. {
  5468. RoomItem @class = (RoomItem)enumerator2.Current;
  5469. stringBuilder.Append(string.Concat(new object[]
  5470. {
  5471. "UPDATE items SET x = '",
  5472. @class.Int32_0,
  5473. "', y = '",
  5474. @class.Int32_1,
  5475. "', z = '",
  5476. @class.Double_0.ToString().Replace(",", "."),
  5477. "', rot = '",
  5478. @class.int_3,
  5479. "', wall_pos = '' WHERE Id = '",
  5480. @class.uint_0,
  5481. "' LIMIT 1; "
  5482. }));
  5483. }
  5484. }
  5485. finally
  5486. {
  5487. IDisposable disposable = enumerator2 as IDisposable;
  5488. if (disposable != null)
  5489. {
  5490. disposable.Dispose();
  5491. }
  5492. }
  5493. this.hashtable_2.Clear();
  5494. foreach (Pet current in this.GetPets())
  5495. {
  5496. if (current.DBState == DatabaseUpdateState.NeedsInsert)
  5497. {
  5498. class6_0.AddParamWithValue("petname" + current.PetId, current.Name);
  5499. class6_0.AddParamWithValue("petcolor" + current.PetId, current.Color);
  5500. class6_0.AddParamWithValue("petrace" + current.PetId, current.Race);
  5501. stringBuilder.Append(string.Concat(new object[]
  5502. {
  5503. "INSERT INTO `user_pets` VALUES ('",
  5504. current.PetId,
  5505. "', '",
  5506. current.OwnerId,
  5507. "', '",
  5508. current.RoomId,
  5509. "', @petname",
  5510. current.PetId,
  5511. ", @petrace",
  5512. current.PetId,
  5513. ", @petcolor",
  5514. current.PetId,
  5515. ", '",
  5516. current.Type,
  5517. "', '",
  5518. current.Expirience,
  5519. "', '",
  5520. current.Energy,
  5521. "', '",
  5522. current.Nutrition,
  5523. "', '",
  5524. current.Respect,
  5525. "', '",
  5526. current.CreationStamp,
  5527. "', '",
  5528. current.X,
  5529. "', '",
  5530. current.Y,
  5531. "', '",
  5532. current.Z,
  5533. "');"
  5534. }));
  5535. }
  5536. else
  5537. {
  5538. if (current.DBState == DatabaseUpdateState.NeedsUpdate)
  5539. {
  5540. stringBuilder.Append(string.Concat(new object[]
  5541. {
  5542. "UPDATE user_pets SET room_id = '",
  5543. current.RoomId,
  5544. "', expirience = '",
  5545. current.Expirience,
  5546. "', energy = '",
  5547. current.Energy,
  5548. "', nutrition = '",
  5549. current.Nutrition,
  5550. "', respect = '",
  5551. current.Respect,
  5552. "', x = '",
  5553. current.X,
  5554. "', y = '",
  5555. current.Y,
  5556. "', z = '",
  5557. current.Z,
  5558. "' WHERE Id = '",
  5559. current.PetId,
  5560. "' LIMIT 1; "
  5561. }));
  5562. }
  5563. }
  5564. current.DBState = DatabaseUpdateState.Updated;
  5565. }
  5566. }
  5567. if (stringBuilder.Length > 0)
  5568. {
  5569. class6_0.ExecuteQuery(stringBuilder.ToString());
  5570. }
  5571. }
  5572. catch (Exception ex)
  5573. {
  5574. Logging.LogCriticalException(string.Concat(new object[]
  5575. {
  5576. "Error during saving furniture for room ",
  5577. this.Id,
  5578. ". Stack: ",
  5579. ex.ToString()
  5580. }));
  5581. }
  5582. }
  5583. private void method_66(bool bool_13)
  5584. {
  5585. if (!this.bool_12)
  5586. {
  5587. this.bool_12 = true;
  5588. if (bool_13)
  5589. {
  5590. this.bool_11 = false;
  5591. if (this.timer_0 != null)
  5592. {
  5593. this.bool_6 = true;
  5594. this.timer_0.Change(-1, -1);
  5595. }
  5596. this.bool_6 = true;
  5597. this.method_64();
  5598. using (DatabaseClient @class = HighSoft.GetDatabase().GetClient())
  5599. {
  5600. @class.ExecuteQuery(string.Concat(new object[]
  5601. {
  5602. "UPDATE user_pets SET room_id = 0 WHERE room_id = ",
  5603. this.Id,
  5604. " AND NOT user_id = ",
  5605. HighSoft.GetGame().GetClientManager().method_27(this.Owner)
  5606. }));
  5607. }
  5608. //this.timer_0.Dispose();
  5609. this.timer_0 = null;
  5610. this.bool_9 = false;
  5611. if (this.Tags != null)
  5612. {
  5613. this.Tags.Clear();
  5614. }
  5615. this.Tags = null;
  5616. if (this.RoomUsers != null)
  5617. {
  5618. Array.Clear(this.RoomUsers, 0, this.RoomUsers.Length);
  5619. }
  5620. this.RoomUsers = null;
  5621. this.RoomIcon = null;
  5622. if (this.UsersWithRights != null)
  5623. {
  5624. this.UsersWithRights.Clear();
  5625. }
  5626. this.RoomIcon = null;
  5627. if (this.dictionary_0 != null)
  5628. {
  5629. this.dictionary_0.Clear();
  5630. }
  5631. this.dictionary_0 = null;
  5632. this.Wallpaper = null;
  5633. this.Floor = null;
  5634. this.Landscape = null;
  5635. if (this.hashtable_0 != null)
  5636. {
  5637. this.hashtable_0.Clear();
  5638. }
  5639. this.hashtable_0 = null;
  5640. if (this.hashtable_4 != null)
  5641. {
  5642. this.hashtable_4.Clear();
  5643. }
  5644. this.hashtable_4 = null;
  5645. this.MoodlightData = null;
  5646. if (this.list_2 != null)
  5647. {
  5648. this.list_2.Clear();
  5649. }
  5650. this.list_2 = null;
  5651. if (this.MusicController != null)
  5652. {
  5653. this.MusicController.UnLinkRoomOutputItem();
  5654. }
  5655. this.MusicController = null;
  5656. if (this.InfobusAnswers != null)
  5657. {
  5658. this.InfobusAnswers.Clear();
  5659. }
  5660. this.InfobusAnswers = null;
  5661. }
  5662. }
  5663. }
  5664. public ServerMessage method_67(bool bool_13)
  5665. {
  5666. List<RoomUser> list = new List<RoomUser>();
  5667. for (int i = 0; i < this.RoomUsers.Length; i++)
  5668. {
  5669. RoomUser @class = this.RoomUsers[i];
  5670. if (@class != null)
  5671. {
  5672. if (!bool_13)
  5673. {
  5674. if (!@class.UpdateNeeded)
  5675. {
  5676. goto IL_35;
  5677. }
  5678. @class.UpdateNeeded = false;
  5679. }
  5680. list.Add(@class);
  5681. }
  5682. IL_35: ;
  5683. }
  5684. ServerMessage result;
  5685. if (list.Count == 0)
  5686. {
  5687. result = null;
  5688. }
  5689. else
  5690. {
  5691. ServerMessage Message = new ServerMessage(34u);
  5692. Message.AppendInt32(list.Count);
  5693. foreach (RoomUser @class in list)
  5694. {
  5695. @class.method_15(Message);
  5696. }
  5697. result = Message;
  5698. }
  5699. return result;
  5700. }
  5701. public bool method_68(uint uint_2)
  5702. {
  5703. return this.dictionary_0.ContainsKey(uint_2);
  5704. }
  5705. public void method_69(uint uint_2)
  5706. {
  5707. this.dictionary_0.Remove(uint_2);
  5708. }
  5709. public void method_70(uint uint_2)
  5710. {
  5711. this.dictionary_0.Add(uint_2, HighSoft.GetUnixTimestamp());
  5712. }
  5713. public bool method_71(uint uint_2)
  5714. {
  5715. bool result;
  5716. if (!this.method_68(uint_2))
  5717. {
  5718. result = true;
  5719. }
  5720. else
  5721. {
  5722. double num = HighSoft.GetUnixTimestamp() - this.dictionary_0[uint_2];
  5723. result = (num > 900.0);
  5724. }
  5725. return result;
  5726. }
  5727. public int method_72(string string_10)
  5728. {
  5729. int num = 0;
  5730. foreach (RoomItem @class in this.Hashtable_1.Values)
  5731. {
  5732. if (@class.GetBaseItem().InteractionType.ToLower() == string_10.ToLower())
  5733. {
  5734. num++;
  5735. }
  5736. }
  5737. foreach (RoomItem @class in this.Hashtable_0.Values)
  5738. {
  5739. if (@class.GetBaseItem().InteractionType.ToLower() == string_10.ToLower())
  5740. {
  5741. num++;
  5742. }
  5743. }
  5744. return num;
  5745. }
  5746. public bool method_73(RoomUser RoomUser_1)
  5747. {
  5748. return !RoomUser_1.IsBot && this.method_74(RoomUser_1.GetClient().GetHabbo().Id);
  5749. }
  5750. public bool method_74(uint uint_2)
  5751. {
  5752. bool result;
  5753. using (TimedLock.Lock(this.list_2))
  5754. {
  5755. foreach (Trade current in this.list_2)
  5756. {
  5757. if (current.method_0(uint_2))
  5758. {
  5759. result = true;
  5760. return result;
  5761. }
  5762. }
  5763. }
  5764. result = false;
  5765. return result;
  5766. }
  5767. public Trade method_75(RoomUser RoomUser_1)
  5768. {
  5769. Trade result;
  5770. if (RoomUser_1.IsBot)
  5771. {
  5772. result = null;
  5773. }
  5774. else
  5775. {
  5776. result = this.method_76(RoomUser_1.GetClient().GetHabbo().Id);
  5777. }
  5778. return result;
  5779. }
  5780. public Trade method_76(uint uint_2)
  5781. {
  5782. Trade result;
  5783. using (TimedLock.Lock(this.list_2))
  5784. {
  5785. foreach (Trade current in this.list_2)
  5786. {
  5787. if (current.method_0(uint_2))
  5788. {
  5789. result = current;
  5790. return result;
  5791. }
  5792. }
  5793. }
  5794. result = null;
  5795. return result;
  5796. }
  5797. public void method_77(RoomUser RoomUser_1, RoomUser RoomUser_2)
  5798. {
  5799. if (RoomUser_1 != null && RoomUser_2 != null && (!RoomUser_1.IsBot || RoomUser_1.RoomBot.Boolean_1) && (!RoomUser_2.IsBot || RoomUser_2.RoomBot.Boolean_1) && !RoomUser_1.Boolean_3 && !RoomUser_2.Boolean_3 && !this.method_73(RoomUser_1) && !this.method_73(RoomUser_2))
  5800. {
  5801. this.list_2.Add(new Trade(RoomUser_1.GetClient().GetHabbo().Id, RoomUser_2.GetClient().GetHabbo().Id, this.Id));
  5802. }
  5803. }
  5804. public void method_78(uint uint_2)
  5805. {
  5806. Trade @class = this.method_76(uint_2);
  5807. if (@class != null)
  5808. {
  5809. @class.method_12(uint_2);
  5810. this.list_2.Remove(@class);
  5811. }
  5812. }
  5813. public bool method_79(GameClient Session, RoomItem RoomItem_0, int int_17, int int_18, int int_19, bool bool_13, bool bool_14, bool bool_15)
  5814. {
  5815. Dictionary<int, AffectedTile> dictionary = this.method_94(RoomItem_0.GetBaseItem().Length, RoomItem_0.GetBaseItem().Width, int_17, int_18, int_19);
  5816. bool result;
  5817. if (!this.method_92(int_17, int_18))
  5818. {
  5819. result = false;
  5820. }
  5821. else
  5822. {
  5823. foreach (AffectedTile current in dictionary.Values)
  5824. {
  5825. if (!this.method_92(current.Int32_0, current.Int32_1))
  5826. {
  5827. result = false;
  5828. return result;
  5829. }
  5830. }
  5831. double num = this.RoomModel.double_1[int_17, int_18];
  5832. if (!bool_14)
  5833. {
  5834. if (RoomItem_0.int_3 == int_19 && RoomItem_0.Int32_0 == int_17 && RoomItem_0.Int32_1 == int_18 && RoomItem_0.Double_0 != num)
  5835. {
  5836. result = false;
  5837. return result;
  5838. }
  5839. if (this.RoomModel.squareState[int_17, int_18] != SquareState.OPEN)
  5840. {
  5841. result = false;
  5842. return result;
  5843. }
  5844. foreach (AffectedTile current in dictionary.Values)
  5845. {
  5846. if (this.RoomModel.squareState[current.Int32_0, current.Int32_1] != SquareState.OPEN)
  5847. {
  5848. result = false;
  5849. return result;
  5850. }
  5851. }
  5852. if (RoomItem_0.GetBaseItem().IsSeat || RoomItem_0.Boolean_0)
  5853. {
  5854. goto IL_1FE;
  5855. }
  5856. if (this.method_97(int_17, int_18) && !RoomItem_0.GetBaseItem().Walkable)
  5857. {
  5858. result = false;
  5859. return result;
  5860. }
  5861. using (Dictionary<int, AffectedTile>.ValueCollection.Enumerator enumerator = dictionary.Values.GetEnumerator())
  5862. {
  5863. while (enumerator.MoveNext())
  5864. {
  5865. AffectedTile current = enumerator.Current;
  5866. if (this.method_97(current.Int32_0, current.Int32_1) && !RoomItem_0.GetBaseItem().Walkable)
  5867. {
  5868. result = false;
  5869. return result;
  5870. }
  5871. }
  5872. goto IL_1FE;
  5873. }
  5874. }
  5875. if (this.RoomModel.squareState[int_17, int_18] != SquareState.OPEN)
  5876. {
  5877. result = false;
  5878. return result;
  5879. }
  5880. if ((!bool_15 || !RoomItem_0.GetBaseItem().Walkable) && this.method_97(int_17, int_18) && RoomItem_0.ExtraData != "1222")
  5881. {
  5882. result = false;
  5883. return result;
  5884. }
  5885. else if (!RoomItem_0.GetBaseItem().Walkable)
  5886. {
  5887. if (!bool_15 && this.method_97(int_17, int_18))
  5888. {
  5889. result = false;
  5890. return result;
  5891. }
  5892. }
  5893. IL_1FE:
  5894. List<RoomItem> list = this.method_93(int_17, int_18);
  5895. List<RoomItem> list2 = new List<RoomItem>();
  5896. List<RoomItem> list3 = new List<RoomItem>();
  5897. foreach (AffectedTile current in dictionary.Values)
  5898. {
  5899. List<RoomItem> list4 = this.method_93(current.Int32_0, current.Int32_1);
  5900. if (list4 != null)
  5901. {
  5902. list2.AddRange(list4);
  5903. }
  5904. }
  5905. if (list == null)
  5906. {
  5907. list = new List<RoomItem>();
  5908. }
  5909. list3.AddRange(list);
  5910. list3.AddRange(list2);
  5911. int num2 = 0;
  5912. foreach (RoomItem current2 in list3)
  5913. {
  5914. if (current2 != null && current2.uint_0 != RoomItem_0.uint_0 && current2.GetBaseItem() != null)
  5915. {
  5916. if (!current2.GetBaseItem().Stackable)
  5917. {
  5918. result = false;
  5919. return result;
  5920. }
  5921. if (RoomItem_0.GetBaseItem().InteractionType.ToLower() == "wf_trg_timer" && current2.GetBaseItem().InteractionType.ToLower() == "wf_trg_timer")
  5922. {
  5923. result = false;
  5924. return result;
  5925. }
  5926. if (RoomItem_0.GetBaseItem().InteractionType.ToLower() == "ball")
  5927. {
  5928. if (current2.GetBaseItem().InteractionType.ToLower() == "blue_goal")
  5929. {
  5930. num2 = 11;
  5931.  
  5932. ProgressFootballAchievement(RoomItem_0);
  5933. }
  5934. if (current2.GetBaseItem().InteractionType.ToLower() == "red_goal")
  5935. {
  5936. num2 = 5;
  5937.  
  5938. ProgressFootballAchievement(RoomItem_0);
  5939. }
  5940. if (current2.GetBaseItem().InteractionType.ToLower() == "yellow_goal")
  5941. {
  5942. num2 = 14;
  5943.  
  5944. ProgressFootballAchievement(RoomItem_0);
  5945. }
  5946. if (current2.GetBaseItem().InteractionType.ToLower() == "green_goal")
  5947. {
  5948. num2 = 8;
  5949.  
  5950. ProgressFootballAchievement(RoomItem_0);
  5951. }
  5952. }
  5953.  
  5954. if (RoomItem_0.GetBaseItem().InteractionType.ToLower() == "ballbug")
  5955. {
  5956. if (current2.GetBaseItem().InteractionType.ToLower() == "blue_goal")
  5957. {
  5958. num2 = 11;
  5959.  
  5960. ProgressFootballAchievement(RoomItem_0);
  5961. }
  5962. if (current2.GetBaseItem().InteractionType.ToLower() == "red_goal")
  5963. {
  5964. num2 = 5;
  5965.  
  5966. ProgressFootballAchievement(RoomItem_0);
  5967. }
  5968. if (current2.GetBaseItem().InteractionType.ToLower() == "yellow_goal")
  5969. {
  5970. num2 = 14;
  5971.  
  5972. ProgressFootballAchievement(RoomItem_0);
  5973. }
  5974. if (current2.GetBaseItem().InteractionType.ToLower() == "green_goal")
  5975. {
  5976. num2 = 8;
  5977.  
  5978. ProgressFootballAchievement(RoomItem_0);
  5979. }
  5980. }
  5981. }
  5982. }
  5983. if (num2 > 0)
  5984. {
  5985. this.method_89(num2, RoomItem_0, false);
  5986. }
  5987. if (!RoomItem_0.Boolean_0)
  5988. {
  5989. if (RoomItem_0.int_3 != int_19 && RoomItem_0.Int32_0 == int_17 && RoomItem_0.Int32_1 == int_18)
  5990. {
  5991. num = RoomItem_0.Double_0;
  5992. }
  5993. foreach (RoomItem current2 in list3)
  5994. {
  5995. if (current2.uint_0 != RoomItem_0.uint_0 && current2.Double_1 > num)
  5996. {
  5997. num = current2.Double_1;
  5998. }
  5999. }
  6000. }
  6001. if (int_19 != 0 && int_19 != 2 && int_19 != 4 && int_19 != 6 && int_19 != 8)
  6002. {
  6003. int_19 = 0;
  6004. }
  6005. Dictionary<int, AffectedTile> dictionary2 = new Dictionary<int, AffectedTile>();
  6006. dictionary2 = this.method_94(RoomItem_0.GetBaseItem().Length, RoomItem_0.GetBaseItem().Width, RoomItem_0.Int32_0, RoomItem_0.Int32_1, RoomItem_0.int_3);
  6007. int num3 = 0;
  6008. int num4 = 0;
  6009. if (!bool_13)
  6010. {
  6011. num3 = RoomItem_0.Int32_0;
  6012. num4 = RoomItem_0.Int32_1;
  6013. }
  6014. RoomItem_0.int_3 = int_19;
  6015. RoomItem_0.method_0(int_17, int_18, num);
  6016. if (!bool_14 && Session != null)
  6017. {
  6018. RoomItem_0.Class69_0.OnPlace(Session, RoomItem_0);
  6019. }
  6020. if (bool_13)
  6021. {
  6022. if (this.hashtable_1.Contains(RoomItem_0.uint_0))
  6023. {
  6024. this.hashtable_1.Remove(RoomItem_0.uint_0);
  6025. }
  6026. if (this.hashtable_3.Contains(RoomItem_0.uint_0))
  6027. {
  6028. result = false;
  6029. return result;
  6030. }
  6031. this.hashtable_3.Add(RoomItem_0.uint_0, RoomItem_0);
  6032. if (RoomItem_0.Boolean_2)
  6033. {
  6034. if (this.hashtable_0.Contains(RoomItem_0.uint_0))
  6035. {
  6036. this.hashtable_0.Remove(RoomItem_0.uint_0);
  6037. }
  6038. this.hashtable_0.Add(RoomItem_0.uint_0, RoomItem_0);
  6039. }
  6040. else
  6041. {
  6042. if (this.hashtable_4.Contains(RoomItem_0.uint_0))
  6043. {
  6044. this.hashtable_4.Remove(RoomItem_0.uint_0);
  6045. }
  6046. this.hashtable_4.Add(RoomItem_0.uint_0, RoomItem_0);
  6047. }
  6048. ServerMessage Message5_ = new ServerMessage(93u);
  6049. RoomItem_0.method_6(Message5_);
  6050. this.SendMessage(Message5_, null);
  6051. string text = RoomItem_0.GetBaseItem().InteractionType.ToLower();
  6052. switch (text)
  6053. {
  6054. case "blue_score":
  6055. this.list_12.Add(RoomItem_0);
  6056. break;
  6057. case "green_score":
  6058. this.list_13.Add(RoomItem_0);
  6059. break;
  6060. case "red_score":
  6061. this.list_10.Add(RoomItem_0);
  6062. break;
  6063. case "yellow_score":
  6064. this.list_11.Add(RoomItem_0);
  6065. break;
  6066. case "stickiepole":
  6067. this.list_3.Add(RoomItem_0);
  6068. break;
  6069. case "wf_trg_onsay":
  6070. case "wf_trg_enterroom":
  6071. case "wf_trg_furnistate":
  6072. case "wf_trg_onfurni":
  6073. case "wf_trg_offfurni":
  6074. case "wf_trg_gameend":
  6075. case "wf_trg_gamestart":
  6076. case "wf_trg_atscore":
  6077. if (!this.list_14.Contains(RoomItem_0))
  6078. {
  6079. this.list_14.Add(RoomItem_0);
  6080. }
  6081. break;
  6082. case "wf_trg_attime":
  6083. if (RoomItem_0.string_2.Length <= 0)
  6084. {
  6085. RoomItem_0.string_2 = "10";
  6086. }
  6087. if (!this.list_14.Contains(RoomItem_0))
  6088. {
  6089. this.list_14.Add(RoomItem_0);
  6090. }
  6091. RoomItem_0.bool_0 = true;
  6092. RoomItem_0.ReqUpdate(1);
  6093. break;
  6094. case "wf_trg_timer":
  6095. if (RoomItem_0.string_2.Length <= 0)
  6096. {
  6097. RoomItem_0.string_2 = "10";
  6098. }
  6099. if (!this.list_14.Contains(RoomItem_0))
  6100. {
  6101. this.list_14.Add(RoomItem_0);
  6102. }
  6103. RoomItem_0.bool_0 = true;
  6104. RoomItem_0.ReqUpdate(1);
  6105. break;
  6106. case "wf_act_saymsg":
  6107. case "wf_act_kick_user":
  6108. case "wf_act_moveuser":
  6109. case "wf_act_togglefurni":
  6110. case "wf_act_givepoints":
  6111. case "wf_act_moverotate":
  6112. case "wf_act_matchfurni":
  6113. case "wf_act_give_phx":
  6114. if (!this.list_15.Contains(RoomItem_0))
  6115. {
  6116. this.list_15.Add(RoomItem_0);
  6117. }
  6118. break;
  6119. case "wf_cnd_trggrer_on_frn":
  6120. case "wf_cnd_furnis_hv_avtrs":
  6121. case "wf_cnd_has_furni_on":
  6122. case "wf_cnd_match_snapshot":
  6123. case "wf_cnd_time_more_than":
  6124. case "wf_cnd_time_less_than":
  6125. case "wf_cnd_phx":
  6126. if (!this.list_16.Contains(RoomItem_0))
  6127. {
  6128. this.list_16.Add(RoomItem_0);
  6129. }
  6130. break;
  6131. case "freeze_tile":
  6132. this.GetFreeze().AddFreezeTile(RoomItem_0);
  6133. break;
  6134. case "freeze_ice_block":
  6135. this.GetFreeze().AddFreezeBlock(RoomItem_0);
  6136. break;
  6137. case "freeze_exit":
  6138. RoomItem exitTeleport = this.GetFreeze().ExitTeleport;
  6139. if (exitTeleport == null)
  6140. {
  6141. this.GetFreeze().ExitTeleport = RoomItem_0;
  6142. }
  6143. break;
  6144. case "freeze_blue_gate":
  6145. this.GetGameManager().AddFreezeGate(RoomItem_0);
  6146. break;
  6147. case "freeze_red_gate":
  6148. this.GetGameManager().AddFreezeGate(RoomItem_0);
  6149. break;
  6150. case "freeze_green_gate":
  6151. this.GetGameManager().AddFreezeGate(RoomItem_0);
  6152. break;
  6153. case "freeze_yellow_gate":
  6154. this.GetGameManager().AddFreezeGate(RoomItem_0);
  6155. break;
  6156. case "freeze_blue_score":
  6157. this.GetGameManager().AddFreezeScoreboard(RoomItem_0);
  6158. break;
  6159. case "freeze_red_score":
  6160. this.GetGameManager().AddFreezeScoreboard(RoomItem_0);
  6161. break;
  6162. case "freeze_green_score":
  6163. this.GetGameManager().AddFreezeScoreboard(RoomItem_0);
  6164. break;
  6165. case "freeze_yellow_score":
  6166. this.GetGameManager().AddFreezeScoreboard(RoomItem_0);
  6167. break;
  6168. }
  6169. }
  6170. else
  6171. {
  6172. if (!this.hashtable_2.Contains(RoomItem_0.uint_0) && !this.hashtable_3.ContainsKey(RoomItem_0.uint_0))
  6173. {
  6174. this.hashtable_2.Add(RoomItem_0.uint_0, RoomItem_0);
  6175. }
  6176. if (RoomItem_0.GetBaseItem().InteractionType.ToLower() == "wf_act_give_phx" && Session != null)
  6177. {
  6178. string text2 = RoomItem_0.string_2.Split(new char[]
  6179. {
  6180. ':'
  6181. })[0].ToLower();
  6182. if (!HighSoft.GetGame().GetRoleManager().method_12(text2, Session))
  6183. {
  6184. RoomItem_0.string_2 = "";
  6185. }
  6186. }
  6187. if (RoomItem_0.GetBaseItem().InteractionType.ToLower() == "wf_cnd_phx" && Session != null)
  6188. {
  6189. string text2 = RoomItem_0.string_2.Split(new char[]
  6190. {
  6191. ':'
  6192. })[0].ToLower();
  6193. if (!HighSoft.GetGame().GetRoleManager().method_11(text2, Session))
  6194. {
  6195. RoomItem_0.string_2 = "";
  6196. }
  6197. }
  6198. ServerMessage Message5_ = new ServerMessage(95u);
  6199. RoomItem_0.method_6(Message5_);
  6200. this.SendMessage(Message5_, null);
  6201. }
  6202. this.method_22();
  6203. if (!bool_14)
  6204. {
  6205. this.method_87(this.method_43(int_17, int_18), true, true);
  6206. foreach (AffectedTile current in dictionary.Values)
  6207. {
  6208. this.method_87(this.method_43(current.Int32_0, current.Int32_1), true, true);
  6209. }
  6210. if (num3 > 0 || num4 > 0)
  6211. {
  6212. this.method_87(this.method_43(num3, num4), true, true);
  6213. }
  6214. foreach (AffectedTile current in dictionary2.Values)
  6215. {
  6216. this.method_87(this.method_43(current.Int32_0, current.Int32_1), true, true);
  6217. }
  6218. }
  6219. result = true;
  6220. }
  6221. return result;
  6222. }
  6223. internal void method_80(RoomItem RoomItem_0)
  6224. {
  6225. if (!this.hashtable_2.Contains(RoomItem_0.uint_0) && !this.hashtable_3.ContainsKey(RoomItem_0.uint_0))
  6226. {
  6227. this.hashtable_2.Add(RoomItem_0.uint_0, RoomItem_0);
  6228. }
  6229. }
  6230. public bool method_81(RoomItem RoomItem_0, int int_17, int int_18, double double_3)
  6231. {
  6232. Dictionary<int, AffectedTile> dictionary = this.method_94(RoomItem_0.GetBaseItem().Length, RoomItem_0.GetBaseItem().Width, int_17, int_18, RoomItem_0.int_3);
  6233. RoomItem_0.method_0(int_17, int_18, double_3);
  6234. if (!this.hashtable_2.Contains(RoomItem_0.uint_0))
  6235. {
  6236. this.hashtable_2.Add(RoomItem_0.uint_0, RoomItem_0);
  6237. }
  6238. this.method_22();
  6239. this.method_87(this.method_43(int_17, int_18), true, true);
  6240. foreach (AffectedTile current in dictionary.Values)
  6241. {
  6242. this.method_87(this.method_43(current.Int32_0, current.Int32_1), true, true);
  6243. }
  6244. return true;
  6245. }
  6246. public bool method_82(GameClient Session, RoomItem RoomItem_0, bool bool_13, string string_10)
  6247. {
  6248. if (bool_13)
  6249. {
  6250. RoomItem_0.Class69_0.OnPlace(Session, RoomItem_0);
  6251. string text = RoomItem_0.GetBaseItem().InteractionType.ToLower();
  6252. if (text != null && text == "dimmer" && this.MoodlightData == null)
  6253. {
  6254. this.MoodlightData = new MoodlightData(RoomItem_0.uint_0);
  6255. RoomItem_0.ExtraData = this.MoodlightData.method_7();
  6256. }
  6257. if (!this.hashtable_3.ContainsKey(RoomItem_0.uint_0))
  6258. {
  6259. this.hashtable_3.Add(RoomItem_0.uint_0, RoomItem_0);
  6260. if (RoomItem_0.Boolean_2)
  6261. {
  6262. this.hashtable_0.Add(RoomItem_0.uint_0, RoomItem_0);
  6263. }
  6264. else
  6265. {
  6266. if (!this.hashtable_4.Contains(RoomItem_0.uint_0))
  6267. {
  6268. this.hashtable_4.Add(RoomItem_0.uint_0, RoomItem_0);
  6269. }
  6270. }
  6271. }
  6272. ServerMessage Message5_ = new ServerMessage(83u);
  6273. RoomItem_0.method_6(Message5_);
  6274. this.SendMessage(Message5_, null);
  6275. }
  6276. else
  6277. {
  6278. if (!this.hashtable_2.Contains(RoomItem_0.uint_0))
  6279. {
  6280. this.hashtable_2.Add(RoomItem_0.uint_0, RoomItem_0);
  6281. }
  6282. }
  6283. if (!bool_13)
  6284. {
  6285. RoomItem_0.string_7 = string_10;
  6286. ServerMessage Message5_ = new ServerMessage(85u);
  6287. RoomItem_0.method_6(Message5_);
  6288. this.SendMessage(Message5_, null);
  6289. }
  6290. return true;
  6291. }
  6292. public void method_83()
  6293. {
  6294. for (int i = 0; i < this.RoomUsers.Length; i++)
  6295. {
  6296. RoomUser @class = this.RoomUsers[i];
  6297. if (@class != null)
  6298. {
  6299. this.method_87(@class, true, true);
  6300. }
  6301. }
  6302. }
  6303. public double method_84(int int_17, int int_18, List<RoomItem> list_18)
  6304. {
  6305. double result;
  6306. try
  6307. {
  6308. bool flag = false;
  6309. if (this.double_2[int_17, int_18] != 0.0)
  6310. {
  6311. flag = true;
  6312. }
  6313. double num = 0.0;
  6314. bool flag2 = false;
  6315. double num2 = 0.0;
  6316. if (list_18 == null)
  6317. {
  6318. list_18 = new List<RoomItem>();
  6319. }
  6320. if (list_18 != null)
  6321. {
  6322. foreach (RoomItem current in list_18)
  6323. {
  6324. if ((current.GetBaseItem().IsSeat || current.GetBaseItem().InteractionType.ToLower() == "bed") && flag)
  6325. {
  6326. result = current.Double_0;
  6327. return result;
  6328. }
  6329. if (current.Double_1 > num)
  6330. {
  6331. if (current.GetBaseItem().IsSeat || current.GetBaseItem().InteractionType.ToLower() == "bed")
  6332. {
  6333. if (flag)
  6334. {
  6335. result = current.Double_0;
  6336. return result;
  6337. }
  6338. flag2 = true;
  6339. num2 = current.GetBaseItem().Height;
  6340. }
  6341. else
  6342. {
  6343. flag2 = false;
  6344. }
  6345. num = current.Double_1;
  6346. }
  6347. }
  6348. }
  6349. double num3 = this.RoomModel.double_1[int_17, int_18];
  6350. double num4 = num - this.RoomModel.double_1[int_17, int_18];
  6351. if (flag2)
  6352. {
  6353. num4 -= num2;
  6354. }
  6355. if (num4 < 0.0)
  6356. {
  6357. num4 = 0.0;
  6358. }
  6359. result = num3 + num4;
  6360. }
  6361. catch
  6362. {
  6363. result = 0.0;
  6364. }
  6365. return result;
  6366. }
  6367. public void method_85(RoomUser RoomUser_1)
  6368. {
  6369. List<RoomItem> list = this.method_93(RoomUser_1.X, RoomUser_1.Y);
  6370. foreach (RoomItem current in list)
  6371. {
  6372. this.method_12(RoomUser_1, current);
  6373. if (current.GetBaseItem().InteractionType.ToLower() == "pressure_pad")
  6374. {
  6375. current.ExtraData = "0";
  6376. current.UpdateState(false, true);
  6377. }
  6378. }
  6379. this.byte_0[RoomUser_1.X, RoomUser_1.Y] = 1;
  6380. }
  6381. public void method_86(RoomUser RoomUser_1)
  6382. {
  6383. List<RoomItem> list = this.method_93(RoomUser_1.X, RoomUser_1.Y);
  6384. foreach (RoomItem current in list)
  6385. {
  6386. string text = current.GetBaseItem().InteractionType.ToLower();
  6387. if (text != null)
  6388. {
  6389. if (!(text == "pressure_pad"))
  6390. {
  6391. if (text == "fbgate" && (!string.IsNullOrEmpty(current.string_2) || !string.IsNullOrEmpty(current.string_3)))
  6392. {
  6393. RoomUser_1 = this.method_43(current.GStruct1_0.x, current.GStruct1_0.y);
  6394. if (RoomUser_1 != null && !RoomUser_1.IsBot && current.string_2 != null && current.string_3 != null)
  6395. {
  6396. string a = RoomUser_1.GetClient().GetHabbo().Gender;
  6397. if (a == "m")
  6398. {
  6399. AntiMutant.smethod_1(RoomUser_1, current.string_2);
  6400. }
  6401. else
  6402. {
  6403. AntiMutant.smethod_1(RoomUser_1, current.string_3);
  6404. }
  6405. ServerMessage Message = new ServerMessage(266u);
  6406. Message.AppendInt32(RoomUser_1.VirtualId);
  6407. Message.AppendStringWithBreak(RoomUser_1.GetClient().GetHabbo().Figure);
  6408. Message.AppendStringWithBreak(RoomUser_1.GetClient().GetHabbo().Gender.ToLower());
  6409. Message.AppendStringWithBreak(RoomUser_1.GetClient().GetHabbo().Motto);
  6410. Message.AppendInt32(RoomUser_1.GetClient().GetHabbo().AchievementScore);
  6411. Message.AppendStringWithBreak("");
  6412. this.SendMessage(Message, null);
  6413. }
  6414. }
  6415. }
  6416. else
  6417. {
  6418. current.ExtraData = "1";
  6419. current.UpdateState(false, true);
  6420. }
  6421. }
  6422. }
  6423. }
  6424. public void method_87(RoomUser User, bool bool_13, bool bool_14)
  6425. {
  6426. int num = 0;
  6427. try
  6428. {
  6429. if (User != null)
  6430. {
  6431. num = 1;
  6432. if (User.IsPet)
  6433. {
  6434. User.PetData.X = User.X;
  6435. User.PetData.Y = User.Y;
  6436. User.PetData.Z = User.double_0;
  6437. }
  6438. else
  6439. {
  6440. if (User.IsBot)
  6441. {
  6442. User.RoomBot.x = User.X;
  6443. User.RoomBot.y = User.Y;
  6444. User.RoomBot.z = User.double_0;
  6445. }
  6446. else
  6447. {
  6448. if (User.class34_1 != null && User.RoomUser_0 != null)
  6449. {
  6450. return;
  6451. }
  6452. }
  6453. }
  6454. num = 2;
  6455. if (!User.bool_12)
  6456. {
  6457. User.UpdateNeeded = false;
  6458. }
  6459. else
  6460. {
  6461. num = 3;
  6462. if (bool_13)
  6463. {
  6464. num = 4;
  6465. if (User.byte_1 > 0)
  6466. {
  6467. num = 5;
  6468. if (User.IsBot)
  6469. {
  6470. if (this.byte_1[User.X, User.Y] == 0)
  6471. {
  6472. User.RoomBot.EffectId = -1;
  6473. User.byte_1 = 0;
  6474. }
  6475. }
  6476. else
  6477. {
  6478. num = 6;
  6479. if ((User.GetClient().GetHabbo().Gender.ToLower() == "m" && this.byte_1[User.X, User.Y] == 0) || (User.GetClient().GetHabbo().Gender.ToLower() == "f" && this.byte_2[User.X, User.Y] == 0))
  6480. {
  6481. User.GetClient().GetHabbo().GetEffectsInventoryComponent().method_2(-1, true);
  6482. User.byte_1 = 0;
  6483. }
  6484. }
  6485. }
  6486. num = 7;
  6487. if (User.Statusses.ContainsKey("lay") || User.Statusses.ContainsKey("sit"))
  6488. {
  6489. User.Statusses.Remove("lay");
  6490. User.Statusses.Remove("sit");
  6491. User.UpdateNeeded = true;
  6492. }
  6493. List<RoomItem> list = this.method_93(User.X, User.Y);
  6494. double num2 = this.method_84(User.X, User.Y, list);
  6495. if (num2 != User.double_0)
  6496. {
  6497. User.double_0 = num2;
  6498. User.UpdateNeeded = true;
  6499. }
  6500. num = 8;
  6501. if (this.RoomModel.squareState[User.X, User.Y] == SquareState.SEAT)
  6502. {
  6503. if (!User.Statusses.ContainsKey("sit"))
  6504. {
  6505. User.Statusses.Add("sit", "1.0");
  6506. if (User.byte_1 > 0)
  6507. {
  6508. if (!User.IsBot)
  6509. {
  6510. User.GetClient().GetHabbo().GetEffectsInventoryComponent().method_2(-1, true);
  6511. }
  6512. else
  6513. {
  6514. User.RoomBot.EffectId = -1;
  6515. }
  6516. User.byte_1 = 0;
  6517. }
  6518. }
  6519. num = 9;
  6520. User.double_0 = this.RoomModel.double_1[User.X, User.Y];
  6521. User.int_7 = this.RoomModel.int_3[User.X, User.Y];
  6522. User.BodyRotation = this.RoomModel.int_3[User.X, User.Y];
  6523. if (User.IsBot && User.RoomBot.RoomUser_0 != null)
  6524. {
  6525. User.RoomBot.RoomUser_0.double_0 = User.double_0 + 1.0;
  6526. User.RoomBot.RoomUser_0.int_7 = User.int_7;
  6527. User.RoomBot.RoomUser_0.BodyRotation = User.BodyRotation;
  6528. }
  6529. User.UpdateNeeded = true;
  6530. }
  6531. if (list.Count < 1 && this.list_4.Contains(User.UId))
  6532. {
  6533. User.GetClient().GetHabbo().GetEffectsInventoryComponent().method_2(-1, false);
  6534. this.list_4.Remove(User.UId);
  6535. User.int_14 = 0;
  6536. User.UpdateNeeded = true;
  6537. }
  6538. num = 10;
  6539. lock (list)
  6540. {
  6541. foreach (RoomItem Item in list)
  6542. {
  6543. num = 11;
  6544. if (Item.GetBaseItem().IsSeat && (!User.IsPet || User.RoomBot.RoomUser_0 == null))
  6545. {
  6546. if (!User.Statusses.ContainsKey("sit"))
  6547. {
  6548. double num3;
  6549. try
  6550. {
  6551. if (Item.GetBaseItem().Height_Adjustable.Count > 1)
  6552. {
  6553. num3 = Item.GetBaseItem().Height_Adjustable[(int)Convert.ToInt16(Item.ExtraData)];
  6554. }
  6555. else
  6556. {
  6557. num3 = Item.GetBaseItem().Height;
  6558. }
  6559. goto IL_BCA;
  6560. }
  6561. catch
  6562. {
  6563. num3 = Item.GetBaseItem().Height;
  6564. goto IL_BCA;
  6565. }
  6566. IL_51B:
  6567. if (User.byte_1 > 0)
  6568. {
  6569. if (!User.IsBot)
  6570. {
  6571. User.GetClient().GetHabbo().GetEffectsInventoryComponent().method_2(-1, true);
  6572. }
  6573. else
  6574. {
  6575. User.RoomBot.EffectId = -1;
  6576. }
  6577. User.byte_1 = 0;
  6578. goto IL_55D;
  6579. }
  6580. goto IL_55D;
  6581. IL_BCA:
  6582. if (User.Statusses.ContainsKey("sit"))
  6583. {
  6584. goto IL_51B;
  6585. }
  6586. User.Statusses.Add("sit", num3.ToString().Replace(',', '.'));
  6587. goto IL_51B;
  6588. }
  6589. IL_55D:
  6590. User.double_0 = Item.Double_0;
  6591. User.int_7 = Item.int_3;
  6592. User.BodyRotation = Item.int_3;
  6593. if (User.IsBot && User.RoomBot.RoomUser_0 != null)
  6594. {
  6595. User.RoomBot.RoomUser_0.double_0 = User.double_0 + 1.0;
  6596. User.RoomBot.RoomUser_0.int_7 = User.int_7;
  6597. User.RoomBot.RoomUser_0.BodyRotation = User.BodyRotation;
  6598. }
  6599. User.UpdateNeeded = true;
  6600. }
  6601. num = 12;
  6602. if (Item.GetBaseItem().InteractionType.ToLower() == "bed")
  6603. {
  6604. if (!User.Statusses.ContainsKey("lay"))
  6605. {
  6606. double num3;
  6607. try
  6608. {
  6609. if (Item.GetBaseItem().Height_Adjustable.Count > 1)
  6610. {
  6611. num3 = Item.GetBaseItem().Height_Adjustable[(int)Convert.ToInt16(Item.ExtraData)];
  6612. }
  6613. else
  6614. {
  6615. num3 = Item.GetBaseItem().Height;
  6616. }
  6617. }
  6618. catch
  6619. {
  6620. num3 = Item.GetBaseItem().Height;
  6621. }
  6622. if (!User.Statusses.ContainsKey("lay"))
  6623. {
  6624. User.Statusses.Add("lay", Item.GetBaseItem().Height.ToString().Replace(',', '.') + " null");
  6625. }
  6626. if (User.byte_1 > 0)
  6627. {
  6628. if (!User.IsBot)
  6629. {
  6630. User.GetClient().GetHabbo().GetEffectsInventoryComponent().method_2(-1, true);
  6631. }
  6632. else
  6633. {
  6634. User.RoomBot.EffectId = -1;
  6635. }
  6636. User.byte_1 = 0;
  6637. }
  6638. }
  6639. User.double_0 = Item.Double_0;
  6640. User.int_7 = Item.int_3;
  6641. User.BodyRotation = Item.int_3;
  6642. if (User.IsBot && User.RoomBot.RoomUser_0 != null)
  6643. {
  6644. User.RoomBot.RoomUser_0.double_0 = User.double_0 + 1.0;
  6645. User.RoomBot.RoomUser_0.int_7 = User.int_7;
  6646. User.RoomBot.RoomUser_0.BodyRotation = User.BodyRotation;
  6647. }
  6648. User.UpdateNeeded = true;
  6649. }
  6650.  
  6651. if (!User.IsBot && !User.IsPet)
  6652. {
  6653. if (User.team != Team.None)
  6654. {
  6655. if (Item.method_8().frzTimer == true)
  6656. {
  6657. if (Item.GetBaseItem().Name == "es_box")
  6658. {
  6659. if (Item.freezePowerUp != FreezePowerUp.None)
  6660. {
  6661. this.GetFreeze().PickUpPowerUp(Item, User);
  6662. }
  6663. }
  6664. }
  6665. }
  6666. }
  6667.  
  6668. TeamManager roomTeamManager;
  6669. roomTeamManager = Item.method_8().GetRoomTeamManager();
  6670.  
  6671. if (!User.IsBot && !User.IsPet && (Item.GetBaseItem().InteractionType.ToLower() == "freeze_blue_gate" || Item.GetBaseItem().InteractionType.ToLower() == "freeze_red_gate" || Item.GetBaseItem().InteractionType.ToLower() == "freeze_green_gate" || Item.GetBaseItem().InteractionType.ToLower() == "freeze_yellow_gate"))
  6672. {
  6673. if (roomTeamManager.CanEnterOnTeam(Item.team))
  6674. {
  6675. if (User.team == Team.None)
  6676. {
  6677. User.game = Rooms.Games.Game.Freeze;
  6678. User.team = Item.team;
  6679. roomTeamManager.AddUser(User);
  6680. int FreezeEffect = ((int)Item.team) + 39;
  6681. if (User.GetClient().GetHabbo().GetEffectsInventoryComponent().int_0 != FreezeEffect)
  6682. {
  6683. User.GetClient().GetHabbo().GetEffectsInventoryComponent().method_2(FreezeEffect, true);
  6684. }
  6685. }
  6686. else
  6687. {
  6688. roomTeamManager.OnUserLeave(User);
  6689. User.GetClient().GetHabbo().GetEffectsInventoryComponent().method_2(0, true);
  6690. }
  6691. }
  6692. }
  6693.  
  6694. /*if (!User.IsBot && (Item.GetBaseItem().InteractionType.ToLower() == "bb_blue_gate" || Item.GetBaseItem().InteractionType.ToLower() == "bb_red_gate" || Item.GetBaseItem().InteractionType.ToLower() == "bb_green_gate" || Item.GetBaseItem().InteractionType.ToLower() == "bb_yellow_gate"))
  6695. {
  6696. if (teamManagerForBanzai.CanEnterOnTeam(Item.team))
  6697. {
  6698. if (User.team != Team.None)
  6699. {
  6700. teamManagerForBanzai.OnUserLeave(User);
  6701. teamManagerForFreeze.OnUserLeave(User);
  6702. }
  6703. User.team = Item.team;
  6704. teamManagerForBanzai.AddUser(User);
  6705. int BanzaiEffect = ((int)Item.team) + 32;
  6706. if (User.GetClient().GetHabbo().method_24().int_0 != BanzaiEffect)
  6707. {
  6708. User.GetClient().GetHabbo().method_24().method_2(BanzaiEffect, true);
  6709. }
  6710. }
  6711. }*/
  6712.  
  6713. /*if (Item.GetBaseItem().Name == "es_gate_r" && Item.method_8().frzTimer == false)
  6714. {
  6715. #region es_gate_r
  6716. User.GetClient().GetHabbo().method_24().method_2(40, true);
  6717. User.GetClient().GetHabbo().frzTeam = 1;
  6718. User.GetClient().GetHabbo().frzRange = 3;
  6719. User.GetClient().GetHabbo().frzLives = 3;
  6720. User.GetClient().GetHabbo().frzBalls = 1;
  6721. User.GetClient().GetHabbo().frzBall = 0;
  6722. #endregion
  6723. }
  6724.  
  6725. if (Item.GetBaseItem().Name == "es_gate_g" && Item.method_8().frzTimer == false)
  6726. {
  6727. #region es_gate_g
  6728. User.GetClient().GetHabbo().method_24().method_2(41, true);
  6729. User.GetClient().GetHabbo().frzTeam = 2;
  6730. User.GetClient().GetHabbo().frzRange = 3;
  6731. User.GetClient().GetHabbo().frzLives = 3;
  6732. User.GetClient().GetHabbo().frzBalls = 1;
  6733. User.GetClient().GetHabbo().frzBall = 0;
  6734. #endregion
  6735. }
  6736.  
  6737. if (Item.GetBaseItem().Name == "es_gate_b" && Item.method_8().frzTimer == false)
  6738. {
  6739. #region es_gate_b
  6740. User.GetClient().GetHabbo().method_24().method_2(42, true);
  6741. User.GetClient().GetHabbo().frzTeam = 3;
  6742. User.GetClient().GetHabbo().frzRange = 3;
  6743. User.GetClient().GetHabbo().frzLives = 3;
  6744. User.GetClient().GetHabbo().frzBalls = 1;
  6745. User.GetClient().GetHabbo().frzBall = 0;
  6746. #endregion
  6747. }
  6748.  
  6749. if (Item.GetBaseItem().Name == "es_gate_y" && Item.method_8().frzTimer == false)
  6750. {
  6751. #region es_gate_y
  6752. User.GetClient().GetHabbo().method_24().method_2(43, true);
  6753. User.GetClient().GetHabbo().frzTeam = 4;
  6754. User.GetClient().GetHabbo().frzRange = 3;
  6755. User.GetClient().GetHabbo().frzLives = 3;
  6756. User.GetClient().GetHabbo().frzBalls = 1;
  6757. User.GetClient().GetHabbo().frzBall = 0;
  6758. #endregion
  6759. }*/
  6760.  
  6761. num = 13;
  6762. if (Item.GetBaseItem().InteractionType.ToLower().IndexOf("bb_") > -1 && !User.IsBot && !User.IsPet)
  6763. {
  6764. if (Item.GetBaseItem().InteractionType.ToLower().IndexOf("_gate") > -1)
  6765. {
  6766. if (Item.GetBaseItem().InteractionType.ToLower() == "bb_yellow_gate" || Item.GetBaseItem().InteractionType.ToLower() == "bb_red_gate" || Item.GetBaseItem().InteractionType.ToLower() == "bb_green_gate" || Item.GetBaseItem().InteractionType.ToLower() == "bb_blue_gate")
  6767. {
  6768. if (roomTeamManager.CanEnterOnTeam(Item.team))
  6769. {
  6770. if (User.team == Team.None)
  6771. {
  6772. User.game = Rooms.Games.Game.BattleBanzai;
  6773. User.team = Item.team;
  6774. roomTeamManager.AddUser(User);
  6775. int FreezeEffect = ((int)Item.team) + 32;
  6776. if (User.GetClient().GetHabbo().GetEffectsInventoryComponent().int_0 != FreezeEffect)
  6777. {
  6778. User.GetClient().GetHabbo().GetEffectsInventoryComponent().method_2(FreezeEffect, true);
  6779. }
  6780. }
  6781. else
  6782. {
  6783. roomTeamManager.OnUserLeave(User);
  6784. User.GetClient().GetHabbo().GetEffectsInventoryComponent().method_2(0, true);
  6785. }
  6786. }
  6787. }
  6788. }
  6789.  
  6790. if (Item.GetBaseItem().InteractionType.ToLower() == "bb_teleport")
  6791. {
  6792. this.method_91(Item, User);
  6793. }
  6794. if (Item.GetBaseItem().InteractionType.ToLower() == "bb_patch" && this.GetTopItem(Item.Int32_0, Item.Int32_1) == Item && User.team != Team.None && User.game == Rooms.Games.Game.BattleBanzai && User.bool_6 && Item.ExtraData != "14" && Item.ExtraData != "5" && Item.ExtraData != "8" && Item.ExtraData != "11" && Item.ExtraData != "1")
  6795. {
  6796. if (Item.ExtraData == "0" || Item.ExtraData == "")
  6797. {
  6798. if (User.team == Team.Yellow)
  6799. {
  6800. Item.ExtraData = Convert.ToString(12);
  6801. }
  6802. else if (User.team == Team.Red)
  6803. {
  6804. Item.ExtraData = Convert.ToString(3);
  6805. }
  6806. else if (User.team == Team.Green)
  6807. {
  6808. Item.ExtraData = Convert.ToString(6);
  6809. }
  6810. else if (User.team == Team.Blue)
  6811. {
  6812. Item.ExtraData = Convert.ToString(9);
  6813. }
  6814. }
  6815. else
  6816. {
  6817. if (Convert.ToInt32(Item.ExtraData) > 0)
  6818. {
  6819. if (User.team == Team.Yellow && (Item.ExtraData == "12" || Item.ExtraData == "13"))
  6820. {
  6821. Item.ExtraData = Convert.ToString(Convert.ToInt32(Item.ExtraData) + 1);
  6822. }
  6823. else
  6824. {
  6825. if (User.team == Team.Red && (Item.ExtraData == "3" || Item.ExtraData == "4"))
  6826. {
  6827. Item.ExtraData = Convert.ToString(Convert.ToInt32(Item.ExtraData) + 1);
  6828. }
  6829. else
  6830. {
  6831. if (User.team == Team.Green && (Item.ExtraData == "6" || Item.ExtraData == "7"))
  6832. {
  6833. Item.ExtraData = Convert.ToString(Convert.ToInt32(Item.ExtraData) + 1);
  6834. }
  6835. else
  6836. {
  6837. if (User.team == Team.Blue && (Item.ExtraData == "9" || Item.ExtraData == "10"))
  6838. {
  6839. Item.ExtraData = Convert.ToString(Convert.ToInt32(Item.ExtraData) + 1);
  6840. }
  6841. else
  6842. {
  6843. if (User.team == Team.Yellow)
  6844. {
  6845. Item.ExtraData = Convert.ToString(12);
  6846. }
  6847. else if (User.team == Team.Red)
  6848. {
  6849. Item.ExtraData = Convert.ToString(3);
  6850. }
  6851. else if (User.team == Team.Green)
  6852. {
  6853. Item.ExtraData = Convert.ToString(6);
  6854. }
  6855. else if (User.team == Team.Blue)
  6856. {
  6857. Item.ExtraData = Convert.ToString(9);
  6858. }
  6859. }
  6860. }
  6861. }
  6862. }
  6863. }
  6864.  
  6865. }
  6866. if (User.team == Team.Yellow && Item.ExtraData == "14")
  6867. {
  6868. User.GetClient().GetHabbo().TilesLocked++;
  6869. User.GetClient().GetHabbo().CheckBattleBanzaiTilesLockedAchievements();
  6870. }
  6871.  
  6872. if (User.team == Team.Red && Item.ExtraData == "5")
  6873. {
  6874. User.GetClient().GetHabbo().TilesLocked++;
  6875. User.GetClient().GetHabbo().CheckBattleBanzaiTilesLockedAchievements();
  6876. }
  6877.  
  6878. if (User.team == Team.Green && Item.ExtraData == "8")
  6879. {
  6880. User.GetClient().GetHabbo().TilesLocked++;
  6881. User.GetClient().GetHabbo().CheckBattleBanzaiTilesLockedAchievements();
  6882. }
  6883.  
  6884. if (User.team == Team.Blue && Item.ExtraData == "11")
  6885. {
  6886. User.GetClient().GetHabbo().TilesLocked++;
  6887. User.GetClient().GetHabbo().CheckBattleBanzaiTilesLockedAchievements();
  6888. }
  6889.  
  6890. int team = 0;
  6891. if (User.team == Team.Yellow)
  6892. {
  6893. team = 14;
  6894. }
  6895. else if (User.team == Team.Red)
  6896. {
  6897. team = 5;
  6898. }
  6899. else if (User.team == Team.Green)
  6900. {
  6901. team = 8;
  6902. }
  6903. else if (User.team == Team.Blue)
  6904. {
  6905. team = 11;
  6906. }
  6907.  
  6908. this.method_89(team, Item, false);
  6909. Item.UpdateState(true, true);
  6910. }
  6911. }
  6912. }
  6913. goto IL_1155;
  6914. }
  6915. }
  6916. num = 14;
  6917. List<RoomItem> list2 = this.method_93(User.int_12, User.int_13);
  6918. lock (list2)
  6919. {
  6920. foreach (RoomItem current in list2)
  6921. {
  6922. if (this.double_0[current.Int32_0, current.Int32_1] <= current.Double_0)
  6923. {
  6924. if (bool_14)
  6925. {
  6926. this.method_11(User, current);
  6927. }
  6928. if (current.GetBaseItem().InteractionType.ToLower() == "pressure_pad")
  6929. {
  6930. current.ExtraData = "1";
  6931. current.UpdateState(false, true);
  6932. }
  6933. num = 15;
  6934. if (current.GetBaseItem().InteractionType.ToLower() == "fbgate" && (!string.IsNullOrEmpty(current.string_2) || !string.IsNullOrEmpty(current.string_3)) && User != null && !User.IsBot)
  6935. {
  6936. if (User.string_0 != "")
  6937. {
  6938. User.GetClient().GetHabbo().Figure = User.string_0;
  6939. User.string_0 = "";
  6940. ServerMessage Message = new ServerMessage(266u);
  6941. Message.AppendInt32(User.VirtualId);
  6942. Message.AppendStringWithBreak(User.GetClient().GetHabbo().Figure);
  6943. Message.AppendStringWithBreak(User.GetClient().GetHabbo().Gender.ToLower());
  6944. Message.AppendStringWithBreak(User.GetClient().GetHabbo().Motto);
  6945. Message.AppendInt32(User.GetClient().GetHabbo().AchievementScore);
  6946. Message.AppendStringWithBreak("");
  6947. this.SendMessage(Message, null);
  6948. }
  6949. else
  6950. {
  6951. string a = User.GetClient().GetHabbo().Gender;
  6952. User.string_0 = User.GetClient().GetHabbo().Figure;
  6953. if (a == "m")
  6954. {
  6955. AntiMutant.smethod_1(User, current.string_2);
  6956. }
  6957. else
  6958. {
  6959. AntiMutant.smethod_1(User, current.string_3);
  6960. }
  6961. ServerMessage Message = new ServerMessage(266u);
  6962. Message.AppendInt32(User.VirtualId);
  6963. Message.AppendStringWithBreak(User.GetClient().GetHabbo().Figure);
  6964. Message.AppendStringWithBreak(User.GetClient().GetHabbo().Gender.ToLower());
  6965. Message.AppendStringWithBreak(User.GetClient().GetHabbo().Motto);
  6966. Message.AppendInt32(User.GetClient().GetHabbo().AchievementScore);
  6967. Message.AppendStringWithBreak("");
  6968. this.SendMessage(Message, null);
  6969. }
  6970. }
  6971. num = 16;
  6972. if (current.GetBaseItem().InteractionType.ToLower() == "ball")
  6973. {
  6974. int num6 = current.Int32_0;
  6975. int num7 = current.Int32_1;
  6976. current.ExtraData = "11";
  6977. if (User != null && User.GetClient() != null && User.GetClient().GetHabbo() != null)
  6978. {
  6979. current.LastPlayerHitFootball = User.GetClient().GetHabbo().Username;
  6980. }
  6981.  
  6982. if (User.BodyRotation == 4)
  6983. {
  6984. num7++;
  6985. if (!this.method_79(null, current, num6, num7, 0, false, true, false))
  6986. {
  6987. this.method_79(null, current, num6, num7 - 2, 0, false, true, true);
  6988. }
  6989. }
  6990. else
  6991. {
  6992. if (User.BodyRotation == 0)
  6993. {
  6994. num7--;
  6995. if (!this.method_79(null, current, num6, num7, 0, false, true, false))
  6996. {
  6997. this.method_79(null, current, num6, num7 + 2, 0, false, true, true);
  6998. }
  6999. }
  7000. else
  7001. {
  7002. if (User.BodyRotation == 6)
  7003. {
  7004. num6--;
  7005. if (!this.method_79(null, current, num6, num7, 0, false, true, false))
  7006. {
  7007. this.method_79(null, current, num6 + 2, num7, 0, false, true, true);
  7008. }
  7009. }
  7010. else
  7011. {
  7012. if (User.BodyRotation == 2)
  7013. {
  7014. num6++;
  7015. if (!this.method_79(null, current, num6, num7, 0, false, true, false))
  7016. {
  7017. this.method_79(null, current, num6 - 2, num7, 0, false, true, true);
  7018. }
  7019. }
  7020. else
  7021. {
  7022. if (User.BodyRotation == 3)
  7023. {
  7024. num6++;
  7025. num7++;
  7026. if (!this.method_79(null, current, num6, num7, 0, false, true, false))
  7027. {
  7028. this.method_79(null, current, num6 - 2, num7 - 2, 0, false, true, true);
  7029. }
  7030. }
  7031. else
  7032. {
  7033. if (User.BodyRotation == 1)
  7034. {
  7035. num6++;
  7036. num7--;
  7037. if (!this.method_79(null, current, num6, num7, 0, false, true, false))
  7038. {
  7039. this.method_79(null, current, num6 - 2, num7 + 2, 0, false, true, true);
  7040. }
  7041. }
  7042. else
  7043. {
  7044. if (User.BodyRotation == 7)
  7045. {
  7046. num6--;
  7047. num7--;
  7048. if (!this.method_79(null, current, num6, num7, 0, false, true, false))
  7049. {
  7050. this.method_79(null, current, num6 + 2, num7 + 2, 0, false, true, true);
  7051. }
  7052. }
  7053. else
  7054. {
  7055. if (User.BodyRotation == 5)
  7056. {
  7057. num6--;
  7058. num7++;
  7059. if (!this.method_79(null, current, num6, num7, 0, false, true, false))
  7060. {
  7061. this.method_79(null, current, num6 + 2, num7 - 2, 0, false, true, true);
  7062. }
  7063. }
  7064. }
  7065. }
  7066. }
  7067. }
  7068. }
  7069. }
  7070. }
  7071. }
  7072.  
  7073. if (current.GetBaseItem().InteractionType.ToLower() == "ballbug" && current.ExtraData != "1222" && User.int_12 == current.Int32_0 && User.int_13 == current.Int32_1)
  7074. {
  7075. KickBall(User, current);
  7076. }
  7077. }
  7078. }
  7079. }
  7080. IL_1155: ;
  7081. }
  7082. }
  7083. }
  7084. catch (Exception ex)
  7085. {
  7086. Logging.LogThreadException(ex.ToString(), string.Concat(new object[]
  7087. {
  7088. "Room [ID: ",
  7089. this.Id,
  7090. "] [Part: ",
  7091. num,
  7092. "] Update User Status"
  7093. }));
  7094. this.method_34();
  7095. }
  7096. }
  7097.  
  7098. public void KickBall(RoomUser User, RoomItem item2, bool rimpallo = false)
  7099. {
  7100. int getX = item2.Int32_0;
  7101. int getY = item2.Int32_1;
  7102.  
  7103. if (!rimpallo)
  7104. {
  7105. item2.ExtraData = "11";
  7106. if (User.BodyRotation == 4)
  7107. {
  7108. getY++;
  7109. if (!this.method_79(null, item2, getX, getY, 0, false, true, false))
  7110. {
  7111. item2.ExtraData = "1222";
  7112. item2.Posizione = "0";
  7113. }
  7114. }
  7115. else if (User.BodyRotation == 0)
  7116. {
  7117. getY--;
  7118. if (!this.method_79(null, item2, getX, getY, 0, false, true, false))
  7119. {
  7120. item2.ExtraData = "1222";
  7121. item2.Posizione = "0";
  7122. }
  7123. }
  7124. else if (User.BodyRotation == 6)
  7125. {
  7126. getX--;
  7127. if (!this.method_79(null, item2, getX, getY, 0, false, true, false))
  7128. {
  7129. item2.ExtraData = "1222";
  7130. item2.Posizione = "0";
  7131. }
  7132. }
  7133. else if (User.BodyRotation == 2)
  7134. {
  7135. getX++;
  7136. if (!this.method_79(null, item2, getX, getY, 0, false, true, false))
  7137. {
  7138. item2.ExtraData = "1222";
  7139. item2.Posizione = "0";
  7140. }
  7141. }
  7142. else if (User.BodyRotation == 3)
  7143. {
  7144. getX++;
  7145. getY++;
  7146. if (!this.method_79(null, item2, getX, getY, 0, false, true, false))
  7147. {
  7148. item2.ExtraData = "1222";
  7149. item2.Posizione = "0";
  7150. }
  7151. }
  7152. else if (User.BodyRotation == 1)
  7153. {
  7154. getX++;
  7155. getY--;
  7156. if (!this.method_79(null, item2, getX, getY, 0, false, true, false))
  7157. {
  7158. item2.ExtraData = "1222";
  7159. item2.Posizione = "0";
  7160. }
  7161. }
  7162. else if (User.BodyRotation == 7)
  7163. {
  7164. getX--;
  7165. getY--;
  7166. if (!this.method_79(null, item2, getX, getY, 0, false, true, false))
  7167. {
  7168. item2.ExtraData = "1222";
  7169. item2.Posizione = "0";
  7170. }
  7171. }
  7172. else if (User.BodyRotation == 5)
  7173. {
  7174. getX--;
  7175. getY++;
  7176. if (!this.method_79(null, item2, getX, getY, 0, false, true, false))
  7177. {
  7178. item2.ExtraData = "1222";
  7179. item2.Posizione = "0";
  7180. }
  7181. }
  7182. }
  7183. else // RIMPALLO
  7184. {
  7185. if (User.BodyRotation == 4)
  7186. {
  7187. item2.ExtraData = "11";
  7188. if (!this.method_79(null, item2, getX, getY + 1, 0, false, true, false))
  7189. {
  7190. if(!this.method_79(null, item2, getX, getY - 1, 0, false, true, false))
  7191. {
  7192. item2.Posizione = "10";
  7193. }
  7194. }
  7195. }
  7196. else if (User.BodyRotation == 0)
  7197. {
  7198. item2.ExtraData = "11";
  7199. if (!this.method_79(null, item2, getX, getY - 1, 0, false, true, false))
  7200. {
  7201. if(!this.method_79(null, item2, getX, getY + 1, 0, false, true, false))
  7202. {
  7203. item2.Posizione = "10";
  7204. }
  7205. }
  7206. }
  7207. else if (User.BodyRotation == 6)
  7208. {
  7209. item2.ExtraData = "11";
  7210. if (!this.method_79(null, item2, getX - 1, getY, 0, false, true, false))
  7211. {
  7212. if(!this.method_79(null, item2, getX + 1, getY, 0, false, true, false))
  7213. {
  7214. item2.Posizione = "10";
  7215. }
  7216. }
  7217. }
  7218. else if (User.BodyRotation == 2)
  7219. {
  7220. item2.ExtraData = "11";
  7221. if (!this.method_79(null, item2, getX + 1, getY, 0, false, true, false))
  7222. {
  7223. if(!this.method_79(null, item2, getX - 1, getY, 0, false, true, false))
  7224. {
  7225. item2.Posizione = "10";
  7226. }
  7227. }
  7228. }
  7229. else if (User.BodyRotation == 3)
  7230. {
  7231. item2.ExtraData = "11";
  7232. if (!this.method_79(null, item2, getX + 1, getY + 1, 0, false, true, false))
  7233. {
  7234. if(!this.method_79(null, item2, getX - 1, getY - 1, 0, false, true, false))
  7235. {
  7236. item2.Posizione = "10";
  7237. }
  7238. }
  7239. }
  7240. else if (User.BodyRotation == 1)
  7241. {
  7242. item2.ExtraData = "11";
  7243. if (!this.method_79(null, item2, getX + 1, getY - 1, 0, false, true, false))
  7244. {
  7245. if(!this.method_79(null, item2, getX - 1, getY + 1, 0, false, true, false))
  7246. {
  7247. item2.Posizione = "10";
  7248. }
  7249. }
  7250. }
  7251. else if (User.BodyRotation == 7)
  7252. {
  7253. item2.ExtraData = "11";
  7254. if (!this.method_79(null, item2, getX - 1, getY - 1, 0, false, true, false))
  7255. {
  7256. if(!this.method_79(null, item2, getX + 1, getY + 1, 0, false, true, true))
  7257. {
  7258. item2.Posizione = "10";
  7259. }
  7260. }
  7261. }
  7262. else if (User.BodyRotation == 5)
  7263. {
  7264. item2.ExtraData = "11";
  7265. if (!this.method_79(null, item2, getX - 1, getY + 1, 0, false, true, false))
  7266. {
  7267. if(!this.method_79(null, item2, getX + 1, getY - 1, 0, false, true, true))
  7268. {
  7269. item2.Posizione = "10";
  7270. }
  7271. }
  7272. }
  7273. }
  7274. }
  7275.  
  7276. public void method_88(int int_17, int int_18, RoomItem RoomItem_0)
  7277. {
  7278. if (int_17 == 5)
  7279. {
  7280. this.int_9 += int_18 - 1;
  7281. }
  7282. else
  7283. {
  7284. if (int_17 == 8)
  7285. {
  7286. this.int_12 += int_18 - 1;
  7287. }
  7288. else
  7289. {
  7290. if (int_17 == 11)
  7291. {
  7292. this.int_11 += int_18 - 1;
  7293. }
  7294. else
  7295. {
  7296. if (int_17 == 14)
  7297. {
  7298. this.int_10 += int_18 - 1;
  7299. }
  7300. }
  7301. }
  7302. }
  7303. this.method_89(int_17, RoomItem_0, false);
  7304. }
  7305. public void method_89(int int_17, RoomItem RoomItem_0, bool bool_13)
  7306. {
  7307. if (int_17 == 5)
  7308. {
  7309. this.int_9++;
  7310. if (RoomItem_0.ExtraData == "5")
  7311. {
  7312. this.list_6.Add(RoomItem_0);
  7313. }
  7314. if (this.list_10.Count > 0)
  7315. {
  7316. foreach (RoomItem current in this.list_10)
  7317. {
  7318. current.ExtraData = Convert.ToString(this.int_9);
  7319. current.UpdateState(true, true);
  7320. }
  7321. }
  7322. this.method_17(this.int_9);
  7323. }
  7324. else
  7325. {
  7326. if (int_17 == 8)
  7327. {
  7328. this.int_12++;
  7329. if (RoomItem_0.ExtraData == "8")
  7330. {
  7331. this.list_7.Add(RoomItem_0);
  7332. }
  7333. if (this.list_13.Count > 0)
  7334. {
  7335. foreach (RoomItem current in this.list_13)
  7336. {
  7337. current.ExtraData = Convert.ToString(this.int_12);
  7338. current.UpdateState(true, true);
  7339. }
  7340. }
  7341. this.method_17(this.int_12);
  7342. }
  7343. else
  7344. {
  7345. if (int_17 == 11)
  7346. {
  7347. this.int_11++;
  7348. if (RoomItem_0.ExtraData == "11")
  7349. {
  7350. this.list_9.Add(RoomItem_0);
  7351. }
  7352. if (this.list_12.Count > 0)
  7353. {
  7354. foreach (RoomItem current in this.list_12)
  7355. {
  7356. current.ExtraData = Convert.ToString(this.int_11);
  7357. current.UpdateState(true, true);
  7358. }
  7359. }
  7360. this.method_17(this.int_11);
  7361. }
  7362. else
  7363. {
  7364. if (int_17 == 14)
  7365. {
  7366. this.int_10++;
  7367. if (RoomItem_0.ExtraData == "14")
  7368. {
  7369. this.list_8.Add(RoomItem_0);
  7370. }
  7371. if (this.list_11.Count > 0)
  7372. {
  7373. foreach (RoomItem current in this.list_11)
  7374. {
  7375. current.ExtraData = Convert.ToString(this.int_10);
  7376. current.UpdateState(true, true);
  7377. }
  7378. }
  7379. this.method_17(this.int_10);
  7380. }
  7381. }
  7382. }
  7383. }
  7384. if (bool_13 || (this.list_5.Count > 0 && this.list_6.Count + this.list_7.Count + this.list_9.Count + this.list_8.Count >= this.list_5.Count))
  7385. {
  7386. bool_13 = true;
  7387. if (this.int_10 > this.int_9 && this.int_10 > this.int_11 && this.int_10 > this.int_12)
  7388. {
  7389. new Room.Delegate2(this.method_90).BeginInvoke(14, null, null);
  7390. }
  7391. else
  7392. {
  7393. if (this.int_9 > this.int_10 && this.int_9 > this.int_11 && this.int_9 > this.int_12)
  7394. {
  7395. new Room.Delegate2(this.method_90).BeginInvoke(5, null, null);
  7396. }
  7397. else
  7398. {
  7399. if (this.int_11 > this.int_9 && this.int_11 > this.int_10 && this.int_11 > this.int_12)
  7400. {
  7401. new Room.Delegate2(this.method_90).BeginInvoke(11, null, null);
  7402. }
  7403. else
  7404. {
  7405. if (this.int_12 > this.int_9 && this.int_12 > this.int_11 && this.int_12 > this.int_10)
  7406. {
  7407. new Room.Delegate2(this.method_90).BeginInvoke(8, null, null);
  7408. }
  7409. }
  7410. }
  7411. }
  7412. }
  7413. if (bool_13)
  7414. {
  7415. this.method_13();
  7416. }
  7417. }
  7418. public void method_90(int int_17)
  7419. {
  7420. List<RoomItem> list = new List<RoomItem>();
  7421. if (int_17 == 5)
  7422. {
  7423. list = this.list_6;
  7424. }
  7425. else
  7426. {
  7427. if (int_17 == 8)
  7428. {
  7429. list = this.list_7;
  7430. }
  7431. else
  7432. {
  7433. if (int_17 == 11)
  7434. {
  7435. list = this.list_9;
  7436. }
  7437. else
  7438. {
  7439. if (int_17 == 14)
  7440. {
  7441. list = this.list_8;
  7442. }
  7443. }
  7444. }
  7445. }
  7446. try
  7447. {
  7448. for (int i = 4; i > 0; i--)
  7449. {
  7450. Thread.Sleep(500);
  7451. foreach (RoomItem current in list)
  7452. {
  7453. current.ExtraData = "1";
  7454. current.UpdateState(false, true);
  7455. }
  7456. Thread.Sleep(500);
  7457. foreach (RoomItem current in list)
  7458. {
  7459. current.ExtraData = Convert.ToString(int_17);
  7460. current.UpdateState(false, true);
  7461. }
  7462. }
  7463. foreach (RoomItem current in this.list_5)
  7464. {
  7465. current.ExtraData = "0";
  7466. current.UpdateState(true, true);
  7467. }
  7468. }
  7469. catch
  7470. {
  7471. }
  7472. this.list_9.Clear();
  7473. this.list_7.Clear();
  7474. this.list_6.Clear();
  7475. this.list_8.Clear();
  7476. this.int_10 = 0;
  7477. this.int_11 = 0;
  7478. this.int_9 = 0;
  7479. this.int_12 = 0;
  7480. foreach (RoomItem current in this.list_10)
  7481. {
  7482. current.ExtraData = "0";
  7483. current.UpdateState(true, true);
  7484. }
  7485. foreach (RoomItem current in this.list_13)
  7486. {
  7487. current.ExtraData = "0";
  7488. current.UpdateState(true, true);
  7489. }
  7490. foreach (RoomItem current in this.list_12)
  7491. {
  7492. current.ExtraData = "0";
  7493. current.UpdateState(true, true);
  7494. }
  7495. foreach (RoomItem current in this.list_11)
  7496. {
  7497. current.ExtraData = "0";
  7498. current.UpdateState(true, true);
  7499. }
  7500. }
  7501. public void method_91(RoomItem RoomItem_0, RoomUser RoomUser_1)
  7502. {
  7503. RoomItem_0.ExtraData = "1";
  7504. RoomItem_0.UpdateState(false, true);
  7505. RoomItem_0.ReqUpdate(1);
  7506. List<RoomItem> list = new List<RoomItem>();
  7507. RoomUser_1.method_3(true);
  7508. foreach (RoomItem @class in this.Hashtable_0.Values)
  7509. {
  7510. if (@class != RoomItem_0 && !(@class.GetBaseItem().InteractionType.ToLower() != "bb_teleport"))
  7511. {
  7512. list.Add(@class);
  7513. }
  7514. }
  7515. if (list.Count > 0)
  7516. {
  7517. Random random = new Random((int)HighSoft.GetUnixTimestamp() * (int)RoomUser_1.UId);
  7518. int index = random.Next(0, list.Count);
  7519. list[index].ExtraData = "1";
  7520. list[index].UpdateState(false, true);
  7521. list[index].ReqUpdate(1);
  7522. this.byte_0[RoomUser_1.X, RoomUser_1.Y] = 1;
  7523. this.byte_0[list[index].Int32_0, list[index].Int32_1] = 1;
  7524. RoomUser_1.method_7(list[index].Int32_0, list[index].Int32_1, list[index].Double_0);
  7525. RoomUser_1.UpdateNeeded = true;
  7526. }
  7527. }
  7528. public bool method_92(int int_17, int int_18)
  7529. {
  7530. return int_17 >= 0 && int_18 >= 0 && int_17 < this.RoomModel.int_4 && int_18 < this.RoomModel.int_5;
  7531. }
  7532. public List<RoomItem> method_93(int int_17, int int_18)
  7533. {
  7534. List<RoomItem> list = new List<RoomItem>();
  7535. List<RoomItem> result;
  7536. if (this.Hashtable_0 != null)
  7537. {
  7538. foreach (RoomItem @class in this.Hashtable_0.Values)
  7539. {
  7540. if (@class.Int32_0 == int_17 && @class.Int32_1 == int_18)
  7541. {
  7542. list.Add(@class);
  7543. }
  7544. Dictionary<int, AffectedTile> dictionary = this.method_94(@class.GetBaseItem().Length, @class.GetBaseItem().Width, @class.Int32_0, @class.Int32_1, @class.int_3);
  7545. foreach (AffectedTile current in dictionary.Values)
  7546. {
  7547. if (current.Int32_0 == int_17 && current.Int32_1 == int_18)
  7548. {
  7549. list.Add(@class);
  7550. }
  7551. }
  7552. }
  7553. result = list;
  7554. }
  7555. else
  7556. {
  7557. result = null;
  7558. }
  7559. return result;
  7560. }
  7561. public Dictionary<int, AffectedTile> method_94(int int_17, int int_18, int int_19, int int_20, int int_21)
  7562. {
  7563. int num = 0;
  7564. Dictionary<int, AffectedTile> dictionary = new Dictionary<int, AffectedTile>();
  7565. if (int_17 > 1)
  7566. {
  7567. if (int_21 == 0 || int_21 == 4)
  7568. {
  7569. for (int i = 1; i < int_17; i++)
  7570. {
  7571. dictionary.Add(num++, new AffectedTile(int_19, int_20 + i, i));
  7572. for (int j = 1; j < int_18; j++)
  7573. {
  7574. dictionary.Add(num++, new AffectedTile(int_19 + j, int_20 + i, (i < j) ? j : i));
  7575. }
  7576. }
  7577. }
  7578. else
  7579. {
  7580. if (int_21 == 2 || int_21 == 6)
  7581. {
  7582. for (int i = 1; i < int_17; i++)
  7583. {
  7584. dictionary.Add(num++, new AffectedTile(int_19 + i, int_20, i));
  7585. for (int j = 1; j < int_18; j++)
  7586. {
  7587. dictionary.Add(num++, new AffectedTile(int_19 + i, int_20 + j, (i < j) ? j : i));
  7588. }
  7589. }
  7590. }
  7591. }
  7592. }
  7593. if (int_18 > 1)
  7594. {
  7595. if (int_21 == 0 || int_21 == 4)
  7596. {
  7597. for (int i = 1; i < int_18; i++)
  7598. {
  7599. dictionary.Add(num++, new AffectedTile(int_19 + i, int_20, i));
  7600. for (int j = 1; j < int_17; j++)
  7601. {
  7602. dictionary.Add(num++, new AffectedTile(int_19 + i, int_20 + j, (i < j) ? j : i));
  7603. }
  7604. }
  7605. }
  7606. else
  7607. {
  7608. if (int_21 == 2 || int_21 == 6)
  7609. {
  7610. for (int i = 1; i < int_18; i++)
  7611. {
  7612. dictionary.Add(num++, new AffectedTile(int_19, int_20 + i, i));
  7613. for (int j = 1; j < int_17; j++)
  7614. {
  7615. dictionary.Add(num++, new AffectedTile(int_19 + j, int_20 + i, (i < j) ? j : i));
  7616. }
  7617. }
  7618. }
  7619. }
  7620. }
  7621. return dictionary;
  7622. }
  7623. public bool method_95(int int_17, int int_18, bool bool_13)
  7624. {
  7625. return !this.AllowWalkthrough && this.method_96(int_17, int_18);
  7626. }
  7627. public bool method_96(int int_17, int int_18)
  7628. {
  7629. return this.method_43(int_17, int_18) != null;
  7630. }
  7631. public bool method_97(int int_17, int int_18)
  7632. {
  7633. return this.method_44(int_17, int_18) != null;
  7634. }
  7635. public string method_98(string string_10)
  7636. {
  7637. string result;
  7638. try
  7639. {
  7640. if (string_10.Contains(Convert.ToChar(13)))
  7641. {
  7642. result = null;
  7643. }
  7644. else
  7645. {
  7646. if (string_10.Contains(Convert.ToChar(9)))
  7647. {
  7648. result = null;
  7649. }
  7650. else
  7651. {
  7652. string[] array = string_10.Split(new char[]
  7653. {
  7654. ' '
  7655. });
  7656. if (array[2] != "l" && array[2] != "r")
  7657. {
  7658. result = null;
  7659. }
  7660. else
  7661. {
  7662. string[] array2 = array[0].Substring(3).Split(new char[]
  7663. {
  7664. ','
  7665. });
  7666. int num = int.Parse(array2[0]);
  7667. int num2 = int.Parse(array2[1]);
  7668. if (num < 0 || num2 < 0 || num > 200 || num2 > 200)
  7669. {
  7670. result = null;
  7671. }
  7672. else
  7673. {
  7674. string[] array3 = array[1].Substring(2).Split(new char[]
  7675. {
  7676. ','
  7677. });
  7678. int num3 = int.Parse(array3[0]);
  7679. int num4 = int.Parse(array3[1]);
  7680. if (num3 < 0 || num4 < 0 || num3 > 200 || num4 > 200)
  7681. {
  7682. result = null;
  7683. }
  7684. else
  7685. {
  7686. result = string.Concat(new object[]
  7687. {
  7688. ":w=",
  7689. num,
  7690. ",",
  7691. num2,
  7692. " l=",
  7693. num3,
  7694. ",",
  7695. num4,
  7696. " ",
  7697. array[2]
  7698. });
  7699. }
  7700. }
  7701. }
  7702. }
  7703. }
  7704. }
  7705. catch
  7706. {
  7707. result = null;
  7708. }
  7709. return result;
  7710. }
  7711. public bool method_99(int int_17, int int_18, int int_19, int int_20)
  7712. {
  7713. return (Math.Abs(int_17 - int_19) <= 1 && Math.Abs(int_18 - int_20) <= 1) || (int_17 == int_19 && int_18 == int_20);
  7714. }
  7715. public int method_100(int int_17, int int_18, int int_19, int int_20)
  7716. {
  7717. return Math.Abs(int_17 - int_19) + Math.Abs(int_18 - int_20);
  7718. }
  7719. internal void method_101()
  7720. {
  7721. for (int i = 0; i < this.RoomUsers.Length; i++)
  7722. {
  7723. RoomUser @class = this.RoomUsers[i];
  7724. if (@class != null)
  7725. {
  7726. @class.int_10 = @class.X;
  7727. @class.int_11 = @class.Y;
  7728. @class.ClearStatuses();
  7729. @class.method_3(false);
  7730. }
  7731. }
  7732. }
  7733. internal void method_102(int int_17)
  7734. {
  7735. this.int_15 = int_17;
  7736. }
  7737.  
  7738. internal TeamManager GetRoomTeamManager()
  7739. {
  7740. if (this.TeamManager == null)
  7741. {
  7742. this.TeamManager = new TeamManager(this);
  7743. }
  7744. return this.TeamManager;
  7745. }
  7746.  
  7747. internal GameManager GetGameManager()
  7748. {
  7749. if (this.GameManager == null)
  7750. {
  7751. this.GameManager = new GameManager(this);
  7752. }
  7753. return this.GameManager;
  7754. }
  7755.  
  7756. internal Freeze GetFreeze()
  7757. {
  7758. if (this.freeze == null)
  7759. {
  7760. this.freeze = new Freeze(this);
  7761. }
  7762. return this.freeze;
  7763. }
  7764.  
  7765. private RoomItem GetTopItem(int X, int Y)
  7766. {
  7767. RoomItem Item = null;
  7768. foreach (RoomItem @class in this.Hashtable_0.Values)
  7769. {
  7770. if (@class != null)
  7771. {
  7772. if (@class.Int32_0 == X && @class.Int32_1 == Y)
  7773. {
  7774. if (this.double_1[X, Y] == @class.Double_1)
  7775. {
  7776. Item = @class;
  7777. }
  7778. }
  7779. }
  7780. }
  7781. return Item;
  7782. }
  7783.  
  7784. private double GetTopItemHeight(int X, int Y)
  7785. {
  7786. double Height = 0.0;
  7787. foreach (RoomItem @class in this.Hashtable_0.Values)
  7788. {
  7789. if (@class.Int32_0 == X && @class.Int32_1 == Y)
  7790. {
  7791. Height = @class.Double_1;
  7792. }
  7793. }
  7794. return Height;
  7795. }
  7796.  
  7797. private void ProgressFootballAchievement(RoomItem football)
  7798. {
  7799. Habbo User;
  7800. GameClient GetPlayerSession = HighSoft.GetGame().GetClientManager().GetClientByHabbo(football.LastPlayerHitFootball);
  7801.  
  7802. if (GetPlayerSession != null)
  7803. {
  7804. User = GetPlayerSession.GetHabbo();
  7805. User.FootballGoalScorer++;
  7806. User.CheckFootballGoalScorerScoreAchievements();
  7807. }
  7808.  
  7809. Habbo User2;
  7810. GameClient GetRoomOwner = HighSoft.GetGame().GetClientManager().GetClientByHabbo(Owner);
  7811.  
  7812. if (GetRoomOwner != null)
  7813. {
  7814. User2 = GetRoomOwner.GetHabbo();
  7815. User2.FootballGoalHost++;
  7816. User2.CheckFootballGoalHostScoreAchievements();
  7817. }
  7818. else if (GetRoomOwner == null)
  7819. {
  7820. using (DatabaseClient @class = HighSoft.GetDatabase().GetClient())
  7821. {
  7822. int RoomOwnerID = @class.ReadInt32("SELECT id FROM users WHERE username = '" + Owner + "'");
  7823. @class.AddParamWithValue("roomownerid", RoomOwnerID);
  7824. @class.ExecuteQuery("UPDATE user_stats SET FootballGoalHost = FootballGoalHost + 1 WHERE id = @roomownerid LIMIT 1");
  7825. }
  7826. }
  7827. }
  7828. }
  7829. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement