Linux Headless YO:Dedicated Server with WINE

Want to learn or teach others some of the finer details of Life is Feudal? This section is for the game guides, tutorials and FAQ's.

Kakusha
 
Posts: 9
Joined: 29 Sep 2014, 03:19

Linux Headless YO:Dedicated Server with WINE

Post by Kakusha » 02 Oct 2014, 08:48

Edit: 2015/10/30
This post may be obsolete at this time.
Since I cannot update these info about LIF any more, Please check other people's great guides instead. Thanks.


----------

Finally I got it working.
So I'd like to share how to setup LiF_YO Dedicated Server on headless linux box.
I'm using CentOS6 64bit but should run on any other distributions.
-------------------------
1. Prepare the game data

Use scp(e.g.WinSCP) or steamcmd to get LiF_YO:Dedicated Server.
For example,
Code: Select all
./steamcmd.sh +@sSteamCmdForcePlatformType windows +login HOGEHOGE +force_install_dir /PATH/TO/DATA +app_update 320850 validate +quit
cp -rf /PATH/TO/DATA /PATH/TO/SRV


2. Install MariaDB5.5 and configure it

###For CentOS6 user like me###
Spoiler


Edit(and backup) MariaDB config file.
Code: Select all
vi /etc/my.cnf.d/server.conf

Merge SRV/docs/my.ini with it. I added them below [mysqld] section.
Spoiler


Start service and do the initial setup.
Code: Select all
chkconfig mysql on
service mysql start
mysql_secure_installation


Create database and its user you will use. Name it like (lif_X: X=1,2,3,...).
Code: Select all
mysql -uroot -p
MariaDB > create database lif_1;
MariaDB > grant all privileges on lif_1.* to DBUSERNAME@localhost identified by "DBPASSWD";
MariaDB > exit


##############
Unfortunately, I couldn't get the game server to create its tables(esp. procedures) in a linux environment.
Hitting a new.sql and a patch.sql in a shell may also end in failure, neither.
So, create a database on your windows machine and export these tables to the linux box.
##############


##############
This is important. First, create a database with mariaDB-server 5.5 on windows environments by simply executing dedicated-server tool available in steam.
Note that running dedi-srv-tool will create a proper database magically :angel: , if it does not already exist.

Then, export it to the designated mariaDB-server 5.5 via mysqldump, 3rd party tools, or whatever you like.
##############

3. Configure game server

config_local.cs
Code: Select all
cp SRV/docs/config_local.cs SRV/

Then edit it so that it uses DBUSERNAME and DBPASSWD for database access.
Also tweak SRV/config/world_x.xml for server name, password, and so on.

4. Install WINE and Xvfb

Just install it.
Code: Select all
yum install wine
yum install xorg-x11-server-Xvfb


5. RUN
Although Bobik-san mentioned that the server is already console only, it does try to create a window.
I suspect that he is planning to implement a 3D-view of the server console. :lol:
Therefore, you need to run Xvfb; otherwise you'll stuck during login process.
Code: Select all
Xvfb :1 -screen 0 800x600x8 &
DISPLAY=127.0.0.1:1.0;export DISPLAY;
wine /PATH/TO/SRV/ddctd_yo_cm.exe "-worldID 1" &


-------------------------
This post is improvised one and not very helpful maybe. (let alone my EngRish)
So, I'll improve this instruction gradually and eager to update this OP.
Anyway, now my life is feudal. thanks everyone!
:)
-------------------------
2014/10/10: Edited
Last edited by Kakusha on 30 Oct 2015, 11:53, edited 11 times in total.


MaxTorS
 
Posts: 4
Joined: 25 Oct 2013, 22:55

Re: Linux Headless YO:Dedicated Server with WINE

Post by MaxTorS » 08 Oct 2014, 15:01

I get this error when i launch the server:
Code: Select all
ERRR 2014-10-08 17:42:25.545 {00} <NOSCOPE> # CmDbTableIDRange::_issueNewDbIDRange() - db problem [T:DBIPrimary:0x0028]
ERRR 2014-10-08 17:42:25.545 {00} <NOSCOPE> # DB error #1305: PROCEDURE lif_1.p_issueIdRange_unmovable_objects does not exist. Query: <unknown> [T:DBIPrimary:0x0028]
ERRR 2014-10-08 17:42:25.545 {00} <NOSCOPE> # DBI can't process event. Error: -1 [T:DBIPrimary:0x0028]
ERRR 2014-10-08 17:42:25.545 {00} <NOSCOPE> # DB error #1305: PROCEDURE lif_1.p_issueIdRange_movable_objects does not exist. Query: CALL p_issueIdRange_movable_objects(1,100); [T:DBIPrimary:0x0028]
WARN 2014-10-08 17:42:25.546 {00} <NOSCOPE> # DB::mfRS(0 ms) CALL p_issueIdRange_movable_objects(1,100); [T:DBIPrimary:0x0028]
ERRR 2014-10-08 17:42:25.546 {00} <NOSCOPE> # CmDbTableIDRange::_issueNewDbIDRange() - db problem [T:DBIPrimary:0x0028]
ERRR 2014-10-08 17:42:25.546 {00} <NOSCOPE> # DB error #1305: PROCEDURE lif_1.p_issueIdRange_movable_objects does not exist. Query: <unknown> [T:DBIPrimary:0x0028]
ERRR 2014-10-08 17:42:25.546 {00} <NOSCOPE> # DBI can't process event. Error: -1 [T:DBIPrimary:0x0028]
HACK 2014-10-08 17:42:27.012 {00} <NOSCOPE> CmSteam::onSteamServersConnected
HACK 2014-10-08 17:42:27.312 {00} <NOSCOPE> CmSteam::onSteamPolicyResponse. secure=1, our steamID=90092253101117443
HACK 2014-10-08 17:42:27.313 {00} <NOSCOPE> Steam initialized
%



