summaryrefslogtreecommitdiffstats
path: root/source/cChunkMap.cpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Monster classes don't use cPackets. Chat messages are sent / broadcast without cPackets. BlockEntities don't use cPackets.madmaxoft@gmail.com2012-08-241-0/+50
| | | | 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-0/+33
| | | | 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/+108
| | | | 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/+32
| | | | | | 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 bit of cleanup and documentation around the UI window handlingmadmaxoft@gmail.com2012-08-061-3/+3
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@716 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Fixed a few gcc pedantic warnings; made BLOCKTYPE an unsigned char type.madmaxoft@gmail.com2012-08-031-1/+1
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@711 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Temporary jungle trees (swamp-like), based on code by STR_Warrior). Also vines don't overwrite leaves anymore.madmaxoft@gmail.com2012-07-021-0/+8
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@646 0a769ca7-a7f5-676a-18bf-c427514a06d6
* cBlockArea object added (with only minimal testing so far)madmaxoft@gmail.com2012-07-021-0/+29
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@641 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Removed the deprecated GetBlockEntity(), added several enumerators to replace it.madmaxoft@gmail.com2012-06-171-0/+84
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@629 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Exported cWorld::ForEachEntity and cWorld::ForEachEntityInChunk; no idea if they actually workmadmaxoft@gmail.com2012-06-161-0/+15
| | | | 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-1485/+1485
| | | | 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/+17
| | | | 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/+17
| | | | 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/+17
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@573 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Repeaters' delays can be set by rclkmadmaxoft@gmail.com2012-06-071-0/+17
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@570 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Item-dropping code rewritten and centralized - now there's only one place to modify if we want to split or merge same-item drops: cWorld:SpawnItemPickups(). Also, mined blocks can now drop more items, and they recognize if they're being mined by the correct tool.madmaxoft@gmail.com2012-06-061-17/+1
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@561 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Added support for SetNextBlockTick() function callable from Luamadmaxoft@gmail.com2012-05-301-0/+17
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@527 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-15/+59
| | | | 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-28/+190
| | | | 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-1/+16
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@454 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Fixed a deadlock by removing clients from all chunks upon their exit, not using the clients chunklists.madmaxoft@gmail.com2012-03-221-4/+19
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@426 0a769ca7-a7f5-676a-18bf-c427514a06d6
* That didn't work.. I forgot some cChunk functions were changed. Now it should compile againfaketruth2012-03-161-1/+1
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@417 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Exposed a function to Lua to get a block's sky light valuefaketruth2012-03-161-1/+19
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@416 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Unified the chunk data to use the BLOCKDATA datatype.madmaxoft@gmail.com2012-03-141-4/+4
| | | | 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-24/+41
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@411 0a769ca7-a7f5-676a-18bf-c427514a06d6
* cClientHandles have a unique ID now to distinguish themfaketruth2012-03-091-2/+3
| | | | | | | | | | | 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-24/+27
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@365 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Linux compilation fix (y u no support const_iterator, gcc?)madmaxoft@gmail.com2012-02-281-1/+1
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@338 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Chunk now has an indicator of load failure; Chunk generator uses cChunkStaymadmaxoft@gmail.com2012-02-281-0/+20
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@337 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Implemented synchronous chunk loading; optimized cChunkStay interface for speed (though still unused ;)madmaxoft@gmail.com2012-02-281-38/+111
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@336 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Const-correctness for packet broadcasting (fixes GCC compilation)madmaxoft@gmail.com2012-02-281-2/+2
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@333 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Fix for the perpetual load issuemadmaxoft@gmail.com2012-02-271-1/+7
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@332 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Implemented chunk loading without generating on load-failuremadmaxoft@gmail.com2012-02-261-3/+13
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@331 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/+91
| | | | 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-0/+15
| | | | 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-4/+6
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@324 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Fixed a potential deadlock in cChunkMap::m_CSLayers vs cWorld::m_CSAllEntitiesmadmaxoft@gmail.com2012-02-221-6/+8
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@313 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Removed cChunkPtrs from everywhere but internal cChunkMap usage. Now we should finally be threadsafe :)madmaxoft@gmail.com2012-02-211-3/+140
| | | | | | 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-0/+45
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@303 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Fixed block-getting so that simulators work againmadmaxoft@gmail.com2012-02-211-0/+37
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@301 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Removed some more cChunkPtr usagemadmaxoft@gmail.com2012-02-201-6/+138
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@298 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Using own ASSERT() that logs to filefaketruth2012-02-201-1/+1
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@297 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-0/+51
| | | | 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-0/+16
| | | | 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/+58
| | | | | | 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-6/+24
| | | | 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-1/+11
| | | | | | 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-6/+105
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@273 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Chunks are properly saved before being unloaded nowfaketruth2012-02-161-0/+3
| | | | | | numchunks server command works again git-svn-id: http://mc-server.googlecode.com/svn/trunk@272 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/+38
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@263 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-456/+112
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@251 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Removed unused codemadmaxoft@gmail.com2012-02-081-15/+8
| | | | 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/+2
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@245 0a769ca7-a7f5-676a-18bf-c427514a06d6
* AString logging fix 2madmaxoft@gmail.com2012-02-011-7/+7
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@218 0a769ca7-a7f5-676a-18bf-c427514a06d6
* sprintf() begone! Replaced with StringUtils' Printf()madmaxoft@gmail.com2012-02-011-6/+5
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@216 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Removed a few duplicate includesmadmaxoft@gmail.com2012-02-011-2/+0
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@215 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Linux fixes, but while it compiles, when a user joins it crashes the server with "*** glibc detected *** ./MCServer: double free or corruption (out): 0x00007fb5f5158db0 ***"mtilden@gmail.com2012-01-311-0/+1
| | | | | | Please look into this. Also, am I the only one compiling/using Linux? git-svn-id: http://mc-server.googlecode.com/svn/trunk@198 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Added a WebAdmin interface to view users their groups, and the permissions of groups.faketruth2012-01-301-1/+1
| | | | | | cChunk::Tick did an assertion in cCSLock, I used a cCSUnlock to fix it, but not sure if this is correct. git-svn-id: http://mc-server.googlecode.com/svn/trunk@194 0a769ca7-a7f5-676a-18bf-c427514a06d6
* More cFile cleanup; removed old format writing for block entitiesmadmaxoft@gmail.com2012-01-301-4/+0
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@193 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Initial cFile implementation (using stdio FILE) and test in cChunkMapmadmaxoft@gmail.com2012-01-301-84/+86
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@192 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Old code begone! ChunkMap cleanupmadmaxoft@gmail.com2012-01-291-348/+250
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@189 0a769ca7-a7f5-676a-18bf-c427514a06d6
* VC2008 / VC2010: Enabled precompiled header through Globals.h; the header included in every module in the project. Compilation optimization.madmaxoft@gmail.com2012-01-291-6/+9
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@188 0a769ca7-a7f5-676a-18bf-c427514a06d6
* ChunkGenerator: rewritten thread-locking using the new RAII CSLock classmadmaxoft@gmail.com2012-01-291-3/+4
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@186 0a769ca7-a7f5-676a-18bf-c427514a06d6
* MSVC 2008 Express compatibility: Added the projects, modified sources to compile. Tested on MSVC 2008 Express and MSVC 2010 Expressmadmaxoft@gmail.com2012-01-271-1/+1
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@179 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Terrain generation is synchronous again, async generation has bugs.faketruth2012-01-191-1/+1
| | | | | | | | | 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-1/+11
| | | | | | | 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
* Users file was pretty messed up with mixed unix and windows line endings. The ini failed to parse correctly under cygwin.faketruth2011-12-271-1/+1
| | | | | | | | | 'Fixed' a 'bug' where MCServer would seemingly endlessly calculate lighting for an entire world (and then crash), when this entire world has 'wrong' lighting. This happens when running a converted map from Vanilla. Fixed this by only allowing a maximum of 50 chunks to recalculate their lighting per tick. Fixed a small coding error in cChunkMap where it would check PakVersion twice, instead of also ChunkVersion. DeNotch converter does not need the VS2010 runtime thingies anymore git-svn-id: http://mc-server.googlecode.com/svn/trunk@138 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/+2
| | | | | | | | | 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
* You can now run multiple worlds by defining them in settings.ini . However there's no way to change worlds on the fly yetfaketruth2011-11-011-12/+8
| | | | | | | | | | | Players are now stored in separate folder /players instead of in the world folder (!so move the folder!) Fixed a memory leak/error in cPickup.cpp Multiple worlds are stored in cRoot cClientHandle lists are taken out of cWorld and now stored in cServer Worlds now have names to distinguish them by Some functions in the Core plugin now distinguish between worlds git-svn-id: http://mc-server.googlecode.com/svn/trunk@40 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Players can now place blocks in creative mode. The blocks players select from the creative mode inventory are not stored in the players' inventory. (I kind of like that)admin@omencraft.com2011-11-011-0/+1
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@37 0a769ca7-a7f5-676a-18bf-c427514a06d6
* denotch map converter works! :Dadmin@omencraft.com2011-10-311-8/+9
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@36 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Prepared some parts of the code for multi world support, I created lots of TODO'sfaketruth2011-10-311-3/+4
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@29 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Changed cChunkMat.cpp back to normal. Made more changes to the denotch map converter. Testing cNBTData parser.admin@omencraft.com2011-10-301-5/+0
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@21 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Added denotch map converter. Program currently reads the only mcr file in the region dir and writes the uncompressed chunk data in world/X0-Z0.pak. I compile in linux with "g++ cConvert.cpp -lz -o denotch"admin@omencraft.com2011-10-291-5/+10
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@20 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Compiles for linuxfaketruth2011-10-211-0/+3
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@6 0a769ca7-a7f5-676a-18bf-c427514a06d6
* MCServer c++ source filesfaketruth2011-10-031-0/+714
git-svn-id: http://mc-server.googlecode.com/svn/trunk@3 0a769ca7-a7f5-676a-18bf-c427514a06d6