(made by Vietexa)
This is a simple yet versatile HTTP and HTTPS server specifically designed to aid you in hosting your GrowTopia Private Server by providing these features:
[x] Main server router: Routes the people who access the "/growtopia/server_data.php" handle to your main server by providing routing data (which the GrowTopia client later on uses to connect to the actual game server) Way of access: over HTTP by sending a POST request.
[x] Static file server: Allows you to serve the files that you specify in the items.dat to the people who connect by putting them inside the "cache" folder/directory. The access path is "/cache/". Way of access: over HTTP by sending a GET request.
[x] New login system handler: Sends the people who connect to your server the markup data of the login prompt. You can configure the login dashboard/prompt by editing the "dashboard.txt" file (which can be found inside the current directory). Way of access: over HTTPS by sending a GET request. The access path of the dashboard is: /player/login/dashboard.
Together with the dashboard there is also the validation path/login handler (the path that tells the people who connect that the login part is over and lets the people enter the server). Way of access: Over HTTPS by sending a GET request. The access path of the login handler is: /player/growid/login/validate
Note: You need to add the logic and functionality for handling the actual login system (/player/growid/login/validate) yourself. If you don't want to handle the login system using the login dashboard/prompt and the login handler you can simply:
-
Create a markup file that gets sent when someone accesses the /player/login/dashboard and that has a button that when pressed it redirects you to the "/player/growid/login/validate" handle.
-
Make the handle send a response with the validation message that the GrowTopia client requires to finish the login part.
You need to install OpenSSL via your package manager and build the source files:
For example, if you use Arch Linux, you can do it by using these commands:
# pacman -Syu (update the repositories)
# pacman -S openssl (install OpenSSL)
$ g++ main.cpp dependencies/httplib.h -o server -lssl -lcrypto (build the source files)
(The project is compatible with Windows as well, building it is a little bit more of a pain)
- You need to download OpenSSL together with the DLL files (openssl.dll and libcrypto.dll)
- You need to build the source files
Building the source files depends on what IDE/solution you are using.
If you use VS 2022, you need to link OpenSSL and Libcrypto and you can do that using the GUI of the IDE.
I can't really give you the steps for Linking OpenSSL and adding it as a dependency as I am not aware of how to do it (I'm a GNU/Linux user). You need to search that up yourself, there probably are some guides on how to do that. From what I remember, having to add OpenSSL as a dependency on Windows is quite a pain.