Commit graph

171 commits

Author SHA1 Message Date
Grooble
5bebac3662
1.21 Support (#1342)
* Update default version

* Update README

* 1.21.1

* Update version.js

* Update ci.yml

* Update version.js

* add values for vec2f and ChatTypes

* fix lint

* fix server tests

* fix lint

* update mcdata

* remove debug install

---------

Co-authored-by: Romain Beaumont <romain.rom1@gmail.com>
2024-10-26 23:52:46 +02:00
extremeheat
9b029e8b6f
1.20.5 (#1309)
* 1.20.5

* update examples

* Update for 1.20.5 chat_command_signed with seperateSignedChatCommandPacket feature

* updates

* update java

* re-enable packet tests

* Update client.js

add debug code after decompress

* Update client.js

* Update ci.yml

* Add `arrayWithLengthOffset` type to interpeter

* Update minecraft.js

* Update compiler-minecraft.js

* Update minecraft.js

* lint

* remote custom ci install

* Update package.json

* Update packetTest.js add Slot, SlotComponent

* Update packetTest.js

* Update packetTest.js

* Fix lint.

* Fix declare_recipes, Slot

* Update package.json

---------

Co-authored-by: Romain Beaumont <romain.rom1@gmail.com>
2024-10-12 23:55:36 +02:00
extremeheat
7057ad979b
Fix realms loading issue due to createClient plugin init order (#1303)
* Fix realms loading issue due to createClient plugin init order

* remove exception on bad parse of disconnect

* Update index.d.ts

* Improve serverTest check logic

try and debug flaky tests
2024-07-13 23:03:33 +02:00
William Gaylord
1d9a38253a
1.20.3 / 1.20.4 support (#1275)
* Inital 1.20.3 update, bring in minecraft-data with 1.20.3 support and add it to the versions

* Add data for packetTest for explosion packet.

* Add 1.20.4 to version list.

* Add fix for 1.20.3+ NBT isntead of strings for chat. Not happy with this but it does work.

* Fix linting

* Update version.js

Remove 1.20.3 since its the same as 1.20.4. (As suggested)

* Comment how handleNBTStrings works.

* Removed debug console.log

* Update README.md

* chat packet nbt handling fix, use feature

* big endian UUID, add back `text` wrapper

* use prismarine-chat in client test

* expose _handleNbtComponent

* use prismarine-chat exposed processNbtMessage

* fix pre-1.20.4

* Update package.json

* Update server.js

* Update server.js

add missing import

* update server hello world

---------

Co-authored-by: Romain Beaumont <romain.rom1@gmail.com>
Co-authored-by: extremeheat <extreme@protonmail.ch>
2024-02-26 01:14:49 +01:00
Romain Beaumont
80d038bd61
Add test to make sure version that are tested are mentioned in the RE… (#1276)
* Add test to make sure version that are tested are mentioned in the README

* fix lint
2023-12-30 23:42:17 +01:00
Romain Beaumont
614be919d0
Print if there is a diff in packets in the cycle packet test (#1273) 2023-12-29 23:11:31 +01:00
extremeheat
112926da0c
Pc1.20.2 (#1265)
* Initial changes for 1.20.2

* add NBT serialize tag type handling

* update tests

* Update pnbt and mcdata for nbt change

* lint

* fix wrong param to sizeOfNbt

* fix dupe NBT types

* move nbt logic to prismarine-nbt

* update tests

* update tests

* disable protodef validator in pluginChannel

* Fix state desync

* dump loginPacket.json in test output

* enable validation

* remove testing line in ci.yml

* update pnbt to 2.5.0

* update doc for `playerJoin`

* Update serializer.js

* update examples

* lint

* disable client bundle handling if bundle becomes too big

* Update client.js

* bump mcdata

* add soundSource and packedChunkPos example test values

---------

Co-authored-by: Romain Beaumont <romain.rom1@gmail.com>
2023-12-28 00:48:10 +01:00
Romain Beaumont
1740124c47
Improve CI setup for per version tests (#1267)
* Improve CI setup: move lint out of per version

* fix

* Simplify go back to all per version.

* refactor cycle test to use supported versions

* fix cycle packet test

* Add v to version to avoid 1.19 running every 1.19 minor.

* Add quotes.

* Use versions from js file in ci.yml

* Fix ci.yml syntax.

* Fix matrix read.

* fix

* fix

* fix gitignore
2023-12-28 00:12:23 +01:00
extremeheat
38e7914cc5
Fix test for entityMetadata on 1.19.4 (#1231)
* Fix test for entityMetadata on 1.19.4
A field type was changed from int to a  named enum

* oops

* fix timing
2023-06-23 22:01:35 +02:00
extremeheat
2718bc64c0
1.19.4 (#1226)
* Rename 'session' (packet) to chat_session_update to fix auth event conflict

* impl packet "bundle" grouping, add client.writeBundle(packets)

* fix handling, test

* test 1.19.4

* 1.19.4 test ci

* test ci against mcdata fork

* lint

* fix delim

* fix 1.19.3 being skipped

* Update ci.yml

* Update package.json

---------

Co-authored-by: Romain Beaumont <romain.rom1@gmail.com>
2023-06-03 21:54:31 +02:00
Frej Alexander Nielsen
cf1f67117d
Update to 1.19.3 (#1069)
* Add 1.19.3 player_info parsing

* player_remove packet parsing

* 1.19.3 chat parsing

* Outgoing chat for 1.19.3

* Fix lint

* Server chat validation

* add 1.19.2 and 1.19.3 in version.js

* Add 1.19.2 and 1.19.3 in ci.yml

* Deprecated client.verifyMessage for server clients

* Update docs

* Deprecate client.verifyMessage for server clients

* Fix tests

* Fix lint

* Fix packetTest

* Fix test

* Remove unneeded log statement

* Update types/docs

* Remove unnecessary feature check

* Remove _session from docs

Co-authored-by: Romain Beaumont <romain.rom1@gmail.com>
2023-01-21 20:31:17 +01:00
extremeheat
367c01567c
Initial 1.19.1/2 signed chat support (#1050)
* Initial 1.19.1/2 signed chat impl

* lint

* remove node 15 nullish operators

* fix undefined uuid error

* handle player left

* fix

* add some feature flags

* fix

* Fix test to use new client.chat() wrapper method

* refactoring

* corrections, working client example

* refactoring

* message expiry checking

* Fix UUID write serialization

* Remove padding from client login to match vanilla client

* Fix server verification

* update packet field terminology

* Add some tech docs
Rename `map` field in Pending to not conflict with Array.map method

* update tech doc

* lint

* Bump mcdata and pauth

* add doc on playerChat event, .chat function

* update doc

* use supportFeature, update doc

Co-authored-by: Romain Beaumont <romain.rom1@gmail.com>
2023-01-14 20:33:04 +01:00
extremeheat
d7c5053a13
1.19.0 support (#1027)
* Bump mcdata for 1.19

* 1.19 in version.js

* 1.19.0 in ci yml

* Update ci.yml

* Update version.js

* Update package.json

* No fail fast

* Update mcdata

* Update package.json

* Update ci.yml

* [1.19] fix tests and library session code (#1020)

* make tests work, add todo's

* clean up, varlong test, additional todo

* removed log statements, fix for older versions

* Update mcdata

* Update ci.yml

* Update ci.yml

* remove excessive version comments near supportFeature checks

Co-authored-by: Romain Beaumont <romain.rom1@gmail.com>

* chat signing implementation

* Update ci.yml

* move some boilerplate to pauth

* update tests

* update chat example

* bump pauth, update doc

* modify test nextMessage func

* lint

* update default version

* add server player verifyMessage

* update doc

Co-authored-by: Romain Beaumont <romain.rom1@gmail.com>
Co-authored-by: Rob9315 <dev.robk@gmail.com>
2022-08-16 00:57:26 +02:00
Jordan Jones
e079e9b0f6
Use offline mode as default authentication, fallback to offline mode if invalid option. (#998)
* Default n-m-p to use offline unless specified.

* Remove expression

* actually make offline default

* Revert examples

* Revert all example changes

* Add deprecation warning that mojang servers are no longer accepting mojang auth tokens.
2022-07-29 18:03:20 +02:00
Rob9315
92fd00d40d
add type values to packetTest (#1023)
* add varlong value to packetTest

* add command_node type value in packetTest
2022-07-21 22:56:34 +02:00
IceTank
a9cc6cee85
Add motdMsg to createServer (#996)
* Add motd as MessageBuilder object

* Fix chatMessageMotd type

* Fix test (?)

* Update API.md

* Remove MessageBuilder dependency and type

* Minor code refactor

* Update docs/API.md

Co-authored-by: u9g <git@u9g.dev>

* chatMessageMotd => motdMsg

Co-authored-by: u9g <git@u9g.dev>
2022-05-13 18:49:08 -04:00
Romain Beaumont
d4bc14a583
fix mc 1.18 (#934)
* use java 17 for mc 1.18

* increase timeout because 1.18 server is slow to boot

* add chunkBlockEntity value in packet test
2021-12-12 19:07:50 +01:00
Rob9315
78f038cae6
Add beforeLogin function option on server (#871)
* Add `beforeLogin` event on server

* optional function passin instead of emitted event

* Add documentation and bump version

* undo release push

* add test for `beforeLogin`
2021-07-06 12:42:00 +02:00
Jordan Jones
4d5dbb118e
automatic port "discovery" for packets and server tests (#870)
* automatic port "discovery" for packets and server tests

* Semi-colon begone!

* move getport to commons file - u9g

* Merge code
2021-06-28 22:58:21 -04:00
u9g
75e5316e8b
make port discovery automatic & update java ver for 1.17 (#869)
* make port discovery automatic

* try to use promise instead of promisify

* update java version

* add faster timeout

* increase timeout duration for server startup

* Update ci.yml

* update ram

* update java again

* Update clientTest.js

* actually skip online

* Update clientTest.js

* comment out

* fix comment

* properly await server data deletion

* fix serverTest for 1.17 with backwards compat

* add back dimension to login packet

* remove comment

* remove duplicated dimension in server test

Co-authored-by: Romain Beaumont <romain.rom1@gmail.com>
2021-06-29 00:27:37 +02:00
u9g
3813d4de7d
Make ci clearer as to what version is being tested (#861)
* Make ci clearer as to what version is being tested

* Update ci.yml

* fix

* fix
2021-06-13 04:54:16 +02:00
Grooble
1796b9693d
Add a way to encode a packet only once and send it to multiple clients (#851)
* Added Server#.writeToClients()

* Documented server.writeToClients()

* Added test for Server#writeToClients()

* Bad arguments for Promise.all()

* Fixed tests

* Fixed tests

* Fixed tests

* Updated tests

* Reverted timeout to the normal
2021-05-02 01:12:37 +02:00
u9g
d3c16e48fb
Add packet cycletests (#842)
* Add packet cycletests

* add mcPackets to deps

* Update and rename cycleTest.js to non-par-test.js

* Add exclude to npm run test for non par tests

* Add seperate job for non-par-tests

* fix indentation

* make tests non-parallel

* fix yml

* fix exclude pattern

* fix test matching

* Fix protocol not being updated for different mc versions

* dynamically get packets to test

* get rid of unused var

* rename non-par-test
2021-04-07 16:13:57 +02:00
David Duarte
5873c1a29f
Only use fullReason for the disconnect packet (#776)
And keep endReason for the client end reason, to avoid having
big JSON string that are more difficult to read
2020-12-05 16:52:36 +01:00
Romain Beaumont
99edabb716 update standard to version 15 2020-10-24 13:44:33 +00:00
Grooble
306b16abcd
1.16.2 and 1.16.3 support (#765)
* Update node-minecraft-data to 2.69.0

* Change default version to 1.16.3

* Update example

* Fix tests

* remove context change for bitfield

* Update README example

* Update tests

* Update examples

* Fix tests

* Update versionChecking for 1.16.3

* Update tests
2020-10-06 22:46:53 +02:00
Romain Beaumont
b7c5a45557
fix tests 2020-06-23 17:02:31 +02:00
Romain Beaumont
2da46e1f35
fix clientbound usage of chat and login for 1.16 2020-06-23 16:52:18 +02:00
Romain Beaumont
a7a7b5c7e2
Add 1.16-rc1 support
add topBitSetTerminatedArray native type
2020-06-23 03:28:14 +02:00
Karang
446bf2e923 Add protodef compiler 2020-05-16 16:57:04 +02:00
Romain Beaumont
33178bb94d
add new fields in login packet usage for 1.15.1 2019-12-29 23:27:04 +01:00
Romain Beaumont
4604330586
handle count with number properly in packet test 2019-12-29 23:17:38 +01:00
Romain Beaumont
83a77be10b fix for latest standard 2019-08-20 22:14:37 +00:00
Romain Beaumont
8e5264dc52 fix lint for new standard version 2019-08-03 23:29:14 +00:00
Romain Beaumont
b5b500adf8
1.14 support (#628) 2019-05-20 01:46:02 +02:00
Romain Beaumont
822d9e12dd
fix slot value in packet tests and update some deps 2018-10-16 22:23:16 +02:00
Romain Beaumont
0bd2e559bd
run standard 1.12 --fix 2018-09-24 22:08:11 +02:00
Romain Beaumont
761fe16f86
Improve test reliability and speed and move to circle ci 2
* increase vanilla server ram in tests
* add more logs
* handle client error properly
* don't wait for chat to be sent back from the server to wait 10s in clientTest
2018-08-26 04:54:17 +02:00
Romain Beaumont
465a98b989
end the client in all cases in clientTest.js
fix #535
2018-08-26 02:23:39 +02:00
Romain Beaumont
34f7611d45
1.13 support 2018-08-11 00:04:21 +02:00
Romain Beaumont
9778bb920b
add test value for type u64 2018-05-14 01:00:32 +02:00
Romain Beaumont
db1cbd4941
small style fixes following standard migration 2018-05-14 00:20:21 +02:00
Romain Beaumont
e3e0a26dfe
change codestyle to standard + enforce it with circle ci 2018-05-13 22:50:16 +02:00
Romain Beaumont
ad0c76dd72
remove console.log 2018-01-01 22:48:13 +01:00
Romain Beaumont
482a4ecffd
17w50a support 2018-01-01 21:01:23 +01:00
allain
137320489c using os.tmpdir() instead of '/tmp' since it's more portable 2017-08-28 10:13:59 -04:00
allain
b44e052f28 store minecraft jars in /tmp unless overriden by ENV variable 2017-08-27 21:55:42 -04:00
Romain Beaumont
5942d42d8b
increase server test timeout a bit 2017-07-21 22:48:18 +02:00
Romain Beaumont
79f82afb91
var -> const/let in examples and tests 2017-07-13 14:03:52 +02:00
Romain Beaumont
1a4d9f1e84
fix version checking bug with 1.12 and share vanilla server instance between tests 2017-06-19 15:28:24 +02:00