I've wanted to be able to run the Tethealla server on Linux since I found it many years ago. At the time I did manage to get it working with a slight modification to the source and using Wine. This however gets annoying if you're primarily a Linux user and have to boot into Windows anytime you want to make a change to the code. So after a few attempts, I've finally got the code building and running natively in Linux.
The source for the buildable Linux version is here https://gitlab.com/theodis3/tethealla
This is meant to be a drop in replacement for the current Tethealla server, as in you can copy an existing Windows install onto a Linux system, replace the binaries and it'll work identically to before, and can do so in a very minimal lightweight environment.
As such the installation process is virtually identical as the one found here https://www.pioneer2.net/community/threads/tethealla-server-setup-instructions.1/ and you'll need the data files that are part of the login and ship server downloads. Just replace the exes with the compiled binaries from the sources from my repo.
I haven't uploaded binaries anywhere yet, so if you want to use it you'll need to build your own from source. If anyone would like to build and distribute binaries of this or package it up for a distro, feel free to do so.
My version can be built as either 32 bit or 64 bit binaries using either gcc or clang. While porting the code I've used gcc 8.2 and clang 7.0, but I suspect older versions should work as well as I haven't used any C features beyond what's in C99.
Depending on your specific requirements you may want to make some modifications to these lines of the Makefile. Depending on the compiler you want to use, change the CC= line to either
The source for the buildable Linux version is here https://gitlab.com/theodis3/tethealla
This is meant to be a drop in replacement for the current Tethealla server, as in you can copy an existing Windows install onto a Linux system, replace the binaries and it'll work identically to before, and can do so in a very minimal lightweight environment.
As such the installation process is virtually identical as the one found here https://www.pioneer2.net/community/threads/tethealla-server-setup-instructions.1/ and you'll need the data files that are part of the login and ship server downloads. Just replace the exes with the compiled binaries from the sources from my repo.
I haven't uploaded binaries anywhere yet, so if you want to use it you'll need to build your own from source. If anyone would like to build and distribute binaries of this or package it up for a distro, feel free to do so.
My version can be built as either 32 bit or 64 bit binaries using either gcc or clang. While porting the code I've used gcc 8.2 and clang 7.0, but I suspect older versions should work as well as I haven't used any C features beyond what's in C99.
Depending on your specific requirements you may want to make some modifications to these lines of the Makefile. Depending on the compiler you want to use, change the CC= line to either
- CC=gcc
- CC=clang
- If you want to build a 32 bit version, add -m32
- If you want to compile a binary and use it on another machine remove -march=native , this option enables CPU specific optimizations that may not be available on machines other than the one you've build the binary on. If the binary will be run on the same machine as it's compiled on you'll probably want to leave it on for the performance boost.
- If you're using GCC as the compiler you'll need to remove -O3 for now. The O3 flag enables aggressive optimizations, which at the moment cause buffer overflow crashes when building with GCC.
- I've made the programs purely console programs, there is absolutely no dependency on X, so stuff like the system tray icon is gone.
- I've removed all "Press [Enter]" prompts before exiting after an error.
- The old MD5 code was thrown out in favor of just using OpenSSL's MD5 implementation. The old code was not working in 64 bit and with it removed there is less to maintain.
- I've removed the mtwist library as I couldn't get it working and am just using the standard rand() function now
- I'd like to figure out why -O3 isn't working for gcc. Since it happens when someone connects on any of the servers I suspect it has something to do with how connections are handled. Hopefully I'll get this fixed.
- I'd like to get the server running on ARM. I haven't tested yet so it may already work, but if it doesn't I'd like to. I think it'd be kinda cool to have a tiny PSOBB server I could carry around with me. The requirements are very minimal so it should be doable on very cheap hardware.
- Replace rand() with a fancier random number library. When looking up mtwist it appears it's not maintained anymore. It would be nice to get it replace something that is actively maintained.