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

Day 4 2/2: SQL security work takes form

wEzz0PA.jpg
I moved forward with the SQL security work

So basically here is the main idea of how It works

cSlXG6u.jpg


and here are some pieces of my SQL code

DECLARE _ragDBWebUserViewer VARCHAR(32);
DECLARE _ragDBWebUserViewerPass VARCHAR(32);

SET _ragDBWebUserViewer = 'ragdbwebviewer';
SET _ragDBWebUserViewerPass = 'huji'

ALTER TABLE login ADD COLUMN emailverrif VARCHAR(32) NOT NULL DEFAULT '' AFTER pincode_change;


DELIMITER //
CREATE PROCEDURE WebRegisterNewRagPlayerOne
(
IN login VARCHAR(23)
, IN email VARCHAR(39)
, IN password VARCHAR(32)
, IN sex ENUM('M','F')
, IN emailverrifhash VARCHAR(32)
, OUT returnparam INT(1)
)
proc_webreg:BEGIN

-- -1 Unhandled error
DECLARE EXIT HANDLER FOR SQLEXCEPTION SET returnparam = -1;

SELECT userid
INTO @loginalreadyexists
FROM login
WHERE userid = login;

SELECT email
INTO @emailalreadyexists
FROM login
WHERE email = email;

IF @loginalreadyexists NOT NULL THEN
-- -2 Login already exists
SET returnparam = -2;
LEAVE proc_webreg;
END IF;

IF @emailalreadyexists NOT NULL THEN
-- -3 Email already exists
SET returnparam = -3;
LEAVE proc_webreg;
END IF;

-- 4085943947 (2099-06-24)
INSERT INTO login
(userid, email, user_pass, sex, emailverrif, unban_time)
VALUES
(login, email, password, sex, emailverrif, 4085943947);
END //
DELIMITER ;

GRANT EXECUTE ON PROCEDURE ragdb.WebRegisterNewRagPlayerOne TO _ragDBWebUserViewer@'localhost';


DELIMITER //
CREATE PROCEDURE WebRegisterNewRagPlayerTwo
(
IN emailverrifhash VARCHAR(32)
, OUT returnparam INT(1)
)
BEGIN
-- Hey it's not a tutorial ;)
END //
DELIMITER ;

GRANT EXECUTE ON PROCEDURE ragdb.WebRegisterNewRagPlayerTwo TO _ragDBWebUserViewer@'localhost';



DELIMITER //
CREATE PROCEDURE RsetPasswordRagPlayerOne
(
IN login VARCHAR(23)
, IN emailverrifhash VARCHAR(32)
, OUT email VARCHAR(39)
)
BEGIN
-- Hey it's not a tutorial ;)
END //
DELIMITER ;

GRANT EXECUTE ON PROCEDURE ragdb.RsetPasswordRagPlayerOne TO _ragDBWebUserViewer@'localhost';





DELIMITER //
CREATE PROCEDURE RsetPasswordRagPlayerTwo
(
IN password VARCHAR(32)
, IN emailverrifhash VARCHAR(32)
, OUT returnparam INT(1)
)
BEGIN
-- Hey it's not a tutorial ;)
END //
DELIMITER ;

GRANT EXECUTE ON PROCEDURE ragdb.RsetPasswordRagPlayerTwo TO _ragDBWebUserViewer@'localhost';



So basically as you can see there is ragdbwebviewer that has access only to the stored procedures and I will add some views

it will have access to

like 

Create View AS SELECT nicnake, level, 

left join job....

