Linux (General Setup)

Post Reply
Melodina
Posts: 29
Joined: Mon Jul 23, 2012 9:20 am

Linux (General Setup)

Post by Melodina » Tue Jul 24, 2012 9:44 am

Any linux can run pretty much anything, so choose your flavor and read lightly.
This guide was orginally written on Fedora 17

Minimal Install
(GCC GCC-C++ PKGCONFIG MYSQL-SERVER SUBVERSION VIM SCREEN PATCH MAKE AUTOGEN AUTOMAKE AUTOCONF LUA LUA-DEVEL) + SYSTEM BASE
Please note: GCC 4.6.3 or better required.
User: ffxi // Password: ffxi
Directory /home/ffxi
dsp/

First, lets check out the latest revision:

Code: Select all

[ffxi@ffxi ~] svn co http://onetimexi.googlecode.com/svn/trunk/ dsp/
        Checked out revision 1532.
Patch for Linux attained from:
http://dspt.freeforums.org/compile-on-l ... -t223.html

Apply patch to dsp

Code: Select all

[ffxi@ffxi dsp]$ patch -p0 -i dssearchv4.diff
        patching file src/search/tcp_request.cpp
        patching file src/search/tcp_request.h
        patching file src/search/data_loader.h
        patching file src/search/search.cpp
        Hunk #1 succeeded at 30 with fuzz 1.
        Hunk #2 succeeded at 70 (offset 2 lines).
        Hunk #3 succeeded at 126 (offset 2 lines).
        Hunk #4 succeeded at 140 (offset 2 lines).
        Hunk #5 succeeded at 162 (offset 2 lines).
        Hunk #6 succeeded at 176 (offset 2 lines).
        Hunk #7 succeeded at 186 (offset 2 lines).
        Hunk #8 succeeded at 201 (offset 2 lines).
        Hunk #9 succeeded at 219 (offset 2 lines).
        Hunk #10 succeeded at 240 (offset 2 lines).
        Hunk #11 succeeded at 253 (offset 2 lines).
        Hunk #12 succeeded at 381 (offset 2 lines).
        Hunk #13 succeeded at 433 (offset 2 lines).
        Hunk #14 succeeded at 495 (offset 5 lines).
        Hunk #15 succeeded at 549 (offset -15 lines).
        Hunk #16 succeeded at 850 (offset 32 lines).
        patching file src/search/packets/party_list.h
        Hunk #1 succeeded at 25 with fuzz 2.
        Hunk #2 succeeded at 47 with fuzz 1 (offset 1 line).
        patching file src/map/packets/trade_update.h
run autogen.sh script.

Code: Select all

[ffxi@ffxi dsp]$ sh autogen.sh
Then run configure

Code: Select all

[ffxi@ffxi dsp]$ ./configure
If you run into problems with configure not finding lua, use ./configure LUA_LIBS=/usr/lib LUA_CFLAGS=llua


It may not compile until you edit the make file. (only some flavors of linux)

Code: Select all

Line 762:
        FROM:
        LIBS_ALL = $(DARKSTAR_LIBS) $(LIBS_LUA) -llua $(LIBS_MYSQL) \
        -lmysqlclient $(am__append_1) $(am__append_2)

        TO:
        LIBS_ALL = $(DARKSTAR_LIBS) $(LIBS_LUA) -llua $(LIBS_MYSQL) \
        -L/usr/lib/mysql -lmysqlclient -lpthread $(am__append_1) $(am__append_2)
Run Make.

Code: Select all

[ffxi@ffxi dsp]$ make
lots of text will scroll here while it creates the binaries.
Compile complete.

Create your mysql database and user.

In our example, we'll create dspdb user.

Code: Select all

mysql -u root -p
        password: **********

        mysql> create user 'dspdb'@'localhost' IDENTIFIED BY 'ffxi';
        mysql> create database dspdb;
        mysql> GRANT USAGE ON * . * TO 'dspdb'@'localhost' IDENTIFIED BY 'ffxi' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;
        mysql> GRANT ALL PRIVILEGES ON `dspdb` . * TO 'dspdb'@'localhost';
Then you'll need to source all of your files in the dsp/sql folder.

Code: Select all

