Code Monkey home page Code Monkey logo

server's Introduction

If you're using Windows or Docker environment, skip the following content and see install using docker.

TL;DR

Compile

The development environment is Ubuntu 20.04, other linux release should also work.

dependency

  • libmysqlclient-dev 5.7
  • lua 4.0
  • xerces-c 3.2.3

lua 4.0 has to be download from the internet, other dependencies can be installed using apt.

compile

If your head file are not in the standard path, specify the include path like this:

export CPLUS_INCLUDE_PATH=/path/to/your/lua-4.0.1/include:$CPLUS_INCLUDE_PATH
// export CPLUS_INCLUDE_PATH=/path/to/your/xerces-c-3.2.3/xerces-c-3.2.3/src/:$CPLUS_INCLUDE_PATH

export LIBRARY_PATH=/path/to/your/lua-4.0.1/lib/:$LIBRARY_PATH
// export LIBRARY_PATH=/path/to/your/xerces-c-3.2.3/xerces-c-3.2.3/src/.libs/:$LIBRARY_PATH

And then compile is easy, just call:

make

or make -j 8 if you have a 8 cores CPU computor to accelerate the compilation.

Setup the Database

MySQL 5.7 or 8 are tested.

Create a user 'elcastle'@'%' with password 'elca110'

Create the DARKEDEN and USERINFO database:

create database DARKEDEN;
create database USERINFO;

Make sure the sql_mode allow zero date time, remove the NO_ZERO_DATE from the sql_mode:

mysql> select @@global.sql_mode;
+-------------------------------------------------------------------------------------------------------------------------------------------+
| @@global.sql_mode                                                                                                                         |
+-------------------------------------------------------------------------------------------------------------------------------------------+
| ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
+-------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> set @@global.sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
Query OK, 0 rows affected (0.02 sec)

Then load the SQL file initdb/DARKEDEN.sql and initdb/USERINFO.sql:

mysql -h 127.0.0.1 -u elcastle -D 'DARKEDEN' -p < initdb/DARKEDEN.sql
mysql -h 127.0.0.1 -u elcastle -D 'USERINFO' -p < initdb/USERINFO.sql

Update the DARKEDEN.WorldDBInfo and DARKEDEN.GameServerInfo table to set the correct IP/PORT().

Modify Configure

You need to change the configure files in the conf/ directory. HomePath should be the repository directory path.

The DB_HOST should be you database IP address, LoginServerIP should also be changed accordingly.

DON'T forget the DARKEDEN.WorldDBInfo and DARKEDEN.GameServerInfo tables in the database, they are not in the configure files, but the data should match, otherwise you can't login.

Start the server

Start the loginserver, sharedserver, gameserver in order:

./bin/loginserver -f ./conf/loginserver.conf
./bin/sharedserver -f ./conf/sharedserver.conf
./bin/gameserver -f ./conf/gameserver.conf

server's People

Contributors

tiancaiamao avatar rafakave avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.