whatever (note I'm not doing select * nor selecting login, email, passwords)

The password reset part is a security weakness, but if my website is hacked and 

ragdbwebviewer credentials obtained, hacker will have to know account login to reset the password... in theory

in real life there will be some more layers of security...

 
Last edited by a moderator:
Day 4 2/2 : One more little thing in client graphics

Using this free character selection screen





available here in Herc Downloads, made myself a new character selection screen

wutMkiL.jpg


Decided not to change the default theme of the interface as

Over the years it became almost a RO's business card....

 
Last edited by a moderator:
Day 6 : Paaaiiiin & Booooredom

For past week every day when I'm back from school, right before doing homework, I dedicate 1 hour of my time to 

run BeyondCompare sessions on files between Latest Hercules and eAthena revision of 2007 before Satan in Morroc (roughly Episode 11.1 : Rachel )

I compare and see the difference

For instance, this is the screenshot of me working on mob_skill_db.txt

On the left side Osiris Has some new skills in the Latest Hercules. (See the date under file path 2017-07-04)

On the Right side Osiris doesn't have some recent skills as It is old eAthena revision (See the date under file path 2007-02-06)

MUqwmEK.jpg


I also write notes as  I go with this process. Otherwise, it is really easy to loose my mind in that process of Pain & Boredom....

HwRVRyy.jpg


Wish me luck and not to loose my mind to boredom.

Doing homework seems so much fun after that!!!!!!

 
Last edited by a moderator:
Day 7 : Was sooooo boored running BeyondCompares

Today been running beyond compares during one hour.

Got fed up and decided to address a client issue that been bugging me for a long time 2013 client that I'm using has a rather special quest window

with multiple tabs.... like WHY?! why would i need this many tabs!!!?

Anyways worse of all is the last tab.... it says episode 14.1 Bifrost.... Hell no!!!

q69goTw.jpg


At first, I wanted to remove all unwanted tabs. But knowledgeable people have told me that it could only be done by hexing the client and applying hexes at soooo many places.

So, I decided to let go that idea of removing useless tabs...

However, I did this: (Well white text will have to do for now.... I was running short on time and my parents started to yell at me "Go do your homework!!" well, you got the picture....)

 
cY7r9GF.jpg


There you go, I fixed it!

That doesn't bug me anymore!

That's right, current episode is matching the year 2007. Episode 11.1 Rachel.
Did you ever wonder hos fast time fly by? What were you doing in 2007?
Can you believe it was 10 years ago? 
We bet you can still feel it like if it was just yesturday.
Well, this is an attempt to dive into the nostalgia with enhanced experience.

And other minor improvements providing authentic gameplay. And some more romantic gibberish here. And some more romantic gibberish here. And some more romantic gibberish here. And some more romantic gibberish here. And some more romantic gibberish here. And some more romantic gibberish here. And some more romantic gibberish here. And some more romantic gibberish here. And some more romantic gibberish here. And some more romantic gibberish here. And some more romantic gibberish here.

 
Last edited by a moderator:
Day 8 :  Patcher (Still bored from comparing bunch of configs)

I decided to do a patching system

First I took the graphical content provided at downloads section

HCtMYGX.jpg


And created 5 accounts on FreeWeb hosting

This free web hosting has these features:

- No ads

- 1Gb storage space (To store updates)

- 100Gb traffic per month

So I have this .com domain name rigged to a free private DNS service (Just like DynDNS pro but free...)

In the DNS I created a CNAME record like so (upd.myserver.com -> tttaaass123.freehosting.com)

So that pretty domain points to domain given by free web hosting

What I found cool is that DNS records updated within an hour!!

(This means upd.myserver.com was pointing to tttaaass123.freehosting.com, yes changing DNS records can take some time. But 1 hour is amazing!)

In the patcher config, I put upd.myserver.com/patch as a directory to get patches from.

Now I will explain why 5 free accounts :

Free Webhosting are really picky, Finnicky and useless people that like to ban and limit things...

So If I get banned, I can switch to the next free account within an hour.

Or, if I see the traffic reaches limit, I switch to the next free account.

How this mobility is achieved:

The index.php which is called by the patcher to display news does quite some more work than just display news.

It writes the JSON object if not exists or outdated

JSON object that is written into webroot directory looks like this

{
lastupdate : datetime,
news : [{picture, publishdatem, body}]
}


Index.php checks lastupdate

- if 1 hour didn't pass, it renders JSON object with news to HTML and sends it.

- if past 1 hour, it does a CURL or WGET call to myserver.com/api/news to get a fresh JSON object. and writes NOW() to the lastupdate.

index.php also sends another CURL or WGET call to 4 other free webhosting accounts with a specific parameter  ?sync=1 

(Obviously, there is some validation going on so that some smarty couldn't botch my patching....)

4 other free accounts copy the JSON with news and compare patchlist.ini (file that lists updates) to their own file

and the get the updates they don't have and update their patchlist.ini .

So, the news are written on the main site, and patches are uploaded to only 1 place and spread through my network by themselves.

That way, I can maintain high mobility.

In the case of a ban or approaching traffic limit, I can switch to the next free webhosting account within 1 hour. The main server internet channel is not busy with patches download traffic.

Players don't need extra lags on the server, right?

 
Last edited by a moderator:
Day 9 : Didn't want to come back to BeyondCompare....

So, I don't want to come back to BeyondCompare and configuring 1000 of files to the episode 11.1, I was desperateley browsing downloads section for at least something more exciting to do!!

Anything... As I've done pretty much everything....

And one more thing cought my eye. DailyRewards!!! 

Well my server already have that, but very basic one. Why not make it golden?

so I took this and a few of similar releases



and did this

day1

xjhwI3h.jpg
day 2

v9Pm0SN.jpg
well you get the idea...

QrEYCtE.jpg


And, Yes you rad it correctly "A little something to make a player's day with us even better"

And no, it is not an invitation to create 500 characters and farm daily rewards 
B38cFIv.jpg


As these items are not actually real items

But an Event version (same features but....)

- Not Kafra/Guild storable

- Not Tradable / Vendable / NPC sellable

- Not droppable

Basically an item given to one character to make his/her day even more fun...

Applying Only Best Practices since 2017...  (C)

 
Last edited by a moderator:
Day 9.5 : Scripting challenge....

Now it is time to script some...

So, I wrote a daily rewards script and integrated everything and here is how it looks like in game:

B9wU79G.jpg
Sorry about blur, there is the real name of the server, didn't want to waste time and create 28 cutins with HabilisRO on them....

Anyways, some people may say these are crappy prizes. Well, tell you what... This server is considered a low rate server. Besides, all a player have to do to get them, is just login.....

Even Habilis can do that!

Took adv. Stylist npc from Downloads and modified it to be sort of a quest ... 

pczsumA.jpg


Also added a healer (just heal with 60 sec delay) <- classic

One more thing, took this pretty map 





and created a vending zone

OBRy0zr.jpg


xd9F6BM.jpg
So, this is basically a vending zone, to assemble all vendors in one area

I'm not expecting many players, so this should be big enough.

Continuing the work ....

 
Last edited by a moderator:
Day 10 : Scripting marathon continues..

I went to download section and downloaded some more scripts of events to integrate them with this server.

And then I though why not fully automate them?

So I asked aroud about randomizing things...

So, Big Special THANKS to @Z3R0 and @Dastgir for giving me this code

OnClock1800:
initnpctimer();
.@currentMinute = 0;
.@startMinute = rand(1,30);
end;

OnTimer60000:
setnpctimer(0);
.@currentMinute += 1;
if (.@startMinute == .@currentMinute) {
stopnpctimer();
doevent;
}


What I wanted to do Is create an AutomaticEventController

A controller that would automatically and randomly start and end events over a day.

and to have the starting time randomly picked within 30 minutes from planned time

(I wanted this to frustrate my players even more! *trollface*)

So far, I have 4 automatic events (available here in download section)

I'm not the author of this scripts, each script has an author. You may find their authors by browsing in Downloads section. However, there is a big thanks from me for releasing wonderful scripts!

- Treasure hunt (pry open treasure chests, some of them are empty to find those containing a treasure) 

XN0KLN4.jpg


vsftTqm.jpg
- Goblin Invasion (need to defeat X number invaders and then invader Leader spawns)

wrrnWpI.jpg


wcmqUEI.jpg


9DWTo2h.jpg
- Poring Count event (just count porings in the fence)

Bg7EENv.jpg
- Slot Machine (With free spins.. 

uJw3aCC.jpg


2 free spins,

U06DeWj.jpg


after out of free spins need to pay...)

2uxaiM0.jpg
How it works:

- AutomaticEventsController at specified time runs a version of code given to me by @Z3R0 and @Dastgir

to determine a real random time of event, It checks for WOE, no auto events on WOE...

- AutomaticEventsController Picks randomly an event script name from Array of string and calls OnEventStart on that script

- Every Automatic event script "Implements" an Imaginary Interface AutomaticEvent with 2 methods OnEventStart OnEventTimeOut (OOP stuff.....)

(basically every Automatic event MUST have those 2 methods Because Controller calls on them)

The rest of implementation is up to the event class script...

So far,  I have 4, but I actively browse downloads section for more scripts to integrate to my Automatic events!

 
Last edited by a moderator:
Day 11: Done some more NPC work..

- added Vampire bal  (From downloadfs section) event to My AutoEvent Controller

kfofrSJ.jpg


JZjduFx.jpg


don't joke around with lady vampire...

0K6ysay.jpg


basicallyically as described in the downloads section.. (A pvp event)

w89dBA6.jpg






 


2






- added Poring Catcher event from the Downloads section

6LU9GlT.jpg


5Ltpdwu.jpg






 


 






Since it is a hardcore LowRate server x8.....

And Novices appear in the outskirts of Prontera with no money and no clothes (Just Like Habilis when he goes to Las Vegas....) 

I've decided to make a Welcomer NPC

aweyaWR.jpg


Basically an NPC that is going couple newcomers brain with some information about the game (Most of it is ported with slight modification form Renewal tutorial...)

MEgYZke.jpg


vkWbYi0.jpg


IVEGwT8.jpg


A48rbH8.jpg


eS82fkS.jpg


zi9Fx6w.jpg


gJdXmNM.jpg


Y3J8Hbj.jpg






 


I also made a simple PVP arena, with this cute assassin girl NPC

I had do do the CUTIN myself...

GfvOUXe.jpg






 


The official one is not as... erotic...

Curious fact : the original Assassin girl on cutin is wearing a Creator or LordKnight skirt ? 
bYjKUBP.png
 (Censored?)

job_black_hucke01.gif


Part 2 : Plugin work

Implemented my favourite @commands (So much appreciated by Russian RO comunity)

I even turned them into Hercules plugins and released here:





I also integrated all of the Dastgir's plugins, Thank you very much!!

@aura is awesome!

I disabled aura at max levels...

When character of 1 or 2 or trans reaches max level, Aura is obtained through quest from him

seU8YRG.jpg


But good thing you can choose your aura...

e30WnLL.jpg






 



 
Last edited by a moderator:
Homeless (Vagabond) Server developer's diary

Day 12 : Doing Stuff....

Browsing publically available content, I found a command 

@identifyall - Identifying all items (Provided by AnnieRuRu, if I'm not mistaken...)

The problem is that the script doesn't use Magnifiers to Identify your items.

Because????... F* you! 
B38cFIv.jpg
©

I don't know if something similar already exist. It was faster to adjust the one I found than continue looking.

And I decided to share it (Costs Habilis nothing, but could make some of you happy)

- script IdentifyAll#Util -1,{
OnInit:
.identifyItemId = 611; //Magnifier
.identifyItemName$ = getitemname(.identifyItemId);
bindatcmd "identifyall", strnpcinfo(0)+"::OnIdentifyAll",0,99;
end;

OnIdentifyAll:

if(countitem(.identifyItemId) < 1) {
dispbottom "To do that, you need at least 1 "+.identifyItemName$+".";
end;
}

getinventorylist;

for ( .@i = 0; .@i < @inventorylist_count; .@i++ ) {

if(countitem(.identifyItemId) < 1) {

dispbottom "You are out of "+.identifyItemName$+"s, "+.@c +" items identified.";
end;
}

if ( !@inventorylist_identify[.@i] ) {
delitem2 @inventorylist_id[.@i], 1,0,0,0,0,0,0,0;
getitem @inventorylist_id[.@i], 1;
delitem .identifyItemId,1;
.@c++;
}
}
dispbottom .@c +" items identified.";
end;
}


Basically it's an utility @Command script that could make clicking less agressive... when have a lot unidentified items.

How it works

When you don't have any magnifiers it says:

q13Gjc8.jpg
When you have less magnifiers than Unidentified items, It identifies as much items as possible...

nupMYM8.jpg
When you have enough magnifiers it just identifies all using your magnifiers

And says You don't have anymore MAgnifiers, X items where identified using few that you had.

zN9ryhH.jpg


Pretty simple stuff, but could make somoene's life easier...

Also, changed vending zone to one that is publically available in Downloads section (It comes with script of vending spots!)

WjfEFc0.jpg
But, blue squares (Where vending is supposed to be permitted) have flag no_vending,1 (Vending forbidden),

Because????... F* you! 
B38cFIv.jpg
©

How Habilis fixed that?

Disabling vending on entire map and changing these flags to no_vending, 0 (0 means no_vending is canceled).

Is not an option, because when entire map vending is disabled, Hercules doesn't even look on individual cells....

And doing bunch of /where to create propper flags, is not an option timewise! 
B38cFIv.jpg


So, Habilis did it lika that, Created 1 flag for no_vending,1 0 0 200 200 (all cells of the map)

And then rename each flag where vending is supposed to be permitted to no_vending, 0

Also that map came without minimap.... not Habilis problem....(made a minimap):

VwQQpCy.jpg
Like they say where Habilis come from : "Prepare winter event in the summer!" ©

ChYLuEB.jpg


jsiV8Xc.jpg


I found that winter texture pack I was looking for, it was uploaded to some 3d party file cloud... as it wrights about 80mb but it totally worth it!!!

(Just winter not holiday)

uwJhrvt.jpg


Qwyue3s.jpg
As it covers almost all Cities and fields!!! so 80mb is worth it!!

EgT93jR.jpg


Also Installed my favorite chatime plugin from dastgir GitHub 

EgnqKzg.jpg


Also changed some buttons in my 2013 client  to be like sortof newer clients

0PSE5XX.jpg
New buttons

7LusKpg.jpg


QsXlg5s.jpg
These buttons not only for aesthetics, they also resolve another problem that you don't need to know about...  :ph34r: :ph34r: :ph34r:

 
Last edited by a moderator:
This DevDiary was a nice insight into the development timeline of a server, very useful and a cool topic to read over! How stable are RPi's for server hosting? I'm currently using a dedicated server to work on my project but it's cool to see something as robust as RO running on an RPi.

 
Habilis is glad that you like!

 How stable are RPi's for server hosting?
For 1 person it's fine

I have a feeling it's fine for up to 10-20 players (will test it soon)

But so far ok.

In virtual life:

r6t7A0P.jpg


In real life:

mXbWTsx.jpg


 
Very nice thing to read, I'm following this one!

 
Day 14 done some more stuff...

Implemented a sprite pack from Adel that makes porings more colorful (colorful porings are really important!)



before:

fjakwwe.jpg
After:

dGs3vzu.jpg


Lika back in 2007 every server had a custom sprite for Asura strike Habilis decided to stick to that old tradition and make some asura sprites

before:

LijE0np.jpg
After:

TZuu1Km.jpg


Before:

jdIZNHM.jpg


After:

F8ma0YO.jpg




Finally I sorted out the old maps and cached them properly

List of maps like before : Prontera, Izlude, Morocc, Alberta

On morroc I've also removed all NPCs related to satan in morroc in one way or another

jGdrpkV.jpg


OJ3yXIX.jpg
and restored all warps and monsters on the Morocc fields (right of the morroc)

Also, returned Ant-hell entrance to the old place (Both of them)

JoalbOU.jpg


ioWyH8J.jpg
Habilis was ready to implement some custom costumes but this piece of gui needed a touch of personalisation

hpM9m8E.png


The challenge here is to remove 2headed chic (an object that is behind other objects I want to keep, lines and points)

Multiple years of experience in removeing copyrights from graphical content have helped Habilis to do just that.

39YUNpY.jpg


fjq1aXy.jpg


This is how costumes look for now

C1mREpJ.jpg


Unfortunately, since no one wanted to provide a bundle (all in one (sprite, item, collection, lub, item_db.conf)) to Habilis

Habilis had to reverse engineer stuff....
default_ph34r.png


This means alot of NotePad++ regular expression search and replace

And a lot of Excel formulas to generate Item_db2.conf

stRn6ey.jpg


LcsOG8w.jpg


nxPmHkN.jpg


And as a result .... 500 custom headgears.

Also this is a ppreview how I want to prevent creation of 500 characters and farm of daily rewards

event versions of items will be given...(they have same properties and a list of limitations)

eg1mwLJ.jpg


Auras, using some custom Auras and Dastgir's plugin I finally managed to make some nice auras

on level 99, aura is not given to a player, on level 99 it have to be obtained by a quest.

some examples of available auras

Jg9GaEE.jpg


IA9kNck.jpg


NHlroNs.jpg


SgsoJlo.jpg


Oz71WIV.jpg
And finally, Habilis's favorite ones!!!!!

zVId7oy.jpg


It8fHZh.jpg




also took guild emblem pack (will provide it as separate download on the downloads page)

If Guild masters don't have time or don't know how to make a guild emblem, they can take one of 2k+ provided.

mGvcaed.jpg





 
Last edited by a moderator:
Day 14 one more thing.

There is a huge skinpack of 72 skins publically available to download 

This is a nice addition to the server's client for the players wanting to showoff or to add a touch of personality to their game client

The problem is, there are few having Glyphs in client buttons and options window

Habilis Easily overcame those by using his highly sharpened (lately) search and replace skills....

It weights around 170mb uncompressed and 60mb compressed. So, it will be an optional download.

Here are some examples:

IbRXW5t.jpg


y4uCOOa.jpg


mQHEF18.jpg


j5p4wnx.jpg


4gXB89v.jpg


2H7i5Og.jpg


So that Makes 2 extra packages to add to my client downloads page.

1 - Set of 2k+ guild emblems (for those who don't have the time or skill to make one )

2 - Set of 72+ skins for those who wnt to add a touch of personality...

There is always something to do with public materials like:

- Fixing Glyphs in skins

- Removing Evasticas and Waffen SS emblems from guild emblems pack (Raccial hate will be forbidden on that server)

But they are pretty usable!

 
Day 15 done some bootstrap stuff...

So Habilis was busy working on the website. Doing it with bootstrap is harsh

Bootstrap is not well suited for gaming web resources with massive graphical content, it is more suited for minimalist Hipster webapps or such.

So, those who do gaming websites with bootstrap, Habilis shake your hands you friggin awedome guys & gals!

Alrighty, enough with the chatter, So, here is what Habilis managed so far..

I'm not a designer or frontend, like AT ALL...

hjtnnJI.jpg


8ZE990E.jpg


B5JJnp4.jpg


8gf7JQz.jpg


p6dXCsY.jpg


kN0BWX6.jpg


DSaPiW2.jpg
 
Last edited by a moderator:
I will try and play on your server when it's up :D

coz it looks cool !!

 
Last edited by a moderator:
Yes it will be open for public.

Just will not be anounced and will appear under a different name than HabilisRO (it's a fictional name as mentionned somewhere above...)

 
Back
Top