1
0
Commit Graph

119 Commits

Author SHA1 Message Date
faketruth
e5b91a8d97 Was using "#else if" which is not valid apparently, now using "#elif"
git-svn-id: http://mc-server.googlecode.com/svn/trunk@391 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-10 13:49:40 +00:00
faketruth
68f3ea56bd You can change axis ordering by setting AXIS_ORDER to AXIS_ORDER_XZY in cChunk.h !THIS WILL SCREW UP YOUR WORLDS THOUGH!
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
2012-03-10 02:39:36 +00:00
faketruth
62ba8f5a20 Using more of the index functions in cChunk, so it should be easy enough to flip the axis ordering now
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
2012-03-10 00:25:05 +00:00
faketruth
f43b65cf53 cClientHandles have a unique ID now to distinguish them
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-09 13:42:28 +00:00
madmaxoft@gmail.com
4d65ffffc0 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 :)
git-svn-id: http://mc-server.googlecode.com/svn/trunk@365 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-05 16:41:57 +00:00
faketruth
f1f762c4fa The world can now truly be made higher by incrementing cChunk::c_ChunkHeight to 256. !!HOWEVER THIS WILL DESTROY YOUR SAVED WORLD!!
git-svn-id: http://mc-server.googlecode.com/svn/trunk@357 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-04 14:09:35 +00:00
faketruth
fb7c60ec11 Changed signed char to unsigned char in block packets, so we can receive height up to 255
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
2012-03-04 13:54:33 +00:00
faketruth
ad89cf88ba Got rid of some hardcoded numbers, now using hardcoded variables! woo
git-svn-id: http://mc-server.googlecode.com/svn/trunk@355 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-03 20:55:16 +00:00
faketruth
eceead8394 Finally got the multiblock packet working! It seems the byte order was wrong
git-svn-id: http://mc-server.googlecode.com/svn/trunk@352 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-02 13:41:42 +00:00
faketruth
4dda2a5c2b MultiBlock packet is working partly.. I really don't understand what's wrong with this packet :/
git-svn-id: http://mc-server.googlecode.com/svn/trunk@351 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-02 01:22:06 +00:00
faketruth
867fc8ee0d New redstone simulator. Should work without crashes!
git-svn-id: http://mc-server.googlecode.com/svn/trunk@345 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-01 15:18:59 +00:00
faketruth
ac117959d3 Server uses ~40% less CPU now
git-svn-id: http://mc-server.googlecode.com/svn/trunk@339 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-28 14:22:03 +00:00
madmaxoft@gmail.com
013ae71c87 Chunk now has an indicator of load failure; Chunk generator uses cChunkStay
git-svn-id: http://mc-server.googlecode.com/svn/trunk@337 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-28 12:11:14 +00:00
madmaxoft@gmail.com
b902546863 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.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@330 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-26 16:15:09 +00:00
madmaxoft@gmail.com
062b38b8b0 Plain pointer cChunkPtr finishing touches; removed cChunk's critical sections
git-svn-id: http://mc-server.googlecode.com/svn/trunk@325 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-23 21:21:37 +00:00
madmaxoft@gmail.com
8f85b9c625 cChunk: removed unused code
git-svn-id: http://mc-server.googlecode.com/svn/trunk@323 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-23 11:38:10 +00:00
faketruth
3ca9b52ab2 Added some asserts to trace a bug
git-svn-id: http://mc-server.googlecode.com/svn/trunk@319 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-22 20:33:33 +00:00
madmaxoft@gmail.com
b653e6a012 Removed cChunkPtrs from everywhere but internal cChunkMap usage. Now we should finally be threadsafe :)
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
2012-02-21 16:27:30 +00:00
madmaxoft@gmail.com
f0145ee9fa Fixed heightmap optimization from rev 302; removed a few more cChunkPtrs
git-svn-id: http://mc-server.googlecode.com/svn/trunk@303 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-21 15:18:02 +00:00
madmaxoft@gmail.com
da4afc0cf3 Optimized hightmap recalc when setting a chunk's block
git-svn-id: http://mc-server.googlecode.com/svn/trunk@302 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-21 13:44:06 +00:00
madmaxoft@gmail.com
d592882fe0 Removed some more cChunkPtr usage
git-svn-id: http://mc-server.googlecode.com/svn/trunk@298 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-20 16:39:00 +00:00
faketruth
0b616909e3 Using own ASSERT() that logs to file
git-svn-id: http://mc-server.googlecode.com/svn/trunk@297 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-19 23:00:00 +00:00
madmaxoft@gmail.com
3a8d2aa421 Substantial cWorld::FastSetBlock() speed up by queueing all such calls and processing them later chunk-wise (makes growing trees in the generator fast again)
git-svn-id: http://mc-server.googlecode.com/svn/trunk@295 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-18 20:10:57 +00:00
madmaxoft@gmail.com
76a92a21d1 Re-implemented tree-growing. May produce artefacts on old-world / new-world boundaries.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@293 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-18 19:18:16 +00:00
madmaxoft@gmail.com
499745c1c7 Thread-safe chunk generation, storage and generator are queried for progress while initializing server
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
2012-02-18 17:53:22 +00:00
madmaxoft@gmail.com
2928cb6853 cWorldGenerator speedup - doesn't call GetChunk() anymore, not queueing the chunk it's generating to be loaded recursively.
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
2012-02-16 17:45:26 +00:00
madmaxoft@gmail.com
44a6fd20c4 Marking chunk dirty after generating
git-svn-id: http://mc-server.googlecode.com/svn/trunk@276 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-16 15:53:52 +00:00
faketruth
bb396c8cc0 Heightmap is properly generated after loading chunks now, so /spawn and /top should work properly again
git-svn-id: http://mc-server.googlecode.com/svn/trunk@274 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-16 15:40:38 +00:00
madmaxoft@gmail.com
423f49d175 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 properly
git-svn-id: http://mc-server.googlecode.com/svn/trunk@273 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-16 13:42:35 +00:00
madmaxoft@gmail.com
1aebcea095 Restored chest and furnace functionality as it was (it's basically working but joined chests show single-chest window)
git-svn-id: http://mc-server.googlecode.com/svn/trunk@263 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-15 14:22:44 +00:00
madmaxoft@gmail.com
4f17362aeb 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.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@251 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-13 21:47:03 +00:00
madmaxoft@gmail.com
10752d2f35 Removed unused code
git-svn-id: http://mc-server.googlecode.com/svn/trunk@249 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-08 19:49:57 +00:00
madmaxoft@gmail.com
32880153ab MTRand class is not created in each tick, therefore much improving tick-thread time (now uses ~5 % CPU instead of one full core)
git-svn-id: http://mc-server.googlecode.com/svn/trunk@245 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-08 12:36:54 +00:00
madmaxoft@gmail.com
48d30d6ab4 Rewritten cAuthenticator to make use of the new cIsThread architecture - now authentication runs in a single separate thread for all clients;
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
2012-02-01 22:38:03 +00:00
madmaxoft@gmail.com
ef196ec22f AString logging fix
git-svn-id: http://mc-server.googlecode.com/svn/trunk@217 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-01 13:50:09 +00:00
madmaxoft@gmail.com
2568bad3cc sprintf() begone! Replaced with StringUtils' Printf()
git-svn-id: http://mc-server.googlecode.com/svn/trunk@216 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-01 13:43:47 +00:00
madmaxoft@gmail.com
d3614be2e0 Removed a few duplicate includes
git-svn-id: http://mc-server.googlecode.com/svn/trunk@215 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-01 12:46:44 +00:00
madmaxoft@gmail.com
b834841aa1 Fixed a problem in cCSLock (sorry); reverted cChunk
git-svn-id: http://mc-server.googlecode.com/svn/trunk@195 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-01-30 21:54:40 +00:00
faketruth
9dfa0f1f15 Added a WebAdmin interface to view users their groups, and the permissions of groups.
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
2012-01-30 16:47:26 +00:00
madmaxoft@gmail.com
51dc47bc70 More cFile cleanup; removed old format writing for block entities
git-svn-id: http://mc-server.googlecode.com/svn/trunk@193 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-01-30 16:01:45 +00:00
madmaxoft@gmail.com
89afb970d8 VC2008 / VC2010: Enabled precompiled header through Globals.h; the header included in every module in the project. Compilation optimization.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@188 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-01-29 19:28:19 +00:00
faketruth
4e34e438f1 Working on a new plugin design with Lua. While retaining backwards compatibility of course...
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
2012-01-26 20:39:46 +00:00
faketruth
d8fa9c15d7 Probably fixed a deadlock! http://www.mc-server.org/support/index.php?do=details&task_id=147
git-svn-id: http://mc-server.googlecode.com/svn/trunk@171 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-01-26 13:13:44 +00:00
faketruth
ce11c6b2bd Cactus towers can be destroyed by removing the bottom block
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
2012-01-23 15:11:45 +00:00
faketruth
50a7722242 Terrain generation is synchronous again, async generation has bugs.
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
2012-01-19 18:12:39 +00:00
faketruth
01398f8424 Fixed the numchunks console command.
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
2012-01-01 16:20:52 +00:00
faketruth
9af5ed43fd Made a couple of functions in cChunk inline, this should speed up several block operations on chunks
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
2011-12-31 21:08:23 +00:00
faketruth
9e4184ca8d This bug should be fixed now http://mc-server.org/support/index.php?do=details&task_id=112
git-svn-id: http://mc-server.googlecode.com/svn/trunk@145 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-28 14:52:31 +00:00
faketruth
0d8ecbeca1 Some kind of 'template' world generator that right now just generates an all dirt world. You can use this to test new algorithms
git-svn-id: http://mc-server.googlecode.com/svn/trunk@127 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-26 23:23:05 +00:00
faketruth
eb942797b8 Players can switch worlds on the fly with the command /gotoworld [worldName]. This uses the function cPlayer::MoveToWorld()
Changed isValidItem to IsValidItem in Core.lua

git-svn-id: http://mc-server.googlecode.com/svn/trunk@126 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-26 21:54:08 +00:00
lapayo94@gmail.com
9f77572fb0 - improved Simulator system
-> 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
2011-12-26 20:57:12 +00:00
mtilden@gmail.com
c7fa610be3 - Linux compatible fixes including updated makefile
- 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
2011-12-26 09:09:47 +00:00
faketruth
537e1afcb1 Moved the actual world generation from cChunk.cpp to a more isolated file cWorldGenerator.cpp
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
2011-12-26 02:39:43 +00:00
faketruth
c35db25269 Made some functions in cChunk and cNoise inline, this should significantly increase chunk generation speed
git-svn-id: http://mc-server.googlecode.com/svn/trunk@115 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-26 02:13:40 +00:00
faketruth
2892a844d4 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 :O
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
2011-12-24 23:34:30 +00:00
lapayo94@gmail.com
24efa6f864 Digging leaves with shears now drops leaves
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
2011-12-22 21:36:24 +00:00
admin@omencraft.com
3ea286fef8 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.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@93 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-15 00:39:01 +00:00
admin@omencraft.com
581165bb58 Fixed doors. I forgot to actually return proper Hex value. Started work on adding farmland, farming, and leaf decay support.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@86 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-10 03:35:46 +00:00
admin@omencraft.com
744c0187ba 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.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@80 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-09 01:31:19 +00:00
admin@omencraft.com
0c3eda9b17 Fixed bug in cChunk.cpp not calculating RedstoneCircuits at the correct positions. Also, forgot to mention you can now place colored wool.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@75 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-07 23:09:03 +00:00
admin@omencraft.com
a9e02cf8fa 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.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@74 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-07 22:59:29 +00:00
admin@omencraft.com
36f7084e3f 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.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@67 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-06 09:23:20 +00:00
admin@omencraft.com
7fe70356b9 Change SetBlock to FastSetBlock in cRedstone.cpp and grass will now grow if any one hit block is above it.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@65 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-05 19:31:25 +00:00
faketruth
dada2bea27 Fixed some "Entity was not found in any chunk!" warnings
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
2011-11-02 20:19:57 +00:00
admin@omencraft.com
bf2806dcb8 fixed player spawning in the ground.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@42 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-01 22:27:09 +00:00
faketruth
e2f1cf51c7 Prepared some parts of the code for multi world support, I created lots of TODO's
git-svn-id: http://mc-server.googlecode.com/svn/trunk@29 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-10-31 00:52:20 +00:00
faketruth
625c30d8bd Using SSE instructions for noise (terrain generation)
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
2011-10-25 18:57:38 +00:00
faketruth
c7b4b9f819 Compiles for linux
git-svn-id: http://mc-server.googlecode.com/svn/trunk@6 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-10-21 21:25:29 +00:00
faketruth
386d58b586 MCServer c++ source files
git-svn-id: http://mc-server.googlecode.com/svn/trunk@3 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-10-03 18:41:19 +00:00