1
0
Fork 0
Commit Graph

447 Commits

Author SHA1 Message Date
peterbell10 950aeffff8
CheckBasicStyle: Check number of empty lines between functions (#4267)
Add check for number of empty lines between functions and fix the corresponding failures
2018-07-26 22:24:36 +01:00
changyong guo 7b0db672d1 Keep players in gmNotSet (#4248)
This allows players game mode to update to the default after portal to another world.
Fixes #4207
2018-07-23 00:35:32 +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
peterbell10 4fbf04413d
Make offline UUIDs consistent with vanilla. (#4178)
Fixes #4177

This is a breaking change to existing Cuberite permissions settings.
2018-07-20 00:30:09 +01:00
changyong guo 2d3013d1d3 Support swap item between main hand and offhand by press key "F" (#4241)
Hi,

I found cuberite don't support to press key "F" to swap items on main hand and offhand, so I implemented this feature.

Best regards
Changyong
2018-06-24 10:24:10 +01:00
peterbell10 a4dbb5c582
Prefer static_cast to reinterpret_cast (#4223)
* Change reinterpret_cast -> static_cast wherever possible
* Remove more unnecessary `const_cast`s.

reinterpret_casts should be avoided for the same reason as c-style casts - they don't do any type-checking. reinterpret_cast was mainly being used for down-casting in inheritance hierarchies but static_cast works just as well while also making sure that there is actually an inheritance relationship there.
2018-05-02 08:50:36 +01:00
mathiascode 02d75c5336 Removed unnecessary disconnect (#4200) 2018-04-27 08:59:03 +02:00
mathiascode f4a1ebd880 Properly destroy player (#4199) 2018-04-03 14:39:39 +01:00
mathiascode a879778968 Broadcast playerlist removal in every world (#4201) 2018-04-02 18:39:54 +01:00
peterbell10 95108c134d
cClientHandle: Always call HOOK_PLAYER_RIGHT_CLICK (#4149)
Reverts the reduction in cases where the hook was called, a change which broke plugins.
2018-01-25 08:10:16 +00: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
peterbell10 757231cc6e
Add the fmt library (#4065)
* Replaces AppendVPrintf with fmt::sprintf
* fmt::ArgList now used as a type safe alternative to varargs.
* Removed SIZE_T_FMT compatibility macros. fmt::sprintf is fully portable and supports %zu.
* Adds FLOG functions to log with fmt's native formatting style.
2018-01-03 17:41:16 +00:00
Bond-009 5badb9bcca cChunkInterface GetBlock, GetBlockMeta, GetBlockTypeMeta use vectors (#4050) 2017-11-20 11:13:11 +00:00
peterbell10 0bacda3269 Implement horse inventory (#4053)
* Implement horse inventory

* Fix sign conversions

* Add API doc for ItemCategory::IsHorseArmor

* Improve HandleOpenHorseInventory comment and style fixes.
2017-10-21 17:56:09 +01:00
Bond-009 10c5c1227e BroadcastBlockBreakAnimation and BroadcastBlockEntity use vectors (#4038) 2017-09-25 18:17:45 +02:00
Lane Kolbly 30c8470a52 Changed BroadcastSoundEffect, SendSoundEffect, and CastThunderbolt parameters to vectors (#3959)
* Made BroadcastSoundEffect take vector parameters.

* Added docs for new vectored methods

* Removed old code

* Fixed lua warnings

* Made old BroadcastSoundEffect not an override.

* m_Block to m_BlockPos, used Vector3d constructor where prettier.

* a_Block to a_BlockPos

* Changed thunderbolt a_Block to a_BlockPos
2017-09-19 15:12:54 +01:00
Lukas Pioch c5f590d460 Removed UTF-8 BOM (#4033) 2017-09-19 10:34:08 +02:00
peterbell10 e225b7f826 Replace ItemCallbacks with lambdas (#3993) 2017-09-11 23:20:49 +02:00
Alexander Harkness c334824199 Shutdown connection when disconnect packet sent (#3999) 2017-09-08 09:36:23 +02:00
LogicParrot 49c443896d Revert "Replace ItemCallbacks with lambdas (#3948)"
This reverts commit 496c337cdf.
2017-09-02 08:50:23 +01:00
Alexander Harkness 7f2c0ef0d6 OnLogin now kicks players properly (#3980) 2017-09-01 15:49:35 +02:00
peterbell10 496c337cdf Replace ItemCallbacks with lambdas (#3948) 2017-09-01 13:04:50 +02: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
satoshinm 6bc5031517 Implement Forge protocol handshake support (#3869) 2017-08-27 23:10:20 +02:00
peterbell10 f4f2fc7c3d Add cUUID class (#3871) 2017-08-25 13:43:18 +01:00
Pablo Beltrán b18f6637b6 Fully implemented leashes (#3798) 2017-08-21 10:46:41 +02:00
Tiger Wang 0e10464ac5 Merge pull request #3921 from lkolbly/removeAssert
- Removed incorrect assert in SendRespawn
2017-08-18 11:36:01 +01:00
Lane Kolbly 9cc48ac2a3 Removed incorrect assert in cClientHandle::SendRespawn. 2017-08-11 11:00:21 -05:00
Tiger Wang 4ef47aed62 Changed entity ownership model to use smart pointers 2017-08-07 19:24:16 +01:00
Lukas Pioch 4691bc5a29 Removed double includes (#3885) 2017-08-02 19:57:20 +01:00
peterbell10 0d0323608d cBlockHandler: take player by ref 2017-08-01 08:21:20 +02:00
peterbell10 8eb5672920 cWorld::SendBlockTo take player by ref 2017-08-01 08:21:20 +02:00
Tiger Wang eb4432bb62 Tentative fix for player-limit race condition (#3862)
* Attempts to fix #2257

Derived from d233e9843148313c71fbaba96ccff660e47b07b1

* Changed player count type to int

* Clarified certain actions
2017-07-28 17:54:40 +01:00
Mattes D f6bab71d05 Fixed memory leak in cClientHandle. (#3794) 2017-06-26 09:11:30 +02:00
Mattes D 9c08b4524c Fix assert when clicking blocks at the top of the world. 2017-06-09 13:44:06 +02:00
Heiko Hund a0341d561a Add rank prefix and suffix to player name in chat (#3730)
Fixes issue #1721
2017-05-27 02:15:56 +01:00
Pablo Beltrán 84bdba345d Off-hand/shield slot functional, save and load slot, bow + arrow functional (#3725)
Fixes #3714.
2017-05-24 08:09:58 +02:00
mathiascode 8cf48f7682 Allow enabling/disabling of block change limit 2017-05-19 19:51:03 +02:00
Mattes D 6b0c795655 Fixed ClientHandle:GetProtocolVersion returning wrong number. 2017-01-28 10:31:04 +01:00
Mattes D 0e3b3be766 Initial support for the 1.11 protocol. 2016-12-16 00:07:22 +01:00
Mattes D 2aecc7d701 Fixed race conditions in cClientHandle's State. 2016-11-19 23:24:01 +01:00
mohe2015 32b38fb264 Anticheat fastbreak (#3411)
Added block hardness checks when breaking blocks.
2016-11-06 19:30:19 +01:00
Lukas Pioch b088123d18 Added SendMessageRaw for sending json string. 2016-10-21 11:17:39 +02:00
bibo38 cb640ffea4 Spectators added (#2852) 2016-10-12 14:38:45 +02:00
Moritz Borcherding b268db4caa Use cChunkDef::Height for Y coord comparison where applicable. 2016-09-27 14:32:20 +02:00
Mattes D e169043a84 Fixed cCompositeChat's constructor LuaAPI bindings.
The tolua-generated constructor would return an extra string value.
2016-09-25 12:42:05 +02:00
LogicParrot 5625598afa Improve cPlayer::DoMoveToWorld (#3113) 2016-09-03 10:39:52 +03:00
LogicParrot c088f7ff0a Proper respawn packets on dimension travel 2016-08-29 11:16:06 +03:00
LogicParrot d5b3fbcadb Fixed SendUnloadChunk bug (#3353) 2016-08-28 12:42:34 +03:00
ElNounch 40b929c02e Fix breaking ice in survival not giving a water's source (#3356)
Fix #3355
2016-08-28 08:18:32 +03:00