Advertisement
Guest User

room.cs

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