{"_id":"@arbytez/cod4-rcon-commands","_rev":"2-30334db341aa283852e7e1efefe2dc45","name":"@arbytez/cod4-rcon-commands","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"version":"0.1.0","license":"MIT","main":"dist/index.js","typings":"dist/index.d.ts","scripts":{"start":"tsdx watch","build":"tsdx build","test":"tsdx test","lint":"tsdx lint","prepare":"tsdx build"},"peerDependencies":{},"husky":{"hooks":{"pre-commit":"tsdx lint"}},"prettier":{"printWidth":80,"semi":true,"singleQuote":true,"trailingComma":"es5"},"name":"@arbytez/cod4-rcon-commands","author":{"name":"arbytez"},"repository":{"type":"git","url":"git+https://github.com/arbytez/cod4-rcon-commands.git"},"homepage":"https://github.com/arbytez/cod4-rcon-commands","keywords":["cod4","rcon"],"module":"dist/cod4-rcon-commands.esm.js","devDependencies":{"@types/jest":"^25.1.2","husky":"^4.2.3","tsdx":"^0.12.3","tslib":"^1.10.0","typescript":"^3.7.5"},"dependencies":{"iconv-lite":"^0.5.1"},"gitHead":"9997f4e9cc5a87525be2544fb9ac7d2128a22a39","description":"A simple wrapper library to the rcon commands you can send to a cod4 server. Response data for commands '_status_', '_rconStatus_' and '_info_' is parsed into custom type object, so it is possible to easily manage the server status/info.","bugs":{"url":"https://github.com/arbytez/cod4-rcon-commands/issues"},"_id":"@arbytez/cod4-rcon-commands@0.1.0","_nodeVersion":"12.14.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-GRk0vv1n8ss4ozEE+rml5cSKRGKEH6nDANHO4Vmu5mrN3M7yg5z6fLfQxPN6Mk9i+W2uhWupHIFBWW81O6dEKQ==","shasum":"e881cdd2d3fac476ae09be2df3ec200ce8a6b5a7","tarball":"https://registry.npmjs.org/@arbytez/cod4-rcon-commands/-/cod4-rcon-commands-0.1.0.tgz","fileCount":14,"unpackedSize":199315,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeR80wCRA9TVsSAnZWagAA4SkP/jvHqUWgS3WnPwvnqsq4\nUGRgVRU4x+qIvjlS0xHhSltpESvnVLqG0OVCXm0MfujC11/EmP02P4Kwiog7\nSo251K8oiHWC57eVB+W8l0XOHaRkXbmvB/SWzWb1IFNZd5plJr5joI/CXEqN\nVuoldyrrcXYuLYCWc+byunmDHoC4ch2P2gglOvvCGNd/GsrtPIKD+glweZlW\n4osVlH3xpkh4Qy5dFCTSNCRYVBdtBeH0gYOy3fDAuBItmTNVW4M/8ksMXutx\nKdmp060w+KKECzzibaF7wooXHBWgxw3p/o30aG6G/i26esJGAYbLGEyCC6rg\nInlKcM68Q6+8e7Yb4nDQAe/85qHrFBeMcOKW112dUS2Jt/9liAOaho52Zh5P\ng8AW4dS1+o6/wMgQp9tPFcniDM1uEpFTbUlRpwjLaKpnMaCVLjJfA2XNxvdM\n36AO8w7NEKZVvob6Ih0tYxCGtNoBl0fxxsXyCbHPXnstcMMjx8sFCzAJMqkT\n09otGm0EWss9UTiTUdQlu7c/W6zxIokSjNstwjELjf0wGBFtqOQg8eqnMolu\nJVyqlqrNRt/ytg6wWei+rJOwLTziUxZ+T23i3jZD9yME6uWN+qT6KMs/99kN\nvoY4wIashV2i0/e+jC2+EhiTC9slULHnayXvJrVYXgAZT6JBQ2ATo6TkqKnj\n+doZ\r\n=GG9U\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAF5TAsaY51/i97mRd+Yk/a9071uKxtpeDeWKb9twjgGAiANgsplXveMa4+fKxNAUSTl4OMgDKYC3ebRt6Xs2TPEgg=="}]},"maintainers":[{"name":"arbytez","email":"arbotarbok@mail.com"}],"_npmUser":{"name":"arbytez","email":"arbotarbok@mail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cod4-rcon-commands_0.1.0_1581763887680_0.8196139221604783"},"_hasShrinkwrap":false},"0.1.1":{"version":"0.1.1","license":"MIT","main":"dist/index.js","typings":"dist/index.d.ts","scripts":{"start":"tsdx watch","build":"tsdx build","test":"tsdx test","lint":"tsdx lint","prepare":"tsdx build"},"peerDependencies":{},"husky":{"hooks":{"pre-commit":"tsdx lint"}},"prettier":{"printWidth":80,"semi":true,"singleQuote":true,"trailingComma":"es5"},"name":"@arbytez/cod4-rcon-commands","author":{"name":"arbytez"},"repository":{"type":"git","url":"git+https://github.com/arbytez/cod4-rcon-commands.git"},"homepage":"https://github.com/arbytez/cod4-rcon-commands","keywords":["cod4","rcon"],"module":"dist/cod4-rcon-commands.esm.js","devDependencies":{"@types/jest":"^25.1.3","husky":"^4.2.3","tsdx":"^0.12.3","tslib":"^1.11.1","typescript":"^3.8.3"},"dependencies":{"iconv-lite":"^0.5.1"},"gitHead":"82f681e8bc4c88bdeaa93d38c113a83e1802c54f","description":"A simple wrapper library to the rcon commands you can send to a cod4 server. Response data for commands '_status_', '_rconStatus_' and '_info_' is parsed into custom type object, so it is possible to easily manage the server status/info.","bugs":{"url":"https://github.com/arbytez/cod4-rcon-commands/issues"},"_id":"@arbytez/cod4-rcon-commands@0.1.1","_nodeVersion":"12.14.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-J9V6doLV7iHTjcd0+TyA+TNH/onc1pwwrzaZHfN3qPj2CXoFIh7MLTJHICGISR5rDJsh7IWOyt0/xVwgsnOB7Q==","shasum":"ddd1441b48fddd0179621265390de53b7b4cb974","tarball":"https://registry.npmjs.org/@arbytez/cod4-rcon-commands/-/cod4-rcon-commands-0.1.1.tgz","fileCount":14,"unpackedSize":201643,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeYA/kCRA9TVsSAnZWagAAUkAP/1T/R1U1UF7t+Q8VovNz\nfqnotDQHkzsU70glEioVhY84xC3BCSsAFAktS1cpHwOPOddZTQYJLjbxYjsn\nosQsIOc37Nu8/R8hXL6i/9mGqJiwUOKV5HOHDPVEAOsNaE3dLLheC+/6IkCT\nfYToBDiwxDUOQB/XhlPW65rHzxI4iY4RAtLS/jpaD8tB/PBOREfHAoYTqU7L\nH2PE+DYRyyW0a3oJV9cQu8jU9PoffBc+7kcHP1R9qEJY+MeRRIbbPRjF+NF0\nY0K3gFjK0G9Ao122qnSyFcyE/DZLA/k8k3g+dn3yYPmqh+xTKh3L14+tTkkW\n70YcKcfyZRa9qS6SfhK/dQxiyTpLJ9ebbopbJKBydnpcIW5DYBv9z09N6VYP\ngyWnrc3ZsE6vo64kjPhddY1Uem6f0n+M8RO7cee1lEfehGUrfKUxj931mh91\nH2ptgqyVKWqfUKitAgbpF1hdAkmQQBkqOHcRprD9pULBd6FDfxiZ2X+ycbFs\nv5UiXb3ZZ4wTkScuaWNYbw79XDYGOJTK4WSCB04yTvGmIppAqcucIM7ht7ns\nuwHUGK/dQauVyMMrNCxu3+UQxIoOvHVWngn0XKXuUgJ4Blkr+4guQ6c5Xx+z\ncN0YhHNir9gicHG0pKmiWZwZOf9yCmoR8V0uHtJyOiHrJADKavauhukCIr7V\nXAgN\r\n=+J0r\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIASDTMXsQDQ7HDnQ7V453BblSjDtLFLXHAq2QJtGYR+dAiEAofB8i1C+Iu0STnuLEkHXtPlmkpt+/QhkIzBT8FeeYeg="}]},"maintainers":[{"name":"arbytez","email":"arbotarbok@mail.com"}],"_npmUser":{"name":"arbytez","email":"arbotarbok@mail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cod4-rcon-commands_0.1.1_1583353828164_0.8040703267448353"},"_hasShrinkwrap":false}},"time":{"created":"2020-02-15T10:51:27.604Z","0.1.0":"2020-02-15T10:51:27.787Z","modified":"2022-04-04T15:15:29.445Z","0.1.1":"2020-03-04T20:30:28.328Z"},"maintainers":[{"name":"arbytez","email":"arbotarbok@mail.com"}],"description":"A simple wrapper library to the rcon commands you can send to a cod4 server. Response data for commands '_status_', '_rconStatus_' and '_info_' is parsed into custom type object, so it is possible to easily manage the server status/info.","homepage":"https://github.com/arbytez/cod4-rcon-commands","keywords":["cod4","rcon"],"repository":{"type":"git","url":"git+https://github.com/arbytez/cod4-rcon-commands.git"},"author":{"name":"arbytez"},"bugs":{"url":"https://github.com/arbytez/cod4-rcon-commands/issues"},"license":"MIT","readme":"# Cod4 Rcon Commands\n\nA simple wrapper library to the rcon commands you can send to a cod4 server.\nResponse data for commands '_status_', '_rconStatus_' and '_info_' is parsed\ninto custom type object, so it is possible to easily manage the server status/info.\n\n## Installation\n\n```sh\n$ yarn add @arbytez/cod4-rcon-commands\n# or\n$ npm install --save @arbytez/cod4-rcon-commands\n```\n\n## Usage\n\n```ts\nimport { createRconCommands } from '@arbytez/cod4-rcon-commands';\n// const { createRconCommands } = require('@arbytez/cod4-rcon-commands');\n\nconst cod4ServerIp = '127.0.0.1';\nconst cod4ServerPort = 28960;\nconst cod4ServerRcon = 'myrconpass';\n\nconst rconCmds = createRconCommands(\n  cod4ServerIp,\n  cod4ServerPort,\n  // you can omit the rcon pass but you will be only be able\n  // to execute the 'status' and 'info' commands\n  cod4ServerRcon\n);\n\nconst status = await rconCmds.status();\n\n// commands are sent using the udp protocol so we can not track the connection state (start/end)\n// each command has its predefined timeout (in ms) already set\n// but you can specify a custom timeout for each of them\n// useful if you get truncated results from the rcon requests\n// timeout default values are different for each command.\n\n// maxTimeOut of 1500ms instead of the default value (for rconStatus cmd is 500ms)\nconst rconStatus = await rconCmds.rconStatus(1500);\n\n// if you need to send a custom command\nconst customCmd = await rconCmds.execRconCmd('custom command');\n```\n\n### Examples\n\n#### status\n\n```ts\nconst status = await rconCmds.status();\nconsole.log(status);\n{\n  online: true,\n  ip: '127.0.0.1',\n  port: '28960',\n  sv_hostname: 'hostname',\n  g_gametype: 'sd',\n  sv_maxclients: '32',\n  uptime: '42 hours',\n  g_mapStartTime: date,\n  sv_privateClients: '0',\n  fs_game: '',\n  version: '...',\n  mapname: 'mp_crash',\n  onlinePlayers: [\n    { score: 68, ping: '51', name: 'player2' },\n    { score: 33, ping: '42', name: 'player1' },\n    { score: 13, ping: '135', name: 'player3' },\n    { score: 5, ping: '28', name: 'player4' }\n  ],\n  branch: '',\n  build: '...',\n  g_compassShowEnemies: '0',\n  gamename: 'Call of Duty 4',\n  protocol: '17',\n  revision: '',\n  shortversion: '1.8',\n  sv_disableClientConsole: '0',\n  sv_floodprotect: '4',\n  sv_maxPing: '0',\n  sv_maxRate: '25000',\n  sv_minPing: '0',\n  sv_pure: '1',\n  sv_voice: '0',\n  type: '1'\n}\n```\n\n#### rconStatus\n\n```ts\nconst rconStatus = await rconCmds.rconStatus();\nconsole.log(rconStatus);\n{\n  ... // same as the status cmd response\n  onlinePlayers: [\n    {\n      num: 3,\n      score: 15,\n      ping: 135,\n      id: '1234567890123456789',\n      steamId: '12345678901234567',\n      name: 'player1',\n      lastmsg: 0,\n      ip: 'xx.xxx.x.xxx',\n      port: 28960,\n      qport: 3717,\n      rate: 25000\n    },\n    {\n      num: 1,\n      score: 10,\n      ping: 25,\n      id: '1234567890123456789',\n      steamId: '12345678901234567',\n      name: 'player2',\n      lastmsg: 0,\n      ip: 'xx.xxx.x.xxx',\n      port: 36785,\n      qport: 28790,\n      rate: 25000\n    },\n    {\n      num: 5,\n      score: 5,\n      ping: 26,\n      id: '1234567890123456789',\n      steamId: '0',\n      name: 'player3',\n      lastmsg: 0,\n      ip: 'xx.xxx.x.xxx',\n      port: 28960,\n      qport: 12999,\n      rate: 25000\n    },\n    ...\n  ],\n  ...\n}\n```\n\n#### info\n\n```ts\nconst info = await rconCmds.info();\nconsole.log(info);\n{\n  build: '...',\n  clients: '6',\n  ff: '0',\n  g_humanplayers: '6',\n  game: '...',\n  gametype: 'sd',\n  hc: '1',\n  hostname: 'hostname',\n  hw: '1',\n  ki: '1',\n  mapname: 'mp_crossfire',\n  mod: '1',\n  od: '1',\n  protocol: '6',\n  pswrd: '0',\n  pure: '1',\n  shortversion: '1.8',\n  sv_maxclients: '32',\n  type: '1',\n  voice: '0'\n}\n```\n\n#### List of all wrapped commands\n\n```\nAdminAddAdmin\nAdminChangeCommandPower\nAdminChangePassword\nAdminListAdmins\nAdminListCommands\nAdminRemoveAdmin\nChangePassword\nXAssetUsage\naddCommand\ncmdlist\ncvarlist\ndumpbanlist\ndumpuser\necho\nexec\nfast_restart\ngametype\ngetmodules\ngetss\ninfo\nkick\nkillserver\nloadPlugin\nmap\nmap_restart\nmap_rotate\nmeminfo\nministatus\nnet_restart\npath\npermban\npluginInfo\nplugins\nquit\nrconStatus\nrecord\nreset\nsay\nscreensay\nscreentell\nserverinfo\nset\nseta\nsetcvartotime\nsetfromcvar\nsets\nsetu\nstatus\nstoprecord\nsysteminfo\ntell\ntempban\ntoggle\nunban\nundercover\nunloadPlugin\nvstr\nwhich\nwriteconfig\nwritenvcfg\nzonememinfo\n```\n","readmeFilename":"README.md"}