{"_id":"@2003scape/rsc-data-server","_rev":"1-571151acf76aa3df096f3c3ccb990a31","name":"@2003scape/rsc-data-server","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@2003scape/rsc-data-server","version":"1.0.0","description":"manage rsc-server worlds, player persistence, friends, etc.","main":"./src/server.js","bin":{"rsc-data-server":"src/bin.js"},"scripts":{"start":"./src/bin.js -v debug | garnish"},"author":{"name":"2003Scape Team"},"license":"AGPL-3.0+","dependencies":{"bcryptjs":"^2.4.3","bole":"^4.0.0","camelcase-keys":"^6.2.2","json-socket":"^0.3.0","sleep-promise":"^8.0.1","snakecase-keys":"^3.2.0","sqlite":"^4.0.14","sqlite3":"^5.0.0","yargs":"^15.4.1"},"devDependencies":{"garnish":"^5.2.0"},"repository":{"type":"git","url":"git+https://github.com/2003scape/rsc-data-server.git"},"keywords":["runescape","classic","mmorpg","game","server","loginserver"],"bugs":{"url":"https://github.com/2003scape/rsc-data-server/issues"},"homepage":"https://github.com/2003scape/rsc-data-server#readme","gitHead":"f69aacd30936cae7f05284568846856ae4c6049d","_id":"@2003scape/rsc-data-server@1.0.0","_nodeVersion":"14.14.0","_npmVersion":"6.14.8","_npmUser":{"name":"misterhat","email":"misterhat144@gmail.com"},"maintainers":[{"name":"misterhat","email":"misterhat144@gmail.com"}],"dist":{"integrity":"sha512-sggQHS86nij2MBmwCZNPDZAKr7h8888xheuEIKgd0r+lGjWT6prLtCIorZbV/J2lrU4Yn1Lq95d/LjOTkTbSEA==","shasum":"b0c8e0ef06b6b39776e8e627f26392925b000db2","tarball":"https://registry.npmjs.org/@2003scape/rsc-data-server/-/rsc-data-server-1.0.0.tgz","fileCount":17,"unpackedSize":74862,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpxSACRA9TVsSAnZWagAAHvMP/1B5fmBptVRcT2FvgE2v\nCbHKM2upawjaHNmBA1oQ4dJTN+IyNtjJ/ynNuU2yCoBAeokEdQgc/AGbuQjz\npXil0g7qPOI9O+12fdS8Yi1ugQF4klzwGYSO75kc43IpN1GQbRe/Fv2aE7RU\n65b9UhTYfDg2UQ4s9Pvyw45s91x2wHMfM0leyerA2hQl487IfEEupkRuobui\nLkK6Sm/VGbabUym5HpYNsVxCOUFP2UrJs5dfs2+YtamNadpa3jFD7/qG2TRd\nQAxu9mY/Vl3L4A71boI8+Q4VWcGsokm5oX26XVdqoVmEtWieUs0LyMn8wnqB\nZ3qG7dhbgTdc4RSOy7JuquBE4NP9ZbWSt6th/4IMN2GyOVE6VSO40x6ZVi3v\nb2mDW/Q3tdk+85EqY367AdVadbIzN05tfmL0x3pJqlCIJNh1RbTqNiCYw+7C\nyfpxUac3OhJoE/Zr0ErngrQAYzhPItd8inlDoBuHVWga/ipl2gVKdKK0paAU\neke4AwoYm/xu92TcTe4br73xOJlCrT0N7R25hFOd6NPLu9JjUiw0v4MLaqVt\n48XvyMohT1krgqbW/YISxAsm+amIlgfxbaOQ1KebyYB2G0uRLTTeMfPD9+yS\nk/rTA44dr2UQojLUWoy/K8IdaRZlXNkmWHsSHTppoaZ4gqFEEbCk0gaOW4RN\nswj5\r\n=PFA+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDYIMdQMD/ShhhwkYgs/72BEgOg+mIuSvxVbXpPRR+JOgIgbD3AdI20NSst+NUMobJTh4d6REvBty1MQraCiSz/ozA="}]},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rsc-data-server_1.0.0_1604785280368_0.8057380324636478"},"_hasShrinkwrap":false}},"time":{"created":"2020-11-07T21:41:20.146Z","1.0.0":"2020-11-07T21:41:20.501Z","modified":"2022-04-04T10:34:56.083Z"},"maintainers":[{"name":"misterhat","email":"misterhat144@gmail.com"}],"description":"manage rsc-server worlds, player persistence, friends, etc.","homepage":"https://github.com/2003scape/rsc-data-server#readme","keywords":["runescape","classic","mmorpg","game","server","loginserver"],"repository":{"type":"git","url":"git+https://github.com/2003scape/rsc-data-server.git"},"author":{"name":"2003Scape Team"},"bugs":{"url":"https://github.com/2003scape/rsc-data-server/issues"},"license":"AGPL-3.0+","readme":"# rsc-data-server\nmanage [rsc-server](https://github.com/2003scape/rsc-server) worlds,\nplayer storage, friend communication, etc. jagex refered to theirs as the\nloginserver.  this server uses [JSON](https://www.npmjs.com/package/json-socket)\nto communicate with rsc-server over TCP or UNIX file sockets for IPC.\n\n## install\n\n    # npm install @2003scape/rsc-data-server # -g for the CLI program\n\n## usage\n```javascript\nconst Server = require('@2003scape/rsc-data-server');\nconst fs = require('fs').promises;\n\n(async () => {\n    const config = JSON.parse(await fs.readFile('./config.json'));\n    const server = new Server(config);\n    await server.init();\n})();\n```\n\n## cli usage\n```\n$ rsc-data-server -c /etc/rsc-data-server/config.json\n```\n\n## configuration\n```javascript\n{\n    \"sockFile\": \"/tmp/rsc-data-server.sock\", // unix IPC socket files\n    \"port\": 8001, // optional TCP port\n    \"sqliteFile\": \"./rsc-data-server.sqlite\",\n    // default is \"test\"\n    \"password\": \"$2y$10$wufvP1CJMLYmBHKl2Ah2k.CGQwQV5aUMIcXrPNUfmqJ9ibNhhvFnS\",\n    \"passwordHashRounds\": 12,\n    \"recoveryHashRounds\": 15,\n    \"playersPerIp\": 1\n}\n```\n\n## handlers\nrsc-data-server responds to JSON messages with the `.handler` property set to\nthe following:\n\n### authenticate\nauthenticate rsc-server or rsc-www instance to allow the rest of the handlers\nto be used.\n\n```javascript\n{\n    handler; 'authenticate',\n    password: 'test'\n}\n```\n\nreturns:\n```javascript\n{\n    success: true, // or false\n    error: '' // if success false\n}\n```\n\n### worldConnect\ninitialize an rsc-server for players to login to.\n\n```javascript\n{\n    handler; 'worldConnect',\n    id: 1, // 1-254\n    tcpPort: 43594,\n    websocketPort: 43595,\n    members: false, // or true\n    country: 'CAN' // ISO 3166-1 alpha-3\n}\n```\n\nreturns:\n```javascript\n{\n    success: true, // or false\n    error: '' // if success false\n}\n```\n\n### worldDisconnect\ndisconnect an rsc-server instance. happens automatically if the connection is\ndropped.\n\n```javascript\n{\n    handler: 'worldDisconnect'\n}\n```\n\n### worldGetList\nget a list of worlds.\n\nreturns:\n```javascript\n[\n    {\n        id: 1,\n        members: false,\n        country: 'CAN',\n        online: true,\n        players: 0 // to 1250\n    }\n]\n```\n\n### playerCount\nthe total number of registered players.\n```javascript\n{\n    handler: 'playerCount'\n}\n```\n\n### playerOnlineCount\nthe number of players online in each world.\n```javascript\n{\n    handler: 'playerOnlineCount'\n}\n```\n\n### playerRegister\n```javascript\n{\n    handler: 'playerRegister'\n    username: '',\n    password: '',\n    ip: ''\n}\n```\n\nreturns:\n```javascript\n{\n    success: true, // or false\n    code: 0 // used in the client to display error message or indicate success\n}\n```\n\n### playerLogin\nchecks if a player's credentials are correct and if they're allowed onto the\nworld they're logging into (membership check).\n\n```javascript\n{\n    handler: 'playerLogin',\n    username: '',\n    password: '',\n    ip: ''\n}\n```\n\nreturns:\n```javascript\n{\n    success: true, // or false\n    code: 0 // similar to registration code\n    player: {\n        id: 1,\n        bank: [ { id: 10, amount: 1000 } ],\n        inventory: [ { id: 10, amount: 1000 } ],\n        skills: { attack: { current: 1, experience: 332 } },\n        // etc.\n    } // undefined if invalid credentials\n}\n```\n\n### playerMessage\nsend a message to a player on another world.\n\n```javascript\n{\n    handler: 'playerMessage',\n    fromUsername: '',\n    toUsername: '',\n    message: ''\n}\n```\n\nreturns:\n```javascript\n{\n    success: true, // or false\n    error: '' // if success false\n}\n```\n\n## senders\nrsc-data-server sends these to certain (or all) clients with the each header\ncorresponding to the `.handler` property:\n\n### playerLogin\nsent to rsc-server instances when players login.\n\n```javascript\n{\n    handler: 'playerLoggedIn',\n    username: '',\n    world: 1 // up to 254\n}\n```\n\n### playerMessage\nsent to the rsc-server instance corresponding to the the world `toUsername`\nresides in the `playerMessage` handler.\n\n```javascript\n{\n    handler: 'playerMessage',\n    fromUsername: '',\n    toUsername: '',\n    message: ''\n}\n```\n\n## license\nCopyright (C) 2020  2003Scape Team\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU Affero General Public License as\npublished by the Free Software Foundation, either version 3 of the\nLicense, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU Affero General Public License for more details.\n\nYou should have received a copy of the GNU Affero General Public License\nalong with this program.  If not, see http://www.gnu.org/licenses/.\n","readmeFilename":"README.md"}