1
0
Commit Graph

80 Commits

Author SHA1 Message Date
madmaxoft@gmail.com
66f4c9e0c0 Cut out all packet handling to a separate cProtocol descendant
git-svn-id: http://mc-server.googlecode.com/svn/trunk@796 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-27 17:31:16 +00:00
madmaxoft@gmail.com
d97ad781b4 git-svn-id: http://mc-server.googlecode.com/svn/trunk@795 0a769ca7-a7f5-676a-18bf-c427514a06d6 2012-08-26 21:01:07 +00:00
madmaxoft@gmail.com
7157ebc061 cWorld doesn't use cPackets.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@789 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-25 21:46:18 +00:00
madmaxoft@gmail.com
f0fc0edd21 cPickup doesn't use cPackets.
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
2012-08-24 09:49:00 +00:00
madmaxoft@gmail.com
e92b9e7ecb Monster classes don't use cPackets. Chat messages are sent / broadcast without cPackets. BlockEntities don't use cPackets.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@783 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-24 07:58:26 +00:00
madmaxoft@gmail.com
674fe1e955 Window, Chest, Furnace and Pawn are not using cPackets at all
git-svn-id: http://mc-server.googlecode.com/svn/trunk@762 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-19 21:14:45 +00:00
madmaxoft@gmail.com
427e582d5f Almost all packets' handling is now rewritten not to use cPacket descendants elsewhere than in cClientHandle.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@761 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-19 19:42:32 +00:00
madmaxoft@gmail.com
eb3ed1aec1 Another handful of packets rewritten.
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
2012-08-19 11:51:17 +00:00
madmaxoft@gmail.com
e8366993ce A bit of cleanup and documentation around the UI window handling
git-svn-id: http://mc-server.googlecode.com/svn/trunk@716 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-06 20:10:16 +00:00
madmaxoft@gmail.com
2a72c5c838 Fixed a few gcc pedantic warnings; made BLOCKTYPE an unsigned char type.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@711 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-03 11:53:11 +00:00
madmaxoft@gmail.com
b587a7f3a5 Temporary jungle trees (swamp-like), based on code by STR_Warrior). Also vines don't overwrite leaves anymore.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@646 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-07-02 19:54:47 +00:00
madmaxoft@gmail.com
bf13084f1f cBlockArea object added (with only minimal testing so far)
git-svn-id: http://mc-server.googlecode.com/svn/trunk@641 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-07-02 16:30:17 +00:00
madmaxoft@gmail.com
e5fdc133bc Removed the deprecated GetBlockEntity(), added several enumerators to replace it.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@629 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-17 19:58:39 +00:00
madmaxoft@gmail.com
ada984facf Exported cWorld::ForEachEntity and cWorld::ForEachEntityInChunk; no idea if they actually work
git-svn-id: http://mc-server.googlecode.com/svn/trunk@620 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-16 08:35:07 +00:00
cedeel@gmail.com
92c59963f8 Attempt to bring sanity to newlines across systems.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@606 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-14 13:06:06 +00:00
madmaxoft@gmail.com
ec61713221 Cacti grow by themselves and by bonemeal
git-svn-id: http://mc-server.googlecode.com/svn/trunk@583 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-09 12:03:49 +00:00
madmaxoft@gmail.com
6d36a82e19 Sugarcane grows and can be grown using bonemeal.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@578 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-08 14:17:33 +00:00
madmaxoft@gmail.com
876014b8e8 Bonemeal works on crops, melons, pumpkins, saplings and grass. Plant growing has been refactored into separate functions callable from Lua, too.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@573 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-07 21:07:21 +00:00
madmaxoft@gmail.com
c0a73ef89d Repeaters' delays can be set by rclk
git-svn-id: http://mc-server.googlecode.com/svn/trunk@570 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-07 11:57:51 +00:00
madmaxoft@gmail.com
1cca9b13b3 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.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@561 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-06 20:18:50 +00:00
madmaxoft@gmail.com
7af3df03a0 Added support for SetNextBlockTick() function callable from Lua
git-svn-id: http://mc-server.googlecode.com/svn/trunk@527 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-05-30 21:29:51 +00:00
madmaxoft@gmail.com
9d6a5b9ce0 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.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@518 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-05-29 14:59:43 +00:00
madmaxoft@gmail.com
a4a418a679 Merged the composable_generator branch into the trunk
git-svn-id: http://mc-server.googlecode.com/svn/trunk@504 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-05-25 07:18:52 +00:00
madmaxoft@gmail.com
c51a4b9469 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!
git-svn-id: http://mc-server.googlecode.com/svn/trunk@454 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-04-10 11:22:11 +00:00
madmaxoft@gmail.com
389062a1ed Fixed a deadlock by removing clients from all chunks upon their exit, not using the clients chunklists.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@426 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-22 15:53:40 +00:00
faketruth
445d31acc9 That didn't work.. I forgot some cChunk functions were changed. Now it should compile again
git-svn-id: http://mc-server.googlecode.com/svn/trunk@417 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-16 15:52:26 +00:00
faketruth
38b219de62 Exposed a function to Lua to get a block's sky light value
git-svn-id: http://mc-server.googlecode.com/svn/trunk@416 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-16 15:48:40 +00:00
madmaxoft@gmail.com
b974b1ea59 Unified the chunk data to use the BLOCKDATA datatype.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@413 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-14 21:21:03 +00:00
madmaxoft@gmail.com
0b24efeb00 Split chunk data into separate arrays; decoupled most sources from cChunk.h dependency
git-svn-id: http://mc-server.googlecode.com/svn/trunk@411 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-14 20:56:09 +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
madmaxoft@gmail.com
0f88ed7c72 Linux compilation fix (y u no support const_iterator, gcc?)
git-svn-id: http://mc-server.googlecode.com/svn/trunk@338 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-28 12:37:46 +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
230f98a774 Implemented synchronous chunk loading; optimized cChunkStay interface for speed (though still unused ;)
git-svn-id: http://mc-server.googlecode.com/svn/trunk@336 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-28 10:45:53 +00:00
madmaxoft@gmail.com
2c9198b208 Const-correctness for packet broadcasting (fixes GCC compilation)
git-svn-id: http://mc-server.googlecode.com/svn/trunk@333 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-28 08:10:51 +00:00
madmaxoft@gmail.com
dee0a12029 Fix for the perpetual load issue
git-svn-id: http://mc-server.googlecode.com/svn/trunk@332 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-27 14:23:16 +00:00
madmaxoft@gmail.com
1f88db187b Implemented chunk loading without generating on load-failure
git-svn-id: http://mc-server.googlecode.com/svn/trunk@331 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-26 16:46:23 +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
9d3b837461 Made cChunkPtr a plain old pointer again, since it's safe now
git-svn-id: http://mc-server.googlecode.com/svn/trunk@324 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-23 21:02:38 +00:00
madmaxoft@gmail.com
1d1b0fd00d Fixed a potential deadlock in cChunkMap::m_CSLayers vs cWorld::m_CSAllEntities
git-svn-id: http://mc-server.googlecode.com/svn/trunk@313 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-22 15:45:00 +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
b4a68e58a9 Fixed block-getting so that simulators work again
git-svn-id: http://mc-server.googlecode.com/svn/trunk@301 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-21 12:29:05 +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
510133bd35 Chunk coords mostly "upgraded" to include the Y coord for future compatibility
git-svn-id: http://mc-server.googlecode.com/svn/trunk@285 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-17 17:56:25 +00:00