summaryrefslogtreecommitdiffstats
path: root/source/cChunk.cpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Server uses ~40% less CPU nowfaketruth2012-02-281-86/+92
| | | | 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/+16
| | | | 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-1/+13
| | | | 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-162/+14
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@325 0a769ca7-a7f5-676a-18bf-c427514a06d6
* cChunk: removed unused codemadmaxoft@gmail.com2012-02-231-6/+0
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@323 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Added some asserts to trace a bugfaketruth2012-02-221-1/+5
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@319 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Removed cChunkPtrs from everywhere but internal cChunkMap usage. Now we should finally be threadsafe :)madmaxoft@gmail.com2012-02-211-5/+6
| | | | | | 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-16/+42
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@303 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Optimized hightmap recalc when setting a chunk's blockmadmaxoft@gmail.com2012-02-211-7/+31
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@302 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Removed some more cChunkPtr usagemadmaxoft@gmail.com2012-02-201-3/+7
| | | | 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-5/+5
| | | | 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-8/+28
| | | | 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/+10
| | | | 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-8/+8
| | | | | | 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
* cWorldGenerator speedup - doesn't call GetChunk() anymore, not queueing the chunk it's generating to be loaded recursively.madmaxoft@gmail.com2012-02-161-5/+6
| | | | | | 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
* Marking chunk dirty after generatingmadmaxoft@gmail.com2012-02-161-0/+2
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@276 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Heightmap is properly generated after loading chunks now, so /spawn and /top should work properly againfaketruth2012-02-161-0/+2
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@274 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-7/+146
| | | | 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/+13
| | | | 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-361/+343
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@251 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Removed unused codemadmaxoft@gmail.com2012-02-081-44/+113
| | | | 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-5/+8
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@245 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Rewritten cAuthenticator to make use of the new cIsThread architecture - now authentication runs in a single separate thread for all clients;madmaxoft@gmail.com2012-02-011-2/+2
| | | | | | | Global player-kicking function (cServer, cRoot); More char * -> AString conversion git-svn-id: http://mc-server.googlecode.com/svn/trunk@221 0a769ca7-a7f5-676a-18bf-c427514a06d6
* AString logging fixmadmaxoft@gmail.com2012-02-011-7/+7
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@217 0a769ca7-a7f5-676a-18bf-c427514a06d6
* sprintf() begone! Replaced with StringUtils' Printf()madmaxoft@gmail.com2012-02-011-3/+3
| | | | 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/+1
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@215 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Fixed a problem in cCSLock (sorry); reverted cChunkmadmaxoft@gmail.com2012-01-301-3/+3
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@195 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-176/+199
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@193 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-10/+5
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@188 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Working on a new plugin design with Lua. While retaining backwards compatibility of course...faketruth2012-01-261-28/+28
| | | | | | In this new design a plugin consists of a folder with Lua files, this should enable plugin developers to keep things separate and have more overview. git-svn-id: http://mc-server.googlecode.com/svn/trunk@172 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Probably fixed a deadlock! http://www.mc-server.org/support/index.php?do=details&task_id=147faketruth2012-01-261-2/+2
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@171 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Cactus towers can be destroyed by removing the bottom blockfaketruth2012-01-231-0/+1
| | | | | | | | | Added checks whether flowers/mushrooms/saplings can be placed on surface Added checks for cactus to see if it's allowed to be placed Fluids now wash away certain items (flower, sapling, cactus) git-svn-id: http://mc-server.googlecode.com/svn/trunk@169 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Terrain generation is synchronous again, async generation has bugs.faketruth2012-01-191-43/+13
| | | | | | | | | 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/+76
| | | | | | | 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-105/+8
| | | | | | | 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
* This bug should be fixed now http://mc-server.org/support/index.php?do=details&task_id=112faketruth2011-12-281-6/+44
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@145 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Some kind of 'template' world generator that right now just generates an all dirt world. You can use this to test new algorithmsfaketruth2011-12-271-2/+2
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@127 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Players can switch worlds on the fly with the command /gotoworld [worldName]. This uses the function cPlayer::MoveToWorld()faketruth2011-12-261-72/+72
| | | | | | Changed isValidItem to IsValidItem in Core.lua git-svn-id: http://mc-server.googlecode.com/svn/trunk@126 0a769ca7-a7f5-676a-18bf-c427514a06d6
* - improved Simulator system lapayo94@gmail.com2011-12-261-26/+1
| | | | | | | | | | | | -> Manager handles all ticks -> advantage: Much easier to add new simulators, because you only have to register them in the manager - moved sand and gravel simulation to a Simulator-class (cSandSimulator) - Made Squid a little bit more funny and realistic, because it dies now when it´s not in water -Escaping mobs run now faster than normal (They just walked away before :D) git-svn-id: http://mc-server.googlecode.com/svn/trunk@125 0a769ca7-a7f5-676a-18bf-c427514a06d6
* - Linux compatible fixes including updated makefilemtilden@gmail.com2011-12-261-4/+5
| | | | | | | | - 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-236/+3
| | | | | | 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-7/+0
| | | | 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-21/+31
| | | | | | | | | 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-4/+31
| | | | | | | | | | | | | 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
* Changed chunk generation so any surface sand with air underneath it will turn into sandstone to prevent most sand cave-ins due to odd cave placement.admin@omencraft.com2011-11-151-12/+37
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@93 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Fixed doors. I forgot to actually return proper Hex value. Started work on adding farmland, farming, and leaf decay support.admin@omencraft.com2011-11-101-0/+5
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@86 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Redstone clocks now work. even one clocks. torches don't update themselves when placed yet, but redstone wire updates the torch. Fixed a bug with piston animations.admin@omencraft.com2011-11-091-4/+4
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@80 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Fixed bug in cChunk.cpp not calculating RedstoneCircuits at the correct positions. Also, forgot to mention you can now place colored wool.admin@omencraft.com2011-11-081-2/+2
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@75 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Updated redstone and pistons some mode. If you break an extended piston the piston extension will now also break. When a redstone device is broken by something other than a person the redstone circuit should now update.admin@omencraft.com2011-11-071-4/+21
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@74 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Patch with diff file created by Sebi (implemented some stuff like lava physics, drops are deleted when in lava, water is now slower, lava gives actual damage etc.). Pistons now work mostly as they should. They do not yet show the motion animation and do not emit sound. They do extend, push, and retract as they should though. Right now the only way to activate a piston is to light redstone wire adjacent to it with a redstone torch.admin@omencraft.com2011-11-061-10/+10
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@67 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Change SetBlock to FastSetBlock in cRedstone.cpp and grass will now grow if any one hit block is above it.admin@omencraft.com2011-11-051-6/+11
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@65 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Fixed some "Entity was not found in any chunk!" warningsfaketruth2011-11-021-10/+18
| | | | | | | Player's current world is saved in the player file. When a player joins the server, the player joins the last world he was in. It seems MCServer can finally run multiple worlds! It just needs functionality to switch between them git-svn-id: http://mc-server.googlecode.com/svn/trunk@46 0a769ca7-a7f5-676a-18bf-c427514a06d6
* fixed player spawning in the ground.admin@omencraft.com2011-11-011-1/+1
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@42 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Prepared some parts of the code for multi world support, I created lots of TODO'sfaketruth2011-10-311-33/+32
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@29 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Using SSE instructions for noise (terrain generation)faketruth2011-10-251-9/+9
| | | | | | Unfortunately the noise functions is only like 7% faster, so you won't even notice git-svn-id: http://mc-server.googlecode.com/svn/trunk@9 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Compiles for linuxfaketruth2011-10-211-6/+9
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@6 0a769ca7-a7f5-676a-18bf-c427514a06d6
* MCServer c++ source filesfaketruth2011-10-031-0/+1388
git-svn-id: http://mc-server.googlecode.com/svn/trunk@3 0a769ca7-a7f5-676a-18bf-c427514a06d6