[Dev's Diary] Minimal $ Ragnarok online server & comunity

Habilis

New member
Messages
225
Points
0
Age
36
Location
Montreal, Canada
IRC Nickname
Habilis
Emulator
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

aaaaaaaaaaaaa.png

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

 
Last edited by a moderator:
Day 3: More on Free Hosting Limitations

Apperantrly, the free webhosting doesn't allow cron or cronjobs to run as often as */5 (every 5 minutes)

Not a problem for me...

server is offline

off.jpg

server is online

on.jpg

First of all I wrote api-like controllers at my Ragnarok server machine's webserver

class api extends Controller
{
public function getServerStatus($statusPass)
{
$output="";
if($statusPass == "test1234")
{
$Status = $this->ServerStatus();
$output = $Status[0].";".$Status[1].";".$Status[2];
}
return $output;
}

private static function ServerStatus() {
$Srv_Host = "127.0.0.1";

// Login, Char, Map Server Port
$Srv_Login = 6900;
$Srv_Char = 6121;
$Srv_Map = 5121;

$Str_Online='1';
$Str_Offline='0';

// Disable Error Reporting (for this function)
error_reporting(0);

$Status = array();
$LoginServer = fsockopen($Srv_Host, $Srv_Login, $errno, $errstr, 1);
$CharServer = fsockopen($Srv_Host, $Srv_Char, $errno, $errstr, 1);
$MapServer = fsockopen($Srv_Host, $Srv_Map, $errno, $errstr, 1);
if(!$LoginServer){ $Status[0]= $Str_Offline; } else { $Status[0] = $Str_Online; };
if(!$CharServer){ $Status[1] = $Str_Offline; } else { $Status[1] = $Str_Online; };
if(!$MapServer){ $Status[2] = $Str_Offline; } else { $Status[2] = $Str_Online; };
return $Status;
}
}

simple enough queries ports on 127.0.0.1 and retruns 1;1;1 as plain text if all 3 servers are up...

On the Free webhosting site i wrote a CURL call 

<?php
function writeStatus()
{
// Disable Error Reporting (for this function)
error_reporting(0);
$statusHtmlFile="status/status.html";
$statusUpdateTime=5 * 60; // 5 minutes status update
$apiToken = "test1234"; // token is plain text for now


if((time()-filemtime($statusHtmlFile))>$statusUpdateTime)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://<serverIP or host>/api/serverstatus/".$apiToken);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 3); // 3 seconds timeout, no answer = server considered offline
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$result=curl_exec ($ch);
curl_close ($ch);

$Str_Online='<img src="web_img/online.png" />';
$Str_Offline='<img src="web_img/offline.png" />';
$Status = explode(";", $result);
$result="<b>Login</b> ".checkStatus($Status[0])."     <b>Char</b> ".checkStatus($Status[1])."     <b>Map</b> ".checkStatus($Status[2]);

$file = fopen($statusHtmlFile,"w");
fwrite($file,$result);
fclose($file);
}
}

function checkStatus($onoff)
{
$Str_Online='<img src="web_img/online.png" />';
$Str_Offline='<img src="web_img/offline.png" />';
return $onoff == 1 ? $Str_Online : $Str_Offline;
}
?>

It checks last update time of status.html file,  if it is more than 5 minutes it does a curl call to my Ragnarok machines webserver

writes status to the status.html file

status.html is ajax loaded on the main page...

 
day 360+X .... Alright, I decided to stop doing it this way.

I Will rethink my way of doing it

So far what I have

- .com domain name I bought for 0.99 $

- Hercules Emulator running on my Raspberry Pi 

- I'm using graphical content from downloads section to make loading screens and login screens, watermark etc.

- I'm using graphical content kindly provided by Daifuku, in the downloads section to create banners and web content

- I adjusted few plugins and scripts (Publicly available on hercules forum) to work with my server

  1. Poring count (Automatic event)
  2. Goblin invasion (Automatic event)
  3. Treasure box hunting (Automatic event)
  4. And many more which I downloaded but not integrated yet
