summaryrefslogtreecommitdiffstats
path: root/src/ChunkSender.cpp (unfollow)
Commit message (Collapse)AuthorFilesLines
2020-08-21ChunkDataSerializer: don't repeatedly mallocateTiger Wang1-7/+4
+ Store an instance of the class, the way it seems it is meant to be used.
2020-08-01Replaced cpp14::make_unique<> with std::make_unique<>.Mattes D1-1/+1
2020-07-19Implement "caching" in ChunkDataSerializerTiger Wang1-3/+5
+ When sending a chunk to multiple clients, group them by protocol version and send the same data
2020-06-24Send entities in cChunkSender (#4532)Mat1-7/+23
Confer issue #3696
2020-04-16Using Super.Mattes D1-2/+2
2019-09-24NBTChunkSerializer: Cleaned up interface.Mattes D1-1/+1
Removed dependency on cChunkDataCallback. Moved all the serializing code into a worker class. Changed the serialization into a single-call action.
2019-09-06Separated chunk generator from world / plugin interfaces.Mattes D1-2/+2
The generator now only takes care of servicing synchronous "GetChunk(X, Y)" and "GetBiomes(X, Y)" requests.
2018-07-26CheckBasicStyle: Check number of empty lines between functions (#4267)peterbell101-2/+1
Add check for number of empty lines between functions and fix the corresponding failures
2018-07-24Broadcast refactor (#4264)peterbell101-1/+1
* Move Broadcast functions from cChunkMap to cBroadcaster - Remove cBroadcastInterface in favour of cBroadcaster. - cChunk: Remove broadcast functions. * resurect broadcast interface * Absorb cBroadcaster into cWorld. Removes the need for forwarding the function calls. * Improve const-correctness * Use Int8 instead of char + Comment `ForClients` functions * Improve comments * Broadcaster: Rename ForClients functions
2018-07-22cIsThread: Reset m_ShouldTerminate after the thread has stopped (#4258)peterbell101-11/+1
This allows threads to be restarted after stopping. Fixes #4257
2017-08-21Implement protocol level chunk sparsing (#3864)peterbell101-1/+2
2016-05-141.9 / 1.9.2 / 1.9.3 / 1.9.4 protocol support (#3135)Pokechu221-1/+1
* 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
2015-10-04Fixed a race condition between chunk loader and generator.Mattes D1-1/+1
When using ChunkWorx to generate multiple chunks, the server would sometimes fail an assert because it would generate a chunk even when it was successfully loaded. This was caused by chunks queued in cWorld's m_SetChunkDataQueue and thus being marked as "InQueue" although they were already loaded. Solved by adding a new parameter to chunk coord callbacks specifying whether the operation succeeded or failed, and using that instead of the chunk presence flag to decide whether to generate or not.
2015-07-31Unified the doxy-comment format.Mattes D1-3/+14
2015-06-22Fixed minor errors in Tycho's codeTiger Wang1-38/+26
Everything should work now :)
2015-06-10Reinstate "Chunk queue collapsing"Tiger Wang1-142/+100
This reinstates commit f36acb683594daff5af3971dcbe3c3a171628b78 and reverts commit adfbc42c021e1bcfcb355933c0fd784306ce0e18.
2015-06-07Revert "Chunk queue collapsing"worktycho1-100/+142
2015-06-05Fix iteratingtycho1-3/+1
2015-06-05Made the list of chunks to stream an unordered_settycho1-4/+4
This should increase performance of chunk streaming
2015-06-05Rewrote ChunkSending queue for significantly improved performancetycho1-143/+74
2015-06-05Moved Chunk Broadcasts over to the regular queuetycho1-58/+87
2015-05-30Made cLightingThread own its callbackstycho1-7/+16
2015-05-24Made -Weverything an error.tycho1-1/+1
2015-05-19Make -Werror disabling file onlytycho1-4/+0
Ad fix a load of warnings
2014-10-28Forgotten m_SendChunksMediumPriority.empty() check.Howaner1-1/+1
2014-10-23Use 3 priorities.Howaner1-4/+40
2014-10-23En masse NULL -> nullptr replaceTiger Wang1-8/+8
2014-10-21style.Howaner1-1/+2
2014-10-21Use two lists and 2 chunk send prioritys.Howaner1-13/+35
2014-10-20En masse NULL -> nullptr replaceTiger Wang1-8/+8
2014-10-06Stream 4 chunks per tick. Added priority.Howaner1-4/+9
2014-10-02Optimized chunk loaderHowaner1-12/+9
2014-09-26Removed more unessicary includesTycho1-0/+1
2014-08-28remove y-coord from chunksLO1ZB1-7/+7
2014-07-17Normalized comments.madmaxoft1-2/+2
This was mostly done automatically and then visually inspected for obvious errors. All //-style comments should have a 2-space separation from the code, and 1 space after the comment sign.
2013-12-22merged in warnings changesTycho Bickerstaff1-1/+1
2013-12-21ChunkSender is now warnings cleanTycho Bickerstaff1-1/+1
2013-12-20Fixed the rest of constructor reorders.madmaxoft1-2/+2
2013-12-20Fixed compiler warning when iterating over a fixed array of items (ARRAYCOUNT).madmaxoft1-1/+1
2013-11-24Moved source to srcAlexander Harkness1-0/+0
2013-05-28Fixed previous commitmadmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1528 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-04-13Rewritten entities so that they are owned by individual chunks and ticked within their chunk's Tick()madmaxoft@gmail.com1-9/+9
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1385 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-10-27Fixed more valgrind issuesmadmaxoft@gmail.com1-1/+2
( http://forum.mc-server.org/showthread.php?tid=598&pid=5139#pid5139 ) git-svn-id: http://mc-server.googlecode.com/svn/trunk@1013 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-10-25Fixed up a few valgrind warningsmadmaxoft@gmail.com1-0/+1
( http://forum.mc-server.org/showthread.php?tid=598&pid=5071#pid5071 ) git-svn-id: http://mc-server.googlecode.com/svn/trunk@1010 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-24Source files cleanup: The rest of the files renamed.madmaxoft@gmail.com1-2/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@887 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-23Source files cleanup: ChunkDataSerializer is Protocol-relatedmadmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@886 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-26git-svn-id: http://mc-server.googlecode.com/svn/trunk@795 0a769ca7-a7f5-676a-18bf-c427514a06d6madmaxoft@gmail.com1-9/+5
2012-08-24Monster classes don't use cPackets. Chat messages are sent / broadcast without cPackets. BlockEntities don't use cPackets.madmaxoft@gmail.com1-11/+8
git-svn-id: http://mc-server.googlecode.com/svn/trunk@783 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-03Fixed a few gcc pedantic warnings; made BLOCKTYPE an unsigned char type.madmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@711 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-14Attempt to bring sanity to newlines across systems.cedeel@gmail.com1-300/+300
git-svn-id: http://mc-server.googlecode.com/svn/trunk@606 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-05-25Merged the composable_generator branch into the trunkmadmaxoft@gmail.com1-3/+54
git-svn-id: http://mc-server.googlecode.com/svn/trunk@504 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-05-07Updated version text to include 1.2.5; ChunkSender doesn't serialize chunk packets for chunks without a clientmadmaxoft@gmail.com1-0/+5
git-svn-id: http://mc-server.googlecode.com/svn/trunk@480 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-27Fixed a possible crash in ChunkSender - a client would be reported as removed but still would be in the internal queue.madmaxoft@gmail.com1-2/+15
git-svn-id: http://mc-server.googlecode.com/svn/trunk@438 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-14Split chunk data into separate arrays; decoupled most sources from cChunk.h dependencymadmaxoft@gmail.com1-9/+0
git-svn-id: http://mc-server.googlecode.com/svn/trunk@411 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-13Removed an unwarranted assert in cChunkSendermadmaxoft@gmail.com1-2/+5
git-svn-id: http://mc-server.googlecode.com/svn/trunk@409 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-12Fixed MapChunk packets to include (fake) biome data, makes clients happymadmaxoft@gmail.com1-1/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@403 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-11Stopping the ChunkSender upon server stopmadmaxoft@gmail.com1-2/+12
git-svn-id: http://mc-server.googlecode.com/svn/trunk@401 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-11Not sending chunks to the client twicemadmaxoft@gmail.com1-0/+11
git-svn-id: http://mc-server.googlecode.com/svn/trunk@399 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-10Fixed *nix threading issue;madmaxoft@gmail.com1-3/+3
Thread objects now use variable names consistent with MCS convention; Fixed a few *nix threading cornercases git-svn-id: http://mc-server.googlecode.com/svn/trunk@392 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-09cClientHandles have a unique ID now to distinguish themfaketruth1-1/+4
cAuthenticator uses unique client ID for authentication Changed the kick function used by cAuthenticator to take a client ID instead of name, so the correct user is kicked Using callback reference instead of pointer in GetChunkData and affiliates GetChunkData returns false when failed, and true when succeeded Renamed entity type enums to something prettier Exposed some functions to Lua git-svn-id: http://mc-server.googlecode.com/svn/trunk@388 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-07ChunkSender: Fixed a potential crash: removing a client means that no Send() is called on that client anymoremadmaxoft@gmail.com1-12/+18
git-svn-id: http://mc-server.googlecode.com/svn/trunk@384 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-06ChunkSender won't send NULL packets anymoremadmaxoft@gmail.com1-1/+5
git-svn-id: http://mc-server.googlecode.com/svn/trunk@376 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-06Fixed rev368's ChunkSender, now sends properly even chunks that are loaded. Fixed a deadlock in cClientHandle vs TickThread over cClientHandle::m_CSChunkListsmadmaxoft@gmail.com1-22/+91
git-svn-id: http://mc-server.googlecode.com/svn/trunk@371 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-05ChunkSender: Chunks are now compressed and sent to clients from a separate threads, proper passive waiting between threads. Not much tested, just appears to work :)madmaxoft@gmail.com1-0/+133
git-svn-id: http://mc-server.googlecode.com/svn/trunk@365 0a769ca7-a7f5-676a-18bf-c427514a06d6