How to install athena-web-service API for hexed 2020+

First, sorry if something is misspelled, I just translated my native language into English;

Well, many people unfortunately didn’t get it online, for some luck in my first attempt I got it, but it wasn’t easy, so in this tutorial I’ll explain how you can install it step by step:

I currently use a windows 7 64 bit, so if it doesn’t work on your pc, I really don’t know how to help, maybe you need a particular support or something.

note: I only tested it on localhost,
obs2: don’t be alarmed by the size of the post, in practice it becomes something quick and easy, it’s because I explain too much!

The necessary links for this tutorial you will find here:

I used the last nemo: https://gitlab.com/4144/Nemo/
GetComposer (php) https://getcomposer.org/download/
Secretdataz api github: https://github.com/secretdataz/athena-web-service

just below I will also put the prints of each one and maybe a video (but it will be in Portuguese, but you can only see the video if you are from another location.)

Well, let’s go:

I downloaded the composer at:

then install normal as a program (for all users I choose)

I also downloaded the most current nero to get the necessary patches

finally the API project


after downloading the api came like this:


Open CMD IN FOLDER (windows command prompt)
obs: you need to open it in the folder, see on google if you don’t know.

type: composer install


will install several things and will ask at the end to give a composer fund (I don’t know if it is necessary, but I did)

now open the file .env.example and edit:


http://

And configure only the important parts for now:

APP_URL = http: //127.0.0.1: 8000 / – 8000 is the door of artisan the api that you will call later ..

db you configure how to configure flux or phpmyadmin.

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=ragnarok
DB_USERNAME=ragnarok
DB_PASSWORD=ragnarok


Here you put the name of your rAthena (in the conf folder there is the name of the server there, default comes rAthena)
ATHENA_ALLOWED_WORLDS=rAthena

what I had a little difficulty was when creating the .env file
windows does not accept renaming the .env.example so I created a .bat

I renamed the .env.example file to env
so in the bat I put: rename env .env

basically he did rename from env to .env so I was able to use artisan

now our .env file exists, so we can proceed to use this command (you can use the same CMD prompt if it hasn’t closed yet)

type the command: php artisan key:generate

it will automatically generate a key in the .env file like this:

APP_KEY=base64:62zQ4OJ3BnMmAZ15QlrQwqoAFzkFXwSnKwrDRpjmUWA=

obs: do not share your api key with anyone, because they can break into your database, this is just an example.

now type the command at the prompt like this: php artisan migrate

it will create several database to your phpmyadmin, inside the ragnarok database for you to make sure it worked browse your phpmyadmin in ragnarok by: web_service means that imported all right.

now let’s copy the entire folder to your xamp the location is:

C:\xampp\htdocs\athena (I renamed athena the folder)

now create one .bat called start_php.bat with this line:

php artisan serve –host 127.0.0.1


Now let’s configure the client:

Go to your client’s folder and see the data folder, if you have the folder called luafiles514

obs: Make sure your client is reading the data folder first OR the grf, this is important to know.

follow these steps to know which one you’re reading first: turn on your emulator and enter the game, if everything is coming, then extract it from the grf and place the sclientinfo.xml in the data folder and change the ip to anything 125.0.0.1, if you don’t connect to your server after connecting xampp and your emulator, it means that your data folder is reading first than the grf, this is good for testing, as you don’t need to change everything to the GRF whenever you want to test something.

Note that you can have several grfs in your client and all grfs can contain the same contents, to know which one you are reading you open DATA.INI and see, for example

[Data]
0 = grfcustom.grf
1 = data.grf
2 = rdata.grf

if the grfcustom.grf have a sclientinfo.xml it is this file that you are reading first than the others of other grfs, so the others do not matter, you can even delete it if you have duplicate files, they would only be useful if in case it was not possible to read then it would read the next 1 = data.grf and if the data.grf if it weren’t possible to read it too, it would skip to read 2 … and so on. (always in that order)
now that you know the location you’re reading first, let’s say it’s your data folder you’re reading before grf, then we’ll extract from the GRF the service_korea folder inside the data\luafiles514\lua files\ folder (in mine I already had this folder because I work on it all the time, so if yours doesn’t, extract it from the GRF as I said) this is very important, what I’ll say:

