summaryrefslogtreecommitdiffstats
path: root/source/cChunk.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Source files cleanup: The rest of the files renamed.madmaxoft@gmail.com2012-09-241-321/+0
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@887 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Merged in a patch for sounds by l0udPLmadmaxoft@gmail.com2012-09-111-0/+1
| | | | | | http://forum.mc-server.org/showthread.php?tid=434&pid=4564#pid4564 git-svn-id: http://mc-server.googlecode.com/svn/trunk@858 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Progress on the 1.3.2 protocol.madmaxoft@gmail.com2012-08-311-1/+1
| | | | | | Sometimes the client lets the player through, but most of the times the connection breaks for no apparent reason. git-svn-id: http://mc-server.googlecode.com/svn/trunk@812 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Gotten completely rid of all cPackets. The cProtocol125 class now does all the parsing and writing by itself.madmaxoft@gmail.com2012-08-291-7/+2
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@802 0a769ca7-a7f5-676a-18bf-c427514a06d6
* git-svn-id: http://mc-server.googlecode.com/svn/trunk@795 0a769ca7-a7f5-676a-18bf-c427514a06d6madmaxoft@gmail.com2012-08-261-0/+2
|
* cWorld doesn't use cPackets.madmaxoft@gmail.com2012-08-251-0/+1
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@789 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Removed cPackets from cChunk.madmaxoft@gmail.com2012-08-251-4/+11
| | | | | | Also decoupled a possible deadlock in player login code. git-svn-id: http://mc-server.googlecode.com/svn/trunk@788 0a769ca7-a7f5-676a-18bf-c427514a06d6
* cPickup doesn't use cPackets.madmaxoft@gmail.com2012-08-241-0/+2
| | | | | | Also, Lua API change, OnCollectItem -> OnCollectPickup; first param is cPlayer to match other callbacks. git-svn-id: http://mc-server.googlecode.com/svn/trunk@786 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Monster classes don't use cPackets. Chat messages are sent / broadcast without cPackets. BlockEntities don't use cPackets.madmaxoft@gmail.com2012-08-241-0/+4
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@783 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Window, Chest, Furnace and Pawn are not using cPackets at allmadmaxoft@gmail.com2012-08-191-1/+4
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@762 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Almost all packets' handling is now rewritten not to use cPacket descendants elsewhere than in cClientHandle.madmaxoft@gmail.com2012-08-191-0/+6
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@761 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Another handful of packets rewritten.madmaxoft@gmail.com2012-08-191-0/+3
| | | | | | Also changed cItem::m_ItemID into m_ItemType of type short. Easier handling. m_ItemID kept for compatibility reasons (Lua-interface etc.) git-svn-id: http://mc-server.googlecode.com/svn/trunk@756 0a769ca7-a7f5-676a-18bf-c427514a06d6
* A new Block handling system :olapayo94@gmail.com2012-07-151-1/+0
| | | | | | | | | | It was really a lot of work :D Took me the complete weekend :D Would really like to here your opinion on this =) The aim of this is to put all the actions for one block in one place so it is not spread around the source. (ToPickup, Action in cWorld, Action in cChunk, Action here, action there :D) git-svn-id: http://mc-server.googlecode.com/svn/trunk@671 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Leaves decay properly - if they are not connected to a logmadmaxoft@gmail.com2012-07-021-1/+5
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@644 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Removed the deprecated GetBlockEntity(), added several enumerators to replace it.madmaxoft@gmail.com2012-06-171-1/+20
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@629 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Fixed leaves blockticking - must touch neighboring chunks, too, instead of self at wrong places.madmaxoft@gmail.com2012-06-171-0/+1
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@626 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Exported cWorld::ForEachEntity and cWorld::ForEachEntityInChunk; no idea if they actually workmadmaxoft@gmail.com2012-06-161-1/+4
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@620 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Attempt to bring sanity to newlines across systems.cedeel@gmail.com2012-06-141-271/+271
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@606 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Cacti grow by themselves and by bonemealmadmaxoft@gmail.com2012-06-091-0/+3
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@583 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Sugarcane grows and can be grown using bonemeal.madmaxoft@gmail.com2012-06-081-0/+3
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@578 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Bonemeal works on crops, melons, pumpkins, saplings and grass. Plant growing has been refactored into separate functions callable from Lua, too.madmaxoft@gmail.com2012-06-071-0/+3
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@573 0a769ca7-a7f5-676a-18bf-c427514a06d6
* BlockChecking split into a separate functionmadmaxoft@gmail.com2012-06-071-1/+4
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@571 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Repeaters' delays can be set by rclkmadmaxoft@gmail.com2012-06-071-0/+1
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@570 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Grass spreads to adjacent dirt blocks. Doesn't check dest light yet.madmaxoft@gmail.com2012-06-061-0/+1
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@563 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Added support for SetNextBlockTick() function callable from Luamadmaxoft@gmail.com2012-05-301-0/+8
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@527 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Fixed blocktick distributionmadmaxoft@gmail.com2012-05-301-12/+1
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@525 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Farmland gets hydrated and dehydrated. Fixed an off-by-one error in neighbor-chunk manipulation.madmaxoft@gmail.com2012-05-301-0/+1
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@522 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Added code for the chunks to manipulate their neighbors while ticking. Also added some basic farming support - melon and pumpkin growing code. Untested and untestable so far, will test and fix later.madmaxoft@gmail.com2012-05-291-8/+14
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@518 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Merged the composable_generator branch into the trunkmadmaxoft@gmail.com2012-05-251-24/+35
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@504 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Added the "/regeneratechunk" command that regenerates either current chunk or a chunk specified with x, z parameters. TODO: permissions - we don't want guests erasing our chunks!madmaxoft@gmail.com2012-04-101-2/+3
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@454 0a769ca7-a7f5-676a-18bf-c427514a06d6
* That didn't work.. I forgot some cChunk functions were changed. Now it should compile againfaketruth2012-03-161-0/+3
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@417 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Unified the chunk data to use the BLOCKDATA datatype.madmaxoft@gmail.com2012-03-141-1/+1
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@413 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Split chunk data into separate arrays; decoupled most sources from cChunk.h dependencymadmaxoft@gmail.com2012-03-141-168/+47
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@411 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Small optimizations in the SetNibble() and GetNibble() functions; removed unused lighting functions from cChunkmadmaxoft@gmail.com2012-03-131-3/+1
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@408 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Completely integrated the new axis ordering. Will update worlds accordinglyfaketruth2012-03-101-1/+1
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@396 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Was using "#else if" which is not valid apparently, now using "#elif"faketruth2012-03-101-2/+2
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@391 0a769ca7-a7f5-676a-18bf-c427514a06d6
* You can change axis ordering by setting AXIS_ORDER to AXIS_ORDER_XZY in cChunk.h !THIS WILL SCREW UP YOUR WORLDS THOUGH!faketruth2012-03-101-13/+22
| | | | | | Still need to update world storage schemes, converters and such git-svn-id: http://mc-server.googlecode.com/svn/trunk@390 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Using more of the index functions in cChunk, so it should be easy enough to flip the axis ordering nowfaketruth2012-03-101-4/+31
| | | | | | Added some more functions that use Vector3i for block coordinates in cChunk git-svn-id: http://mc-server.googlecode.com/svn/trunk@389 0a769ca7-a7f5-676a-18bf-c427514a06d6
* cClientHandles have a unique ID now to distinguish themfaketruth2012-03-091-1/+1
| | | | | | | | | | | 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
* ChunkSender: 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.com2012-03-051-6/+9
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@365 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Should have complete support for 256 blocks high worlds. Old save files are converted to new ones at load.faketruth2012-03-041-1/+1
| | | | | | BACK UP YOUR WORLD! git-svn-id: http://mc-server.googlecode.com/svn/trunk@358 0a769ca7-a7f5-676a-18bf-c427514a06d6
* The world can now truly be made higher by incrementing cChunk::c_ChunkHeight to 256. !!HOWEVER THIS WILL DESTROY YOUR SAVED WORLD!!faketruth2012-03-041-1/+1
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@357 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Changed signed char to unsigned char in block packets, so we can receive height up to 255faketruth2012-03-041-1/+2
| | | | | | Blocks placed above 128 limit don't become obsidian anymore. This was due to the cChunk::MakeIndex() function return 0 when outside of bounds, it now returns an 'error constant' git-svn-id: http://mc-server.googlecode.com/svn/trunk@356 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Got rid of some hardcoded numbers, now using hardcoded variables! woofaketruth2012-03-031-4/+6
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@355 0a769ca7-a7f5-676a-18bf-c427514a06d6
* New redstone simulator. Should work without crashes!faketruth2012-03-011-0/+1
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@345 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Server uses ~40% less CPU nowfaketruth2012-02-281-1/+1
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@339 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Chunk now has an indicator of load failure; Chunk generator uses cChunkStaymadmaxoft@gmail.com2012-02-281-0/+3
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@337 0a769ca7-a7f5-676a-18bf-c427514a06d6
* New cChunkStay class for temporarily keeping chunks loaded even when then have no clients. For now unused, will be used by generator and lighting in the future.madmaxoft@gmail.com2012-02-261-0/+6
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@330 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Plain pointer cChunkPtr finishing touches; removed cChunk's critical sectionsmadmaxoft@gmail.com2012-02-231-14/+5
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@325 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Made cChunkPtr a plain old pointer again, since it's safe nowmadmaxoft@gmail.com2012-02-231-1/+1
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@324 0a769ca7-a7f5-676a-18bf-c427514a06d6
* cChunk: removed unused codemadmaxoft@gmail.com2012-02-231-2/+0
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@323 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Removed cChunkPtrs from everywhere but internal cChunkMap usage. Now we should finally be threadsafe :)madmaxoft@gmail.com2012-02-211-2/+8
| | | | | | Also fixed a threading issue when a player connecting might have gotten stuck in "Downloading world" forever git-svn-id: http://mc-server.googlecode.com/svn/trunk@304 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Fixed heightmap optimization from rev 302; removed a few more cChunkPtrsmadmaxoft@gmail.com2012-02-211-3/+4
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@303 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Removed some more cChunkPtr usagemadmaxoft@gmail.com2012-02-201-2/+24
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@298 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Substantial cWorld::FastSetBlock() speed up by queueing all such calls and processing them later chunk-wise (makes growing trees in the generator fast again)madmaxoft@gmail.com2012-02-181-1/+16
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@295 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Re-implemented tree-growing. May produce artefacts on old-world / new-world boundaries.madmaxoft@gmail.com2012-02-181-3/+6
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@293 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Thread-safe chunk generation, storage and generator are queried for progress while initializing servermadmaxoft@gmail.com2012-02-181-1/+1
| | | | | | Note that this commit breaks foliage generation - there are no trees in the chunks generated! git-svn-id: http://mc-server.googlecode.com/svn/trunk@292 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Chunk coords mostly "upgraded" to include the Y coord for future compatibilitymadmaxoft@gmail.com2012-02-171-2/+12
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@285 0a769ca7-a7f5-676a-18bf-c427514a06d6
* cWorldGenerator speedup - doesn't call GetChunk() anymore, not queueing the chunk it's generating to be loaded recursively.madmaxoft@gmail.com2012-02-161-4/+4
| | | | | | cChunk fix - setting a block to the same value doesn't mark chunk dirty (resulted in un-unloadable chunks) git-svn-id: http://mc-server.googlecode.com/svn/trunk@279 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Chunk is now marked as dirty; saving only dirty chunks; rewritten load / save not to use cChunkPtr; set VC2008 project to level4 warnings; block entities are now loaded and saved properlymadmaxoft@gmail.com2012-02-161-3/+49
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@273 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Restored chest and furnace functionality as it was (it's basically working but joined chests show single-chest window)madmaxoft@gmail.com2012-02-151-0/+2
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@263 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Slight cleanup - removed old code, some additional comments on dangerous functionsmadmaxoft@gmail.com2012-02-141-10/+9
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@261 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Rewritten most of the code for multithreading; still not 100%, but getting there. If this commit proves to be too problematic, we can always undo it.madmaxoft@gmail.com2012-02-131-36/+93
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@251 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Removed unused codemadmaxoft@gmail.com2012-02-081-3/+5
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@249 0a769ca7-a7f5-676a-18bf-c427514a06d6
* MTRand class is not created in each tick, therefore much improving tick-thread time (now uses ~5 % CPU instead of one full core)madmaxoft@gmail.com2012-02-081-2/+12
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@245 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Old code begone! ChunkMap cleanupmadmaxoft@gmail.com2012-01-291-2/+0
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@189 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Terrain generation is synchronous again, async generation has bugs.faketruth2012-01-191-2/+2
| | | | | | | | | Made some funky smart pointer things for chunks. Fixed a bug where the client would override the player position on the server and back again, resulting in sending too many chunks to the client which it doesn't even need. Fixed some compiler warnings in cPickup.cpp git-svn-id: http://mc-server.googlecode.com/svn/trunk@164 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Fixed the numchunks console command.faketruth2012-01-011-0/+5
| | | | | | | Added some form of reference counting to cChunk to make sure it's not referenced when deleting it. Right now it's only needed due to the generation of chunks in a separate thread and adding it to the spread light list in cWorld git-svn-id: http://mc-server.googlecode.com/svn/trunk@161 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Made a couple of functions in cChunk inline, this should speed up several block operations on chunksfaketruth2011-12-311-1/+14
| | | | | | | Players should not spawn in the ground anymore. When an entity was added to cWorld twice (which shouldn't happen actually), the server would crash when the entity is destroyed, this should be fixed now. git-svn-id: http://mc-server.googlecode.com/svn/trunk@158 0a769ca7-a7f5-676a-18bf-c427514a06d6
* - Linux compatible fixes including updated makefilemtilden@gmail.com2011-12-261-1/+1
| | | | | | | | - Mersenne Twister still says uint32 but it's now signed for compatibility with random uses needing negative values - Server seed is sent to clients, but needs to be able to be signed long long later on for authentic reasons - Protocol Version is required to match to ensure client compatibility, this should probably have a settings.ini check as well as store the value there git-svn-id: http://mc-server.googlecode.com/svn/trunk@121 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Moved the actual world generation from cChunk.cpp to a more isolated file cWorldGenerator.cppfaketruth2011-12-261-15/+7
| | | | | | New generators should inherit cWorldGenerator and implement their own generation algorithms git-svn-id: http://mc-server.googlecode.com/svn/trunk@117 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Made some functions in cChunk and cNoise inline, this should significantly increase chunk generation speedfaketruth2011-12-261-1/+6
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@115 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Chunks are generated in a separate thread allowing players to keep on playing and chatting while chunks are generated. This means, however, that cWorld::GetChunk() does not always return a chunk and is something you need to be aware of. I am not entirely sure if all this is completely stable, but I think so :Ofaketruth2011-12-251-0/+1
| | | | | | | | | Chunks are now generated before the player is able to see them. This is done because after a chunks is done generating, some blocks might still need to be set (parts of trees from neighboring chunk), causing more bandwidth to be used (each changed block needs to be sent to clients again) and (fps) lagging the clients when changing a lot of blocks. Calculating ahead fixes these issues. Separated the placing of foliage (trees and stuff) when generated chunks into a new function GenerateFoliage() Cleaned up the VS2010 project, now using some VS2010 specific functions like dependencies on projects (no need for setting library dependencies manually). VS2010 project now compiles way faster in Release by using multi threading. git-svn-id: http://mc-server.googlecode.com/svn/trunk@103 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Digging leaves with shears now drops leaveslapayo94@gmail.com2011-12-221-0/+2
| | | | | | | | | | | | | Falling Sand now notifies water around Implemented Function to get the relative chunk position in the total position (cChunk::PositionToWorldPosition) Pistons donĀ“t drop water and lava items anymore when stopping water/lava implemented Getter for lava and water simulator IsBlockWater and IsBlockLava function in Defines.h git-svn-id: http://mc-server.googlecode.com/svn/trunk@97 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Prepared some parts of the code for multi world support, I created lots of TODO'sfaketruth2011-10-311-4/+7
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@29 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Compiles for linuxfaketruth2011-10-211-1/+2
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@6 0a769ca7-a7f5-676a-18bf-c427514a06d6
* MCServer c++ source filesfaketruth2011-10-031-0/+127
git-svn-id: http://mc-server.googlecode.com/svn/trunk@3 0a769ca7-a7f5-676a-18bf-c427514a06d6