When client going to connect get a cr_internal_db_error

How i can fix it ? :x


Kakusha
 
Posts: 9
Joined: 29 Sep 2014, 03:19

Re: Linux Headless YO:Dedicated Server with WINE

Post by Kakusha » 09 Oct 2014, 06:46

Seems like the procedures are missing in your setup.
As I wrote, executing these sql files on linux environments may results in a failure and these essential procedures may not be created.

So, first, create a database on windows environments by simply executing dedicated-server tool available in steam.
Then, export it to the designated mariaDB-server via mysqldump, 3rd party tools, or whatever you like.

Thanks for feedback and hope this helps.


MaxTorS
 
Posts: 4
Joined: 25 Oct 2013, 22:55

Re: Linux Headless YO:Dedicated Server with WINE

Post by MaxTorS » 09 Oct 2014, 13:56

Kakusha wrote:Seems like the procedures are missing in your setup.
As I wrote, executing these sql files on linux environments may results in a failure and these essential procedures may not be created.

So, first, create a database on windows environments by simply executing dedicated-server tool available in steam.
Then, export it to the designated mariaDB-server via mysqldump, 3rd party tools, or whatever you like.

Thanks for feedback and hope this helps.


Yes i make a SQL tables in windows and import via MySQLworkbench to the linux server, may you can give me a .SQL file ?


Ataman
 
Posts: 6
Joined: 07 Oct 2014, 19:16

Re: Linux Headless YO:Dedicated Server with WINE

Post by Ataman » 09 Oct 2014, 17:33

I can't find any way to dump functions with HeidiSQL or Navicat, any other suggestion to dump a remote MariaDB database?

Nevermind: the new.sql script inserts the procedures.


MaxTorS
 
Posts: 4
Joined: 25 Oct 2013, 22:55

Re: Linux Headless YO:Dedicated Server with WINE

Post by MaxTorS » 09 Oct 2014, 19:16

Ataman wrote:I can't find any way to dump functions with HeidiSQL or Navicat, any other suggestion to dump a remote MariaDB database?

Nevermind: the new.sql script inserts the procedures.


When i tryed to import the new.sql i have 1 error, how u fix it?


Funky
Alpha Tester
 
Posts: 4
Joined: 05 Mar 2014, 18:54

Re: Linux Headless YO:Dedicated Server with WINE

Post by Funky » 09 Oct 2014, 22:24

I got this
Code: Select all
ERROR 1064 (42000) at line 140820: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 3

When trying to mysql -u -p < new.sql

I have tried to continue the installation anyway after this ... But .. Got several other issues next (wine, xvfb :p)

Any help ? :)


MaxTorS
 
Posts: 4
Joined: 25 Oct 2013, 22:55

Re: Linux Headless YO:Dedicated Server with WINE

Post by MaxTorS » 10 Oct 2014, 01:35

Funky wrote:I got this
Code: Select all
ERROR 1064 (42000) at line 140820: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 3

When trying to mysql -u -p < new.sql

I have tried to continue the installation anyway after this ... But .. Got several other issues next (wine, xvfb :p)

Any help ? :)


I have the same problem, anyone can attach the sql file, or upload on external site same mega or similar?


Ataman
 
Posts: 6
Joined: 07 Oct 2014, 19:16

Re: Linux Headless YO:Dedicated Server with WINE

Post by Ataman » 10 Oct 2014, 11:14

I imported it through HeidiSQL and a remote connection from my local PC, if you do that be sure to select UTF-8 before loading the script. (HeidiSQL usually tries to determine it automatically but this seems to fail).


Funky
Alpha Tester
 
Posts: 4
Joined: 05 Mar 2014, 18:54

Re: Linux Headless YO:Dedicated Server with WINE

Post by Funky » 15 Oct 2014, 08:22

Finally managed to make it run over a Debian 7.5 stable (Wheezy) (32bits).
I am using wine-1.7.15, compiled into a .deb file by a friend of mine. I think I can share those deb files :)

Another tips, it seems that you need to use this command when dumping from windows, otherwise some routines are missing :
Code: Select all
mysqldump --routines -u root -p "lif_1" > "lifdu
mp.sql"

lif_1 being database name, lifdump.sql the output file that will be imported in your linux database.

