1
0
Fork 0
Commit Graph

230 Commits

Author SHA1 Message Date
peterbell10 a56cfd1f42 Remove smart pointer macros 2017-07-21 14:41:51 +01:00
Mattes D f6bab71d05 Fixed memory leak in cClientHandle. (#3794) 2017-06-26 09:11:30 +02:00
Lukas Pioch e35ac1bfb9 Clang 5.0 fixes
- Added override keyword
- Removed inherited member variables
2017-05-21 12:19:06 +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
Tiger Wang 8c6d0b51c7 Use CMake's Android generators to crosscompile 2016-12-12 14:32:32 +00:00
Mattes D 2aecc7d701 Fixed race conditions in cClientHandle's State. 2016-11-19 23:24:01 +01:00
mohe2015 a990a6d133 Add Lua API export for titles. (#3408) 2016-11-13 16:04:18 +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
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
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 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 ca6ef58b1e Bulk clearing of whitespace 2016-02-05 23:50:18 +02:00
Lukas Pioch e1ba104359 Fixed race conditions 2016-01-17 20:11:37 +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
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
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
Mattes D 6e4122e551 Unified the doxy-comment format. 2015-07-31 16:49:10 +02: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
worktycho 106e06617a Merge pull request #2224 from cuberite/ChunkQueueCollapsing
Chunk queue collapsing: MK II
2015-07-04 14:43:00 +01:00
tycho 257011b440 use atomic for state, to avoid torn reads 2015-06-27 12:10:24 +01: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
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 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
Scott Moore 8c144207dc Implement backend for /title command 2015-04-13 16:22:51 +10: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
Mattes D 19d463ae1c Fixed a deadlock in cClientHandle network sending. 2015-01-27 14:53:38 +01:00
Mattes D 7dfeb67f01 Converted cServer to use the cNetwork API. 2015-01-27 14:53:31 +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
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 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 6de07d4a39 Fixed compile errors 2014-12-08 00:45:29 -08:00
Vincent d8d3b9aec5 Moved the check into a new function and just calls that function and a blank FindAndDoWithPlayer added. 2014-12-08 00:12:48 -08:00
Mattes D 3c3cb198f3 Fixed c++11 branch issues. 2014-12-07 15:46:27 +01:00
Tiger Wang 79e5b82354 Merge remote-tracking branch 'origin/master' into c++11
Conflicts:
	src/Noise/Noise.h
	src/World.h
2014-11-23 17:12:34 +00:00
Mattes D 9ece37e8f1 Merge pull request #1598 from mc-server/SignEditor
Fixed a security problem with signs.
2014-11-18 08:52:48 +01:00
Howaner 277151582f Use LastPlacedSign instead of LastPlacedBlock. 2014-11-15 22:36:31 +01:00
Howaner 09cea625fc Renamed m_UsedViewDistance to m_CurrentViewDistance 2014-11-15 22:26:54 +01:00
Howaner 927d8d7702 Renamed m_SetViewDistance to m_RequestedViewDistance 2014-11-15 15:33:42 +01:00
Howaner 78fb789631 Fixed a security problem with signs. 2014-11-15 15:16:52 +01:00
Howaner 8c3c11d6b3 Renamed GetSettedViewDistance() to GetRequestedViewDistance() 2014-11-15 14:27:50 +01:00
Howaner 83d3f3347b Use m_UsedViewDistance and m_SetViewDistance. 2014-11-14 22:53:12 +01:00
Mattes D 765bf006ad Merged branch 'master' into c++11. 2014-10-24 10:19:13 +02:00
Howaner 44514e53fc Merge branch 'master' into ChunkLoader
Conflicts:
	src/ClientHandle.cpp
2014-10-21 16:55:22 +02:00
Tiger Wang 2334c8dd9d Merge branch 'master' of https://github.com/mc-server/MCServer 2014-10-20 19:01:53 +01:00
Tiger Wang bde99d684e Migrated cSleep and cTimer to std::chrono 2014-10-20 18:59:40 +01:00
Mattes D cf73fee7e3 Fixed minor style issues. 2014-10-19 18:45:42 +02:00
Tiger Wang 2874bf73be Merge pull request #1502 from mc-server/furnaces
Improved furnaces
2014-10-18 21:33:55 +01:00
Mattes D 8c2a99711e Merged branch 'fix_chunks'. 2014-10-16 21:12:26 +02:00
Howaner b493beb3bb Stream 4 chunks per tick. Added priority. 2014-10-06 21:27:53 +02:00
Howaner a59f2d15fb Merge branch 'master' into ChunkLoader 2014-10-06 17:38:42 +02:00
Howaner 5a6b86180e Better StreamNextChunk() method 2014-10-06 17:38:17 +02:00
Mattes D a8aeceab9d cClientHandle: Added protocol version knowledge. 2014-10-05 20:19:21 +02:00
Tiger Wang b5a2c6667a Improved furnaces
* Fixed progress bar on 1.8
* Fixed bugs
* Improved code
* Fixes #1068
* Fixes #1070
2014-10-03 21:32:41 +01:00
Howaner 382e014ebc Optimized chunk loader 2014-10-02 23:50:41 +02:00
madmaxoft e65e0f1795 cClientHandle: Alpha-sorted the sending functions. 2014-10-01 12:14:38 +02:00
madmaxoft d7066f43d3 Rewritten plugin messages, vanilla are being parsed directly.
This should finally fix the compatibility problems between 1.7 and 1.8 protocols with the changes in the vanilla plugin messages.
2014-09-30 13:33:57 +02:00
Tiger Wang 72c087cfd3 Dropped support for <1.7.x 2014-09-27 14:28:14 +01:00
Howaner d83d6456e8 Fixed players custom name in 1.8 2014-09-26 17:37:19 +02:00
Howaner 4398156b2e Merge branch 'master' into 1.8-Protocol 2014-09-19 14:31:18 +02:00
Howaner 43ed690520 Exported player list states to extra functions. 2014-09-18 18:50:17 +02:00
madmaxoft 82317709f8 Full BungeeCord compatibility.
Fixes #1392.
Fixes SpigotMC/BungeeCord#1211.
2014-09-17 11:07:42 +02:00
Howaner b462416e1f 1.8: Fixed maps. 2014-09-13 02:20:04 +02:00
Howaner 3bd3ac2200 1.8: Added ParticleEffect packet. 2014-09-11 17:03:09 +02:00
Howaner f94df06b66 Added the player list to the 1.8 protocol. 2014-09-09 03:02:25 +02:00
Mattes D c5cd75fae8 Exported cClientHandle:GetIPString() to Lua API. 2014-09-07 22:35:22 +02:00
Mattes D c140ba2367 Merge pull request #1351 from LO1ZB/remove-a_RelY
remove y-coord from chunks
2014-09-03 21:47:00 +02:00
Hownaer 6c3b80f04c Fixed crashes and use std::swap. 2014-08-28 14:58:03 +02:00
LO1ZB 3c1c073714 remove y-coord from chunks 2014-08-28 11:36:35 +02:00
Howaner 47c928cab7 Exported daylight cycle flag to the protocol. 2014-08-11 00:20:28 +02:00
Howaner 4271d719b6 Added SetDoDaylightCycle() and IsDaylightCycleEnabled() to cWorld.
I need this for a GameRule plugin.
2014-08-07 01:07:32 +02:00
Mattes D 941a182d8a Merge pull request #1255 from mc-server/NameToUUID
Name to UUID
2014-08-01 22:35:12 +02:00
madmaxoft 6d02fce9a2 Merged branch 'master' into NameToUUID. 2014-07-31 23:17:49 +02:00
Howaner 89b1bbdc5f Added beacon. 2014-07-30 21:59:35 +02:00
madmaxoft 17a94b16ea MojangAPI: Implemented UUID shortening and dashing. 2014-07-30 13:56:30 +02:00
Tiger Wang 8811837aea Merge branch 'master' into portals
Conflicts:
	src/World.h
2014-07-29 15:27:19 +01:00
tonibm19 997a643977 Moar view distance!
Let's blow up our computers! :D
2014-07-23 20:28:56 +02:00
archshift 4044d0a6e6 Export SendEntityAnimation to ToLua 2014-07-22 13:10:12 -07:00
Tiger Wang 3385ed56b8 Merge remote-tracking branch 'origin/master' into portals
Conflicts:
	src/Chunk.cpp
	src/Entities/Player.cpp
	src/Root.cpp
	src/World.cpp
2014-07-22 10:24:28 +01:00
madmaxoft 93d29555e5 Style: Normalized to no spaces before closing parenthesis. 2014-07-21 17:40:43 +02:00
Tiger Wang 719551c31f Fix failed merge and other issues 2014-07-18 20:12:27 +01:00
Tiger Wang 37140ae578 Merge branch 'master' into portals
Conflicts:
	src/Blocks/WorldInterface.h
	src/ClientHandle.cpp
	src/ClientHandle.h
	src/Entities/Player.cpp
	src/Entities/Player.h
	src/Generating/FinishGen.cpp
	src/Protocol/Protocol.h
	src/Protocol/Protocol125.cpp
	src/Protocol/Protocol125.h
	src/Protocol/Protocol16x.cpp
	src/Protocol/Protocol16x.h
	src/Protocol/Protocol17x.cpp
	src/Protocol/Protocol17x.h
	src/Protocol/ProtocolRecognizer.cpp
	src/Protocol/ProtocolRecognizer.h
	src/Root.h
	src/World.cpp
2014-07-18 20:10:51 +01:00
madmaxoft 7fff12bfac Fixed spaces around single-line comments.
There should be at least two spaces in front and one space after //-style comments.
2014-07-17 19:13:23 +02:00
madmaxoft 993fd14ddf Fixed basic whitespace problems.
Indenting by spaces and alignment by spaces, as well as trailing whitespace on non-empty lines.
2014-07-17 16:33:09 +02:00
Mattes D e444106d09 Merge pull request #1192 from mc-server/skinuuid
Skins
2014-07-16 13:30:57 +02:00