1
0
Fork 0
Commit Graph

476 Commits

Author SHA1 Message Date
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
Mattes D d1dee3c909 Fixed RasPi builds of unit tests.
On RasPi with gcc 4.8.2, the asserts wouldn't compile when tests were enabled.
Enforced the assumption that ASSERT code is generated only in Debug builds.
2016-08-04 20:47:53 +02:00
Alexander Harkness a2a9341c24 Tab completion across worlds (#3270)
Fixes #2563.
2016-07-21 13:00:30 +02:00
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
Tiger Wang f3da0cf1ae Reverted non-functional changes 2015-03-05 21:21:39 +00:00
Mattes D b474b9fb5d Fixed race condition for TCP link deleting.
This could have caused crashes when a client disconnected from the server.
2015-02-22 19:06:04 +01:00
Tiger Wang 3869f76cc2 Handle client 'leave bed' request
* Fixes #1728
2015-02-08 21:21:48 +00:00
Howaner 2c7925f0ad Merge branch 'master' into Inventory 2015-02-06 21:52:14 +01:00
Mattes D 19d463ae1c Fixed a deadlock in cClientHandle network sending. 2015-01-27 14:53:38 +01:00
Mattes D 4eecf9363a Client: Only decode protocol when there's actual data incoming. 2015-01-27 14:53:36 +01:00
Mattes D edce2cbdcf Fixed enchant packet handling. 2015-01-27 14:53:34 +01:00
Mattes D 7dfeb67f01 Converted cServer to use the cNetwork API. 2015-01-27 14:53:31 +01:00
Howaner 1eedccc56a Merge branch 'master' into Inventory 2015-01-25 00:34:19 +01:00
Mattes D 5ac3a23586 Fixed warnings in 1.7 protocol. 2015-01-18 22:43:35 +01:00
Mattes D ccdf03daaf Refactored all player block placing to go through hooks.
Fixes #1618.
2014-12-24 07:20:17 +01:00
Howaner b6fd400276 Own classes for all windows. 2014-12-13 15:06:55 +01:00
Mattes D 33c6ff872e Cosmetic touchups.
Removed trailing whitespace, added cast to remove warning, added file seeking in case of corrupt files.
2014-12-11 14:34:09 +01:00
Mattes D 32bce44f1f Merge pull request #1623 from p-mcgowan/issue_1253
Prevent multiple logins with same username, unless allowed in settings
2014-12-10 11:17:11 +01:00
Vincent 9bba8e4c7d Changed method call to DoesAllowMultiLogin() instead of IsAllowMultiLogin()
Compiles correctly.
2014-12-10 00:45:24 -08:00
Vincent 3a2759fdc1 Fixed return value in CheckMultiLogin() 2014-12-09 14:23:44 -08:00
Vincent 4b08ca261b Fixed indent problems and added return definitions to CheckMultiLogin().
Changed from IsAllowMultiLogin() to DoesAllowMultiLogin().
Fixed CheckMultiLogin() to not run to the end without returning a value.
2014-12-09 03:06:25 -08:00
Vincent 12c012fa01 Changed CheckMultiLogin() to not have main body wrapped in an if statement.
Added in indent to cPlayerListCallBack in cCallback class inside CheckMultiLogin().
Added doxy-comment for DoWithPlayer().
Changed comments on IsPlayerInQueue() and IsAllowMultiLogin() to doxy-comments.
2014-12-08 14:33:59 -08:00
Vincent e28cc876c4 created callback in Root and changed CheckMultiLogin() to use the DoWithPlayer function at Root instead of World. 2014-12-08 00:57:46 -08:00