-
Notifications
You must be signed in to change notification settings - Fork 1
/
client.js
47 lines (37 loc) · 933 Bytes
/
client.js
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
36
37
38
39
40
41
42
43
44
45
46
47
var swg = require('swg')
var app = swg({
verbose: true
});
var port = 44453;
var address = '127.0.0.1';
app.setDefault('port', port);
app.setDefault('address', address);
var connectionId = '58b026ca';
app.on('SOE_SESSION_REPLY', function(req, res) {
app.setDefault('crcSeed', req.packet.crcSeed);
app.setDefault('crcLength', req.packet.crcLength);
app.setDefault('useCompression', !!req.packet.useCompression);
app.setDefault('seedSize', req.packet.seedSize);
res.sendPacket({
name: 'LoginClientId',
username: 'swganh0',
password: 'swganh',
version: '20050408-18:00'
});
});
app.on('SOE_ACK_A', function(req, res) {
console.log('ack', req.packet);
});
app.on('LoginClientToken', function(req, res) {
console.log('received token', req.packet);
});
app.send({
packet: {
name: 'SOE_SESSION_REQUEST',
crcLength: 2,
connectionId: 1487939274,
clientUDPSize: 496
},
port: port,
address: address
});