One of the things I love doing is building out servers that the average user never realized existed. Today build out is a SEGS server, built on CentOS7 from source. SEGS is a service that can run on most *nix platforms that allows users to connect their CoX client to and run around the city. (Well it will be that when its done, has a fair bit of work to do on it). If you don’t know what CoX is here is a quick definition http://cityofheroes.wikia.com/wiki/CoX.

Now lets get building:

  1. First we are starting out with a bare minimum install of CentOS 7 at which time there are some general tools I like to install, (Vim my text editor of choice, htop a prettier and better version of top, git which will be required to pull the source code, cmake3 which is used for compiling the source code and screen which allows you to have running processes set into a screen which doesn’t close if you disconnect. Run the below commands to install these (Assumes running at root)
    • yum install epel-release
    • yum install htop vim git screen
  2. Next I’ll be slightly modifying what it says in SEGS readme on their repo (https://github.com/Segs/Segs) Note the change of devtoolset-6 to devtoolset-7
    • yum install git centos-release-scl-rh
    • yum install devtoolset-7-gcc-c++ devtoolset-6-gcc-c++
    • source /opt/rh/devtoolset-7/enable
    • source /opt/rh/devtoolset-6/enable
    • yum install gcc gcc-c++ git-core kernel-devel qt5-qtdeclarative-devel qt5-qtbase-devel qt5-qtbase qt5-qtwebsockets qt5-qtwebsockets-devel
    • Optional: yum install qt5-qtbase-mysql
  3. Next you will need to pull the source from the repo
    • git clone https://github.com/Segs/Segs.git
  4. Now that you have installed the pre-reqs and pulled the source down you should be ready to build. These instructions are on the site, but I figured I’d condense it down here
    • Make your build directory
      • mkdir bld
    • Run cmake against the source code from your build directory
      • cmake <path to source code>
        • eg cmake ../Segs
    • Now to compile you need to run make in the build directory
      • Run make
  5. After this compiles you will see an out folder this is where all the compiled files went to including the settings.cfg which you will need to update all the localhost entries (127.0.0.1) except the database if you are using sqlite
  6. You will need to create the default db and user, as well as mapinstances folder.
    • from the out folder run:
      • ./dbtool -f create
    • To create an admin user run:
      • ./dbtool adduser -l otlichno -p Temp1234 -a 9
    • And finally create the MapInstances folder with sub folder
      • From the out folder run:
        • mkdir MapInstances
        • mkdir MapInstances/City_00_01
  7. Finally the Pigg files, these are the files containing different components to the CoX game, and come with the CoX download. There is one in particular that needs to be extracted in order for the service to run. However all pigg files included with your CoX download need to be copied to the ./out/data folder directly. Steps are below:
    • Copy pigg files to ./out/data (The copy files not the folder)
    • Change directory into the data directory and run
      • ../piggtool -x bin.pigg
      • ../piggtool -x geom.pigg
      • ../piggtool -x geomBC.pigg
      • ../piggtool -x geomV1.pigg
      • ../piggtool -x geomV2.pigg
      • ../piggtool -x mapsCities1.pigg
      • ../piggtool -x mapsCities2.pigg
      • ../piggtool -x mapsHazards.pigg
      • ../piggtool -x mapsMisc.pigg
      • ../piggtool -x mapsMissiong.pigg
      • ../piggtool -x mapsTrials.pigg
  8. Then all you need to do is run ./authserver from the out folder
  9. **NOTE** If your firewall is enabled (Which it is by default) you will need to enable ports 2106, 7002, and 7003
    • sudo firewall-cmd –add-port=2106/tcp –permanent
    • sudo firewall-cmd –add-port=7002/udp –permanent
    • sudo firewall-cmd –add-port=7003/udp –permanent
    • sudo firewall-cmd –reload
    • **Aditional Note** MapInstance will have it’s port increment from the MapServer’s base port, which means you may want to execute the following firwall-cmd command prior to running the reload command
      • sudo firewall-cmd –add-port=7004-7009/udp –permanent

After all this you should have a ‘working’ version of SEGS and should be able to point your client at the server and at least log in and create characters and log into the world as it were.

Thank you for trying this out, let me know if you have any questions or issues.

************************************************************************************

Further notes:

if you are seeing error

c++: error: unrecognized command line option ‘-std=c++14’

you may need to add the below to your cmake command:

-DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc

2 Replies to “SEGS – Super Entity Game Server on Cent OS 7 build out guide”

  1. It seems like files are missing in mine after I run make… dbtool is missing, pigstool is missing, no authserver. The only files I have in ../bld/out are: data default_dbs README.md scripts settings.cfg.

    I do get a few warnings and then a few errors when running make:

    [ 18%] Building CXX object Utilities/slav/CMakeFiles/slav.dir/slav_autogen/mocs_compilation.cpp.o
    In file included from /home/aaron/CityofHeroes/Segs-0.5.0/bld/Utilities/slav/slav_autogen/mocs_compilation.cpp:2:0:
    /home/aaron/CityofHeroes/Segs-0.5.0/bld/Utilities/slav/slav_autogen/EWIEGA46WW/moc_FileSignatureWorker.cpp: In static member function âstatic void FileSignatureWorker::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)â:
    /home/aaron/CityofHeroes/Segs-0.5.0/bld/Utilities/slav/slav_autogen/EWIEGA46WW/moc_FileSignatureWorker.cpp:99:96: warning: useless cast to type â_t {aka void (FileSignatureWorker::*)()}â [-Wuseless-cast]
    if (*reinterpret_cast(func) == static_cast(&FileSignatureWorker::finished)) {
    ^
    /home/aaron/CityofHeroes/Segs-0.5.0/bld/Utilities/slav/slav_autogen/EWIEGA46WW/moc_FileSignatureWorker.cpp:106:96: warning: useless cast to type â_t {aka void (FileSignatureWorker::*)(QString, float)}â [-Wuseless-cast]
    if (*reinterpret_cast(func) == static_cast(&FileSignatureWorker::progress)) {
    ^
    /home/aaron/CityofHeroes/Segs-0.5.0/bld/Utilities/slav/slav_autogen/EWIEGA46WW/moc_FileSignatureWorker.cpp:113:93: warning: useless cast to type â_t {aka void (FileSignatureWorker::*)(QString)}â [-Wuseless-cast]
    if (*reinterpret_cast(func) == static_cast(&FileSignatureWorker::error)) {
    ^
    In file included from /home/aaron/CityofHeroes/Segs-0.5.0/bld/Utilities/slav/slav_autogen/mocs_compilation.cpp:3:0:
    /home/aaron/CityofHeroes/Segs-0.5.0/bld/Utilities/slav/slav_autogen/EWIEGA46WW/moc_SLAVLogic.cpp: In static member function âstatic void SLAVLogic::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)â:
    /home/aaron/CityofHeroes/Segs-0.5.0/bld/Utilities/slav/slav_autogen/EWIEGA46WW/moc_SLAVLogic.cpp:113:88: warning: useless cast to type â_t {aka void (SLAVLogic::*)(AppVersionManifest*, const QString&)}â [-Wuseless-cast]
    if (*reinterpret_cast(func) == static_cast(&SLAVLogic::needUpdate)) {
    ^
    In file included from /home/aaron/CityofHeroes/Segs-0.5.0/bld/Utilities/slav/slav_autogen/mocs_compilation.cpp:4:0:
    /home/aaron/CityofHeroes/Segs-0.5.0/bld/Utilities/slav/slav_autogen/EWIEGA46WW/moc_ServerConnection.cpp: In static member function âstatic void ServerConnection::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)â:
    /home/aaron/CityofHeroes/Segs-0.5.0/bld/Utilities/slav/slav_autogen/EWIEGA46WW/moc_ServerConnection.cpp:151:101: warning: useless cast to type â_t {aka void (ServerConnection::*)(const QString&, long long int, long long int)}â [-Wuseless-cast]
    if (*reinterpret_cast(func) == static_cast(&ServerConnection::downloadProgress)) {
    ^
    /home/aaron/CityofHeroes/Segs-0.5.0/bld/Utilities/slav/slav_autogen/EWIEGA46WW/moc_ServerConnection.cpp:158:99: warning: useless cast to type â_t {aka void (ServerConnection::*)(const QString&)}â [-Wuseless-cast]
    if (*reinterpret_cast(func) == static_cast(&ServerConnection::networkFailure)) {
    ^
    /home/aaron/CityofHeroes/Segs-0.5.0/bld/Utilities/slav/slav_autogen/EWIEGA46WW/moc_ServerConnection.cpp:165:102: warning: useless cast to type â_t {aka void (ServerConnection::*)(QString, QString)}â [-Wuseless-cast]
    if (*reinterpret_cast(func) == static_cast(&ServerConnection::retrievedManifest)) {
    ^
    /home/aaron/CityofHeroes/Segs-0.5.0/bld/Utilities/slav/slav_autogen/EWIEGA46WW/moc_ServerConnection.cpp:172:101: warning: useless cast to type â_t {aka void (ServerConnection::*)(ProjectApp*)}â [-Wuseless-cast]
    if (*reinterpret_cast(func) == static_cast(&ServerConnection::appDataAvailable)) {
    ^
    /home/aaron/CityofHeroes/Segs-0.5.0/bld/Utilities/slav/slav_autogen/EWIEGA46WW/moc_ServerConnection.cpp:179:105: warning: useless cast to type â_t {aka void (ServerConnection::*)(ProjectList*)}â [-Wuseless-cast]
    if (*reinterpret_cast(func) == static_cast(&ServerConnection::projectListAvailable)) {
    ^
    /home/aaron/CityofHeroes/Segs-0.5.0/bld/Utilities/slav/slav_autogen/EWIEGA46WW/moc_ServerConnection.cpp:186:102: warning: useless cast to type â_t {aka void (ServerConnection::*)(AppVersionManifest*)}â [-Wuseless-cast]
    if (*reinterpret_cast(func) == static_cast(&ServerConnection::manifestAvailable)) {
    ^
    In file included from /home/aaron/CityofHeroes/Segs-0.5.0/bld/Utilities/slav/slav_autogen/mocs_compilation.cpp:5:0:
    /home/aaron/CityofHeroes/Segs-0.5.0/bld/Utilities/slav/slav_autogen/EWIEGA46WW/moc_UpdaterDlg.cpp: In static member function âstatic void UpdaterDlg::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)â:
    /home/aaron/CityofHeroes/Segs-0.5.0/bld/Utilities/slav/slav_autogen/EWIEGA46WW/moc_UpdaterDlg.cpp:110:101: warning: useless cast to type â_t {aka void (UpdaterDlg::*)(ServerDescriptor*)}â [-Wuseless-cast]
    if (*reinterpret_cast(func) == static_cast(&UpdaterDlg::requestUpdateForServer)) {
    ^
    [ 19%] Linking CXX executable ../../out/slav
    /usr/lib64/libQt5Gui.so.5.9.2: undefined reference to `hb_font_funcs_set_nominal_glyph_func’
    /usr/lib64/libQt5Gui.so.5.9.2: undefined reference to `hb_font_funcs_set_font_h_extents_func’
    /usr/lib64/libQt5Gui.so.5.9.2: undefined reference to `hb_font_funcs_set_variation_glyph_func’
    collect2: error: ld returned 1 exit status
    make[2]: *** [out/slav] Error 1
    make[1]: *** [Utilities/slav/CMakeFiles/slav.dir/all] Error 2

Leave a Reply

Your email address will not be published. Required fields are marked *