Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 108.57 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. namespace ServerTools
  5. {
  6. public class ChatHook
  7. {
  8. public static bool ChatFlood = false, Admin_Name_Coloring = false, Donator_Name_Coloring = false;
  9. public static bool Special_Player_Name_Coloring = false, Normal_Player_Name_Coloring = false;
  10. public static bool Reserved_Check = false;
  11. public static string Admin_Color = "[FF0000]", Mod_Color = "[008000]";
  12. public static string Don_Color1 = "[009000]", Don_Color2 = "[FF66CC]", Don_Color3 = "[E9C918]";
  13. public static string Special_Player_Color = "[ADAD85]", Normal_Player_Color = "[00B3B3]";
  14. public static string Admin_Prefix = "(ADMIN)", Mod_Prefix = "(MOD)";
  15. public static string Don_Prefix1 = "(DON)", Don_Prefix2 = "(DON)", Don_Prefix3 = "(DON)";
  16. public static string Special_Player_Prefix = "(SPECIAL)";
  17. public static string Normal_Player_Prefix = "(NOOB)";
  18. public static int Admin_Level = 0, Mod_Level = 1;
  19. public static int Don_Level1 = 100, Don_Level2 = 101, Don_Level3 = 102;
  20. public static string Special_Players_List = "76561191234567891,76561191987654321";
  21. public static bool ChatCommandPrivateEnabled = false, ChatCommandPublicEnabled = false;
  22. public static string Command_Private = "/", Command_Public = "!";
  23. private static string filepath = string.Format("{0}/ServerTools.bin", GameUtils.GetSaveGameDir());
  24. private static SortedDictionary<string, DateTime> Dict = new SortedDictionary<string, DateTime>();
  25. private static SortedDictionary<string, string> Dict1 = new SortedDictionary<string, string>();
  26. public static List<string> SpecialPlayers = new List<string>();
  27. private static List<string> SpecialPlayersColorOff = new List<string>();
  28.  
  29. public static void SpecialIdCheck()
  30. {
  31. if (Special_Player_Name_Coloring)
  32. {
  33. SpecialPlayers.Clear();
  34. var s_Id = Special_Players_List.Split(',');
  35. foreach (var specialId in s_Id)
  36. {
  37. SpecialPlayers.Add(specialId.ToString());
  38. }
  39. }
  40. }
  41.  
  42. public static bool Hook(ClientInfo _cInfo, string _message, string _playerName, string _secondaryName, bool _localizeSecondary)
  43. {
  44. if (!string.IsNullOrEmpty(_message) && _cInfo != null && _playerName != Config.Server_Response_Name && _secondaryName != "ServerTools")
  45. {
  46. if (ChatFlood)
  47. {
  48. if (_message.Length > 500)
  49. {
  50. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}Message too long.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  51. return false;
  52. }
  53. }
  54. if (ChatLog.IsEnabled)
  55. {
  56. ChatLog.Log(_message, _playerName);
  57. }
  58. if (MutePlayer.IsEnabled)
  59. {
  60. if (MutePlayer.Mutes.Contains(_cInfo.playerId))
  61. {
  62. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, "You are muted.", Config.Server_Response_Name, false, "ServerTools", false));
  63. return false;
  64. }
  65. }
  66. if (!Jail.Jailed.Contains(_cInfo.playerId))
  67. {
  68. if (Admin_Name_Coloring && !_message.StartsWith("@") && _secondaryName != "ServerTools1" && _secondaryName != "Coppis" && !_message.StartsWith(Command_Private) && !_message.StartsWith(Command_Public) && GameManager.Instance.adminTools.IsAdmin(_cInfo.playerId) && !AdminChatColor.AdminColorOff.Contains(_cInfo.playerId))
  69. {
  70. AdminToolsClientInfo Admin = GameManager.Instance.adminTools.GetAdminToolsClientInfo(_cInfo.playerId);
  71. if (Admin.PermissionLevel <= Admin_Level)
  72. {
  73. if (!ClanManager.ClanMember.Contains(_cInfo.playerId))
  74. {
  75. if (Admin_Prefix != "")
  76. {
  77. _playerName = string.Format("{0}{1} {2}[-]", Admin_Color, Admin_Prefix, _playerName);
  78. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, _message, _playerName, false, "ServerTools1", false);
  79. return false;
  80. }
  81. else
  82. {
  83. _playerName = string.Format("{0}{1}[-]", Admin_Color, _playerName);
  84. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, _message, _playerName, false, "ServerTools1", false);
  85. return false;
  86. }
  87. }
  88. else
  89. {
  90. _playerName = string.Format("{0}({1}) {2}[-]", Admin_Color, PersistentContainer.Instance.Players[_cInfo.playerId, false].ClanName, _playerName);
  91. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, _message, _playerName, false, "ServerTools1", false);
  92. return false;
  93. }
  94. }
  95. if (Admin.PermissionLevel > Admin_Level & Admin.PermissionLevel <= Mod_Level)
  96. {
  97. if (!ClanManager.ClanMember.Contains(_cInfo.playerId))
  98. {
  99. if (Mod_Prefix != "")
  100. {
  101. _playerName = string.Format("{0}{1} {2}[-]", Mod_Color, Mod_Prefix, _playerName);
  102. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, _message, _playerName, false, "ServerTools1", false);
  103. return false;
  104. }
  105. else
  106. {
  107. _playerName = string.Format("{0}{1}[-]", Mod_Color, _playerName);
  108. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, _message, _playerName, false, "ServerTools1", false);
  109. return false;
  110. }
  111. }
  112. else
  113. {
  114. _playerName = string.Format("{0}({1}) {2}[-]", Mod_Color, PersistentContainer.Instance.Players[_cInfo.playerId, false].ClanName, _playerName);
  115. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, _message, _playerName, false, "ServerTools1", false);
  116. return false;
  117. }
  118. }
  119. }
  120. if (Donator_Name_Coloring && !_message.StartsWith("@") && _secondaryName != "ServerTools1" && _secondaryName != "Coppis" && !_message.StartsWith(Command_Private) && !_message.StartsWith(Command_Public))
  121. {
  122. AdminToolsClientInfo Admin = GameManager.Instance.adminTools.GetAdminToolsClientInfo(_cInfo.playerId);
  123. if (Admin.PermissionLevel == Don_Level1)
  124. {
  125. if (ReservedSlots.Dict.ContainsKey(_cInfo.playerId))
  126. {
  127. DateTime _dt;
  128. ReservedSlots.Dict.TryGetValue(_cInfo.playerId, out _dt);
  129. if (DateTime.Now < _dt)
  130. {
  131. if (!ClanManager.ClanMember.Contains(_cInfo.playerId))
  132. {
  133. if (Don_Prefix1 != "")
  134. {
  135. _playerName = string.Format("{0}{1} {2}[-]", Don_Color1, Don_Prefix1, _playerName);
  136. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, _message, _playerName, false, "ServerTools1", false);
  137. return false;
  138. }
  139. else
  140. {
  141. _playerName = string.Format("{0}{1}[-]", Don_Color1, _playerName);
  142. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, _message, _playerName, false, "ServerTools1", false);
  143. return false;
  144. }
  145. }
  146. else
  147. {
  148. _playerName = string.Format("{0}({1}) {2}[-]", Don_Color1, PersistentContainer.Instance.Players[_cInfo.playerId, false].ClanName, _playerName);
  149. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, _message, _playerName, false, "ServerTools1", false);
  150. return false;
  151. }
  152. }
  153. }
  154. }
  155. if (Admin.PermissionLevel == Don_Level2)
  156. {
  157. if (ReservedSlots.Dict.ContainsKey(_cInfo.playerId))
  158. {
  159. DateTime _dt;
  160. ReservedSlots.Dict.TryGetValue(_cInfo.playerId, out _dt);
  161. if (DateTime.Now < _dt)
  162. {
  163. if (!ClanManager.ClanMember.Contains(_cInfo.playerId))
  164. {
  165. if (Don_Prefix2 != "")
  166. {
  167. _playerName = string.Format("{0}{1} {2}[-]", Don_Color2, Don_Prefix2, _playerName);
  168. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, _message, _playerName, false, "ServerTools1", false);
  169. return false;
  170. }
  171. else
  172. {
  173. _playerName = string.Format("{0}{1}[-]", Don_Color2, _playerName);
  174. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, _message, _playerName, false, "ServerTools1", false);
  175. return false;
  176. }
  177. }
  178. else
  179. {
  180. _playerName = string.Format("{0}({1}) {2}[-]", Don_Color2, PersistentContainer.Instance.Players[_cInfo.playerId, false].ClanName, _playerName);
  181. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, _message, _playerName, false, "ServerTools1", false);
  182. return false;
  183. }
  184. }
  185. }
  186. }
  187. if (Admin.PermissionLevel == Don_Level3)
  188. {
  189. if (ReservedSlots.Dict.ContainsKey(_cInfo.playerId))
  190. {
  191. DateTime _dt;
  192. ReservedSlots.Dict.TryGetValue(_cInfo.playerId, out _dt);
  193. if (DateTime.Now < _dt)
  194. {
  195. if (!ClanManager.ClanMember.Contains(_cInfo.playerId))
  196. {
  197. if (Don_Prefix3 != "")
  198. {
  199. _playerName = string.Format("{0}{1} {2}[-]", Don_Color3, Don_Prefix3, _playerName);
  200. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, _message, _playerName, false, "ServerTools1", false);
  201. return false;
  202. }
  203. else
  204. {
  205. _playerName = string.Format("{0}{1}[-]", Don_Color3, _playerName);
  206. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, _message, _playerName, false, "ServerTools1", false);
  207. return false;
  208. }
  209. }
  210. else
  211. {
  212. _playerName = string.Format("{0}({1}) {2}[-]", Don_Color2, PersistentContainer.Instance.Players[_cInfo.playerId, false].ClanName, _playerName);
  213. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, _message, _playerName, false, "ServerTools1", false);
  214. return false;
  215. }
  216. }
  217. }
  218. }
  219. }
  220. if (Special_Player_Name_Coloring && !_message.StartsWith("@") && _secondaryName != "ServerTools1" && _secondaryName != "Coppis" && !_message.StartsWith(Command_Private) && !_message.StartsWith(Command_Public) && SpecialPlayers.Contains(_cInfo.playerId) && !SpecialPlayersColorOff.Contains(_cInfo.playerId))
  221. {
  222. if (!ClanManager.ClanMember.Contains(_cInfo.playerId))
  223. {
  224. if (Special_Player_Prefix != "")
  225. {
  226. _playerName = string.Format("{0}{1} {2}[-]", Special_Player_Color, Special_Player_Prefix, _playerName);
  227. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, _message, _playerName, false, "ServerTools1", false);
  228. return false;
  229. }
  230. else
  231. {
  232. _playerName = string.Format("{0}{1}[-]", Special_Player_Color, _playerName);
  233. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, _message, _playerName, false, "ServerTools1", false);
  234. return false;
  235. }
  236. }
  237. else
  238. {
  239. _playerName = string.Format("{0}({1}) {2}[-]", Special_Player_Color, PersistentContainer.Instance.Players[_cInfo.playerId, false].ClanName, _playerName);
  240. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, _message, _playerName, false, "ServerTools1", false);
  241. return false;
  242. }
  243. }
  244. if (Normal_Player_Name_Coloring && !_message.StartsWith("@") && _secondaryName != "ServerTools1" && _secondaryName != "Coppis" && !_message.StartsWith(Command_Private) && !_message.StartsWith(Command_Public))
  245. {
  246. if (!ClanManager.ClanMember.Contains(_cInfo.playerId))
  247. {
  248. if (Normal_Player_Prefix != "")
  249. {
  250. _playerName = string.Format("{0}{1} {2}[-]", Normal_Player_Color, Normal_Player_Prefix, _playerName);
  251. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, _message, _playerName, false, "ServerTools1", false);
  252. return false;
  253. }
  254. else
  255. {
  256. _playerName = string.Format("{0}{1}[-]", Normal_Player_Color, _playerName);
  257. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, _message, _playerName, false, "ServerTools1", false);
  258. return false;
  259. }
  260. }
  261. else
  262. {
  263. _playerName = string.Format("{0}({1}) {2}[-]", Normal_Player_Color, PersistentContainer.Instance.Players[_cInfo.playerId, false].ClanName, _playerName);
  264. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, _message, _playerName, false, "ServerTools1", false);
  265. return false;
  266. }
  267. }
  268. if (ClanManager.IsEnabled && !_message.StartsWith("@") && _secondaryName != "ServerTools1" && _secondaryName != "Coppis" && !_message.StartsWith(Command_Private) && !_message.StartsWith(Command_Public) && ClanManager.ClanMember.Contains(_cInfo.playerId))
  269. {
  270. _playerName = string.Format("({0}) {1}[-]", PersistentContainer.Instance.Players[_cInfo.playerId, false].ClanName, _playerName);
  271. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, _message, _playerName, false, "ServerTools1", false);
  272. return false;
  273. }
  274. if (Badwords.Invalid_Name)
  275. {
  276. bool _hasBadName = false;
  277. string _playerName1 = _playerName.ToLower();
  278. foreach (string _word in Badwords.List)
  279. {
  280. if (_playerName1.Contains(_word))
  281. {
  282. _hasBadName = true;
  283. }
  284. }
  285. if (_hasBadName)
  286. {
  287. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, _message, "Invalid Name-No Commands", false, "ServerTools", false);
  288. return false;
  289. }
  290. }
  291. if (Badwords.IsEnabled)
  292. {
  293. bool _hasBadWord = false;
  294. string _message1 = _message.ToLower();
  295. foreach (string _word in Badwords.List)
  296. {
  297. if (_message1.Contains(_word))
  298. {
  299. string _replace = "";
  300. for (int i = 0; i < _word.Length; i++)
  301. {
  302. _replace = string.Format("{0}*", _replace);
  303. }
  304. _message1 = _message1.Replace(_word, _replace);
  305. _hasBadWord = true;
  306. }
  307. }
  308. if (_hasBadWord)
  309. {
  310. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, _message1, Config.Server_Response_Name, false, "ServerTools", false);
  311. return false;
  312. }
  313. }
  314. if (_message.StartsWith(" "))
  315. {
  316. _message.Substring(1);
  317. }
  318. if (_message.StartsWith(" "))
  319. {
  320. _message.Substring(2);
  321. }
  322. if (_message.StartsWith("[") && _message.Contains("]") || _message.Contains(Command_Private) || _message.Contains(Command_Public) || _message.StartsWith(Command_Private) || _message.StartsWith(Command_Public))
  323. {
  324. if (_message.StartsWith("[") && _message.Contains("]"))
  325. {
  326. _message = _message.Replace("(\\[.*\\] )", "");
  327. }
  328. if (_message.StartsWith("(") && _message.Contains(")"))
  329. {
  330. _message = _message.Replace("(\\(.*\\) )", "");
  331. }
  332. bool _announce = false;
  333. if (_message.StartsWith(Command_Public))
  334. {
  335. _announce = true;
  336. _message = _message.Replace(Command_Public, "");
  337. }
  338. if (_message.StartsWith(Command_Private))
  339. {
  340. _message = _message.Replace(Command_Private, "");
  341. }
  342. if (_message.StartsWith("w ") || _message.StartsWith("W ") || _message.StartsWith("pm ") || _message.StartsWith("PM "))
  343. {
  344. if (CustomCommands.IsEnabled)
  345. {
  346. Whisper.Send(_cInfo, _message);
  347. return false;
  348. }
  349. }
  350. if (_message.StartsWith("r ") || _message.StartsWith("R ") || _message.StartsWith("RE ") || _message.StartsWith("re "))
  351. {
  352. if (CustomCommands.IsEnabled)
  353. {
  354. Whisper.Reply(_cInfo, _message);
  355. return false;
  356. }
  357. }
  358. _message = _message.ToLower();
  359. if (TeleportHome.IsEnabled && _message == "sethome")
  360. {
  361. if (!Zones.Set_Home)
  362. {
  363. if (!Players.ZoneExit.ContainsKey(_cInfo.entityId))
  364. {
  365. TeleportHome.SetHome(_cInfo, _playerName, _announce);
  366. }
  367. else
  368. {
  369. if (_announce)
  370. {
  371. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, string.Format("{0}You can not use sethome in a protected zone.[-]", _message), Config.Server_Response_Name, false, "ServerTools", true);
  372. }
  373. else
  374. {
  375. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}You can not use sethome in a protected zone.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  376. }
  377. }
  378. }
  379. else
  380. {
  381.  
  382. TeleportHome.SetHome(_cInfo, _playerName, _announce);
  383. }
  384. return false;
  385. }
  386. if (TeleportHome.IsEnabled && _message == "home")
  387. {
  388.  
  389. TeleportHome.TeleHome(_cInfo, _playerName, _announce);
  390. return false;
  391. }
  392. if (TeleportHome.IsEnabled && _message == "fhome")
  393. {
  394.  
  395. TeleportHome.FTeleHome(_cInfo, _playerName, _announce);
  396. return false;
  397. }
  398. if (TeleportHome.IsEnabled && _message == "delhome")
  399. {
  400.  
  401. TeleportHome.DelHome(_cInfo, _playerName, _announce);
  402. return false;
  403. }
  404. if (TeleportHome.Set_Home2_Enabled && _message == "sethome2")
  405. {
  406. if (TeleportHome.Set_Home2_Donor_Only && ReservedSlots.IsEnabled)
  407. {
  408. if (!Zones.Set_Home)
  409. {
  410. if (!Players.ZoneExit.ContainsKey(_cInfo.entityId))
  411. {
  412. if (ReservedSlots.Dict.ContainsKey(_cInfo.playerId))
  413. {
  414. DateTime _dt;
  415. ReservedSlots.Dict.TryGetValue(_cInfo.playerId, out _dt);
  416. if (DateTime.Now < _dt)
  417. {
  418.  
  419. TeleportHome.SetHome2(_cInfo, _playerName, _announce);
  420. }
  421. else
  422. {
  423. if (_announce)
  424. {
  425. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, string.Format("{0}Your reserved status has expired. Command is unavailable.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", true);
  426. }
  427. else
  428. {
  429. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}Your reserved status has expired Command is unavailable..[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  430. }
  431. }
  432. }
  433. else
  434. {
  435. if (_announce)
  436. {
  437. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, string.Format("{0}You are not listed as a reserved player. Command is unavailable.[-]", _message), Config.Server_Response_Name, false, "ServerTools", true);
  438. }
  439. else
  440. {
  441. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}You are not listed as a reserved player. Command is unavailable.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  442. }
  443. }
  444. }
  445. else
  446. {
  447. if (_announce)
  448. {
  449. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, string.Format("{0}You can not use sethome2 in a protected zone.[-]", _message), Config.Server_Response_Name, false, "ServerTools", true);
  450. }
  451. else
  452. {
  453. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}You can not use sethome2 in a protected zone.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  454. }
  455. }
  456. }
  457. else
  458. {
  459. if (ReservedSlots.Dict.ContainsKey(_cInfo.playerId))
  460. {
  461. DateTime _dt;
  462. ReservedSlots.Dict.TryGetValue(_cInfo.playerId, out _dt);
  463. if (DateTime.Now < _dt)
  464. {
  465. TeleportHome.SetHome2(_cInfo, _playerName, _announce);
  466. }
  467. else
  468. {
  469. if (_announce)
  470. {
  471. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, string.Format("{0}Your reserved status has expired. Command is unavailable.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", true);
  472. }
  473. else
  474. {
  475. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}Your reserved status has expired Command is unavailable..[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  476. }
  477. }
  478. }
  479. else
  480. {
  481. if (_announce)
  482. {
  483. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, string.Format("{0}You are not listed as a reserved player. Command is unavailable.[-]", _message), Config.Server_Response_Name, false, "ServerTools", true);
  484. }
  485. else
  486. {
  487. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}You are not listed as a reserved player. Command is unavailable.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  488. }
  489. }
  490. }
  491. }
  492. else if (TeleportHome.Set_Home2_Enabled && !TeleportHome.Set_Home2_Donor_Only)
  493. {
  494. if (!Zones.Set_Home)
  495. {
  496. if (!Players.ZoneExit.ContainsKey(_cInfo.entityId))
  497. {
  498. TeleportHome.SetHome2(_cInfo, _playerName, _announce);
  499. }
  500. else
  501. {
  502. if (_announce)
  503. {
  504. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, string.Format("{0}You can not use sethome2 in a protected zone.[-]", _message), Config.Server_Response_Name, false, "ServerTools", true);
  505. }
  506. else
  507. {
  508. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}You can not use sethome2 in a protected zone.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  509. }
  510. }
  511. }
  512. else
  513. {
  514. TeleportHome.SetHome2(_cInfo, _playerName, _announce);
  515. }
  516. }
  517. return false;
  518. }
  519. if (TeleportHome.IsEnabled && _message == "home2")
  520. {
  521. if (TeleportHome.Set_Home2_Enabled && TeleportHome.Set_Home2_Donor_Only && ReservedSlots.IsEnabled)
  522. {
  523. if (ReservedSlots.Dict.ContainsKey(_cInfo.playerId))
  524. {
  525. DateTime _dt;
  526. ReservedSlots.Dict.TryGetValue(_cInfo.playerId, out _dt);
  527. if (DateTime.Now < _dt)
  528. {
  529. TeleportHome.TeleHome2(_cInfo, _playerName, _announce);
  530. }
  531. else
  532. {
  533. if (_announce)
  534. {
  535. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, string.Format("{0}Your reserved status has expired. Command is unavailable.[-]", Config.Chat_Response_Color), _playerName, false, "ServerTools", true);
  536. }
  537. else
  538. {
  539. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}Your reserved status has expired. Command is unavailable.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  540. }
  541. }
  542. }
  543. else
  544. {
  545. if (_announce)
  546. {
  547. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, string.Format("{0}You are not on the reserved list, please donate or contact an admin.[-]", Config.Chat_Response_Color), _playerName, false, "ServerTools", true);
  548. }
  549. else
  550. {
  551. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}You are not on the reserved list, please donate or contact an admin.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  552. }
  553. }
  554. }
  555. else if (TeleportHome.Set_Home2_Enabled && !TeleportHome.Set_Home2_Donor_Only)
  556. {
  557. TeleportHome.TeleHome2(_cInfo, _playerName, _announce);
  558. }
  559. else
  560. {
  561. if (_announce)
  562. {
  563. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, string.Format("{0}Home2 is not enabled.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", true);
  564. }
  565. else
  566. {
  567. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}Home2 is not enabled.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  568. }
  569. }
  570. return false;
  571. }
  572. if (TeleportHome.IsEnabled && _message == "fhome2")
  573. {
  574. if (TeleportHome.Set_Home2_Enabled && TeleportHome.Set_Home2_Donor_Only && ReservedSlots.IsEnabled)
  575. {
  576. if (ReservedSlots.Dict.ContainsKey(_cInfo.playerId))
  577. {
  578. DateTime _dt;
  579. ReservedSlots.Dict.TryGetValue(_cInfo.playerId, out _dt);
  580. if (DateTime.Now < _dt)
  581. {
  582. TeleportHome.FTeleHome2(_cInfo, _playerName, _announce);
  583. }
  584. else
  585. {
  586. if (_announce)
  587. {
  588. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, string.Format("{0}Your reserved status has expired. Command is unavailable.[-]", Config.Chat_Response_Color), _playerName, false, "ServerTools", true);
  589. }
  590. else
  591. {
  592. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}Your reserved status has expired. Command is unavailable.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  593. }
  594. }
  595. }
  596. else
  597. {
  598. if (_announce)
  599. {
  600. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, string.Format("{0}You are not on the reserved list, please donate or contact an admin.[-]", Config.Chat_Response_Color), _playerName, false, "ServerTools", true);
  601. }
  602. else
  603. {
  604. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}You are not on the reserved list, please donate or contact an admin.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  605. }
  606. }
  607. }
  608. else if (TeleportHome.Set_Home2_Enabled && !TeleportHome.Set_Home2_Donor_Only)
  609. {
  610. TeleportHome.FTeleHome2(_cInfo, _playerName, _announce);
  611. }
  612. else
  613. {
  614. if (_announce)
  615. {
  616. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, string.Format("{0}Home2 is not enabled.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", true);
  617. }
  618. else
  619. {
  620. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}Home2 is not enabled.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  621. }
  622. }
  623. return false;
  624. }
  625. if (TeleportHome.IsEnabled && _message == "delhome2")
  626. {
  627. if (TeleportHome.Set_Home2_Enabled && TeleportHome.Set_Home2_Donor_Only && ReservedSlots.IsEnabled)
  628. {
  629. if (ReservedSlots.Dict.ContainsKey(_cInfo.playerId))
  630. {
  631. DateTime _dt;
  632. ReservedSlots.Dict.TryGetValue(_cInfo.playerId, out _dt);
  633. if (DateTime.Now < _dt)
  634. {
  635. TeleportHome.DelHome2(_cInfo, _playerName, _announce);
  636. }
  637. else
  638. {
  639. if (_announce)
  640. {
  641. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, string.Format("{0}Your reserved status has expired. Command is unavailable.[-]", Config.Chat_Response_Color), _playerName, false, "ServerTools", true);
  642. }
  643. else
  644. {
  645. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}Your reserved status has expired. Command is unavailable.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  646. }
  647. }
  648. }
  649. else
  650. {
  651. if (_announce)
  652. {
  653. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, string.Format("{0}You are not on the reserved list, please donate or contact an admin.[-]", Config.Chat_Response_Color), _playerName, false, "ServerTools", true);
  654. }
  655. else
  656. {
  657. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}You are not on the reserved list, please donate or contact an admin.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  658. }
  659. }
  660. }
  661. else if (TeleportHome.Set_Home2_Enabled && !TeleportHome.Set_Home2_Donor_Only)
  662. {
  663. TeleportHome.DelHome2(_cInfo, _playerName, _announce);
  664. }
  665. return false;
  666. }
  667. if (TeleportHome.IsEnabled && _message == "go")
  668. {
  669. if (TeleportHome.Invite.ContainsKey(_cInfo.entityId))
  670. {
  671. TeleportHome.FriendHome(_cInfo);
  672. return false;
  673. }
  674. }
  675. if (Hardcore.IsEnabled && _message == "top3")
  676. {
  677. Hardcore.TopThree(_cInfo, _announce);
  678. return false;
  679. }
  680. if (Hardcore.IsEnabled && _message == "score")
  681. {
  682. Hardcore.Score(_cInfo, _announce);
  683. return false;
  684. }
  685. if (AdminChat.IsEnabled)
  686. {
  687. if (_message.StartsWith("mute ") || _message.StartsWith("unmute "))
  688. {
  689. if (_message.StartsWith("mute "))
  690. {
  691. MutePlayer.Add(_cInfo, _message);
  692. }
  693. if (_message.StartsWith("unmute "))
  694. {
  695. MutePlayer.Remove(_cInfo, _message);
  696. }
  697. return false;
  698. }
  699. }
  700. if (CustomCommands.IsEnabled && _message == "commands")
  701. {
  702. string _commands1 = CustomCommands.GetChatCommands1(_cInfo);
  703. string _commands2 = CustomCommands.GetChatCommands2(_cInfo);
  704. string _commands3 = CustomCommands.GetChatCommands3(_cInfo);
  705. string _commands4 = CustomCommands.GetChatCommands4(_cInfo);
  706. string _commandsCustom = CustomCommands.GetChatCommandsCustom(_cInfo);
  707. string _commandsAdmin = CustomCommands.GetChatCommandsAdmin(_cInfo);
  708. if (_announce)
  709. {
  710. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, _commands1, Config.Server_Response_Name, false, "ServerTools", false);
  711. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, _commands2, Config.Server_Response_Name, false, "ServerTools", false);
  712. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, _commands3, Config.Server_Response_Name, false, "ServerTools", false);
  713. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, _commands4, Config.Server_Response_Name, false, "ServerTools", false);
  714. if (CustomCommands.IsEnabled)
  715. {
  716. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, _commandsCustom, Config.Server_Response_Name, false, "ServerTools", false);
  717. }
  718. AdminToolsClientInfo Admin = GameManager.Instance.adminTools.GetAdminToolsClientInfo(_cInfo.playerId);
  719. if (Admin.PermissionLevel <= Admin_Level)
  720. {
  721. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, _commandsAdmin, Config.Server_Response_Name, false, "ServerTools", false);
  722. }
  723. }
  724. else
  725. {
  726. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, _commands1, Config.Server_Response_Name, false, "ServerTools", false));
  727. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, _commands2, Config.Server_Response_Name, false, "ServerTools", false));
  728. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, _commands3, Config.Server_Response_Name, false, "ServerTools", false));
  729. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, _commands4, Config.Server_Response_Name, false, "ServerTools", false));
  730. if (CustomCommands.IsEnabled)
  731. {
  732. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, _commandsCustom, Config.Server_Response_Name, false, "ServerTools", false));
  733. }
  734. AdminToolsClientInfo Admin = GameManager.Instance.adminTools.GetAdminToolsClientInfo(_cInfo.playerId);
  735. if (Admin.PermissionLevel <= Admin_Level)
  736. {
  737. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, _commandsAdmin, Config.Server_Response_Name, false, "ServerTools", false));
  738. }
  739. }
  740. return false;
  741. }
  742. if (Day7.IsEnabled && (_message == "day7" || _message == "day"))
  743. {
  744. if (_announce)
  745. {
  746. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, string.Format("{0}{1}", Command_Public, _message), Config.Server_Response_Name, false, "ServerTools", true);
  747. }
  748. Day7.GetInfo(_cInfo, _announce);
  749. return false;
  750. }
  751. if (Bloodmoon.IsEnabled && (_message == "bloodmoon" || _message == "bm"))
  752. {
  753. Bloodmoon.GetBloodmoon(_cInfo, _announce);
  754. return false;
  755. }
  756. if (Suicide.IsEnabled && (_message == "killme" || _message == "wrist" || _message == "hang" || _message == "suicide"))
  757. {
  758. if (_announce)
  759. {
  760. Suicide.CheckPlayer(_cInfo, _announce);
  761. }
  762. else
  763. {
  764. Suicide.CheckPlayer(_cInfo, _announce);
  765. }
  766. return false;
  767. }
  768. if (Gimme.IsEnabled && (_message == "gimme" || _message == "gimmie"))
  769. {
  770. if (Gimme.Always_Show_Response)
  771. {
  772. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, string.Format("{0}{1}", Command_Public, _message), Config.Server_Response_Name, false, "ServerTools", true);
  773. Gimme.Checkplayer(_cInfo, true, _playerName);
  774. }
  775. else
  776. {
  777. Gimme.Checkplayer(_cInfo, _announce, _playerName);
  778. }
  779. return false;
  780. }
  781. if (Jail.IsEnabled && (_message == "setjail" || _message.StartsWith("jail ") || _message.StartsWith("unjail ")))
  782. {
  783. if (_message == "setjail")
  784. {
  785. if (_announce)
  786. {
  787. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, string.Format("{0}{1}", Command_Public, _message), Config.Server_Response_Name, false, "ServerTools", true);
  788. }
  789. Jail.SetJail(_cInfo);
  790. }
  791. if (_message.StartsWith("jail "))
  792. {
  793. if (_announce)
  794. {
  795. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, string.Format("{0}{1}", Command_Public, _message), Config.Server_Response_Name, false, "ServerTools", true);
  796. }
  797. Jail.PutInJail(_cInfo, _message);
  798. }
  799. else
  800. {
  801. if (_announce)
  802. {
  803. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, string.Format("{0}{1}", Command_Public, _message), Config.Server_Response_Name, false, "ServerTools", true);
  804. }
  805. Jail.RemoveFromJail(_cInfo, _message);
  806. }
  807. return false;
  808. }
  809. if (NewSpawnTele.IsEnabled && _message == "setspawn")
  810. {
  811. if (_announce)
  812. {
  813. NewSpawnTele.SetNewSpawnTele(_cInfo);
  814. }
  815. else
  816. {
  817. NewSpawnTele.SetNewSpawnTele(_cInfo);
  818. return false;
  819. }
  820. }
  821. if (Animals.IsEnabled && (_message == "trackanimal" || _message == "track"))
  822. {
  823. Animals.Checkplayer(_cInfo, _announce, _playerName);
  824. return false;
  825. }
  826. if (FirstClaimBlock.IsEnabled && _message == "claim")
  827. {
  828. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}Checking your claim block status.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  829. FirstClaimBlock.firstClaim(_cInfo);
  830. return false;
  831. }
  832. if (ClanManager.IsEnabled && (_message.StartsWith("clanadd") || _message == "clandel" || _message.StartsWith("claninvite") || _message == "clanaccept" || _message == "clandecline" || _message.StartsWith("clanremove") || _message.StartsWith("clanpromote") || _message.StartsWith("clandemote") || _message.StartsWith("clan") || _message == "clancommands"))
  833. {
  834. if (_message == "clancommands")
  835. {
  836. ClanManager.GetChatCommands(_cInfo);
  837. }
  838. if (_message.StartsWith("clanadd"))
  839. {
  840. if (_message == "clanadd")
  841. {
  842. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}Usage: /clanadd clanName[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  843. }
  844. else
  845. {
  846. _message = _message.Replace("clanadd ", "");
  847. ClanManager.AddClan(_cInfo, _message);
  848. }
  849. }
  850. if (_message == "clandel")
  851. {
  852. ClanManager.RemoveClan(_cInfo);
  853. }
  854. if (_message.StartsWith("claninvite"))
  855. {
  856. if (_message == "claninvite")
  857. {
  858. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}Usage: /claninvite playerName[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  859. }
  860. else
  861. {
  862. _message = _message.Replace("claninvite ", "");
  863. ClanManager.InviteMember(_cInfo, _message);
  864. }
  865. }
  866. if (_message == "clanaccept")
  867. {
  868. ClanManager.InviteAccept(_cInfo);
  869. return false;
  870. }
  871. if (_message == "clandecline")
  872. {
  873. ClanManager.InviteDecline(_cInfo);
  874. }
  875. if (_message.StartsWith("clanremove"))
  876. {
  877. if (_message == "clanremove")
  878. {
  879. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}Usage: /clanremove playerName[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  880. }
  881. else
  882. {
  883. _message = _message.Replace("clanremove ", "");
  884. ClanManager.RemoveMember(_cInfo, _message);
  885. }
  886. }
  887. if (_message.StartsWith("clanpromote"))
  888. {
  889. if (_message == "clanpromote")
  890. {
  891. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}Usage: /clanpromote playerName[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  892. }
  893. else
  894. {
  895. _message = _message.Replace("clanpromote ", "");
  896. ClanManager.PromoteMember(_cInfo, _message);
  897. }
  898. }
  899. if (_message.StartsWith("clandemote"))
  900. {
  901. if (_message == "clandemote")
  902. {
  903. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}Usage: /clandemote playerName[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  904. }
  905. else
  906. {
  907. _message = _message.Replace("clandemote ", "");
  908. ClanManager.DemoteMember(_cInfo, _message);
  909. }
  910. }
  911. if (_message == "clanleave")
  912. {
  913. ClanManager.LeaveClan(_cInfo);
  914. }
  915. if (_message.StartsWith("clan"))
  916. {
  917. if (_message == "clan")
  918. {
  919. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}Usage: /clan message[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  920. }
  921. else
  922. {
  923. _message = _message.Replace("clan ", "");
  924. ClanManager.Clan(_cInfo, _message);
  925. }
  926. }
  927. return false;
  928. }
  929. if (Donator_Name_Coloring && _message == "doncolor")
  930. {
  931. if (ReservedSlots.Dict.ContainsKey(_cInfo.playerId))
  932. {
  933. GameManager.Instance.adminTools.IsAdmin(_cInfo.playerId);
  934. AdminToolsClientInfo Admin = GameManager.Instance.adminTools.GetAdminToolsClientInfo(_cInfo.playerId);
  935. if (Admin.PermissionLevel <= Mod_Level)
  936. {
  937. DateTime _dt;
  938. ReservedSlots.Dict.TryGetValue(_cInfo.playerId, out _dt);
  939. if (DateTime.Now < _dt)
  940. {
  941. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}Sorry {1}, your chat color can not be changed as a moderator or administrator.[-]", Config.Chat_Response_Color, _playerName), Config.Server_Response_Name, false, "ServerTools", false));
  942. }
  943. else
  944. {
  945. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}, your reserved status expired on {2}. Moderators and Admins can not change their chat color.[-]", Config.Chat_Response_Color, _playerName, _dt), Config.Server_Response_Name, false, "ServerTools", false));
  946. }
  947. }
  948. else
  949. {
  950. if (Admin.PermissionLevel == Don_Level1)
  951. {
  952. DateTime _dt;
  953. ReservedSlots.Dict.TryGetValue(_cInfo.playerId, out _dt);
  954. if (DateTime.Now < _dt)
  955. {
  956. SdtdConsole.Instance.ExecuteSync(string.Format("admin add {0} {1}", _cInfo.entityId, Don_Level2), null);
  957. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}, your chat color has been switched.[-]", Config.Chat_Response_Color, _playerName), Config.Server_Response_Name, false, "ServerTools", false));
  958. }
  959. else
  960. {
  961. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}, your reserved status expired on {2}. Command is unavailable.[-]", Config.Chat_Response_Color, _playerName, _dt), Config.Server_Response_Name, false, "ServerTools", false));
  962. }
  963. }
  964. else if (Admin.PermissionLevel == Don_Level2)
  965. {
  966. DateTime _dt;
  967. ReservedSlots.Dict.TryGetValue(_cInfo.playerId, out _dt);
  968. if (DateTime.Now < _dt)
  969. {
  970. SdtdConsole.Instance.ExecuteSync(string.Format("admin add {0} {1}", _cInfo.entityId, Don_Level3), null);
  971. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}, your chat color has been switched.[-]", Config.Chat_Response_Color, _playerName), Config.Server_Response_Name, false, "ServerTools", false));
  972. }
  973. else
  974. {
  975. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}, your reserved status expired on {2}. Command is unavailable.[-]", Config.Chat_Response_Color, _playerName, _dt), Config.Server_Response_Name, false, "ServerTools", false));
  976. }
  977. }
  978. else if (Admin.PermissionLevel == Don_Level3)
  979. {
  980. DateTime _dt;
  981. ReservedSlots.Dict.TryGetValue(_cInfo.playerId, out _dt);
  982. if (DateTime.Now < _dt)
  983. {
  984. SdtdConsole.Instance.ExecuteSync(string.Format("admin remove {0}", _cInfo.entityId), _cInfo);
  985. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}, your chat color has been turned off.[-]", Config.Chat_Response_Color, _playerName), Config.Server_Response_Name, false, "ServerTools", false));
  986. }
  987. else
  988. {
  989. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}, your reserved status expired on {2}. Command is unavailable.[-]", Config.Chat_Response_Color, _playerName, _dt), Config.Server_Response_Name, false, "ServerTools", false));
  990. }
  991. }
  992. else
  993. {
  994. SdtdConsole.Instance.ExecuteSync(string.Format("admin add {0} {1}", _cInfo.entityId, Don_Level1), null);
  995. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}, your chat color has been turned on.[-]", Config.Chat_Response_Color, _playerName), Config.Server_Response_Name, false, "ServerTools", false));
  996. }
  997. }
  998. }
  999. return false;
  1000. }
  1001. if (Reserved_Check && _message == "reserved")
  1002. {
  1003. if (ReservedSlots.Dict.ContainsKey(_cInfo.playerId))
  1004. {
  1005. DateTime _dt;
  1006. if (ReservedSlots.Dict.TryGetValue(_cInfo.playerId, out _dt))
  1007. {
  1008. if (DateTime.Now < _dt)
  1009. {
  1010. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}, your reserved status expires on {2}.[-]", Config.Chat_Response_Color, _playerName, _dt), Config.Server_Response_Name, false, "ServerTools", false));
  1011. }
  1012. else
  1013. {
  1014. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}, your reserved status has expired on {2}.[-]", Config.Chat_Response_Color, _playerName, _dt), Config.Server_Response_Name, false, "ServerTools", false));
  1015. }
  1016. }
  1017. }
  1018. else
  1019. {
  1020. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}You have not donated {1}. Expiration date unavailable.[-]", Config.Chat_Response_Color, _playerName), Config.Server_Response_Name, false, "ServerTools", false));
  1021. }
  1022. return false;
  1023. }
  1024. if (Special_Player_Name_Coloring && _message == "spcolor")
  1025. {
  1026. if (SpecialPlayers.Contains(_cInfo.playerId))
  1027. {
  1028. if (!SpecialPlayersColorOff.Contains(_cInfo.playerId))
  1029. {
  1030. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}, your chat color has been turned off.[-]", Config.Chat_Response_Color, _playerName), Config.Server_Response_Name, false, "ServerTools", false));
  1031. SpecialPlayersColorOff.Add(_cInfo.playerId);
  1032. }
  1033. else
  1034. {
  1035. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}, your chat color has been turned on.[-]", Config.Chat_Response_Color, _playerName), Config.Server_Response_Name, false, "ServerTools", false));
  1036. SpecialPlayersColorOff.Remove(_cInfo.playerId);
  1037. }
  1038. }
  1039. return false;
  1040. }
  1041. if (VoteReward.IsEnabled && _message == "reward")
  1042. {
  1043. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}Checking for your vote.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  1044. VoteReward.Check(_cInfo);
  1045. return false;
  1046. }
  1047. if (AutoShutdown.IsEnabled && (_message == "Scheck" || _message == "scheck"))
  1048. {
  1049. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}Checking for the next shutdown time.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  1050. AutoShutdown.CheckNextShutdown(_cInfo, _announce);
  1051. return false;
  1052. }
  1053. if (AdminList.IsEnabled && _message == "admin")
  1054. {
  1055. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}Listing online administrators and moderators.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  1056. AdminList.List(_cInfo, _announce, _playerName);
  1057. return false;
  1058. }
  1059. if (Travel.IsEnabled && _message == "travel")
  1060. {
  1061. Travel.Check(_cInfo, _announce, _playerName);
  1062. return false;
  1063. }
  1064. if (Zones.IsEnabled && _message == "return")
  1065. {
  1066. if (Players.Victim.ContainsKey(_cInfo.entityId))
  1067. {
  1068. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}Sending you to your death point.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  1069. Zones.ReturnToPosition(_cInfo);
  1070. return false;
  1071. }
  1072. }
  1073. if (Zones.IsEnabled && Jail.IsEnabled && _message == "forgive")
  1074. {
  1075. if (Players.Forgive.ContainsKey(_cInfo.entityId))
  1076. {
  1077. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}Your killer has been forgiven.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  1078. Jail.Forgive(_cInfo);
  1079. return false;
  1080. }
  1081. }
  1082. if (Wallet.IsEnabled && _message == "wallet")
  1083. {
  1084. Wallet.WalletValue(_cInfo, _playerName);
  1085. return false;
  1086. }
  1087. if (Shop.IsEnabled && _message == "shop")
  1088. {
  1089. Shop.Check(_cInfo, _playerName);
  1090. return false;
  1091. }
  1092. if (Shop.IsEnabled && _message.StartsWith("buy"))
  1093. {
  1094. if (_message == "buy")
  1095. {
  1096. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}Usage: /buy #[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  1097. }
  1098. else
  1099. {
  1100. _message = _message.Replace("buy ", "");
  1101. Shop.BuyCheck(_cInfo, _message, _playerName);
  1102. }
  1103. return false;
  1104. }
  1105. if (FriendTeleport.IsEnabled && _message.StartsWith("friend"))
  1106. {
  1107. if (_message == "friend")
  1108. {
  1109. FriendTeleport.ListFriends(_cInfo, _message);
  1110. }
  1111. else
  1112. {
  1113. _message = _message.Replace("friend ", "");
  1114. FriendTeleport.CheckDelay(_cInfo, _message, _announce);
  1115. }
  1116. return false;
  1117. }
  1118. if (FriendTeleport.IsEnabled && _message == ("accept"))
  1119. {
  1120. if (FriendTeleport.Dict.ContainsKey(_cInfo.entityId))
  1121. {
  1122. int _dictValue;
  1123. if (FriendTeleport.Dict.TryGetValue(_cInfo.entityId, out _dictValue))
  1124. {
  1125. DateTime _dict1Value;
  1126. if (FriendTeleport.Dict1.TryGetValue(_cInfo.entityId, out _dict1Value))
  1127. {
  1128. TimeSpan varTime = DateTime.Now - _dict1Value;
  1129. double fractionalSeconds = varTime.TotalSeconds;
  1130. int _timepassed = (int)fractionalSeconds;
  1131. if (ReservedSlots.IsEnabled && ReservedSlots.Reduced_Delay)
  1132. {
  1133. if (ReservedSlots.Dict.ContainsKey(_cInfo.playerId))
  1134. {
  1135. DateTime _dt;
  1136. ReservedSlots.Dict.TryGetValue(_cInfo.playerId, out _dt);
  1137. if (DateTime.Now < _dt)
  1138. {
  1139. int _newTime = _timepassed / 2;
  1140. _timepassed = _newTime;
  1141. }
  1142. }
  1143. }
  1144. if (_timepassed <= 30)
  1145. {
  1146. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}Your friends teleport request was accepted.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  1147. FriendTeleport.TeleFriend(_cInfo, _dictValue);
  1148. FriendTeleport.Dict.Remove(_cInfo.entityId);
  1149. FriendTeleport.Dict1.Remove(_cInfo.entityId);
  1150. }
  1151. else
  1152. {
  1153. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}Your friends teleport request has expired.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  1154. FriendTeleport.Dict.Remove(_cInfo.entityId);
  1155. FriendTeleport.Dict1.Remove(_cInfo.entityId);
  1156. }
  1157. }
  1158. }
  1159. return false;
  1160. }
  1161. }
  1162. if (DeathSpot.IsEnabled && _message == ("died"))
  1163. {
  1164. DeathSpot.DeathDelay(_cInfo, _announce, _playerName);
  1165. return false;
  1166. }
  1167. if (WeatherVote.IsEnabled && _message == "weathervote")
  1168. {
  1169. if (WeatherVote.VoteNew)
  1170. {
  1171. if (!WeatherVote.VoteOpen)
  1172. {
  1173. WeatherVote.CallForVote1();
  1174. }
  1175. else
  1176. {
  1177. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}A weather vote has already begun.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  1178. }
  1179. }
  1180. else
  1181. {
  1182. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}A weather vote can only begin every {1} minutes.[-]", Config.Chat_Response_Color, Timers.Weather_Vote_Delay), Config.Server_Response_Name, false, "ServerTools", false));
  1183. }
  1184. return false;
  1185. }
  1186. if (WeatherVote.IsEnabled && _message == "clear")
  1187. {
  1188. if (WeatherVote.VoteOpen)
  1189. {
  1190. if (!WeatherVote.snow.Contains(_cInfo.entityId) && !WeatherVote.clear.Contains(_cInfo.entityId) && !WeatherVote.rain.Contains(_cInfo.entityId))
  1191. {
  1192. WeatherVote.clear.Add(_cInfo.entityId);
  1193. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}Vote cast for {1}.[-]", Config.Chat_Response_Color, _message), Config.Server_Response_Name, false, "ServerTools", false));
  1194. }
  1195. else
  1196. {
  1197. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}You have already voted.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  1198. }
  1199. }
  1200. else
  1201. {
  1202. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}There is no active weather vote. Type /weather in chat to open a new vote.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  1203. }
  1204. return false;
  1205. }
  1206. if (WeatherVote.IsEnabled && _message == "rain")
  1207. {
  1208. if (WeatherVote.VoteOpen)
  1209. {
  1210. if (!WeatherVote.snow.Contains(_cInfo.entityId) && !WeatherVote.clear.Contains(_cInfo.entityId) && !WeatherVote.rain.Contains(_cInfo.entityId))
  1211. {
  1212. WeatherVote.rain.Add(_cInfo.entityId);
  1213. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}Vote cast for {1}.[-]", Config.Chat_Response_Color, _message), Config.Server_Response_Name, false, "ServerTools", false));
  1214. }
  1215. else
  1216. {
  1217. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}You have already voted.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  1218. }
  1219. }
  1220. else
  1221. {
  1222. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}There is no active weather vote. Type /weather in chat to open a new vote.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  1223. }
  1224. return false;
  1225. }
  1226. if (WeatherVote.IsEnabled && _message == "snow")
  1227. {
  1228. if (WeatherVote.VoteOpen)
  1229. {
  1230. if (!WeatherVote.snow.Contains(_cInfo.entityId) && !WeatherVote.clear.Contains(_cInfo.entityId) && !WeatherVote.rain.Contains(_cInfo.entityId))
  1231. {
  1232. WeatherVote.snow.Add(_cInfo.entityId);
  1233. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}Vote cast for {1}.[-]", Config.Chat_Response_Color, _message), Config.Server_Response_Name, false, "ServerTools", false));
  1234. }
  1235. else
  1236. {
  1237. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}You have already voted.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  1238. }
  1239. }
  1240. else
  1241. {
  1242. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}There is no active weather vote. Type /weather in chat to open a new vote.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  1243. }
  1244. return false;
  1245. }
  1246. if (RestartVote.IsEnabled && _message == "restartvote")
  1247. {
  1248. if (!KickVote.VoteOpen && !RestartVote.VoteOpen && !MuteVote.VoteOpen && !NightVote.VoteOpen)
  1249. {
  1250. if (RestartVote.VoteNew)
  1251. {
  1252. RestartVote.CallForVote1(_cInfo);
  1253. }
  1254. }
  1255. else
  1256. {
  1257. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}A vote is open. Wait for it to finish and try again.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  1258. }
  1259. return false;
  1260. }
  1261. if (MuteVote.IsEnabled && _message.StartsWith("mutevote"))
  1262. {
  1263. if (!KickVote.VoteOpen && !RestartVote.VoteOpen && !MuteVote.VoteOpen && !NightVote.VoteOpen)
  1264. {
  1265. _message = _message.Replace("mutevote ", "");
  1266. {
  1267. MuteVote.Vote(_cInfo, _message);
  1268. }
  1269. }
  1270. else
  1271. {
  1272. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}A vote is open. Wait for it to finish and try again.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  1273. }
  1274. return false;
  1275. }
  1276. if (KickVote.IsEnabled && _message.StartsWith("kickvote"))
  1277. {
  1278. if (!KickVote.VoteOpen && !RestartVote.VoteOpen && !MuteVote.VoteOpen && !NightVote.VoteOpen)
  1279. {
  1280. _message = _message.Replace("kickvote ", "");
  1281. {
  1282. KickVote.Vote(_cInfo, _message);
  1283. }
  1284. }
  1285. else
  1286. {
  1287. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}A vote is open. Wait for it to finish and try again.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  1288. }
  1289. return false;
  1290. }
  1291. if (NightVote.IsEnabled && _message == "nightvote")
  1292. {
  1293. if (!KickVote.VoteOpen && !RestartVote.VoteOpen && !MuteVote.VoteOpen && !NightVote.VoteOpen)
  1294. {
  1295. NightVote.Vote(_cInfo);
  1296. }
  1297. else
  1298. {
  1299. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}A vote is open. Wait for it to finish and try again.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  1300. }
  1301. return false;
  1302. }
  1303. if (_message == "yes")
  1304. {
  1305. if (KickVote.VoteOpen || RestartVote.VoteOpen || MuteVote.VoteOpen || NightVote.VoteOpen)
  1306. {
  1307. if (KickVote.IsEnabled)
  1308. {
  1309. if (!KickVote.Kick.Contains(_cInfo.entityId))
  1310. {
  1311. KickVote.Kick.Add(_cInfo.entityId);
  1312. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, string.Format("{0}{1} of 8 votes to kick", Config.Chat_Response_Color, KickVote.Kick.Count), Config.Server_Response_Name, false, "ServerTools", true);
  1313. }
  1314. else
  1315. {
  1316. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}You have already voted.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  1317. }
  1318. }
  1319. if (RestartVote.IsEnabled)
  1320. {
  1321. if (!RestartVote.Restart.Contains(_cInfo.entityId))
  1322. {
  1323. RestartVote.Restart.Add(_cInfo.entityId);
  1324. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, string.Format("{0}{1} of {2} votes to restart[-]", Config.Chat_Response_Color, RestartVote.Restart.Count, RestartVote.Minimum_Players / 2 + 1), Config.Server_Response_Name, false, "ServerTools", true);
  1325. }
  1326. else
  1327. {
  1328. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}You have already voted.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  1329. }
  1330. }
  1331. if (MuteVote.IsEnabled)
  1332. {
  1333. if (!MuteVote.Mute.Contains(_cInfo.entityId))
  1334. {
  1335. MuteVote.Mute.Add(_cInfo.entityId);
  1336. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, string.Format("{0}{1} of 8 votes to mute", Config.Chat_Response_Color, MuteVote.Mute.Count), Config.Server_Response_Name, false, "ServerTools", true);
  1337. }
  1338. else
  1339. {
  1340. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}You have already voted.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  1341. }
  1342. }
  1343. if (NightVote.IsEnabled)
  1344. {
  1345. if (!NightVote.Night.Contains(_cInfo.entityId))
  1346. {
  1347. NightVote.Night.Add(_cInfo.entityId);
  1348. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, string.Format("{0}{1} of 8 votes to skip the night", Config.Chat_Response_Color, NightVote.Night.Count), Config.Server_Response_Name, false, "ServerTools", true);
  1349. }
  1350. else
  1351. {
  1352. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}You have already voted.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  1353. }
  1354. }
  1355. return false;
  1356. }
  1357. }
  1358. if (AuctionBox.IsEnabled && _message == "auction")
  1359. {
  1360. AuctionBox.AuctionList(_cInfo);
  1361. return false;
  1362. }
  1363. if (AuctionBox.IsEnabled && _message == "auction cancel")
  1364. {
  1365. AuctionBox.CancelAuction(_cInfo);
  1366. return false;
  1367. }
  1368. if (AuctionBox.IsEnabled && _message.StartsWith("auction buy"))
  1369. {
  1370. if (AuctionBox.No_Admins)
  1371. {
  1372. AdminToolsClientInfo Admin = GameManager.Instance.adminTools.GetAdminToolsClientInfo(_cInfo.playerId);
  1373. if (Admin.PermissionLevel > Admin_Level)
  1374. {
  1375. _message = _message.Replace("auction buy ", "");
  1376. {
  1377. int _purchase;
  1378. if (int.TryParse(_message, out _purchase))
  1379. {
  1380. if (AuctionBox.AuctionItems.ContainsKey(_purchase))
  1381. {
  1382. AuctionBox.WalletCheck(_cInfo, _purchase);
  1383. }
  1384. else
  1385. {
  1386. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}You have used an auction item # that does not exist or has sold. Type /auction.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  1387.  
  1388. }
  1389. }
  1390. }
  1391. }
  1392. else
  1393. {
  1394. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}The auction is disabled for your tier.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  1395. }
  1396. }
  1397. else
  1398. {
  1399. _message = _message.Replace("auction buy ", "");
  1400. {
  1401. int _purchase;
  1402. if (int.TryParse(_message, out _purchase))
  1403. {
  1404. if (AuctionBox.AuctionItems.ContainsKey(_purchase))
  1405. {
  1406. AuctionBox.WalletCheck(_cInfo, _purchase);
  1407. }
  1408. else
  1409. {
  1410. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}You have used an auction item # that does not exist or has sold. Type /auction.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  1411. }
  1412. }
  1413. }
  1414. }
  1415. return false;
  1416. }
  1417. if (AuctionBox.IsEnabled && _message.StartsWith("auction sell"))
  1418. {
  1419. if (AuctionBox.No_Admins)
  1420. {
  1421. AdminToolsClientInfo Admin = GameManager.Instance.adminTools.GetAdminToolsClientInfo(_cInfo.playerId);
  1422. if (Admin.PermissionLevel > Admin_Level)
  1423. {
  1424. _message = _message.Replace("auction sell ", "");
  1425. AuctionBox.Delay(_cInfo, _message);
  1426. }
  1427. else
  1428. {
  1429. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}The auction is disabled for your tier.[-]", Config.Chat_Response_Color), Config.Server_Response_Name, false, "ServerTools", false));
  1430. }
  1431. }
  1432. else
  1433. {
  1434. _message = _message.Replace("auction sell ", "");
  1435. AuctionBox.Delay(_cInfo, _message);
  1436. }
  1437. return false;
  1438. }
  1439. if (Fps.IsEnabled && _message == "fps")
  1440. {
  1441. if (_announce)
  1442. {
  1443. Fps.FPS(_cInfo, _announce);
  1444. }
  1445. else
  1446. {
  1447. Fps.FPS(_cInfo, _announce);
  1448. return false;
  1449. }
  1450. }
  1451. if (Loc.IsEnabled && _message == "loc")
  1452. {
  1453. if (_announce)
  1454. {
  1455. Loc.Exec(_cInfo);
  1456. }
  1457. else
  1458. {
  1459. Loc.Exec(_cInfo);
  1460. return false;
  1461. }
  1462. }
  1463. if (BikeReturn.IsEnabled && _message == "bike")
  1464. {
  1465. BikeReturn.BikeDelay(_cInfo, _playerName);
  1466. return false;
  1467. }
  1468. if (Report.IsEnabled && _message.StartsWith("report"))
  1469. {
  1470. _message = _message.Replace("report ", "");
  1471. Report.Check(_cInfo, _message);
  1472. return false;
  1473. }
  1474. if (Bounties.IsEnabled && _message == "bounty")
  1475. {
  1476. Bounties.BountyList(_cInfo, _playerName);
  1477. return false;
  1478. }
  1479. if (Bounties.IsEnabled && _message.StartsWith("bounty"))
  1480. {
  1481. _message = _message.Replace("bounty ", "");
  1482. Bounties.NewBounty(_cInfo, _message, _playerName);
  1483. return false;
  1484. }
  1485. if (Lottery.IsEnabled && _message == "lottery")
  1486. {
  1487. Lottery.Response(_cInfo);
  1488. return false;
  1489. }
  1490. if (Lottery.IsEnabled && _message == "lottery enter")
  1491. {
  1492. Lottery.EnterLotto(_cInfo);
  1493. return false;
  1494. }
  1495. if (Lottery.IsEnabled && _message.StartsWith("lottery"))
  1496. {
  1497. _message = _message.Replace("lottery ", "");
  1498. Lottery.NewLotto(_cInfo, _message, _playerName);
  1499. return false;
  1500. }
  1501. if (NewSpawnTele.IsEnabled && NewSpawnTele.Return && _message == "ready")
  1502. {
  1503. NewSpawnTele.ReturnPlayer(_cInfo);
  1504. return false;
  1505. }
  1506. if (LobbyChat.IsEnabled && _message == "setlobby")
  1507. {
  1508. SetLobby.Set(_cInfo);
  1509. return false;
  1510. }
  1511. if (LobbyChat.IsEnabled && _message == "lobby")
  1512. {
  1513. LobbyChat.Delay(_cInfo, _playerName, _announce);
  1514. return false;
  1515. }
  1516. if (LobbyChat.IsEnabled && LobbyChat.Return && _message == "return")
  1517. {
  1518. if (LobbyChat.LobbyPlayers.Contains(_cInfo.entityId))
  1519. {
  1520. LobbyChat.SendBack(_cInfo, _playerName);
  1521. return false;
  1522. }
  1523. }
  1524. if (PlayerList.IsEnabled && _message == "list")
  1525. {
  1526. PlayerList.Exec(_cInfo, _playerName);
  1527. return false;
  1528. }
  1529. if (Stuck.IsEnabled && _message == "stuck")
  1530. {
  1531. Stuck.Delay(_cInfo, _playerName, _announce);
  1532. return false;
  1533. }
  1534. if (_message == "pollyes")
  1535. {
  1536. if (PersistentContainer.Instance.PollOpen)
  1537. {
  1538. if (!Poll.PolledYes.Contains(_cInfo.entityId) && !Poll.PolledNo.Contains(_cInfo.entityId))
  1539. {
  1540. Poll.VoteYes(_cInfo);
  1541. }
  1542. else
  1543. {
  1544. string _phrase812;
  1545. if (!Phrases.Dict.TryGetValue(812, out _phrase812))
  1546. {
  1547. _phrase812 = "{PlayerName} you have already voted on the poll";
  1548. }
  1549. _phrase812 = _phrase812.Replace("{PlayerName}", _playerName);
  1550. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}[-]", Config.Chat_Response_Color, _phrase812), Config.Server_Response_Name, false, "ServerTools", false));
  1551. }
  1552. return false;
  1553. }
  1554. }
  1555. if (_message == "pollno")
  1556. {
  1557. if (PersistentContainer.Instance.PollOpen)
  1558. {
  1559. if (!Poll.PolledYes.Contains(_cInfo.entityId) && !Poll.PolledNo.Contains(_cInfo.entityId))
  1560. {
  1561. Poll.VoteNo(_cInfo);
  1562. }
  1563. else
  1564. {
  1565. string _phrase812;
  1566. if (!Phrases.Dict.TryGetValue(812, out _phrase812))
  1567. {
  1568. _phrase812 = "{PlayerName} you have already voted on the poll.";
  1569. }
  1570. _phrase812 = _phrase812.Replace("{PlayerName}", _playerName);
  1571. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}[-]", Config.Chat_Response_Color, _phrase812), Config.Server_Response_Name, false, "ServerTools", false));
  1572. }
  1573. return false;
  1574. }
  1575. }
  1576. if (_message == "poll")
  1577. {
  1578. if (PersistentContainer.Instance.PollOpen)
  1579. {
  1580. string _phrase926;
  1581. if (!Phrases.Dict.TryGetValue(926, out _phrase926))
  1582. {
  1583. _phrase926 = "Poll: {Message}";
  1584. }
  1585. _phrase926 = _phrase926.Replace("{Message}", PersistentContainer.Instance.PollMessage);
  1586. string _phrase813;
  1587. if (!Phrases.Dict.TryGetValue(813, out _phrase813))
  1588. {
  1589. _phrase813 = "Currently, the pole is yes {YesCount} / no {NoCount}.";
  1590. }
  1591. _phrase813 = _phrase813.Replace("{YesCount}", PersistentContainer.Instance.PollYes.ToString());
  1592. _phrase813 = _phrase813.Replace("{NoCount}", PersistentContainer.Instance.PollNo.ToString());
  1593. if (_announce)
  1594. {
  1595. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, string.Format("{0}{1}[-]", Config.Chat_Response_Color, _phrase926), Config.Server_Response_Name, false, "ServerTools", true);
  1596. GameManager.Instance.GameMessageServer(null, EnumGameMessages.Chat, string.Format("{0}{1}[-]", Config.Chat_Response_Color, _phrase813), Config.Server_Response_Name, false, "ServerTools", true);
  1597. }
  1598. else
  1599. {
  1600. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}[-]", Config.Chat_Response_Color, _phrase926), Config.Server_Response_Name, false, "ServerTools", false));
  1601. _cInfo.SendPackage(new NetPackageGameMessage(EnumGameMessages.Chat, string.Format("{0}{1}[-]", Config.Chat_Response_Color, _phrase813), Config.Server_Response_Name, false, "ServerTools", false));
  1602. }
  1603. return false;
  1604. }
  1605. }
  1606. if (Bank.IsEnabled && _message == "bank")
  1607. {
  1608. Bank.Check(_cInfo);
  1609. return false;
  1610. }
  1611. if (Bank.IsEnabled && _message.StartsWith("deposit"))
  1612. {
  1613. _message = _message.Replace("deposit ", "");
  1614. Bank.CheckLocation(_cInfo, _message, 1);
  1615. return false;
  1616. }
  1617. if (Bank.IsEnabled && _message.StartsWith("withdraw"))
  1618. {
  1619. _message = _message.Replace("withdraw ", "");
  1620. Bank.CheckLocation(_cInfo, _message, 2);
  1621. return false;
  1622. }
  1623. if (Bank.IsEnabled && _message.StartsWith("wallet deposit"))
  1624. {
  1625. _message = _message.Replace("wallet deposit ", "");
  1626. Bank.CheckLocation(_cInfo, _message, 3);
  1627. return false;
  1628. }
  1629. if (Bank.IsEnabled && _message.StartsWith("wallet withdraw"))
  1630. {
  1631. _message = _message.Replace("wallet withdraw ", "");
  1632. Bank.CheckLocation(_cInfo, _message, 4);
  1633. return false;
  1634. }
  1635. if (Bank.IsEnabled && _message.StartsWith("transfer "))
  1636. {
  1637. _message = _message.Replace("transfer ", "");
  1638. Bank.Transfer(_cInfo, _message);
  1639. return false;
  1640. }
  1641. if (Event.Invited && _message == "event")
  1642. {
  1643. Event.AddPlayer(_cInfo);
  1644. return false;
  1645. }
  1646. if (Wallet.IsEnabled && _message == "mogul")
  1647. {
  1648. Mogul.TopFive(_cInfo, _announce);
  1649. return false;
  1650. }
  1651. if (_message == "test")
  1652. {
  1653. Lottery.StartLotto();
  1654. return false;
  1655. }
  1656. if (CustomCommands.IsEnabled && CustomCommands.Dict.ContainsKey(_message))
  1657. {
  1658. CustomCommands.CheckCustomDelay(_cInfo, _message, _playerName, _announce);
  1659. return false;
  1660. }
  1661. }
  1662. }
  1663. if (AdminChat.IsEnabled && _message.StartsWith("@"))
  1664. {
  1665. if (_message.StartsWith("@admins ") || _message.StartsWith("@ADMINS "))
  1666. {
  1667. AdminChat.SendAdmins(_cInfo, _message);
  1668. return false;
  1669. }
  1670. if (_message.StartsWith("@all ") || _message.StartsWith("@ALL "))
  1671. {
  1672. AdminChat.SendAll(_cInfo, _message);
  1673. return false;
  1674. }
  1675. }
  1676. }
  1677. return true;
  1678. }
  1679. }
  1680. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement