craftd / craftd Goto Github PK
View Code? Open in Web Editor NEWThis project forked from kev009/craftd
High performance and low overhead Minecraft server
Home Page: http://mc.kev009.com/craftd
License: Other
This project forked from kev009/craftd
High performance and low overhead Minecraft server
Home Page: http://mc.kev009.com/craftd
License: Other
Welcome to craftd! Up to date documentation lives at: http://mc.kev009.com/craftd/ Need help? Want to help? Come talk! irc.freenode.net #craftd. This is early, pre-alpha software. If you aren't familiar with autotools, please wait until binary packages are available. Dependencies: libevent 2.0.9+ - http://monkey.org/~provos/libevent/ zlib 1.2.3+ - http://zlib.net/ jansson 2.0+ - http://www.digip.org/jansson/ pthreads Successfully built on: Linux - GCC, LLVM/clang FreeBSD - GCC IRIX - MIPSpro (Big-Endian functionality verified) AIX - xlC, GCC (Big-Endian functionality verified) Windows - MinGW - Needs rework. Priority is getting basics working on UNIX. Windows - Cygwin (works great without modification) == Users == Ubuntu users can try to compile from the latest source tarball available from this server: http://bb.tkte.ch/job/craftd-ubuntu/ or use git to download from git://github.com/kev009/craftd.git. Keep in mind that this is bleeding edge and may not always be stable or usable. Ruby and Rake are the suggested way of building craftd, although a statically generated Makefile and configure script are shipped if you cannot/do not want to install Ruby and Rake. If you need to compile from the git repo, don't forget to run ./autogen.sh before heading into configuration/compilation. Once you have the source prepared you can run rake install OR ./configure, make, and make install. By default, the server binary is located at /usr/local/bin/craftd. At the moment craftd does not generate world data for a new server. You will need to provide world data from another server to start. == Developers == Please contact me and let me know what parts you intend to work on first. NOTE: You must run ./autogen.sh after checking out the git repo to generate a configure script and pull the submodules. Use `git pull` for being up to date. Should you run into build issues, try running `make distclean` and see if it helps. Developer Documentation: Coding style and architecture notes are on the wiki - http://mc.kev009.com/wiki/Craftd:Main_Page You should have a good understanding of libevent-2. http://www.wangafu.net/~nickm/libevent-book/ http://mc.kev009.com/libevent - Up to date doxygen Bundled Libs: bstring - Safer C strings - http://bstring.sourceforge.net/ klib - a standalone and lightweight C library Protocol reference: http://mc.kev009.com/wiki/ Continuous Integration Builds; http://bb.tkte.ch/job/craftd-ubuntu/ Also recommended books: * Advanced Programming in the UNIX Environment - Stevens, et. al * Programming with POSIX Threads - Butenhof * UNIX Network Programming, Vol. 1 - Stevens, et. al * A download of POSIX.1-2008 - http://www.unix.org/2008edition/
Crash backtrace:
0x000000000041be4c in CD_HashLength (self=0x642f90) at src/Hash.c:83
83 result = kh_size(self->raw);
(gdb) bt
#0 0x000000000041be4c in CD_HashLength (self=0x642f90) at src/Hash.c:83
#1 0x000000000040ff1d in SV_WorldBroadcastBuffer (self=0x643060, buffer=0x7fffec0049c0) at src/protocols/survival/World.c:193
#2 0x00000000004100c9 in SV_WorldBroadcastPacket (self=0x643060, packet=0x7ffff3f21c50) at src/protocols/survival/World.c:211
#3 0x0000000000410146 in SV_WorldBroadcastMessage (self=0x643060, message=0x7fffec000950) at src/protocols/survival/World.c:229
#4 0x00007ffff2b162e6 in cdsurvival_PlayerLogout (server=0x637070, player=0x64aba0) at plugins/survival/base/callbacks.c:728
#5 0x00007ffff2b1670d in cdsurvival_ClientDisconnect (server=0x637070, client=0x649520, status=false) at plugins/survival/base/callbacks.c:770
#6 0x0000000000414a2c in CD_RunWorker (self=0x6392c0) at src/Worker.c:187
#7 0x00007ffff7bc7c1a in start_thread () from /lib64/libpthread.so.0
#8 0x00007ffff674e6ed in clone () from /lib64/libc.so.6
Deadlock backtrace:
Thread 4 (Thread 0x7ffff3721700 (LWP 18470)):
#0 0x00007ffff674ed43 in epoll_wait () from /lib64/libc.so.6
#1 0x00007ffff778f55e in epoll_dispatch () from /usr/lib64/libevent-2.0.so.5
#2 0x00007ffff7781d06 in event_base_loop () from /usr/lib64/libevent-2.0.so.5
#3 0x000000000040b28f in CD_RunTimeLoop (self=0x637220) at src/TimeLoop.c:83
#4 0x00007ffff7bc7c1a in start_thread () from /lib64/libpthread.so.0
#5 0x00007ffff674e6ed in clone () from /lib64/libc.so.6
Thread 3 (Thread 0x7ffff3f22700 (LWP 18469)):
#0 0x00007ffff7bcf064 in __lll_lock_wait () from /lib64/libpthread.so.0
#1 0x00007ffff7bcbac4 in pthread_rwlock_rdlock () from /lib64/libpthread.so.0
#2 0x000000000041be45 in CD_HashLength (self=0x642f90) at src/Hash.c:82
#3 0x000000000040ff1d in SV_WorldBroadcastBuffer (self=0x643060, buffer=0x642660) at src/protocols/survival/World.c:193
#4 0x00000000004100c9 in SV_WorldBroadcastPacket (self=0x643060, packet=0x7ffff3f21c50) at src/protocols/survival/World.c:211
#5 0x0000000000410146 in SV_WorldBroadcastMessage (self=0x643060, message=0x64a5f0) at src/protocols/survival/World.c:229
#6 0x00007ffff2b162e6 in cdsurvival_PlayerLogout (server=0x637070, player=0x64aba0) at plugins/survival/base/callbacks.c:728
#7 0x00007ffff2b1670d in cdsurvival_ClientDisconnect (server=0x637070, client=0x649520, status=false) at plugins/survival/base/callbacks.c:770
#8 0x0000000000414a2c in CD_RunWorker (self=0x6392c0) at src/Worker.c:187
#9 0x00007ffff7bc7c1a in start_thread () from /lib64/libpthread.so.0
#10 0x00007ffff674e6ed in clone () from /lib64/libc.so.6
Thread 1 (Thread 0x7ffff7fcb720 (LWP 18451)):
#0 0x00007ffff671e2ed in nanosleep () from /lib64/libc.so.6
#1 0x00007ffff6748754 in usleep () from /lib64/libc.so.6
#2 0x0000000000415116 in CD_StopWorker (self=0x6392c0) at src/Worker.c:221
#3 0x00000000004203a6 in CD_StopWorkers (self=0x637da0) at src/Workers.c:85
#4 0x000000000041712f in CD_StopServer (self=0x637070) at src/Server.c:418
#5 0x0000000000415220 in cd_HandleSignal (fd=2, what=8, self=0x637070) at src/Server.c:39
#6 0x00007ffff7781e8b in event_base_loop () from /usr/lib64/libevent-2.0.so.5
#7 0x0000000000416eae in CD_RunServer (self=0x637070) at src/Server.c:397
#8 0x000000000041cd90 in main (argc=3, argv=0x7fffffffdf28) at src/craftd.c:129
The problem is clearly with the broadcast message of "player left" and that player being the last one, guess the fix has to be done on the various SV_WorldBroadcast*, because they're doing something wrong :)
Move some of the functions around in the survival plugin so that the callbacks.c file isn't so darn messy...
JavaScript should be the default scripting language.
Use curses to implement an optionally built JSON-API admin console client.
Will use same libs as server - evhttp for requests, libjansson for JSON. A scripting language is also acceptable (python, ruby).
I'm working on the survival admin and chat plugin now. The end goal is to at least have chat and a few basic commands implemented.
Apparently with Minecraft 1.5 string encoding changed, we now have 2 different encodings: the minecraft modified UTF-8 and UCS-2.
Some packets work with UCS-2 and others work with UTF-8.
What has to be done is add a second Buffer(Remove|Add) for UCS-2 strings and do an UCS-2 โ UTF-8 and UTF-8 โ UCS-2 so we can keep things sane.
If nobody takes it I'll do it this weekend.
We have to separate each part of the mapgen into their own plugins.
For example: mapgen.hills, mapgen.caves, mapgen.whatever.
We need to think about a way to commonly set/get configurations of server elements so that the RPC plugins just have to convert their data to this common protocol.
The digging/implementing behaviour of minecraft needs to be implemented so that the map can be sculpted by the user.
Lighting, liquids, tree grow and various stuff have to be implemented in a physics namespace.
The actual implemented parts are buggy, we're using ECL, I'll work on this if I get it working with threads, in the meantime I'll focus on JS.
Trace from sheenobu:
Thread 3 (Thread 0x7ffff59d4700 (LWP 17570)):
#0 0x0000000000412733 in cd_UTF8_nextCharLength (data=0x649ee0 "craftd> sheenobu\020\226c tried handshake", limit=35) at src/String.c:53
#1 CD_UTF8_strnlen (data=0x649ee0 "craftd> sheenobu\020\226c tried handshake", limit=35) at src/String.c:89
#2 0x00000000004127ef in cd_UpdateLength (self=0x641440) at src/String.c:114
#3 0x0000000000412e74 in CD_CreateStringFromFormatList (format=0x7ffff45ce3d0 "%s> %s tried handshake", ap=0x7ffff59d3c20) at src/String.c:224
#4 0x0000000000413c6f in cd_ConsoleLog (priority=, format=0x649ee0 "craftd> sheenobu\020\226c tried handshake") at src/ConsoleLogger.c:49
#5 0x00007ffff45ccf97 in cdsurvival_ClientProcess (server=0x623070, client=0x634440, packet=0x63a420) at plugins/survival/base/callbacks.c:551
#6 0x00000000004106e5 in CD_RunWorker (self=0x625350) at src/Worker.c:153
#7 0x00007ffff7bc9d40 in start_thread () from /lib/libpthread.so.0
#8 0x00007ffff6935aed in clone () from /lib/libc.so.6
#9 0x0000000000000000 in ?? ()
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.