be careful with multiple grf, because some grf like KRO, use 2 folders called luafiles514, one of which is Luafiles514, what changes in both is that it has files in one and the other has other files, so they complement each other and not nothing is missing, but we will only use 1 single file.

Going back to what I was writing up there, you will extract the service_korea, but his can this reading depending on the diff you used, can this reading service_brazil, service_americaETC …, now you need to “find “ which one are you really reading. (it is not enough to have it there, it has to work)

*I spent 1 hour modifying the wrong file and then I noticed that my client was not reading the file I was modifying, so it never worked.

In nemo I selected a patch that applies a single service to all langtypes, so it becomes SERVICE_KOREA, but it is not necessary, only if you do not want to waste time searching.

For those who want to search, it is the following:

Rename all services_ to anything and leave only 1 that you believe is working * MAKE SURE TO EXCLUDE THESE FOLDERS FROM ALL GRFS so that you have no chance of thinking it is a folder and actually reading it from the GRF and you did everything for nothing.

so let’s say you have

Service_brazil
Service_korea


— rename:

Service_brazil_1
Service_korea

you renamed it to Service_brazil_1 because you believe it is korea reading this, and you joined the game! OK perfect, you can exclude the brazil that now you are sure which folder is right, but inside the korea folder there are 2 files:

ExternalSettings_kr_sak.lub
ExternalSettings_kr.lub


same thing, rename and enter the game and if you log in ok, you delete the one you renamed (if yours has only 1 file, you don’t even need to test it, you know it’s correct)

it’s more likely to be: ExternalSettings_kr.lub at least in my case, so let’s say yes, open it with notepad ++ or any text editor and see the lines:

AccountLinkedUserDataUrl = {
Save = “http://0.0.0.1:3000/userconfig/save”,
Load = “http://0.0.0.0:3000/userconfig/load”
}
TwitterDataUrl = {
Auth = “http://0.0.0.0:3000/twitter/user-auth”,
Upload = “http://0.0.0.0:3000/twitter/upload”
}
EmblemDataUrl = {
Upload = “http://0.0.0.0:3000/emblem/upload”,
Download = “http://0.0.0.0:3000/emblem/download”
}


the paths they remain the same, what changes is the IP:

then it will look like this: (remembering that 8000 is the door of Artisan)

AccountLinkedUserDataUrl = {
Save = “http://127.0.0.1:8000/userconfig/save”,
Load = “http://127.0.0.1:8000/userconfig/load”
}
TwitterDataUrl = {
Auth = “http://mywebsite.com:8000/twitter/user-auth”,
Upload = “http://mywebsite.com:8000/twitter/upload”
}
EmblemDataUrl = {
Upload = “http://127.0.0.1:8000/emblem/upload”,
Download = “http://127.0.0.1:8000/emblem/download”
}


Now you need to open nemo and it will be the last step!

opening nemo you will search exactly for this patch in the filters, the rest you choose exactly as you always use, but this is necessary, if you don’t have it it won’t work! (only the last nemo has it)

Enable HTTP Emblem on Ragexe (Enable)


your client is all ready to work! but to test the link you can do the following, to see that everything is fine:

go there in the xampp folder that is athena and open the start_php.bat that you did before, remember?

will look like this:

you can click on any link and you will receive this message in your browser:

http://127.0.0.1:8000/emblem/download

as i clicked through the link it will say that it is working but the method is not the correct one, and why? because it is not for him to collect images with the url, but through a button in the game, if I click on the link the only thing he will get is the favicon.ico image from the web page that I opened (but only for test this correct)

Now let’s test ingame and see if the client has been configured correctly, if so, you will see a message like the one above, but like this:

and don’t forget to put the emblems in the folder Emblem

it may take a few seconds for it to connect to the api:

when i click on a badge i get this:


One last note: in .env there is a file that you need to add in your emulator there came with a problem so I fixed it for all files:

//Add the script in resources/scripts/rAthena/woe_status.txt to your server to use this feature

in the api itself goes to resources/scripts/rAthena/woe_status.txt

you will find this script:

but it goes wrong on the last line, so I’ll paste it here and you just replace:

query_sql “UPDATE web_service SET woe=” + .@status + “WHERE key =’woe'”;

*maybe the secretz wrote too fast and got it wrong, but I corrected it.

Well that’s it! when I record the video everything will be there at the beginning the link 🙂