Hello Boys and Gals
I decided to do a experiment project, on with how minimal $ input, I could make a decent
(by decent, I mean, players wouldn't want to delete the game client after 15 minutes playing)
Ragnarok Online server and Comunity
I will write it all in the Dev's Diary Format (Every entyr will follow standart : Day X : doing stuff [What I've done])
Day 1: First steps
First of all, I needed a server software. After reading few reviews, I considered Hercules as my server software, mainly for it's hardware resources management.
Then, I needed hardware. Since this is minimal $ input, I have compiled it and configured it to run on my RaspberryPi 3, which runs already a webserver, OwnCloud.
It has an UPS made out of a PowerBank (for those who are curious http://raspi-ups.appspot.com/en/index.jsp)
Not and option for you ?
- You can spend 150-200$ for a year of VPS
- Or, you could dustoff that Intel Core 2 duo that sits in your closet (im sure, for many of you, it does), it will run a server just fine...
Need to configure a home network (its actually really easy)
all I needed to do is give my server machine
- a static ip (good business practice)
- To that static IP, I needed to forward ports 3 ragnarok ports, 80/443 (80 if Im planning to host a webserver aswell, 443 if Im planning to use SSL, you know that https:// link... will be explained later in the DevsDiary...)
I decided not to host a webserver for my Ragnarok Server Comunity.
If the game server is down, I want the web site still be available...
no problem go to Google and search for free web hosting, there are many of them just suit myself....
then I went to domain registrar (I used Godaddy) and look for a .com domain for my server
.com domain grants some credibility
When I have added my .com domain to the cart
I went to google and search "cupons domain [site where I buy my domain] (in my case its godaddy)"
I got a cupon code for first year registration of .com domain for 99cents
Now I needed a website... there is plenty of website designs on these forums
I liked : https://rathena.org/board/files/file/3012-erods-unfinished-web-template/
Mainly because it was already HTML, I didn't have to slice PSDs...
since, I just want a website with basic info
a little design and there you go
I've configured the DNS of my .com domain to the free webhosting
Now everyone can access my server Website from .com domain
So far I've spent 99cents on .com domain...
Day 2: Free Hosting Limitations
The Idea behind using a freehosting, is to keep site and comunity online during Game server downtime.
Sure free hostings limit possibilities. But Im designing a strategy to bypass those limitations in one way or another...
1) Free hostings do not allow open socket (used to check server status Online/Offline)
Its actually pretty easy to bypass
Free hostings offer Cron (Planified tasks)
So I will start writing API-like software to run on the webserver on same machine as RagnarokServer
Ragnariok server Machine Free Web Hosting
Web-API (like) <--------------------- Cron job every 5 minutes with CURL call to Server machine
does open socket on 127.0.0.1
returns Plain Text Or JSON (undecided yet)
111 (1 - map is on 1- login is on 1 - char is on) -------------------------> Builds static HTML file with styling and all that good stuff
(if no reply from GameServer, Server considered offline)
WebSite just includes that static HTML
file using AJAX
True, the status is not very accurate, it has 5 minutes update lag. but its fully functionnal, no matter what crazy Limitation my free web hosting impose....
Im also thinking to add a API key concept Much like KeyChain VPN token some company give you to work from home...
My strategy is never reveal what my database connection string is....
In case a Hacker gets a webshell on that free site the only thing he will see is the
WEB-API adress and API token generation algorithm and SALT.
Im also thinking to add logging to API so if API spam or bruting attemps detected, I would just change API token Algorithm...