From f9676d2e621fd11791ba7701d9620c577ecf7c1e Mon Sep 17 00:00:00 2001 From: apathy Date: Mon, 25 Jul 2016 08:41:14 -0700 Subject: [PATCH] Added a default, empty database to be placed in a default location to make setup and running a simple process. --- CMakeLists.txt | 7 +++++-- README.md | 24 ++++++++++++++++++++++-- extras/chat.db.dist | Bin 0 -> 81920 bytes 3 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 extras/chat.db.dist diff --git a/CMakeLists.txt b/CMakeLists.txt index 053ea5b..d4241cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,9 +12,11 @@ cmake_minimum_required(VERSION 2.8) project(stationapi CXX) set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin") include(GroupSourceByFilesystem) include(ModernCpp) + set_property(GLOBAL PROPERTY USE_FOLDERS ON) if (EXISTS "${PROJECT_SOURCE_DIR}/externals/udplibrary/CMakeLists.txt") @@ -39,5 +41,6 @@ add_subdirectory(externals) add_subdirectory(src) add_subdirectory(tests) -configure_file(extras/logger.cfg.dist src/stationchat/logger.cfg COPYONLY) -configure_file(extras/swgchat.cfg.dist src/stationchat/swgchat.cfg COPYONLY) +configure_file(extras/logger.cfg.dist bin/logger.cfg COPYONLY) +configure_file(extras/swgchat.cfg.dist bin/swgchat.cfg COPYONLY) +configure_file(extras/chat.db.dist bin/chat.db COPYONLY) diff --git a/README.md b/README.md index b3c8afc..0c69a1e 100644 --- a/README.md +++ b/README.md @@ -31,9 +31,29 @@ Copy the udplibrary directory from the Star Wars Galaxies offical source to the ## Database Initialization ## -Create the database with the following commands: +By default, a clean database instance is provided and placed with the default configuration files in the **build/bin** directory; therefore, nothing needs to be done for new installations, the db is already created and placed in the appropriate location. + +To create a new, clean database instance, use the following commands: sqlite3 chat.db - sqlite> .read /path/to/init_database.sql + sqlite> .read /path/to/extras/init_database.sql Then update the **database_path** config option with the full path to the database. + +## Running ## + +A default configuration and database is created when building the project. Configure the listen address/ports in **build/bin/stationchat.cfg**. Then run the following commands from the project root: + +### Windows ### + + cd build/bin + .\Debug\stationchat.exe + +### Linux ### + + cd build/bin + ./stationchat + +## Final Notes ## + +It is recommended to copy the **build/bin** directory to another location after building to ensure the configuration files are not overwritten by future changes to the default versions of these files. diff --git a/extras/chat.db.dist b/extras/chat.db.dist new file mode 100644 index 0000000000000000000000000000000000000000..28dd84cae4e31d944fef22988e659a2cd40ef6b8 GIT binary patch literal 81920 zcmeI3O>f&q8plPykdht0bhid$1Of&yuoYn!fzbAp1-i1r1VS9SkrlMLEI~;lgRLaG zB;~p-da)y5kB>FfweWhD3zRR8z~PQ4f4nbbj9!ag z*n)hh9+2Hf)FX9IZ=jTR)#tvR$sJ zrMgP$rQ;KoL~D?O(IS;`$?4g)v{BPZkaG{Cw2nK= zK*mSgIwHO&CC){VP$b;Mq>{EUj3}spTQ-CLM|VWIaxklV;m$n7S~0M*bxm`UoX-n` z{8+Yz-t$b@??zNGR!R!&t4Gs_#oL^(R8XeLMiQtLlxVX0+bb0G?w?S|sarNfp8Ff3 zT+YYJ!{YU|VOyIwcO^+y6k+hiSeUNKdKTR=EwAy>UN$Py=ol%CHq%{N?4FQRGk*IB zDmSIg1mbZ&LC915gn-BONO9L0Ybn@FN-ZB`Mfp^T)p8s-zuHFoxtqeecV{1bJJwZi zb&VdozmK&Im55P&L&r(M+fA*n%R8OMZjGSM6YVC}*!2?>V8YL$G@fiGrOsthls_%T z>KxL+zj{Mu(%{2YN#5HNUOgG5#^8fg^bZ_(JTAQj^R*E z?>nZquNmh()1q3D|Nd6G74OOW`@%qT^hSraEra%2{ClTdQ%iM~)Jw-FD&b|MpkL~a zZfQn~RH}9Lv06LYAk#kFUQ24;G`n5eb4XqNtUklzC$-AcQtbtKqP`eMapVU!Zb+F? z{n2Sntvs%Vt1G0YK2mFHwXB{I9&5p9Dde}r_qw_kdo2kgq`zHP7=U89hb=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