forked from spkaeros/rsc-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
executable file
·35 lines (32 loc) · 1.38 KB
/
index.js
File metadata and controls
executable file
·35 lines (32 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
const mudclient = require('./src/mudclient');
if (typeof window === 'undefined') {
const {createCanvas} = require('canvas');
const mcCanvas = createCanvas(512,346);
const mc = new mudclient(mcCanvas);
mc.options.middleClickCamera = true;
mc.options.mouseWheel = true;
mc.options.resetCompass = true;
mc.options.zoomCamera = true;
mc.members = false;
}
(async () => {
const mcCanvas = document.getElementById('gameCanvas');
const args = window.location.hash.slice(1).split(',');
const mc = new mudclient(mcCanvas);
mc.options.middleClickCamera = true;
mc.options.mouseWheel = true;
mc.options.resetCompass = true;
mc.options.zoomCamera = true;
mc.members = args[0] === 'members';
window.mcOptions = mc.options;
// To connect to a remote server on another machine, change the below to match your server processes IP and port.
// mc.server = 'rscturmoil.com';
mc.server = '127.0.0.1';
mc.port = 43595;
// to enable SSL set mc.transportLayerSecurity var to true (please note that RSCGo must have been provided SSL certs to use this feature)
// Thw websocket library takes care of the heavy lifting for us, and we reap the benefit of full stream encryption at the cost of changing one var
mc.transportLayerSecurity = true;
// Maximum time engine allowed to sleep between frames
mc.threadSleep = 1;
await mc.startApplication(512, 346, 'RSCTurmoil - RSCGo by ZlackCode LLC', false);
})();