[Dev Rev] download / install / build / log / debug

Welcome in the osRose emulator Project.

Moderators: osRose dev team, ospRose dev team, osiRose dev team, Moderators

[Dev Rev] download / install / build / log / debug

Postby lmame on Sun Jan 04, 2009 11:25 pm

***** Disclaimer *****
This is for the dev rev, NOT for rev 80.
***** Disclaimer *****

I suggest you read this thread for more details on what client is needed and on the GameGuard server.


I°) Download Tortoise SVN:
To get the source code from SVN, you can use Tortoise SVN, go get it and install it:
http://tortoisesvn.tigris.org/


II°) Download source code:
The source code is available through SVN.
Create a folder somewhere, right click on it and choose "SVN checkout".
Image

Enter the URL address of the SVN (see this thread):

Image

If asked, enter next the login / password (beta81/beta81) and wait for the source code to be downloaded.
Image


III°) Download CodeBlocks and its plugins:
1°) Codeblocks:
To build the server, you need a "compiler", we'll use Codeblocks.
You can get it from here:
http://www.codeblocks.org/downloads/5

Note:
Don't download version 10.x, it's not compatible! Use the 8.02!


Take the "codeblocks-8.02mingw-setup.exe", always with the "mingw".

You can use Codeblocks 8.02 or the nightly builds which are more recent but harder to install.

Anyway, install Codeblocks, for example to c:\codeblocks.

Note:
-> If you got some problems when you build the projects (invalid compiler...) it means quite often the path to MingW is wrong in Codeblocks, so change it:
viewtopic.php?f=27&t=33&p=35543&hilit=mingw#p35543


2°) the plugins:
In order to build the server, you need plugins, here they are, in this thread or here:
libmysql_pthread2.zip
(700.96 KiB) Downloaded 8031 times


Unrar them into the "plugins" folder of codeblocks, for example "c:\codeblocks\plugins". If the folder doesn't exist, create it.
Image

Once it's done, open Codeblocks, then go to menu:
Settings->Compiler and debugger
Image

Then goto tab "Search directories" and:
For tab "Compiler", add:
c:\codeblocks\plugins\include
For tab "Linker", add:
c:\codeblocks\plugins\lib
Image
Image

In my captures I installed codeblocks in d:\CBN so use your imagination and choose your "good" installation folder of course...


IV°) build the source code:
1°) open:
There are three servers as source code, login server, char server and world server. Each one has its own "project file" which are in "binary" folder:
loginserver.cbp, charserver.cbp, worldserver.cbp.
Image

To open one of those servers in Codeblocks, just double click on those files or open them in Codeblocks (File->Open).


2°) build:
It's simple, once a server is loaded into codeblocks, go in menu "build" and choose "rebuild".
Image

The exe are into the "binary" folder.

Note:
Don't build a server if the exe is already launched. Stop the server first.

Note 2:
Every time you change a single line of code, rebuild the server to update the executable.
It's not because you changed the source code that the .exe is automatically updated! You NEED to recreate it!


V°) Install the database and setup your server .conf files and IPs:
1°) Install Mysql:
Install Mysql server, the recommanded version is 5.0.x but use 5.1 or 6 if you want...
http://dev.mysql.com/downloads/mysql/5.0.html#downloads
Installation is pretty easy and straightforward usually...


Note:
You can download the tools as well:
http://dev.mysql.com/downloads/workbench/


2°) Navicat:
Navicat is a software to easily manage your databases. You're free to use another software, I'll use it for demonstration purposes.
A lite and free version exists.
Or use PhpMyAdmin (needs a webserver).

3°) create the database:
You must create a database in order to use the server.
For that, you can use navicat.

a°) create a connexion to your mysql server:
Click on "connection" the enter the informations that are needed and save.
Image

The root password is the one you chose when installing Mysql server.

b°) create a database:
Launch the connection (simply double click on it), then right click on it and choose "new database". Enter a new name (like "roseon") and it's ok.
Image