Finally, we have also managed to make it run correctly via ssh only with those commands :
Code: Select all
Xvfb :0 -screen 0 800x600x8
export DISPLAY=:0
nohup xterm -e 'wine /home/steam/steamCMD/LIF/ddctd_cm_yo_server.exe "-worldID 1"' &


If it starts correctly, you will see ddctd_cm_yo_server.exe taking 100% CPU, means its good, once it starts to reduce to like 5%, your serv is ready (it takes at least more than a minute).

Hope this helps.

F.

User avatar
Nuruti
 
Posts: 13
Joined: 07 Oct 2014, 08:26

Re: Linux Headless YO:Dedicated Server with WINE

Post by Nuruti » 25 Oct 2014, 22:32

There is some weird kind of syntax problem in the new.sql file. Here is a python3 script to fix the sql dump so you can import it with the mysql tool.

https://gist.github.com/fr3aker/f57781e5251af0ccfa1b

Code: Select all
cd sql
python3 fixnewsql.py
mysql -u mysqluser -p lif_1 < fixed_new.sql


McyD
 
Posts: 2
Joined: 17 Oct 2014, 22:12

Re: Linux Headless YO:Dedicated Server with WINE

Post by McyD » 11 Nov 2014, 03:05

Thanks, this really helped in getting a server running on my dedi, question though.

How to reattach to the console once it is running? I would rather not have to kill the pid to shut it down. I am not familiar with xfvb at all, and it seems a screen is not re-attachable as normal.

NVM, I just started a new screen first before starting it, lol.

Okay that did not work, as the quit(); casues the screen to lose the console but leaves it running.


Briggybros
 
Posts: 1
Joined: 30 Nov 2014, 20:57

Re: Linux Headless YO:Dedicated Server with WINE

Post by Briggybros » 30 Nov 2014, 21:25

Hello, I'm also trying to get this to work, I've got all of the database stuff working and have wine and xvfb installed. I run this command to try to run the server:
Code: Select all
Xvfb :1 -screen 0 800x600x8 &
DISPLAY=localhost:1.0;export DISPLAY;
wine /home/agent/lifyo/ddctd_cm_yo_server.exe "-worldID 1" &


However, I get this back from wine:
Code: Select all
wine: Call from 0x7b83b581 to unimplemented function msvcp100.dll.??0_Container_base12@std@@QAE@XZ, aborting
wine: Unimplemented function msvcp100.dll.??0_Container_base12@std@@QAE@XZ called at address 0x7b83b581 (thread 0009), starting debugger...


Does anyone have a fix for this?


Ecstasy
 
Posts: 2
Joined: 07 Dec 2014, 11:16

Re: Linux Headless YO:Dedicated Server with WINE

Post by Ecstasy » 07 Dec 2014, 11:18

Can someone help me to install the game on a Debian 7 Root Server?

Maybe is here a german who can help me? My english is not realy the best ^^


Jarlvk
 
Posts: 1
Joined: 10 Oct 2014, 15:01

Re: Linux Headless YO:Dedicated Server with WINE

Post by Jarlvk » 10 Dec 2014, 10:57

Whats the performance like in linux? Is most load in the sql server, or in the wine environment?


Atomtomate
 
Posts: 1
Joined: 06 Jan 2015, 19:27

Re: Linux Headless YO:Dedicated Server with WINE

Post by Atomtomate » 06 Jan 2015, 19:33

did you do anything else (e.g. winetricks) to make it run?
my server keeps crashing after PassabilityWorldMap::Initialize finished.
i am using a self compiled wine-1.7.33:i386 on a headless debian 64 machine. i honestly don't want to downgrade to some (now) intermediate version. stable doesn't work for sure (tried that first)


Kamikazementos
 
Posts: 3
Joined: 12 Jan 2015, 17:02

Re: Linux Headless YO:Dedicated Server with WINE

Post by Kamikazementos » 13 Jan 2015, 08:55

I couldn't install wine with yum. Did you do anything before "yum install wine"? I installed wine from a self built version, but I am not able to get libpng to work, which results in a lot of errors whenever wine is started. Could anyone help me out?


Kenny
 
Posts: 1
Joined: 31 Mar 2015, 21:13

Re: Linux Headless YO:Dedicated Server with WINE

Post by Kenny » 31 Mar 2015, 21:17

Hey!

After recent patch, we're having problems starting our server. First, there were some DLLs missing, just copied them from my local windows machine to .wine-folder and it works. But now the server startup hangs at

Code: Select all
<loadAIs> PassabilityWorldMap::Load_map_from_disk(): reading from 'PassabilityMap_1.dat'


Even after 12 hours there's no change... Any ideas?


Zaarjin
 
Posts: 3
Joined: 06 Apr 2015, 18:39

Re: Linux Headless YO:Dedicated Server with WINE

Post by Zaarjin » 09 Apr 2015, 08:50

Thanks for the tutorial.
It was really helpful to get a server working on debian.

However after 24h, the server starts giving cr_internal_db_error errors like described in that post.

Did anyone of you had this error and find a way of fixing it?

Return to Guides and Tutorials

cron