810 Commits

Author SHA1 Message Date
deathcap
09ecdcfcff Merge branch 'master' into forge 2016-02-02 21:58:00 -08:00
Romain Beaumont
e9d959e219 Merge pull request #320 from deathcap/clientstream
Add 'stream' option to client, generic stream alternative to TCP/IP host/port options
2016-02-01 10:25:48 +01:00
Romain Beaumont
c23db885fa let's not compute the size of the varInt 2 times 2016-02-01 10:18:01 +01:00
Romain Beaumont
172e31c58d Merge pull request #316 from deathcap/frame1
Send framed packets in one push()
2016-02-01 10:15:19 +01:00
Romain Beaumont
bf029d3698 Merge pull request #334 from deathcap/legacyping
Server response to legacy ping (fe and fe01) packets
2016-02-01 10:07:40 +01:00
deathcap
cf2688d8f8 Send framed packets in one push() 2016-01-31 18:25:14 -08:00
deathcap
39b7199ec6 Add 'stream' option to client/tcp_dns, alternative to host,port for TCP 2016-01-31 15:33:06 -08:00
deathcap
834170689e Remove createClientStream 2016-01-31 15:27:38 -08:00
deathcap
dccb9cef58 Merge branch 'master' into clientstream 2016-01-31 15:26:26 -08:00
deathcap
70f1883a0c Set tagHost in src/client/forgeHandshake.js 2016-01-31 11:17:35 -08:00
deathcap
4a677a25ba Use endian-toggle for UTF-16BE encoding (not in nodejs, see https://github.com/nodejs/node-v0.x-archive/issues/1684) 2016-01-30 21:40:03 -08:00
deathcap
6eb95766cb Add legacy ping type 1 support (includes versions) 2016-01-30 16:07:56 -08:00
deathcap
dda0cb2e77 Refactor ping replying into sendPingResponse() 2016-01-30 16:00:12 -08:00
deathcap
af542c29f2 Add server support for legacy ping type 0 (0xfe) 2016-01-30 15:56:48 -08:00
deathcap
9b824b5b88 Legacy ping is only allowed when in HANDSHAKING state (otherwise, varint packet length 254) 2016-01-30 15:28:40 -08:00
deathcap
4840ffe7b1 Splitter prepends length header to legacy ping for deserializer support 2016-01-30 15:20:53 -08:00
deathcap
c24718f64c Recognize legacy ping in splitter. GH-332 2016-01-30 14:45:41 -08:00
deathcap
069a79ba3e Update client/forgeHandshake.js to be installable as module 2016-01-27 20:42:15 -08:00
deathcap
0ab5b6150d Rename src/fml.js -> src/client/forgeHandshake.js 2016-01-27 20:34:48 -08:00
deathcap
fd9caddb67 Merge branch 'master' into forge (client modularization)
Merging https://github.com/PrismarineJS/node-minecraft-protocol/pull/333
2016-01-27 20:27:53 -08:00
Romain Beaumont
a6a673a8c8 Merge pull request #333 from deathcap/m2client
Modularization attempt of createClient()
2016-01-27 22:46:26 +01:00
deathcap
c3d86d7674 Add client.connect(port, host) for backwards-compatibility
Would like to remove this method because it is hardcoded to dependent on
TCP/IP, but the serverTest uses it. Load tcp_dns as needed.
2016-01-26 01:15:59 -08:00
deathcap
bf5ce9e569 Pass haveCredentials/accessToken between client/caseCorrect and client/encrypt 2016-01-26 00:55:44 -08:00
deathcap
2f60088fdf Fix missing tcp_dns host option 2016-01-26 00:47:21 -08:00
deathcap
cf5f8c1c4c Pass options to all src/client/*, for consistency 2016-01-26 00:01:09 -08:00
deathcap
fe327c85e1 Move net.socket() and dns.resolveSrv() into client/net_tcp
This has been the trickest to refactor/remodularize, since it used to
modify the Client prototype to augument connect(host, port). This added
a dependence on TCP/IP host/port socketpairs, refactor to add a
'connect' option instead, called with the client instance. Update ping
accordingly, but it has to call connect itself since it does not include
client/caseCorrect, which normally calls connect. Still may be able to
improve further and untangle these interdependencies cleanlier.
2016-01-25 23:57:10 -08:00
deathcap
de36de8496 Break client/caseCorrect dependence on TCP/IP host/port; generalize options.connect(client) 2016-01-25 23:47:23 -08:00
deathcap
9c2112802a Fix ursa imports 2016-01-25 23:40:35 -08:00
deathcap
34534b2aa6 Move onLogin set state=PLAY to client/play 2016-01-25 23:36:36 -08:00
deathcap
b37dcc4d08 Move onConnect/set_protocol to client/setProtocol 2016-01-25 23:33:58 -08:00
deathcap
821227d73e Move making a request to get case-correct username before connecting to client/caseCorrect 2016-01-25 23:28:14 -08:00
deathcap
8c4406b4a2 Move keepAlive/checkTimeoutInterval to client/keepalive 2016-01-25 23:24:20 -08:00
deathcap
20e076ebcf Move onCompressionRequest to client/compress 2016-01-25 23:22:35 -08:00
deathcap
a727829a98 Move onKeepAlive to client/keepalive 2016-01-25 23:19:57 -08:00
deathcap
cbaaeb8eb2 Move onEncryptionKeyRequest to client/encryption 2016-01-25 23:18:32 -08:00
deathcap
bd72488bf3 Move FML|HS listener to forge_client example, reduce changes in createClient 2016-01-24 11:19:19 -08:00
deathcap
93c5c7315a Add tagHost option, clients can use to append to set_protocol serverHost
This is used by Forge clients to tell the server they support FML|HS,
otherwise the server will kick with "you must have FML/Forge installed".
2016-01-24 11:11:47 -08:00
deathcap
92b6c3778b Add documentation for forge/forgeMods options and forgeMods event 2016-01-23 21:00:00 -08:00
deathcap
c0271874d2 Emit forgeMods event when receiving server's ModList 2016-01-23 20:56:00 -08:00
deathcap
2802ac9d2b fml console.log -> debug 2016-01-23 20:54:43 -08:00
deathcap
f6ad1d8061 Move FML|HS to fml.js 2016-01-23 20:47:29 -08:00
deathcap
283b75d694 Forge client example pings server to get forgeMods list
Avoids the need to hardcode the mod list in the client, in order to
successfully connect to arbitrary Forge servers (with various mods).
2016-01-23 20:01:07 -08:00
deathcap
0b45b439bc Use symbolic values for writeAck() phase 2016-01-23 19:29:27 -08:00
deathcap
6c33ec2856 Refactor FML|HS to use state machine
Instead of responding based on the packet type received, maintain a
local state and ensure the correct packets are received. Should help
avoid unexpected states/behavior. See:
https://github.com/ORelio/Minecraft-Console-Client/pull/100/files#diff-65b97c02a9736311374109e22d30ca9cR297
2016-01-23 19:26:50 -08:00
deathcap
8fd30f6af9 Move to fmlHandshakeStep() 2016-01-23 19:03:54 -08:00
deathcap
0b2550e206 Add forgeMods option, set to array of Forge modifications installed on client 2016-01-23 18:17:18 -08:00
deathcap
1349fdfc73 Update examples to log when connection is lost
Normally, the client will send a kick packet if the client is
disconnected from the server, but if the connection is lost due to
network or lower-level protocol issues, the 'end' event will be emitted.
Log this event in the examples so it is clear why the scripts exit.
2016-01-23 18:08:18 -08:00
deathcap
46a134c5e9 Fix sending Handshake|Ack phase 2016-01-23 17:44:20 -08:00
deathcap
c680c0d12a Fix RegistryData hasMore field definition and usage 2016-01-23 17:05:33 -08:00
deathcap
265fcd9d4c ModList field uses 'modid' to match ServerPingList packet JSON 2016-01-23 17:04:02 -08:00