1
0
Fork 0
Commit Graph

38 Commits

Author SHA1 Message Date
Tiger Wang a999c5d845 More cProtocol cleanup
* Alpha sort functions
* Simplify hand handling
* Fix left handed mode client-side display
2021-04-12 22:35:07 +01:00
Tiger Wang 66c211c33a Unify multiprotocol entity animations 2021-04-12 22:35:07 +01:00
Tiger Wang 1394fc8eb5 Streamline player abilities handling
* Update player list gamemode on world change
* Fix invisibility for spectators, use entity metadata
* Populate m_World for cPlayers on load
- Remove SendPlayerMaxSpeed, a duplicate of SendEntityProperties
2021-04-12 22:35:07 +01:00
Tiger Wang e3fe9e5e93 Deduplicate WriteBlockEntity 2021-03-17 23:44:59 +00:00
12xx12 8405b8969f
Adding Boss bar (#5025)
+ Add boss bar

Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2021-03-05 15:08:30 +00:00
Tiger Wang eeb63b8901
zlib -> libdeflate (#5085)
+ Use libdeflate
+ Use std::byte
* Fix passing temporary to string_view
+ Emulate make_unique_for_overwrite
2021-01-11 16:39:43 +00:00
12xx12 e35519ec8a
Adding new monster types to enum and saving/loading for easier future implementation (#4941)
* added new monster types to enum
added string <-> enum conversion in namespace serializer
added loading functions
added to saving

* renamed zombie pigman to zombified piglins in enum

Co-authored-by: 12xx12 <12xx12100@gmail.com>
Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2020-11-22 23:41:13 +00:00
Tiger Wang 608e7a9950 Remove unused ServerPort argument 2020-09-18 16:41:06 +01:00
Tiger Wang 7f372b12cb Add State enum to protocol 2020-09-18 16:41:06 +01:00
Tiger Wang acc399ffb3 Cleanup Protocol classes
* Visibility, static, ordering changes
2020-09-18 16:41:06 +01:00
Tiger Wang 07ffd9f6f3 Unused/duplicate function cleanup
* FaceIntToBlockFace in 1.8/1.9 protocol merged
- Removed undefined permissions stuff in Player header
2020-08-29 16:47:40 +01:00
Tiger Wang 07f3f7ec30 Remove some unused inclusions 2020-07-20 09:28:02 +01:00
Tiger Wang 5dd51e87e5 Inherit constructors, remove duplication 2020-07-19 20:49:29 +01:00
Tiger Wang 00f8c3a225 Implement "caching" in ChunkDataSerializer
+ When sending a chunk to multiple clients, group them by protocol version and send the same data
2020-07-19 16:29:49 +01:00
Tiger Wang 5141d05ba6 Delete duplicated status request handlers
Here we go again...
2020-07-18 19:23:10 +01:00
Tiger Wang ff2c246de2
cProtocolRecognizer goes on a diet (#4770)
- Removed inheritance from cProtocol
2020-07-17 18:46:50 +01:00
Tiger Wang 07ca095740
Improve entity position updates (#4701)
* Make puking pickups fly nicer

* Improve entity position updates

* Move determination of whether a delta is too big for a packet into the protocol handlers
+ Less jittery movement
+ Generalise CollectEntity to take any entity
2020-05-04 08:10:47 +00:00
Tiger Wang 0b9b7bc1a8 Unify entity spawn packet sending 2020-04-30 23:04:56 +01:00
Tiger Wang afd377a941 Unify 1.8 and 1.9
- Deleted ridiculous amount of duplicated code
2020-04-22 17:26:31 +01:00
Tiger Wang 246acb19f9 Delet SpawnObject params
* Fix #4679

awkward...
2020-04-19 23:29:52 +01:00
Mattes D 9ee47e5999 Using Super. 2020-04-16 20:07:48 +00:00
Mat 6a21bf979c
Initial resource pack support (#4622) 2020-04-07 21:23:54 +00:00
Mat 31ace87d28
Add protocol mob ID remapping (#4538) 2020-03-29 17:54:37 +02:00
Mattes D c7132a3091 Protocol 1.9: Alpha-sort, add useful debugging code. 2019-09-16 15:37:54 +02:00
Tiger Wang 77731f80fb Initial support for 1.13 clients
+ Can look at *shape* of world
+ Can look at *shape* of inventory
2019-09-16 15:37:54 +02:00
Mattes D 2c804dd34a Protocol: Use logical outgoing packet types. 2019-09-10 09:45:28 +02:00
peterbell10 ee84197014
Force all headers other than "Globals.h" to be included with relative paths (#4269)
Closes #4236

CMake now creates a header file in the build directory under the path "include/Globals.h" which just includes "src/Globals.h" with an absolute path. Then instead of adding "src/" to the include directories, it adds "include/".

#include "Globals.h" still works by including the build generated file and any other src-relative path will not work.
2018-08-29 01:51:25 +01:00
Alexander Harkness c4f43cd8ec
Store and pass entity effect duration as an int not a short. (#4293)
Fixes #4292.
2018-08-26 15:52:39 +01:00
changyong guo 3e802932a6 recover hotbar selected slot after reconnect (#4249)
1. implement protocol message SendHeldItemChange
2. add save / load inventory equipped item slot in JSON
3. send held item slot message after player connect to server

Fixes #4189
2018-07-22 23:23:33 +01:00
9caihezi 4242431407 Rewrite cClientHandle::HandleRightClick (#4089)
* Add hand parameter to distinguish main hand/off hand.
* Add a new function cClientHandle::HandleUseItem to separate the functionality of using an item without a target block. This matches the protocol with client version >= 1.9
* Always actively update the status of a block if the placement fails (by out of reach or rejected by plugin).
* Do not call plugin callback CallHookPlayerRightClick(-1, 255, -1, -1, 0, 0, 0) when using item.
   The CallHookPlayerUsingItem will still be called.
   Now at most one of CallHookPlayerRightClick, CallHookPlayerUsingBlock,
   CallHookPlayerUsingItem and CallHookPlayerEating will be called based on
   the type of action (not including the used version of callbacks).
* Do not count using item as BlockInteractionsRate check (Using item takes time).
* Now we can open chests(etc.) when sneaking as long as the player's hand is empty.
   This is what vanilla server does.
2018-01-08 13:37:10 +00:00
Lane Kolbly 028a35ef0d Added assert to cProtocolRecognizer::GetPacketId. (#4001) 2017-09-04 16:58:38 +01:00
Lane Kolbly aebfbfb8c8 GetPacketID for protocol packet IDs (#3977)
* Added GetPacketId method to protocol, implemented for all protocols.

* Moved GetPacketID methods into a single file, alpha-sorted.

* Fixed 1.12.1 HandlePacket switch statement.

* Added SendLogin to the GetPacketId framework.

* Added SpawnObject to GetPacketId framework.

* Added missing sendEntityEquipment packet ID update for 1.12.1

* Added LeashEntity packet ID change to 1.12.1

* Alphabetized packet enum, added SpawnGlobalEntity to GetPacketId framework

* Fixed clang errors

* Indented cases, expanded comment for GetPacketId

* Changed dyslexic comment.
2017-09-02 17:46:57 +01:00
peterbell10 84941bcc9f Update mbedtls to 2.5.1 (#3964)
* Renaming changes:
  * macro prefix "POLARSSL" -> "MBEDTLS"
  * functions now prefixed with "mbedtls_"
  * rename PolarSSL++ -> mbedTLS++
  * rename polarssl submodule

* Use mbedtls' AES-CFB8 implementation.

* Add cSslConfig to wrap mbedtls_ssl_config

* Update cTCPLink and cBlockingSslClientSocket to use cSslConfig

* Use cSslConfig in cHTTPServer

* Use cSslConfig for cMojangAPI::SecureRequest

* CI Fixes

* Set -fomit-frame-pointer on the right target
2017-08-30 15:00:06 +01:00
Pablo Beltrán b18f6637b6 Fully implemented leashes (#3798) 2017-08-21 10:46:41 +02:00
Lukas Pioch 0397535fa7 Removed unused forward declarations (#3888) 2017-08-03 15:10:29 +02:00
Lane Kolbly dc49092ae5 Handle Teleport Confirmation Packet (#3884)
+ Added code to drop incoming client position packets until the most recent teleport was confirmed.
2017-08-02 15:46:29 +01:00
Lukas Pioch 4e0ae63ec2 Added WriteBlockEntity to 1.10 and 1.11 and fixed mob spawner 2017-06-09 12:16:44 +02:00
Mattes D 0e3b3be766 Initial support for the 1.11 protocol. 2016-12-16 00:07:22 +01:00