mirror of
https://github.com/SWG-Source/stationapi.git
synced 2026-01-16 23:04:18 -05:00
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:
@@ -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)
|
||||
|
||||
24
README.md
24
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.
|
||||
|
||||
BIN
extras/chat.db.dist
Normal file
BIN
extras/chat.db.dist
Normal file
Binary file not shown.
Reference in New Issue
Block a user