c°) create an user to access it:
It's better to create an user (mysql user) to access this database. Click on "user" and then on "add user".
Image

Enter its name and password (here "test").
Image

Then select him on the list, and the database you want to give access rights "roseon".
Image

Click on "select all" to give all rights and save.
Image


4°) Install the database:
Open the file "Database/database_installer.bat" which is your server.
Inside, you have to change some of the data according to YOUR specifications:

  1. REM MYSQL BIN PATH
  2. set mysqlBinPath=C:\Program Files\MySQL\MySQL Server 5.0\bin
  3.  
  4. set user=root
  5. set pass=
  6. set db=roseon
  7. set host=localhost


Look where your mysql server is installed for:
  1. set mysqlBinPath=C:\Program Files\MySQL\MySQL Server 5.0\bin

and change if necessary.

The other data is the informations to access your database we created. We need to give the database name (roseon) and the login / password of the user we created as well (test / your_password).
So update the data accordingly and save the file.

Then just double click on "database_installer.bat" and wait until it's done.

Note:
If you want to run the installer again, delete first the tables in your database... Use Navicat for that (launch navicat, open the database, right click on a table and hit delete).

5°) Update the .conf files:
Each server (loginserver, charserver, worldserver) has his own config file, loginserver.conf, charserver.conf, worldserver.conf.

In all the three .conf files, a block is the same it's the one used for the MySQL database access, you need to put in there your own values:
[DATABASE]
mysql_host=localhost
mysql_user=root
mysql_pass=password
mysql_database=database
mysql_port=3306
AutoQueryTime=600


So in my example it would do:
[DATABASE]
mysql_host=localhost
mysql_user=test
mysql_pass=password
mysql_database=roseon
mysql_port=3306
AutoQueryTime=600


Then each .conf file has his own details:

a°) loginserver.conf:
You need to set the IP's values for your servers, please check this guide for more details:
[SERVERDATA]
serverid=0
servertype=0
serverip=IP
serverport=29000
servername=LoginServer
connection=2
lanip=IP
lansubmask=IP



Other interesting stuff:
[LOGINSERVER]
accesslevel=100
CreateLoginAccount=0
checkGameGuard=0
usethreads=0

acceslevel means the minimum rights people must have to access your server. Players have level 100.
CreateLoginAccount means that, the first time an unknown player will try to login on your server, he will be rejected BUT an account will be created server side in your MySQL database. So if he tries to login again, it will work. It is NOT recommended, use rather a CMS to create account than this way. 0 means disable, 1 means enable.
checkGameGuard means that server should check if the player has GameGuard or not. It should be let to 0 (disabled). 0 is highly RECOMMENDED.


b°) charserver.conf:
You need to set the IP's values for your servers, please check this guide for more details:

[SERVERDATA]
serverid=1
servertype=1
serverip=IP
serverport=29100
servername=Server1
parentid=0
accesslevel=100
connection=2
lanip=IP
lansubmask=IP

acceslevel means the minimum rights people must have to access your server. Players have level 100.
servername is the server name that will be displayed after the player logs in.


c°) worldserver.conf:
You need to set the IP's values for your servers, please check this guide for more details:

[SERVERDATA]
serverid=1
servertype=2
serverip=IP
serverport=29200
servername=Channel1
maxconnections=500
parentid=1
connection=2
lanip=IP
lansubmask=IP

servername is the channel name that will be displayed after the player logs in and when he selects a world.


Other interesting stuff:
[WORLDSERVER]
accesslevel=100
welcome_msg=Welcome to Open Source Rose Online EVO

acceslevel means the minimum rights people must have to access your server. Players have level 100.
welcome_msg is the message the player will have when he joins the game (after beeing logged and choosing his avatar).


6°) configure your server's IPs:
See 5°) above and check this guide for more details.


VI°) Update your data files to match your client:
1°) extract data from the client:
You need several files taken from the client so the server has the exact same informations. This way the server will know what items are in your client, what skills can be learned and so on.
So the client and server informations MUST match.