[ffxi@ffxi dsp]$ cd sql
        [ffxi@ffxi sql]$ for f in *.sql
        > do
        >         mysql -u dspdb -pffxi dspdb < $f
        >         echo "sourcing $f"
        > done

        sourcing abilities.sql
        sourcing accounts_banned.sql
        sourcing accounts_sessions.sql
        sourcing accounts.sql
        sourcing auction_house.sql
        sourcing bcnm_info.sql
        sourcing bcnm_instance.sql
        sourcing char_effects.sql
        sourcing char_equip.sql
        sourcing char_exp.sql
        sourcing char_inventory.sql
        sourcing char_jobs.sql
        sourcing char_look.sql
        sourcing char_skills.sql
        sourcing chars.sql
        sourcing char_stats.sql
        sourcing char_titles.sql
        sourcing char_vars.sql
        sourcing delivery_box.sql
        sourcing elevators.sql
        sourcing exp_base.sql
        sourcing exp_table.sql
        sourcing fishing_fish.sql
        sourcing fishing_lure.sql
        sourcing fishing_rod.sql
        sourcing fishing_zone.sql
        sourcing guild_shops.sql
        sourcing item_armor.sql
        sourcing item_basic.sql
        sourcing item_furnishing.sql
        sourcing item_mods.sql
        sourcing item_puppet.sql
        sourcing item_usable.sql
        sourcing item_weapon.sql
        sourcing linkshells.sql
        sourcing mob_droplist.sql
        sourcing mob_family_system.sql
        sourcing mob_groups.sql
        sourcing mob_pools.sql
        sourcing mob_skill.sql
        sourcing mob_spawn_points.sql
        sourcing npc_list.sql
        sourcing pet_list.sql
        sourcing server_variables.sql
        sourcing skill_caps.sql
        sourcing skillchain_damage_modifiers.sql
        sourcing skill_ranks.sql
        sourcing spell_list.sql
        sourcing status_effects.sql
        sourcing synth_recipes.sql
        sourcing traits.sql
        sourcing transport.sql
        sourcing triggers.sql
        sourcing weapon_skills.sql
        sourcing zonelines.sql
        sourcing zone_settings.sql
Your databases are now created and ready for use, please edit your config files and update your zone settings.

Zone Settings --> http://dspt.freeforums.org/installing-s ... er-t4.html
Section E. Configure the ZoneIP for the Map Server


Config Files:
in login_darkstar.conf

Code: Select all

        mysql_host:      127.0.0.1
        mysql_port:      3306
        mysql_login:     dspdb
        mysql_password:  ffxi
        mysql_database:  dspdb
in map_darkstar.conf

Code: Select all

        mysql_host:      127.0.0.1
        mysql_port:      3306
        mysql_login:     dspdb
        mysql_password:  ffxi
        mysql_database:  dspdb
in search_server.conf

Code: Select all

        mysql_host:      127.0.0.1
        mysql_port:      3306
        mysql_login:     dspdb
        mysql_password:  ffxi
        mysql_database:  dspdb
Your now ready to start your binaries.
Run: screen
in window 1:
./dsconnect

Press ctrl+a a
./dssearch

Press Ctrl+a a
./dsgame

If you want to check on them, press ctrl+a # (0-2) to switch windows.
Once this is completed, you should beable to login with a client.

FFXI Boot or mXI required.

User avatar
whasf
Site Admin
Posts: 1312
Joined: Thu Jul 19, 2012 9:11 pm

Re: Linux (General Setup)

Post by whasf » Sun Jul 29, 2012 5:35 pm

Here is dssearchv6.diff (zipped up obviously)
Attachments
dssearchv6.zip
(2.66 KiB) Downloaded 571 times
-- Whasf

lautan
Developer
Posts: 164
Joined: Mon Jul 30, 2012 6:17 pm

Re: Linux (General Setup)

Post by lautan » Fri Dec 28, 2012 9:01 pm

Thanks for the guide. I have some useful commands for others doing this:

To start dsgame, dsconnect etc on separate processes simply run:

Code: Select all

nohup ./dsconnect &
You can then press ctrl + c to get out. It will still be running in the background though.

If you want to kill the process run:

Code: Select all

ps -ax | grep ds
Find the number beside it and run kill -9 *process-id*. process-id is of course the number.

I also created an easy to use migration command:

Code: Select all

find ./sql -name '*.sql' -mtime 0 -print0 | xargs -0 awk 'FNR==1{print ";"}1' | mysql -u root -p dspdb
Run this inside the root directory. This will find all sql scripts updated TODAY and run them. Simply run svn update and then that command to update the database. If that command causes you issues you can use cat instead.

Code: Select all

find ./sql -name '*.sql' -mtime 0 -print0 | xargs -0 cat | mysql -u root -p dspdb

altalus
Posts: 136
Joined: Wed Nov 14, 2012 8:31 pm
Location: Montreal Qc, CAN

Re: Linux (General Setup)

Post by altalus » Sat Dec 29, 2012 8:35 am

The advantage of screen is that you can disconnect and reconnect to a session at will. We use it quite a lot at work and on client's servers.

bluekirby0
Developer
Posts: 707
Joined: Sun Jul 22, 2012 12:11 am

Re: Linux (General Setup)

Post by bluekirby0 » Sun Dec 30, 2012 12:17 pm

I'd like to point out that there are Linux setup guides on the wiki as well. If something is wrong or out-of-date on the wiki anyone can fix it up just by signing up (without needing an e-mail address to do so).

idlemind
Posts: 22
Joined: Sun Apr 14, 2013 8:07 pm

Re: Linux (General Setup)

Post by idlemind » Tue Apr 16, 2013 10:03 pm

Updated dssearchv6.diff to stop trade_update.h errors. The items in dssearchv6.diff for that file are in core now.
Attachments
dssearchv7.zip
(2.53 KiB) Downloaded 569 times

lautan
Developer
Posts: 164
Joined: Mon Jul 30, 2012 6:17 pm

Re: Linux (General Setup)

Post by lautan » Wed May 29, 2013 5:31 pm

Thanks idlemind

Post Reply