Commit graph

95 commits

Author SHA1 Message Date
Romain Beaumont
e3e0a26dfe
change codestyle to standard + enforce it with circle ci 2018-05-13 22:50:16 +02:00
Oscar Beaumont
8afeee014f
Add Minecraft Version To The Server
Add the Minecraft version this example was built with to the create server function so that this example code works even if the default Minecraft version for this module changes.
2017-11-09 18:32:10 +08:00
Oscar Beaumont
f3a25af4dc
Added package.json
Added a package.json that has the dependencies for the example code.
2017-11-09 10:29:56 +08:00
Oscar Beaumont
39b2fc2157
Send The Player Position After The Chunk Data
The players position was sent before sending the chunk which had now been switched.
2017-11-09 10:28:33 +08:00
Oscar Beaumont
a70eee40c8
Added New Example For Generating A World
This is a new example that shows how to generate a chunk (Using prismarine-chunk) and send it to the user.
2017-11-08 23:27:00 +08:00
Lane Kolbly
c7aaee6dbc Changed let scope, added undefined check. 2017-08-10 16:50:12 -05:00
Romain Beaumont
650c411822 add readme.md for the proxy example, progress on #380 2017-07-28 22:41:51 +02:00
Romain Beaumont
010362ef78
add connect option to createClient for multiple (ping + normal) connections for the proxy examples, use the normal options for pinging in autoVersion to have that option available and fix the proxy examples accordingly 2017-07-19 18:39:25 +02:00
Romain Beaumont
6279ae9afe
fix socks proxy using a socks module that actually works and provide a proper node stream 2017-07-19 17:24:51 +02:00
Romain Beaumont
cab5a329bf
fix http proxy 2017-07-19 16:41:24 +02:00
Romain Beaumont
e9ced90a50 Update client_socks_proxy.js 2017-07-17 15:30:14 +02:00
Romain Beaumont
d8844a5ba1 Update client_http_proxy.js 2017-07-17 15:30:00 +02:00
Romain Beaumont
ed425e775d
add 2 examples : client_http_proxy and client_socks_proxy. fix #185 fix #436 2017-07-13 14:42:42 +02:00
Romain Beaumont
79f82afb91
var -> const/let in examples and tests 2017-07-13 14:03:52 +02:00
Romain Beaumont
eb5764e7ab
fix autoversion in online mode.
Explanation:
in this specific case, we were changing the state of the client to hanshaking (in autoVersion.js) before a connection was made (using setSocket), the consequence is the serializer was already piped to the framer when setSocket was called, and setSocket doesn't unpipe before piping. The consequence of that was the framer was piped 2 times, the packet was sent 2 times and the server kicked us.
My solution is piping the serializer to the framer in Client constructor.
Then if the state is changed, it will anyway automatically unpipe before repiping.

Other places correctly unpipe before piping.

