1
0
Commit Graph

395 Commits

Author SHA1 Message Date
Pokechu22
a4f327118b 1.9 / 1.9.2 / 1.9.3 / 1.9.4 protocol support (#3135)
* Semistable update to 15w31a

I'm going through snapshots in a sequential order since it should make things easier, and since protocol version history is written.

* Update to 15w34b protocol

Also, fix an issue with the Entity Equipment packet from the past version.  Clients are able to connect and do stuff!

* Partially update to 15w35e

Chunk data doesn't work, but the client joins.  I'm waiting to do chunk data because chunk data has an incomplete format until 15w36d.

* Add '/blk' debug command

This command lets one see what block they are looking at, and makes figuring out what's supposed to be where in a highly broken chunk possible.

* Fix CRLF normalization in CheckBasicStyle.lua

Normally, this doesn't cause an issue, but when running from cygwin, it detects the CR as whitespace and creates thousands of violations for every single line.  Lua, when run on windows, will normalize automatically, but when run via cygwin, it won't.

The bug was simply that gsub was returning a replaced version, but not changing the parameter, so the replaced version was ignored.

* Update to 15w40b

This includes chunk serialization.  Fully functional chunk serialization for 1.9.

I'm not completely happy with the chunk serialization as-is (correct use of palettes would be great), but cuberite also doesn't skip sending empty chunks so this performance optimization should probably come later.  The creation of a full buffer is suboptimal, but it's the easiest way to implement this code.

* Write long-by-long rather than creating a buffer

This is a bit faster and should be equivalent.  However, the code still doesn't look too good.

* Update to 15w41a protocol

This includes the new set passengers packet, which works off of the ridden entity, not the rider.  That means, among other things, that information about the previously ridden vehicle is needed when detaching.  So a new method with that info was added.

* Update to 15w45a

* 15w51b protocol

* Update to 1.9.0 protocol

Closes #3067.  There are still a few things that need to be worked out (picking up items, effects, particles, and most importantly inventory), but in general this should work.  I'll make a few more changes tomorrow to get the rest of the protocol set up, along with 1.9.1/1.9.2 (which did make a few changes).  Chunks, however, _are_ working, along with most other parts of the game (placing/breaking blocks).

* Fix item pickup packet not working

That was a silly mistake, but at least it was an easy one.

* 1.9.2 protocol support

* Fix version info found in server list ping

Thus, the client reports that it can connect rather than saying that the server is out of date.  This required creating separate classes for 1.9.1 and 1.9.2, unfortunately.

* Fix build errors generated by clang

These didn't happen in MSVC.

* Add protocol19x.cpp and protocol19x.h to CMakeLists

* Ignore warnings in protocol19x that are ignored in protocol18x

* Document BLOCK_FACE and DIG_STATUS constants

* Fix BLOCK_FACE links and add separate section for DIG_STATUS

* Fix bat animation and object spawning

The causes of both of these are explained in #3135, but the gist is that both were typos.

* Implement Use Item packet

This means that buckets, bows, fishing rods, and several other similar items now work when not looking at a block.

* Handle DIG_STATUS_SWAP_ITEM_IN_HAND

* Add support for spawn eggs and potions

The items are transformed from the 1.9 version to the 1.8 version when reading and transformed back when sending.

* Remove spammy potion debug logging

* Fix wolf collar color metadata

The wrong type was being used, causing several clientside issues (including the screen going black).

* Fix 1.9 chunk sending in the nether

The nether and the end don't send skylight.

* Fix clang build errors

* Fix water bottles becoming mundane potions

This happened because the can become splash potion bit got set incorrectly.  Water bottles and mundane potions are only differentiated by the fact that water bottles have a metadata of 0, so setting that bit made it a mundane potion.

Also add missing break statements to the read item NBT switch, which would otherwise break items with custom names and also cause incorrect "Unimplemented NBT data when parsing!" logging.

* Copy Protocol18x as Protocol19x

Aditionally, method and class names have been swapped to clean up other diffs.  This commit is only added to make the following diffs more readable; it doesn't make any other changes (beyond class names).

* Make thrown potions use the correct appearence

This was caused by potions now using metadata.

* Add missing api doc for cSplashPotionEntity::GetItem

* Fix compile error in SplashPotionEntity.cpp

* Fix fix of cSplashPotionEntity API doc

* Temporarilly disable fall damage particles

These were causing issues in 1.9 due to the changed effect ID.

* Properly send a kick packet when connecting with an invalid version

This means that the client no longer waits on the server screen with no indication whatsoever.  However, right now the server list ping isn't implemented for unknown versions, so it'll only load "Old" on the ping.

I also added a GetVarIntSize method to cByteBuffer.  This helps clean up part of the code here (and I think it could clean up other parts), but it may make sense for it to be moved elsewhere (or declared in a different way).

* Handle server list pings from unrecognized versions

This isn't the cleanest way of writing it (it feels odd to use ProtocolRecognizer to send packets, and the addition of m_InPingForUnrecognizedVersion feels like the wrong technique), but it works and I can't think of a better way (apart from creating a full separate protocol class to handle only the ping... which would be worse).

* Use cPacketizer for the disconnect packet

This also should fix clang build errors.

* Add 1.9.3 / 1.9.4 support

* Fix incorrect indentation in APIDesc
2016-05-14 20:12:42 +01:00
LogicParrot
00e7b65d87 Fixed some logout crashes 2016-04-24 19:09:44 +03:00
LogicParrot
3283a9613c ClientHandle destruction thread safety 2016-04-23 10:22:48 +03:00
LogicParrot
9b60ee6e43 Auto clean bad world linkages 2016-04-19 12:06:52 +03:00
LogicParrot
bb0e885589 Minor improvements to player freeze 2016-04-05 21:47:49 +03:00
LogicParrot
a431b45641 Improved player freeze code 2016-04-05 14:20:50 +03:00
LogicParrot
dd0ce3287f Players never fall through unloaded chunks or end up inside solids on teleport 2016-03-31 21:35:43 +03:00
LogicParrot
83459d0d89 Proper entity destruction in non-ticking chunks 2016-02-19 07:05:22 +02:00
Lukas Pioch
dc4ea39755 Don't remove water after ice block has been destroyed 2016-02-18 08:16:34 +01:00
LogicParrot
6e269de274 Prevent player from falling when block breaking is denied 2016-02-08 14:10:51 +02:00
Mathias
89f3dec7ac Updated old forum links 2016-01-31 02:25:03 +02:00
LogicParrot
439b3304f4 Improved tamed wolf pack cooperation and projectile reactions 2016-01-22 21:16:27 +02:00
LogicParrot
8c12227687 Fix crash when tamed wolf is hit by arrows 2016-01-16 16:37:37 +02:00
bibo38
41aa7cf123 Limited the username length to 16 characters.
This fixes a client crash, because Minecraft requires that a username is not longer than 16 characters.
See also: http://minecraft.gamepedia.com/The_Player#Name
Fixes #2545
2016-01-13 09:55:48 +01:00
LogicParrot
359e772dee Tamed wolf assists owner (attack / defence) 2016-01-12 11:47:59 +02:00
Tiger Wang
5b62c4c314 Reorganised the redstone simulator
-> Many thanks to @worktycho for the idea, and @Haxi52 for the implementation plan!
* Uses classes and inheritance now
* Speed should be improved
2015-12-18 13:17:38 +00:00
Gargaj
f9008a4860 allow use failures to propagate from the entity/block to the player 2015-12-13 13:27:38 +01:00
Dave Tucker
83870f9fc0 Add enum for Sound and Particle Effects
Fixes #2603

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2015-11-24 13:21:40 +00:00
Tiger Wang
9de3a3f938 Examined a fix for #2588 2015-11-02 22:07:48 +00:00
Mattes D
da92286da9 Fixed a crash when sending messages too early after connection. 2015-10-21 20:59:48 +02:00
tycho
d8c860ae58 Improved the data structure for storing loaded chunks
Should significantly increase the performance of deciding which chunks to stream
2015-10-05 16:20:07 +01:00
Lukas Pioch
e56aa4032d Maked it compileable for clang-3.7 2015-09-25 17:09:19 +02:00
tycho
fd7b87741a Refactored cProtocol Chat handling 2015-09-21 12:32:56 +01:00
Tiger Wang
de2cce9b79 Fixed food drain bugs 2015-08-20 16:26:42 +01:00
Matti Hänninen
b20294604c Fix old style casts and implicit conversions 2015-08-12 16:51:38 +03:00
Samuel Barney
804805d35a Silenced and fixed many warning messages across multiple files. 2015-07-29 09:49:30 -06:00
Tiger Wang
8656e149c8 Improved maps 2015-07-14 21:46:30 +01:00
Mattes D
bebd4de144 Fixed warnings generated by 64-bit MSVC. 2015-07-07 11:50:06 +02:00
Tiger Wang
dd4b415051 Reinstate "Chunk queue collapsing"
This reinstates commit f36acb6835
     and reverts commit adfbc42c02.
2015-06-10 15:16:05 +01:00
worktycho
adfbc42c02 Revert "Chunk queue collapsing" 2015-06-07 20:45:47 +01:00
tycho
9ebbe969c8 Made the list of chunks to stream an unordered_set
This should increase performance of chunk streaming
2015-06-05 22:31:22 +01:00
jan64
d37e0eb72b Added system and above action bar chat messages 2015-06-02 19:59:46 +02:00
Tiger Wang
291370e367 Fix Destroy() calling behaviour
* Fixes Core/#142
2015-05-30 00:23:34 +01:00
b33duck
022348645e Fix for the way connecting clients receive player lists and broadcast chat 2015-05-28 19:43:16 -07:00
Tiger Wang
20b7152572 Potential crash fixes
* Potentially addresses my comment in #1969
* Probably fixes #2145
2015-05-28 13:03:28 +01:00
tycho
31b95afd79 Fixed ClientHandle not getting properly removed from the world
when socket is closed whilst the client is being added to the world
Fixes #1969
2015-05-26 10:34:14 +01:00
Mattes D
c3c30a78e1 Merge pull request #1848 from scottwillmoore/ImplementTitleCommand
Implement backend for /title command
2015-05-26 08:46:16 +02:00
Mattes D
2cdc2a16e4 Fixed chat message manipulation by plugins.
Plugins, in their OnChat hook, can change the chat message sent by a player.
2015-05-13 18:45:29 +02:00
Mattes D
c13b1931ff More style checking.
Spaces around some operators are checked.
2015-05-09 12:58:54 +02:00
tycho
448df85e56 Added support for additional data in the ParticleEffect Packet
Also started refactoring how broadcasts are handled
2015-05-07 03:47:46 +01:00
Mattes D
fd497b8269 ClientHandle: Fixed re-sending refused right-clicks.
The coords weren't checked against Y boundary and -1 coords weren't sent.
This fixes mc-server/Gallery#45.
2015-04-19 17:33:58 +02:00
Mattes D
de8e5ea8e4 Placing a fluid from bucket calls plugin hooks.
Ref.: #1857.
2015-04-14 10:49:01 +02:00
Scott Moore
8c144207dc Implement backend for /title command 2015-04-13 16:22:51 +10:00
Mattes D
e5a7a730ed Merge pull request #1826 from mc-server/UnifyPacketizer
Unify packetizer
2015-03-24 13:09:41 +01:00
Mattes D
c3c29577a5 Fixed signedness warnings in Protocol. 2015-03-21 16:11:57 +01:00
Mattes D
3923e3e37a Fixed signedness issues in protocols. 2015-03-21 15:40:56 +01:00
Mattes D
b1d4b3bb96 Unified cByteBuffer types.
cByteBuffer now reads and writes any of the [U]Int<N> types.
2015-03-21 13:00:20 +01:00
Tommy Santerre
3f6d823aa4 Correct world height validations.
Unify the way we test block above the current one (Height - 1 instead of a_RelY + 1).
Allow generation of world of flat height = 255
2015-03-19 20:32:17 -04:00
Mattes D
65d2ef32e9 Merge pull request #1734 from mc-server/pistons
Handle client 'leave bed' request
2015-03-14 22:44:04 +01:00
Howaner
a96c21fc0d Merge branch 'master' into Inventory 2015-03-09 22:39:11 +01:00