And yes they all work as expected, and no I don't care if they are written by a monkey...

As users don't see the code, the only thing that matters is that they work as expected.

If they don't, I make them to.

- I have few licenses of responsive bootstrap themes, I bought them back in 2015.

http://webapplayers.com/homer_admin-v2.0/landing_page.html

I will use this one to create my website. (Soon screenshots will be available)

It is possible to use a free bootstrap theme, but since I already have that one I will use that one...

- To write BackEnd, I will use Laravel Framework.

- I will apply Let's Encrypt free SSL certificate so that my ro site would use https://

Wait for screenshots.

 
Last edited by a moderator:
This guide will show you how to ruin ragnarok online at all.
More 1day servers, please.

 
This guide will show you how to ruin ragnarok online at all.
More 1day servers, please.
My dear friend, this is not a guide.

Hence the [Dev's Diary] tag.

So, please don't be so upset!

I'm telling what I'm doing but I'm not going to show how to :

- Develop a RO server website with Laravel

- Use Photoshop to tweak graphical content

- Develop Herc Plugins

- Develop Scripts

You got to know that there is a catch to minimal $ investment, meaning I will have to do EVERYTHING on my own....

 
Last edited by a moderator:
day 360+X .... Alright, I decided to stop doing it this way.

I Will rethink my way of doing it

So far what I have

- .com domain name I bought for 0.99 $

- Hercules Emulator running on my Raspberry Pi 

- I'm using graphical content from downloads section to make loading screens and login screens, watermark etc.

- I'm using graphical content kindly provided by Daifuku, in the downloads section to create banners and web content

- I adjusted few plugins and scripts (Publicly available on hercules forum) to work with my server

  1. Poring count (Automatic event)
  2. Goblin invasion (Automatic event)
  3. Treasure box hunting (Automatic event)
  4. And many more which I downloaded but not integrated yet
And yes they all work as expected, and no I don't care if they are written by a monkey...

As users don't see the code, the only thing that matters is that they work as expected.

If they don't, I make them to.

- I have few licenses of responsive bootstrap themes, I bought them back in 2015.

http://webapplayers.com/homer_admin-v2.0/landing_page.html

I will use this one to create my website. (Soon screenshots will be available)

It is possible to use a free bootstrap theme, but since I already have that one I will use that one...

- To write BackEnd, I will use Laravel Framework.

- I will apply Let's Encrypt free SSL certificate so that my ro site would use https://

Wait for screenshots.
I alrealy love that kind Diary, i has been write one .

For backend, i suggesting you use small framework than laravel.

Laravel is strong with large project but with small it's not good.
And Laravel required minimum PHP 5.6 or newer, i dont think your hosting manager accept install this for you if your hosting is running PHP < 5.6.
Other point, laravel size too large... it's need ~200+ MB disk size.

I suggesting: yii2, or Codeiginiter 3 :D

Anyway, best lucky for you i see the enthusiasm on you.

 
Last edited by a moderator:
yii2 or codeignighter are just as big as Laravel.

I use Laravel, because I know how to work with it, see my blog is written in Laravel.

It runs on My Raspberry Pi  with PHP 7.1, If I am to pay a hoster, I would buy a VPS or even better Dedicated Server, That way I don't have to deal with finicky hosters using  PHP 5.3 (Because we are in 2009 (c)).

 
Day ... Hell if I know:

Using the theme I had

http://webapplayers.com/homer_admin-v2.0/landing_page.html

I designed the home page (needs some more work like for timer and other) 

But this how I wanted my home page to look.

It's completely adaptive.

And I finally put to use my personally developed Ragnarok captcha,

at the register section.

DISCLAIMER : 

NOT AN ADVERTISMENT

Server name HabilisRO is fictional, made up for the purpose of this Dev's Diary. All matches with the existing servers are a coincidence. 

VcW9e91.jpg


Ow and should I mention the Special Thanks ?

Special thanks to Daifuku for providing free graphical content.

There will be a link to her profile...

 
Last edited by a moderator:
yay, my freebies found a purpose after all /o/ 

 
UPDATE: Now That I have the Logo

I can start doing stuff with it

Like

Creating a login screen

and

Making a screenshot watermark (Thingy that appears in the bottom right corner on screenshots)

0INjiXw.jpg


Nextup, some loading screens.....

 
Last edited by a moderator:
Day 3 from new beginning:

Some 12 loading screens.....

Some of them are really ugly, but they were made from free stuff.

And starting from loading screen 8 I begun loosing my imagination.

Anyways guys, I really don't know what else should I do for my server client of a Minimal $ investment server?

Q0OfgVx.jpg


 
Last edited by a moderator:
I really love that "humon check" captcha 

Ps- you made it since most of the free web hosting do not support it ?

I remember makinig my first  website for ragnarok using .tk (was free) domain with free web hosting which had alot if restrictions like using captcha! , so I gave up on free web hosting :P

 
I really love that "humon check" captcha 

Ps- you made it since most of the free web hosting do not support it ?

I remember makinig my first  website for ragnarok using .tk (was free) domain with free web hosting which had alot if restrictions like using captcha! , so I gave up on free web hosting :P
I've decided not to go with a free hosting as they are all pile of crap.

What I'm going to do with free hosting is host my patches and patcher news.

As most free hosting forbid to use their services only for file hosting. I don't care, patcher news page looks like a website to me...

 
Last edited by a moderator:
I've decided not to go with a free hosting as they are all pile of crap.

What I'm going to do with free hosting is host my patches and patcher news.

As most free hosting forbid to use their services only for file hosting. I don't care, patcher news page looks like a website to me...
Well, id suggest you to buy this one euro hosting which comes with one gb ram and 20gb hd

You can also host Hercules there since it got one gb.

So web hosting + server hosting for 2 euro/month,

You can also buy other  web hosting which I came across 10 usd/year with 4gb space which also provides cpanel 

Both are simply good for a starting simple website with a good amount of bandwidth

 
Still Day 3:

Alright, I've done one more little thing.

The banner made from free banner found at RA...

ALhcLfJ.png


I din't bother with animations, as most places where this banner would go require $

But good thing to do if I really have nothing else to do, would be:

- Scale properly logo (remake it with lower font-weight)

- Scale features text and animate it

01PXVbs.jpg


Next-up: SQL Security work....

Idea to create a tiny SQL script that would create a DataBaseWebUser in my Ragnarok Database.

- Create few SQL views returning player names, scores, levels (obviously not password nor login) Information to make TOPs

- Crate 2-3 SQL stored procedures (new user register, password reset, email reset)

- make password reset, email reset stored procedures tricky so that they cannot be executed to reset password just like that...

and give my DataBaseWebUser  access just to those Stored procedures and SQL views in my ragnarok server databse

This way if a hacker, somehow breaches into my website and obtains usaername and password of  DataBaseWebUser, all he will be able to do to my RO server database is

- register an account

- select information that already appears in the tops

B38cFIv.jpg


 
Last edited by a moderator:
Day 4 1/2: minor adjustments to the graphics

Improved that banner, even-though, I don't expect to pay $ to the tops to be able to put it....

ZdtNAPm.gif


Added a little credit to the graphical content made mostly from Daifuku's graphical content (Will work some more later to make it blend better...)

FCG7blK.jpg


hVKdKl8.jpg


Improved a little Watermark see on screenshot

zFpjMw1.jpg

 
Last edited by a moderator:
Why is the priestess in your loading screen not wearing panties?  :o

 
Why is the priestess in your loading screen not wearing panties?  :o
B38cFIv.jpg
 

Light erotica. While not completely NSFW, Allows room for imagination, to imagine the rest..... and the rest of the story......

(Basically another mind game that I love so much playing with people)

 
Last edited by a moderator:
Back
Top