Coder Social home page Coder Social logo

craftd / craftd Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kev009/craftd

28.0 3.0 6.0 2.37 MB

High performance and low overhead Minecraft server

Home Page: http://mc.kev009.com/craftd

License: Other

C 61.27% C++ 6.49% Ruby 0.29% Shell 0.19% JavaScript 31.41% Common Lisp 0.34%

craftd's Introduction

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/

craftd's People

Contributors

alyawn avatar ayan4m1 avatar dotblank avatar jbergstroem avatar kev009 avatar meh avatar youx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

craftd's Issues

Crashes/deadlocks on server quit when someone is logged in.

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 :)

Implement console curses JSON-API admin client

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).

Re-adding admin and chat...

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.

Port to new string encoding.

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.

UCS2 string handshake corruption/deadlock

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 ?? ()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.