Autoversion is now the default in nmp too
2017-07-12 13:07:25 +02:00
Romain Beaumont
a0717a1232
add logic for custom channel, and corresponding examples 2016-08-10 19:27:50 +02:00
Romain Beaumont
1dcd119d93
fix version in pluginChannels, add writeChannel, add two examples for a vanilla channel (MC|Brand) 2016-08-10 18:54:06 +02:00
deathcap
14e848ab99 Enable strict mode 2016-04-27 16:27:32 -07:00
Romain Beaumont
d9d29bf17d Merge pull request #392 from vimes1984/patch-2
Update proxy.js
2016-03-21 15:56:21 +01:00
christopher james churchill
25750ddf2d Update proxy.js
ups != was right in one of those cases.... 
ummm using typeof may be better? 
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof
2016-03-21 14:51:26 +00:00
christopher james churchill
bc94bc1fe0 Update proxy.js
changing == to === and != to !== becuase js is a bitch see: 
http://www.impressivewebs.com/why-use-triple-equals-javascipt/
2016-03-21 14:46:06 +00:00
christopher james churchill
d9782d6d9f Update proxy.js
fixing type in example code :D
2016-03-21 14:40:53 +00:00
Romain Beaumont
440a190780 update to 1.9-pre4, improve the proxy errors a bit 2016-02-27 18:10:11 +01:00
Romain Beaumont
d78d87b9fc update to new minecraft-data protocol schema 2016-02-23 18:42:01 +01:00
Romain Beaumont
91ccac44df index custom packets by version 2016-02-20 17:19:36 +01:00
Romain Beaumont
eba07e6b90 add an optional property to add custom packets to createClient and createServer 2016-02-20 17:19:36 +01:00
Romain Beaumont
a698749387 fix state displaying in proxy 2016-02-15 23:18:57 +01:00
Romain Beaumont
86397e7d06 display error in proxy 2016-02-15 20:50:42 +01:00
deathcap
a807bdd872 Fix client_chat example extra array iteration. Closes GH-343 2016-02-09 20:30:40 -08:00
Romain Beaumont
77d4583d06 Merge pull request #340 from deathcap/connection-lost
Log when connection lost in client_echo example
2016-02-07 09:19:23 +01:00
deathcap
91f7e23338 Log when connection lost in client_echo example 2016-02-07 00:05:55 -08:00
deathcap
f9e302c08e Remove client chat exclusion from server 2016-02-06 16:06:45 -08:00
deathcap
9a68fd6c34 Support options.version==false in createClient() to auto-detect version 2016-01-30 22:53:38 -08:00
deathcap
66e6f4dd0b Update to use compatible sync API (createClient) 2016-01-30 22:16:36 -08:00
deathcap
a53a2977f2 Add dynamic cross-protocol support 2016-01-27 23:28:27 -08:00
deathcap
4aac85c09a Show disconnect reason in examples 2016-01-22 00:32:36 -08:00
Romain Beaumont
43d56de2f6 fix cli options doc proxy example, fix #313 2016-01-07 01:55:28 +01:00
Romain Beaumont
b2b53c9343 a few small changes to make the code better 2015-11-30 22:19:56 +01:00
Romain Beaumont
57d9c05941 use require-self to be able to use require('minecraft-protocol') in examples 2015-11-30 13:23:38 +01:00
Romain Beaumont
787f8d3423 fix gamemode3 in proxy : fix #146
* correctly generate the same uuidv3 than the vanilla server does in offline mode : fix #282
* remove "one player online mode" in the proxy : it doesn't make sense to identify all players as the user/passwd given in the cli. Now both servers in offline mode.
2015-11-08 23:34:15 +01:00
Romain Beaumont
23b077b76f fix compression in proxy, fix #292 2015-11-08 23:34:15 +01:00
Romain Beaumont
f45c6dff49 use protodef:
* move general datatypes to protodef along with their tests
* move states to states.js file
* use one protodef serializer by state and direction instead of one big serializer for everything (same thing for the deserializer)
* define a packet as a protodef type using a switch and a container, and adding each minecraft packet as a type (packet_ + name)
* use mapper type from protodef to convert id to name in packet definition
* use general string type : pstring
* divide by 10 the number of iteration in the benchmark to get back to a reasonable test execution time
2015-11-08 23:29:51 +01:00
Romain Beaumont
0da2b14607 change dependency from buffertools to buffer-equal in proxy 2015-10-13 17:15:49 +02:00
Romain Beaumont
30fd138ae9 use bufferEqual instead of buffertools
native modules are annoying
2015-10-13 17:11:51 +02:00
Romain Beaumont
3f50a6f19a add an optional argument to the proxy example to specify the version 2015-09-30 00:17:44 +02:00
Romain Beaumont
7871ac446a fix proxy relatively to the unexposing of createPacketBuffer
also fix a small bug in serializer.js
2015-09-30 00:03:42 +02:00
Robin Lambertz
a337e5ae3e Merge pull request #249 from rom1504/fix_client_chat
clean up and fix client_chat
2015-09-23 20:25:03 +02:00
Robin Lambertz
84b32fd4d3 Merge pull request #250 from rom1504/fix_server
fix server example
2015-09-23 19:43:30 +02:00
Robin Lambertz
c2749505e8 Merge pull request #251 from rom1504/fix_client_echo
fix client_echo example
2015-09-23 19:43:19 +02:00
roblabla
cf1503f9de Fix proxy.js 2015-09-23 15:22:02 +02:00