To do this, use a vfs extract tool, for example this one.
Unzip it where you installed Rose Online, next to the .vfs files.
Image

Launch the software and choose "File->extract all" and choose a folder where all the data will go.
Image

Now wait.


2°) what is needed?:
Your server needs that you copy ALL the content of the folders from your client (the one you just extracted):
3DDATA/QUESTDATA
3DDATA/AI
3DDATA/STB

To your server. Copy those three folders into:
Image
Image
Image
Image
Image
Binary/3DData/

That's all, it's good now.


3°) .csv and .sql files:
Sometimes STB, AIP and QSD aren't enough. Especially when something changes on a NPC or spawns or telegates...
You'll have to update those .sql files using the tools that are in this thread: [rev80 / dev rev] extracters and converters (.sql, .csv).
Once you got the necessary files (see the thread for the few ones you need), IMPORT them into your database using Navicat or whatever.
If there is a mysql error, perhaps you'll have to DELETE the according table before importing the new data.
See the thread [rev80 / dev rev] extracters and converters (.sql, .csv) for an "how to".


VII°) tips/tricks:
Most of the informations are on the other "rev 80" tutorial, I'll tell here only other stuff...

1°) client version:
You MUST use the "Trose.exe" from the game, no need anymore for "gameguard patch". DON'T USE THE GAMEGUARD PATCH.


2°) GameGuard server:
You'll need to setup one, check this thread for files and instructions.
Or you can use a Trose.Exe without Gameguard:
viewtopic.php?f=18&t=2106

Note:
Since their client 212, naRose REMOVED Gameguard so if you're using naRose client 212 and above, you DON'T need to setup a Gameguard server anymore.
So you can use the naRose client, with naRose's Trose.exe, without Gameguard server.



2°) launching servers:
You have to launch in order: loginserver.exe, then charserver.exe, then worldserver.exe.

3°) config tricks:
a°)In loginserver.conf:
set this to 1 if you want to create automatically an account. First time it'll fail, next time the guy will be able to login.
it's supposed to check if Gameguard is installed or not. 0 is RECOMMENDED.

b°) where are the other config?:
Most of them have been moved to the mysql table "list_config", go see there:
viewtopic.php?f=18&t=4261


4°) how to have log files?:
You simply have to create a folder "log" into your "binary" folder to get your servers logs.
Image
Image
Image
To get packets as well, create a folder "plog" into your "binary" folder.


5°) Running a server in debug mode:
It's very useful if you got a crash and want to report something.

Open the server you want to run in debug mode, let's say "loginserver.cbp".
Then hit "Debug"->"Start" and the server should launch itself.
Image
Image

Note:
In some rare occasions you'll have messages like that:
Image
Hit "Control+F7" to pass that until the server is launched.


When a crash occurs, Codeblocks will trap it and will tell you where it happened:
SNAG-dev_rev_0005.png


Be sure to have the "call stack" window opened:
Image
Image

To have all the interesting informations like line numbers and so on, make a screenshot of it.
Image

See this thread to know what watches are (seeing variables values while debugging).

Press the stop to stop debug mode:
Image


6°) Update the server (SVN):
It's easy. First stop all the servers, else you would have troubles.
Then right click on the folder where is your source code, then select "SVN Update":
SNAG-dev_rev_0000.png
SNAG-dev_rev_0000.png (9.64 KiB) Viewed 140812 times


And wait...
SNAG-dev_rev_0001.png


Now, of course if some code changed in the server, REBUILD them before launching them again.



7°) See the SVN Logs:
For each rev, the devs tell what changed. It's QUITE important you READ them!
To do this, simply right click on the folder where you source code is, then "properties":
SNAG-dev_rev_0002.png


Then tab "subversion" and "show log".
SNAG-dev_rev_0003.png


Wait a bit and you'll have the history.
SNAG-dev_rev_0004.png



