Advertisement
Guest User

Untitled

a guest
Feb 7th, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.35 KB | None | 0 0
  1. var Logger = require('./Logger');
  2. var UserRoleEnum = require("../enum/UserRoleEnum");
  3.  
  4. function PlayerCommand(gameServer, playerTracker) {
  5. this.gameServer = gameServer;
  6. this.playerTracker = playerTracker;
  7. this.roleList = [];
  8. }
  9.  
  10. module.exports = PlayerCommand;
  11.  
  12. PlayerCommand.prototype.writeLine = function (text) {
  13. this.gameServer.sendChatMessage(null, this.playerTracker, text);
  14. };
  15.  
  16. PlayerCommand.prototype.executeCommandLine = function(commandLine) {
  17. if (!commandLine) return;
  18.  
  19. // Splits the string
  20. var args = commandLine.split(" ");
  21.  
  22. // Process the first string value
  23. var first = args[0].toLowerCase();
  24.  
  25. // Get command function
  26. var execute = playerCommands[first];
  27. if (typeof execute != 'undefined') {
  28. execute.bind(this)(args);
  29. } else {
  30. this.writeLine("ERROR: Unknown command, type /help for command list");
  31. }
  32. };
  33.  
  34.  
  35. PlayerCommand.prototype.userLogin = function (username, password) {
  36. if (!username || !password) return null;
  37. for (var i = 0; i < this.gameServer.userList.length; i++) {
  38. var user = this.gameServer.userList[i];
  39. if (user.username != username)
  40. break;
  41. if (user.password != password)
  42. break;
  43. return user;
  44. }
  45. return null;
  46. };
  47.  
  48. var playerCommands = {
  49. help: function (args) {
  50. var page = parseInt(args[1]);
  51. if (this.playerTracker.userRole == UserRoleEnum.ADMIN || this.playerTracker.userRole == UserRoleEnum.MODER) {
  52. if (isNaN(page)) {
  53. this.writeLine("Please Enter a Page Number!");
  54. return;
  55. }
  56. if (page == 1) {
  57. this.writeLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
  58. this.writeLine("/skin %shark - change skin");
  59. this.writeLine("/kill - self kill");
  60. this.writeLine("/help [page #] - this command list");
  61. this.writeLine("/id - Gets your playerID");
  62. this.writeLine("/mass - gives mass to yourself or to other players");
  63. this.writeLine("/merge - Instantly Recombines all of your cells or other players cells");
  64. this.writeLine("/rec - Toggles rec mode for you or for other players - MUST BE ADMIN");
  65. this.writeLine("/spawnmass - gives yourself or other players spawnmass - MUST BE ADMIN");
  66. this.writeLine("/minion - gives yourself or other players minions");
  67. this.writeLine("/minion remove - removes all of your minions or other players minions");
  68. this.writeLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
  69. this.writeLine("Showing Page 1 of 2.");
  70. } else if (page == 2) {
  71. this.writeLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
  72. this.writeLine("/userrole - Allows you to give User Role to a player ID - MUST BE ADMIN");
  73. this.writeLine("/userrole list - Lists all the people you have given a Role - MUST BE ADMIN");
  74. this.writeLine("/kick - Kicks a Player ID to make them lose their Temporarily Role");
  75. this.writeLine("/addbot - Adds Bots to the Server - MUST BE ADMIN");
  76. this.writeLine("/change - Allows you to Temporarily change the config of the Server! - MUST BE ADMIN");
  77. this.writeLine("/reloadconfig - Reloads the config of the Server to the gameServer.ini file - MUST BE ADMIN");
  78. this.writeLine("/shutdown - SHUTDOWNS THE SERVER - MUST BE ADMIN");
  79. this.writeLine("/restart - RESTARTS THE SERVER - MUST BE ADMIN");
  80. this.writeLine("/status - Shows Status of the Server");
  81. this.writeLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
  82. this.writeLine("Showing Page 2 of 2.");
  83. }
  84. }
  85. else {
  86. this.writeLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
  87. this.writeLine("/skin %shark - change skin");
  88. this.writeLine("/kill - self kill");
  89. this.writeLine("/help - this command list");
  90. this.writeLine("/id - Gets your playerID");
  91. this.writeLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
  92. }
  93. },
  94. id: function (args) {
  95. this.writeLine("Your PlayerID is " + this.playerTracker.pID);
  96. },
  97. skin: function (args) {
  98. if (this.playerTracker.cells.length) {
  99. this.writeLine("ERROR: Cannot change skin while player in game!");
  100. return;
  101. }
  102. var skinName = "";
  103. if (args[1]) skinName = args[1];
  104. this.playerTracker.setSkin(skinName);
  105. if (skinName == "")
  106. this.writeLine("Your skin was removed");
  107. else
  108. this.writeLine("Your skin set to " + skinName);
  109. },
  110. kill: function (args) {
  111. if (!this.playerTracker.cells.length) {
  112. this.writeLine("You cannot kill yourself, because you're still not joined to the game!");
  113. return;
  114. }
  115. while (this.playerTracker.cells.length) {
  116. var cell = this.playerTracker.cells[0];
  117. this.gameServer.removeNode(cell);
  118. // replace with food
  119. var food = require('../entity/Food');
  120. food = new food(this.gameServer, null, cell.position, cell._size);
  121. food.setColor(cell.color);
  122. this.gameServer.addNode(food);
  123. }
  124. this.writeLine("You killed yourself");
  125. },
  126. mass: function (args) {
  127. if (this.playerTracker.userRole != UserRoleEnum.ADMIN && this.playerTracker.userRole != UserRoleEnum.MODER) {
  128. this.writeLine("ERROR: access denied!");
  129. return;
  130. }
  131. var mass = parseInt(args[1]);
  132. var id = parseInt(args[2]);
  133. var size = Math.sqrt(mass * 100);
  134.  
  135. if (isNaN(mass)) {
  136. this.writeLine("ERROR: missing mass argument!");
  137. return;
  138. }
  139.  
  140. if (isNaN(id)) {
  141. this.writeLine("Warn: missing ID arguments. This will change your mass.");
  142. for (var i in this.playerTracker.cells) {
  143. this.playerTracker.cells[i].setSize(size);
  144. }
  145. this.writeLine("Set mass of " + this.playerTracker._name + " to " + size * size / 100);
  146.  
  147. } else {
  148. for (var i in this.gameServer.clients) {
  149. var client = this.gameServer.clients[i].playerTracker;
  150. if (client.pID == id) {
  151. for (var j in client.cells) {
  152. client.cells[j].setSize(size);
  153. }
  154. this.writeLine("Set mass of " + client._name + " to " + size * size / 100);
  155. var text = this.playerTracker._name + " changed your mass to " + size * size / 100;
  156. this.gameServer.sendChatMessage(null, client, text);
  157. break;
  158. }
  159. }
  160. }
  161.  
  162. },
  163. spawnmass: function (args) {
  164. if (this.playerTracker.userRole != UserRoleEnum.ADMIN) {
  165. this.writeLine("ERROR: access denied!");
  166. return;
  167. }
  168. var mass = parseInt(args[1]);
  169. var id = parseInt(args[2]);
  170. var size = Math.sqrt(mass * 100);
  171.  
  172. if (isNaN(mass)) {
  173. this.writeLine("ERROR: missing mass argument!");
  174. return;
  175. }
  176.  
  177. if (isNaN(id)) {
  178. this.playerTracker.spawnmass = size;
  179. this.writeLine("Warn: missing ID arguments. This will change your spawnmass.");
  180. this.writeLine("Set spawnmass of " + this.playerTracker._name + " to " + size * size / 100);
  181. } else {
  182. for (var i in this.gameServer.clients) {
  183. var client = this.gameServer.clients[i].playerTracker;
  184. if (client.pID == id) {
  185. client.spawnmass = size;
  186. this.writeLine("Set spawnmass of " + client._name + " to " + size * size / 100);
  187. var text = this.playerTracker._name + " changed your spawn mass to " + size * size / 100;
  188. this.gameServer.sendChatMessage(null, client, text);
  189. }
  190. }
  191. }
  192. },
  193. minion: function(args) {
  194. if (this.playerTracker.userRole != UserRoleEnum.ADMIN && this.playerTracker.userRole != UserRoleEnum.MODER) {
  195. this.writeLine("ERROR: access denied!");
  196. return;
  197. }
  198. if (this.playerTracker.userRole == UserRoleEnum.ADMIN) {
  199. var add = args[1];
  200. var id = parseInt(args[2]);
  201. }
  202. var player = this.playerTracker;
  203. if (this.playerTracker.userrole == UserRoleEnum.MODER && args[1] != "remove") var add = 1;
  204. else var add = "remove";
  205. /** For you **/
  206. if (this.playerTracker.userRole == UserRoleEnum.ADMIN) {
  207. if (isNaN(id)) {
  208. this.writeLine("Warn: missing ID arguments. This will give you minions.");
  209. // Remove minions
  210. if (player.minionControl == true && add == "remove") {
  211. player.minionControl = false;
  212. player.miQ = 0;
  213. this.writeLine("Succesfully removed minions for " + player._name);
  214. // Add minions
  215. } else {
  216. player.minionControl = true;
  217. // Add minions for self
  218. if (isNaN(parseInt(add))) add = 1;
  219. for (var i = 0; i < add; i++) {
  220. this.gameServer.bots.addMinion(player);
  221. }
  222. this.writeLine("Added " + add + " minions for " + player._name);
  223. }
  224.  
  225. } else {
  226. /** For others **/
  227. for (var i in this.gameServer.clients) {
  228. var client = this.gameServer.clients[i].playerTracker;
  229. if (client.pID == id) {
  230. // Remove minions
  231. if (client.minionControl == true) {
  232. client.minionControl = false;
  233. client.miQ = 0;
  234. this.writeLine("Succesfully removed minions for " + client._name);
  235. var text = this.playerTracker._name + " removed all off your minions.";
  236. this.gameServer.sendChatMessage(null, client, text);
  237. // Add minions
  238. } else {
  239. client.minionControl = true;
  240. // Add minions for client
  241. if (isNaN(parseInt(add))) add = 1;
  242. for (var i = 0; i < add; i++) {
  243. this.gameServer.bots.addMinion(client);
  244. }
  245. this.writeLine("Added " + add + " minions for " + client._name);
  246. var text = this.playerTracker._name + " gave you " + add + " minions.";
  247. this.gameServer.sendChatMessage(null, client, text);
  248. }
  249. }
  250. }
  251. }
  252. } else {
  253. if (add = "remove" && player.minionControl == true) {
  254. player.minionControl = false;
  255. player.miQ = 0;
  256. } else {
  257. player.minionControl = true;
  258. if (player.miQ > 1) {
  259. this.writeLine("You can't have more then 1 minion!");
  260. return;
  261. } else this.gameServer.bots.addMinion(player);
  262. }
  263.  
  264. }
  265. },
  266. userrole: function(args) {
  267. // Temporarily changes the User Role of a player until that player leaves the server.
  268. if (this.playerTracker.userRole != UserRoleEnum.ADMIN) {
  269. this.writeLine("ERROR: access denied");
  270. return;
  271. }
  272. var id = args[1];
  273. var role = args[2];
  274. if(isNaN(parseInt(id))) {
  275. this.writeLine("Please specify a valid player ID!");
  276. if (id == "list") {
  277. if (!this.roleList.length) {
  278. this.writeLine("You have not given anyone a Role!");
  279. return;
  280. }
  281. this.writeLine(" ID | SCORE | NICK");
  282. for (var i in this.roleList) {
  283. var client = this.roleList[i];
  284. var id = client.pID;
  285. var nick = client._name;
  286. var score = Math.round(client._score);
  287. this.writeLine(id + " " + score + " " + nick);
  288. }
  289. return;
  290. }
  291. return;
  292. } else {
  293. if (role != "moder" && role != "user" && role != "guest" || role == null) {
  294. this.writeLine("Please specify a valid Role!");
  295. return;
  296. }
  297. if (this.playerTracker.pID == id) {
  298. this.writeLine("You cannot change your own Role!");
  299. return;
  300. }
  301. for (var i in this.gameServer.clients) {
  302. var client = this.gameServer.clients[i].playerTracker;
  303. if (client.pID == id) {
  304. if (client.userRole == UserRoleEnum.ADMIN) {
  305. this.writeLine("You cannot change Admins Roles!");
  306. return;
  307. }
  308. if (role == "moder") {
  309. client.userRole = UserRoleEnum.MODER;
  310. this.writeLine("Successfully changed " + client._name + "'s Role to Moder");
  311. this.gameServer.sendChatMessage(null, client, "You have been temporarily changed to MODER."); // notify
  312. this.roleList.push(client);
  313. } else if (role == "user") {
  314. client.userRole = UserRoleEnum.USER;
  315. this.writeLine("Successfully changed " + client._name + "'s Role to User!");
  316. this.gameServer.sendChatMessage(null, client, "You have been temporarily changed to USER."); // notify
  317. this.roleList.push(client);
  318. } else {
  319. client.userRole = UserRoleEnum.GUEST;
  320. this.writeLine("Successfully changed " + client._name + "'s Role to Guest!");
  321. this.gameServer.sendChatMessage(null, client, "You have been temporarily changed to GUEST."); // notify
  322. this.roleList.push(client);
  323. }
  324. }
  325. }
  326. }
  327. },
  328. kick: function(args) {
  329. var id = parseInt(args[1]);
  330. if (this.playerTracker.userRole != UserRoleEnum.ADMIN && this.playerTracker.userRole != UserRoleEnum.MODER) {
  331. this.writeLine("ERROR: acces denied!");
  332. return;
  333. }
  334. if (isNaN(id)) {
  335. this.writeLine("Please specify a valid player ID!");
  336. return;
  337. }
  338. // kick player
  339. var count = 0;
  340. this.gameServer.clients.forEach(function (socket) {
  341. if (socket.isConnected === false)
  342. return;
  343. if (id !== 0 && socket.playerTracker.pID != id)
  344. return;
  345. if (socket.playerTracker.userRole == UserRoleEnum.ADMIN) {
  346. this.writeLine("You cannot kick a ADMIN in game!");
  347. return;
  348. }
  349. // remove player cells
  350. for (var j = 0; j < socket.playerTracker.cells.length; j++) {
  351. this.gameServer.removeNode(socket.playerTracker.cells[0]);
  352. count++;
  353. }
  354. // disconnect
  355. socket.close(1000, "Kicked from server");
  356. var name = socket.playerTracker._name;
  357. this.writeLine("Successfully kicked " + name);
  358. count++;
  359. }, this);
  360. if (count) return;
  361. if (!id) this.writeLine("Warn: No players to kick!");
  362. else this.writeLine("Warn: Player with ID " + id + " not found!");
  363. },
  364. addbot: function(args) {
  365. var add = parseInt(args[1]);
  366. if (isNaN(add)) add = 1;
  367. if (this.playerTracker.userRole != UserRoleEnum.ADMIN) {
  368. this.writeLine("ERROR: access denied!");
  369. return;
  370. }
  371. for (var i = 0; i < add; i++) {
  372. this.gameServer.bots.addBot();
  373. }
  374. Logger.warn(this.playerTracker.socket.remoteAddress + " ADDED " + add + " BOTS");
  375. this.writeLine("Added " + add + " Bots");
  376. },
  377. status: function(args) {
  378. if (this.playerTracker.userRole != UserRoleEnum.ADMIN && this.playerTracker.userRole != UserRoleEnum.MODER) {
  379. this.writeLine("ERROR: access denied!");
  380. return;
  381. }
  382. // Get amount of humans/bots
  383. var humans = 0,
  384. bots = 0;
  385. for (var i = 0; i < this.gameServer.clients.length; i++) {
  386. if ('_socket' in this.gameServer.clients[i]) {
  387. humans++;
  388. } else {
  389. bots++;
  390. }
  391. }
  392. var ini = require('./ini.js');
  393. this.writeLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
  394. this.writeLine("Connected players: " + this.gameServer.clients.length + "/" + this.gameServer.config.serverMaxConnections);
  395. this.writeLine("Players: " + humans + " - Bots: " + bots);
  396. this.writeLine("Server has been running for " + Math.floor(process.uptime() / 60) + " minutes");
  397. this.writeLine("Current memory usage: " + Math.round(process.memoryUsage().heapUsed / 1048576 * 10) / 10 + "/" + Math.round(process.memoryUsage().heapTotal / 1048576 * 10) / 10 + " mb");
  398. this.writeLine("Current game mode: " + this.gameServer.gameMode.name);
  399. this.writeLine("Current update time: " + this.gameServer.updateTimeAvg.toFixed(3) + " [ms] (" + ini.getLagMessage(this.gameServer.updateTimeAvg) + ")");
  400. this.writeLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
  401. },
  402. merge: function(args) {
  403. // Validation checks
  404. if (this.playerTracker.userRole != UserRoleEnum.ADMIN && this.playerTracker.userRole != UserRoleEnum.MODER) {
  405. this.writeLine("ERROR: access denied!");
  406. return;
  407. }
  408. var id = parseInt(args[1]);
  409. if (isNaN(id)) {
  410. this.writeLine("Warn: Missing ID arguments. This will merge you.");
  411. if (this.playerTracker.cells.length == 1) {
  412. this.writeLine("You already have one cell!");
  413. return;
  414. }
  415. this.playerTracker.mergeOverride = !this.playerTracker.mergeOverride;
  416. if (this.playerTracker.mergeOverride) this.writeLine(this.playerTracker._name + " is now force mergeing");
  417. else this.writeLine(this.playerTracker._name + " isn't force merging anymore");
  418. } else {
  419.  
  420. // Find client with same ID as player entered
  421. for (var i = 0; i < this.gameServer.clients.length; i++) {
  422. if (id == this.gameServer.clients[i].playerTracker.pID) {
  423. var client = this.gameServer.clients[i].playerTracker;
  424. if (client.cells.length == 1) {
  425. this.writeLine("Client already has one cell!");
  426. return;
  427. }
  428. // Set client's merge override
  429. client.mergeOverride = !client.mergeOverride;
  430. if (client.mergeOverride) {
  431. this.writeLine(client._name + " is now force merging");
  432. var text = this.playerTracker._name + " Caused you to merge!";
  433. this.gameServer.sendChatMessage(null, client, text); // notify
  434. }
  435. else {
  436. this.writeLine(client._name + " isn't force merging anymore");
  437. var text = this.playerTracker._name + " Stopped your mergeing"
  438. this.gameServer.sendChatMessage(null, client, text); // notify
  439. }
  440. }
  441. }
  442. }
  443. },
  444. rec: function(args) {
  445. var id = parseInt(args[1]);
  446. if (isNaN(id)) {
  447. this.writeLine("Warn: Missing ID arguments. This will give you rec mode.");
  448. this.playerTracker.rec = !this.playerTracker.rec;
  449. if (this.playerTracker.rec) this.writeLine(this.playerTracker._name + " is now in rec mode!");
  450. else this.writeLine(this.playerTracker._name + " is no longer in rec mode");
  451. }
  452.  
  453. // set rec for client
  454. for (var i in this.gameServer.clients) {
  455. if (this.gameServer.clients[i].playerTracker.pID == id) {
  456. var client = this.gameServer.clients[i].playerTracker;
  457. client.rec = !client.rec;
  458. if (client.rec) {
  459. this.writeLine(client._name + " is now in rec mode!");
  460. var text = this.playerTracker._name + " gave you rec mode!";
  461. this.gameServer.sendChatMessage(null, client, text); // notify
  462. } else {
  463. this.writeLine(client._name + " is no longer in rec mode");
  464. var text = this.playerTracker._name + " Removed your rec mode";
  465. this.gameServer.sendChatMessage(null, client, text); // notify
  466. }
  467. }
  468. }
  469. },
  470. change: function(args) {
  471. if (this.playerTracker.userRole != UserRoleEnum.ADMIN) {
  472. this.writeLine("ERROR: access denied!");
  473. return;
  474. }
  475. if (args.length < 3) {
  476. this.writeLine("Invalid command arguments");
  477. return;
  478. }
  479. var key = args[1];
  480. var value = args[2];
  481.  
  482. // Check if int/float
  483. if (value.indexOf('.') != -1) {
  484. value = parseFloat(value);
  485. } else {
  486. value = parseInt(value);
  487. }
  488.  
  489. if (value == null || isNaN(value)) {
  490. this.writeLine("Invalid value: " + value);
  491. return;
  492. }
  493. if (!this.gameServer.config.hasOwnProperty(key)) {
  494. this.writeLine("Unknown config value: " + key);
  495. return;
  496. }
  497. this.gameServer.config[key] = value;
  498.  
  499. // update/validate
  500. this.gameServer.config.playerMinSize = Math.max(32, this.gameServer.config.playerMinSize);
  501. Logger.setVerbosity(this.gameServer.config.logVerbosity);
  502. Logger.setFileVerbosity(this.gameServer.config.logFileVerbosity);
  503. this.writeLine("Set " + key + " = " + this.gameServer.config[key]);
  504. Logger.warn("CONFIGURATION CHANGE REQUEST FROM " + this.playerTracker.socket.remoteAddress + " as " + this.playerTracker.userAuth);
  505. Logger.info(key + " WAS CHANGED TO " + value);
  506. },
  507. reloadconfig: function(args) {
  508. if (this.playerTracker.userRole != UserRoleEnum.ADMIN) {
  509. this.writeLine("ERROR: access denied!");
  510. return;
  511. }
  512. this.gameServer.loadConfig();
  513. this.gameServer.loadIpBanList();
  514. Logger.warn("CONFIGURATION RELOAD REQUEST FROM " + this.playerTracker.socket.remoteAddress + " as " + this.playerTracker.userAuth);
  515. this.writeLine("Configuration was Successfully Reloaded!");
  516. },
  517. login: function (args) {
  518. try {
  519. var username = args[1].trim();
  520. } catch (error) {
  521. this.writeLine("ERROR: you have to type in a username!");
  522. return;
  523. }
  524. try {
  525. var password = args[2].trim();
  526. } catch (error) {
  527. this.writeLine("ERROR: You have to type in a password!");
  528. return;
  529. }
  530. var user = this.userLogin(username, password);
  531. if (!user) {
  532. this.writeLine("ERROR: login failed!");
  533. return;
  534. }
  535. Logger.info(username + " Logined in as " + user.name + " from " + this.playerTracker.socket.remoteAddress + ":" + this.playerTracker.socket.remotePort);
  536. this.playerTracker.userRole = user.role;
  537. this.playerTracker.userAuth = user.name;
  538. this.writeLine("Login done as \"" + user.name + "\"");
  539. return;
  540. },
  541. logout: function (args) {
  542. if (this.playerTracker.userRole == UserRoleEnum.GUEST) {
  543. this.writeLine("ERROR: not logged in");
  544. return;
  545. }
  546. var username = this.playerTracker.username;
  547. Logger.info(username + " Logged out from " + this.playerTracker.socket.remoteAddress + ":" + this.playerTracker.socket.remotePort);
  548. this.playerTracker.userRole = UserRoleEnum.GUEST;
  549. this.playerTracker.userAuth = null;
  550. this.writeLine("Logout done");
  551. },
  552. shutdown: function (args) {
  553. if (this.playerTracker.userRole != UserRoleEnum.ADMIN) {
  554. this.writeLine("ERROR: access denied!");
  555. return;
  556. }
  557. Logger.warn("SHUTDOWN REQUEST FROM " + this.playerTracker.socket.remoteAddress + " as " + this.playerTracker.userAuth);
  558. process.exit(0);
  559. },
  560. restart: function (args) {
  561. if (this.playerTracker.userRole != UserRoleEnum.ADMIN) {
  562. this.writeLine("ERROR: acces denied!");
  563. return;
  564. }
  565. Logger.warn("RESTART REQUEST FROM " + this.playerTracker.socket.remoteAddress + " as " + this.playerTracker.userAuth);
  566. process.exit(3);
  567. }
  568. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement