Added a default, empty database to be placed in a default location to make setup and running a simple process.

This commit is contained in:
apathy
2016-07-25 08:41:14 -07:00
parent e760c7ebd8
commit f9676d2e62
3 changed files with 27 additions and 4 deletions

View File

@@ -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)

View File

@@ -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.

BIN
extras/chat.db.dist Normal file

Binary file not shown.