8°) Dev rev updates:
Sometimes from one rev to another some files are updated, like STB, AIP and QSD files. Those files don't need special handling.
Though sometimes some databases files (.sql) are changed, you NEED to import back those files into your mysql database, with Navicat for example.
The best way is FIRST to delete the according database table BEFORE importing the new one.
For example if you "list_npcs.sql" changed, delete the table "list_npcs" and import after the file "list_npcs.sql".

9°) How to post a bug, how to export data from an avatar:
See this thread in bug forum:
viewtopic.php?f=30&t=2173

10°) how to launch the game?:
Make a batch file (like "rose.bat") near Trose.Exe with this command line:
  1. TRose.exe @TRIGGER_SOFT@ _server your_server_ip

so for example:
  1. TRose.exe @TRIGGER_SOFT@ _server 127.0.0.1



11°) GM commands:
Most of the time GM Commands needs at least a 300 level AND the "isgm" flag set to 1 for a player.
You can set the player's "level" into the "account" mysql table, it will apply for ALL his avatars (characters).
You can set the "isgm" to 1 into the "characters" mysql table, for each of his avatar (one can have this, one don't...).

If you want to give your players access to some GM commands, you must set the access level for this command so they can use them. It's in file "commands.ini". By default it's GM (level 300) only, for example /go:
[/quote]Go=299[/quote]

If you want players (who are only level 100) to access it you need to change the value by:
[/quote]Go=99[/quote]


Notes:
-> For your GMs it's better than you give them 300 level AND the isGM set to 1,
-> Some GM commands check that the "isgm" flag is set to 1 for example:
  1. if(Config.Command_Ban > thisclient->Session->accesslevel || thisclient->CharInfo->isGM == false)

So this command wouldn't be accessible to players, even if you lower its access to "99" in commands.ini.


12°) Where can I find an item list, GM command lists, class list?:
You can use the amazing PurpleYouko's website and use too the amazing rl2171 admin's guide which is in the tools SVN.


13°) I'd like to install a CMS and an item mall:
Look at the guide for rev 80 for some details, but there are some new CMS available in this forum, for example this one.
An item mall done by Rifke is in this forum too.

Note:
You should check that the CMS are "hack" free. That means the MySQL queries are sanitized (using mysql_real_escape_string, stuff like that), there are some discussions on it in the forum.


14°) Can I install the Dev Rev database on top on my old rev 80 one?:
No.
Some fields and unique keys have been added (like ow_slot) so please do a NEW mysql database and install in it the dev rev database using the installer.
Then if you want to import your "old" characters, account, items and so on, export them (dump) from your rev 80 and import them back in the new database.
BUT don't use "drop" and "create". Only "insert" mysql commands.
Meaning respect the tables structure...


15°) I have a lot of warning about missing QSDs:
It's ok.
It's because from time to time naRose doesn't clean the QSD list and removes "old" QSD files (from event for example) and doesn't update the QSD list (.stb file).


16°) I want to add a map / I have a warning about "NB_GRIDS"?:
NB_GRIDS tells the server how many active maps are expected. It's very important you solve this warning!

See this thread:
viewtopic.php?f=18&t=3901


17°) I want to add a skill to each player when they create an avatar (like drving cart or CG)?:
You need to change the "default" value of the field "basic_skills" in "characters" mysql table to add (or delete) it.
Open Navicat Lite (or PhpMyAdmin), right click on "characters" and "Design Table":
skill_01.png


there in "basic_skills" you see in "default" all the skills a player will have when he'll create a new avatar.
If you want to add one, just add a ",xxxx" at the end of the line, for example: ",5002" (without the " of course).
If you want to delete one, just delete the ",yyyy" (yyy beeing the skill ID), for example ",5001".
skill_02.png


Btw., 5001 is driving cart skill, 5002 for CG.


18°) I have some errors when I try to buy an item from a NPC?:
If you have those errors:
npc_01.jpg
npc_01.jpg (9.78 KiB) Viewed 128260 times

npc_02.jpg

That means your server and data files (list_sell.stb) aren't the same. So it's very possible other files aren't the same as well.
So extract the files from your client and copy them to your server (see VI°)).
See this thread too for more explanations:
viewtopic.php?f=18&t=4250&start=0
The world is full of love and peace ^_^
Image
User avatar
lmame
Admin
Admin
 
