Skip to content

Commit 5d333dc

Browse files
committed
browser stuff, aggression fix, docs & dependencies
1 parent 64551f4 commit 5d333dc

13 files changed

+235722
-548
lines changed

README.md

+76-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,30 @@
11
# rsc-server
2-
[runescape classic](https://classic.runescape.wiki/w/RuneScape_Classic) mmorpg
3-
game server emulator. designed to work with the web-based
2+
[runescape classic](https://classic.runescape.wiki/w/RuneScape_Classic)
3+
private server mmorpg emulator. designed to work with the web-based
44
[rsc-client](https://github.com/2003scape/rsc-client) or the java-based
55
[mudclient204](https://github.com/2003scape/mudclient204).
66

7+
features:
8+
* supports TCP and WebSockets via Node.js with SQLite persistence and multiple
9+
worlds (with [rsc-data-server](https://github.com/2003scape/rsc-data-server)),
10+
and single-page with optional
11+
multiplayer on the browser via WebWorkers and WebRTC
12+
* [plugin-based content addition](https://github.com/2003scape/rsc-server/tree/master/src/plugins).
13+
add files with certain function signatures (
14+
`function onTalkToNpc(player, npc) {}`,
15+
`function onUseWithInventory(player, item, target) {}`, etc.) to implement
16+
quests, skills, item interactions, and other game content
17+
* [simple, JSON-based data formats for spawns, skills, probabilities, etc.](https://github.com/2003scape/rsc-data)
18+
* NPC combat (melee and ranged) with accurate
19+
[roll-based RNG drops](https://github.com/2003scape/rsc-data/blob/master/rolls/drops.json)
20+
are implemented
21+
* [all of the free-to-play quests implemented](https://github.com/2003scape/rsc-server/tree/master/src/plugins/quests/free)
22+
* [accurate sleep captcha](https://github.com/2003scape/rsc-captcha)
23+
* [compatible with period-accurate website replica](https://github.com/2003scape/rsc-www)
24+
725
## install
826

9-
* download and install [nodejs](https://nodejs.org/en/) (which comes with
27+
* download and install [Node.js](https://nodejs.org/en/) (which comes with
1028
[npm](https://docs.npmjs.com/about-npm))
1129

1230
* for the latest stable release, run:
@@ -46,9 +64,60 @@ they will look for *config.json* in their own directory first):
4664
$ cd rsc-data-server && npm start &
4765
$ cd ../rsc-server && npm start
4866

49-
## config.json
67+
## browser usage
68+
create a new `Worker` instance using
69+
`./dist/server.bundle.js` or `./dist/server.bundle.min.js`. if making any
70+
changes to the source, use `$ npm run build-browser` to re-build these files.
71+
you can then pass the worker instance into
72+
[mudclient's](https://github.com/2003scape/rsc-client) `.server` property.
73+
74+
```javascript
75+
const serverWorker = new Worker('./server.bundle.min.js');
76+
77+
serverWorker.postMessage({
78+
type: 'start',
79+
config: {
80+
worldID: 1,
81+
version: 204,
82+
members: false,
83+
experienceRate: 1,
84+
fatigue: true,
85+
rememberCombatStyle: false
86+
}
87+
});
88+
89+
// mc.server = serverWorker;
90+
```
91+
92+
## commands
93+
94+
|Command|Description|
95+
|-|-|
96+
|::addexp <skill> <experience>|Add experience to a skill name.|
97+
|::appearance|Toggle the character creation screen.|
98+
|::bank|Open the bank interface.|
99+
|::bubble <id>|Create a player action bubble with an item ID.|
100+
|::clearinventory|Clear your inventory items.|
101+
|::coords|Display your current coordinates.|
102+
|::dmg <amount>|Remove a certain amount of current hitpoints.|
103+
|::fatigue|Set your fatigue to 100%.|
104+
|::give <username> <id> <amount = 1>|Spawn an item in someone else's (online) inventory with optional amount.|
105+
|::goto <username>|Teleport to a username (online).|
106+
|::gotoentity <type> <id>|Teleport to the first entity (npcs, gameObjects, groundItems) of a certain ID.|
107+
|::item <id> <amount = 1>|Spawn an item in your inventory with optional amount.|
108+
|::kick <username>|Forcefully log out a username (online).|
109+
|::npc <id>|Spawn an NPC in your current position.|
110+
|::setqp <amount>|Set your quest points to a certain amount.|
111+
|::shop <name>|Open a shop by name (see [rsc-data/shops.json](https://github.com/2003scape/rsc-data/blob/master/shops.json))|
112+
|::sound <name>|Play a sound file (members client only, see [rsc-sounds/sounds1.json](https://github.com/2003scape/rsc-sounds/blob/master/sounds1.json)).|
113+
|::step <deltaX> <deltaY>|Step in a certain direction (delta can be -1, 0 or 1).
114+
|::teleport <x> <y> \| <region>|Teleport to an x, y coordinate or region name (see [rsc-data/regions.json](https://github.com/2003scape/rsc-data/blob/master/regions.json)).|
115+
116+
## config
50117
when using `$ rsc-server`, pass in `-c <config-file>` (or edit `config.json`
51-
in the *rsc-server* directory if cloned from git) to modify the following:
118+
in the *rsc-server* directory if cloned from git), or change the object
119+
passed into the `{ type: 'start' }` Worker message to modify the following
120+
settings:
52121

53122
```javascript
54123
{
@@ -72,7 +141,7 @@ in the *rsc-server* directory if cloned from git) to modify the following:
72141
// (for mudclient204)
73142
"tcpPort": 43594,
74143

75-
// port to listen to https://en.wikipedia.org/wiki/WebSocket connections
144+
// port to listen to https://developer.mozilla.org/en-US/docs/Web/API/WebSocket connections
76145
// (for rsc-client)
77146
"websocketPort": 43595,
78147

@@ -106,7 +175,7 @@ in the *rsc-server* directory if cloned from git) to modify the following:
106175
* best source of accurate runescape classic data
107176

108177
## license
109-
Copyright (C) 2020 2003Scape Team
178+
Copyright (C) 2021 2003Scape Team
110179

111180
This program is free software: you can redistribute it and/or modify
112181
it under the terms of the GNU Affero General Public License as

0 commit comments

Comments
 (0)