Posts: 8997
Joined: Mon Aug 06, 2007 4:42 pm
Location: July City

Re: [Dev Rev] download / install / build / log / debug

Postby kazumi_14 on Mon Jan 05, 2009 1:43 pm

Wow nice Guide, i'll Try it. Thanks Lmame
Image
User avatar
kazumi_14
Rackie
Rackie
 
Posts: 192
Joined: Mon Jan 28, 2008 3:09 pm
Location: Philippines

Re: [Dev Rev] download / install / build / log / debug

Postby lmame on Fri Jan 16, 2009 9:01 pm

Some stuff added:
-> how to update the code,
-> how to read the svn logs,
-> stuff not to forget when updating the server,
The world is full of love and peace ^_^
Image
User avatar
lmame
Admin
Admin
 
Posts: 8997
Joined: Mon Aug 06, 2007 4:42 pm
Location: July City

Re: [Dev Rev] download / install / build / log / debug

Postby lmame on Sat Jan 17, 2009 4:46 pm

Added a screenshot for debug mode.
The world is full of love and peace ^_^
Image
User avatar
lmame
Admin
Admin
 
Posts: 8997
Joined: Mon Aug 06, 2007 4:42 pm
Location: July City

Re: [Dev Rev] download / install / build / log / debug

Postby PurpleYouko on Sat Jan 17, 2009 5:05 pm

My call stack window does not show any data for 'file' or 'line'
It shows the address and function but file and line just stay empty after a crash.
Without this data the debug mode is kind of useless.

is there some setting that I'm missing?
I can't find anything that will enable to output. :?
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Re: [Dev Rev] download / install / build / log / debug

Postby lmame on Sat Jan 17, 2009 5:10 pm

I think debugging symbols are missing.

Menu "Project"->"Build Options"
Then select your profile in the left pannel (we got two in osRose, "worldserver" and "default" for example).
On the right panel:
Select tab "Compiler settings"-> and inside tab "Compiler Flags"
Then check "Produce debugging symbols".
Do that for both profiles if you want (we did it only for "worldserver").

Rebuild your server after that and you should be ok :)
The world is full of love and peace ^_^
Image
User avatar
lmame
Admin
Admin
 
Posts: 8997
Joined: Mon Aug 06, 2007 4:42 pm
Location: July City

Re: [Dev Rev] download / install / build / log / debug

Postby PurpleYouko on Sat Jan 17, 2009 5:19 pm

OK i checked and the debug symbol check box was definitely un checked.

I checked it and rebuilt the server. Now we wait to see what happens if and when it crashes.
It hasn't actually crashed in a little over a week now though so it might be a long wait. :lol:
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Re: [Dev Rev] download / install / build / log / debug

Postby lmame on Sat Jan 17, 2009 5:22 pm

Well, long is good in this case :lol:
The world is full of love and peace ^_^
Image
User avatar
lmame
Admin
Admin
 
Posts: 8997
Joined: Mon Aug 06, 2007 4:42 pm
Location: July City

Re: [Dev Rev] download / install / build / log / debug

Postby lmame on Fri Jan 30, 2009 9:22 am

Added the link to the "bug" forum and how to export data from an avatar.
The world is full of love and peace ^_^
Image
User avatar
lmame
Admin
Admin
 
Posts: 8997
Joined: Mon Aug 06, 2007 4:42 pm
Location: July City

Re: [Dev Rev] download / install / build / log / debug

Postby Berryman13 on Sun Mar 08, 2009 8:42 pm

lmame wrote:Added the link to the "bug" forum and how to export data from an avatar.


Sorry for bump, but this is awesome >.>
Berryman13
Smoulie
Smoulie
 
Posts: 36
Joined: Sun Mar 08, 2009 7:30 pm

Next

Return to Support - OsRose Emulator

Who is online

Users browsing this forum: No registered users and 16 guests

cron