Skip to content

Commit

Permalink
update code to:
Browse files Browse the repository at this point in the history
  • Loading branch information
mattyx14 committed Sep 14, 2023
1 parent 93c43f4 commit 887683e
Show file tree
Hide file tree
Showing 156 changed files with 8,147 additions and 13,113 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ else()
endif()

option(BUILD_TESTS "Build tests" OFF) # By default, tests will not be built
option(RUN_TESTS_AFTER_BUILD "Run tests when building" OFF) # By default, tests will only run if requested

# *****************************************************************************
# Add project
Expand Down
16 changes: 15 additions & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
},
"BUILD_STATIC_LIBRARY": "ON",
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"OPTIONS_ENABLE_CCACHE": "ON"
"OPTIONS_ENABLE_CCACHE": "ON",
"RUN_TESTS_AFTER_BUILD": "OFF"
},
"condition": {
"type": "equals",
Expand Down Expand Up @@ -102,6 +103,15 @@
"SPEED_UP_BUILD_UNITY": "OFF",
"ASAN_ENABLED": "ON"
}
},
{
"name": "linux-test",
"inherits": "linux-release",
"displayName": "Linux - Test Build",
"description": "Build Tests",
"cacheVariables": {
"BUILD_TESTS": "ON"
}
}
],
"buildPresets": [
Expand All @@ -113,6 +123,10 @@
"name": "linux-debug",
"configurePreset": "linux-debug"
},
{
"name": "linux-test",
"configurePreset": "linux-test"
},
{
"name": "windows-release",
"configurePreset": "windows-release"
Expand Down
16 changes: 15 additions & 1 deletion cmake/modules/CanaryLib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,35 @@ add_library(${PROJECT_NAME}_lib)
setup_target(${PROJECT_NAME}_lib)

# Add subdirectories
add_subdirectory(account)
add_subdirectory(config)
add_subdirectory(creatures)
add_subdirectory(database)
add_subdirectory(game)
add_subdirectory(io)
add_subdirectory(items)
add_subdirectory(lib)
add_subdirectory(kv)
add_subdirectory(lua)
add_subdirectory(map)
add_subdirectory(security)
add_subdirectory(server)
add_subdirectory(utils)

# Add more global sources - please add preferably in the sub_directory CMakeLists.
target_sources(${PROJECT_NAME}_lib PRIVATE canary_server.cpp protobuf/appearances.pb.cc)
set(ProtobufFiles
protobuf/appearances.pb.cc
protobuf/kv.pb.cc
)

# Add more global sources - please add preferably in the sub_directory CMakeLists.
target_sources(${PROJECT_NAME}_lib PRIVATE canary_server.cpp ${ProtobufFiles})

# Skip unity build inclusion for protobuf files
set_source_files_properties(
${ProtobufFiles} PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
)


# Add public pre compiler header to lib, to pass down to related targets
target_precompile_headers(${PROJECT_NAME}_lib PUBLIC pch.hpp)
Expand Down
4 changes: 3 additions & 1 deletion config.lua.dist
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ redSkullDuration = 1
blackSkullDuration = 3
orangeSkullDuration = 7

onlyInvitedCanMoveHouseItems = true
cleanProtectionZones = false

-- Connection Config
Expand Down Expand Up @@ -161,6 +160,7 @@ wheelPointsPerLevel = 1
-- Only change it here if you know what you are doing or to make testing easier with familiars
familiarTime = 30

partyAutoShareExperience = true
partyShareLootBoosts = false
partyShareLootBoostsDimishingFactor = 0.7

Expand Down Expand Up @@ -261,6 +261,8 @@ houseRentPeriod = "never"
houseRentRate = 1.0
houseOwnedByAccount = false
houseBuyLevel = 100
housePurchasedShowPrice = false
onlyInvitedCanMoveHouseItems = true

-- Item Usage
timeBetweenActions = 200
Expand Down
11 changes: 10 additions & 1 deletion schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CREATE TABLE IF NOT EXISTS `server_config` (
CONSTRAINT `server_config_pk` PRIMARY KEY (`config`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

INSERT INTO `server_config` (`config`, `value`) VALUES ('db_version', '36'), ('motd_hash', ''), ('motd_num', '0'), ('players_record', '0');
INSERT INTO `server_config` (`config`, `value`) VALUES ('db_version', '38'), ('motd_hash', ''), ('motd_num', '0'), ('players_record', '0');

-- Table structure `accounts`
CREATE TABLE IF NOT EXISTS `accounts` (
Expand All @@ -33,6 +33,7 @@ CREATE TABLE IF NOT EXISTS `coins_transactions` (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`account_id` int(11) UNSIGNED NOT NULL,
`type` tinyint(1) UNSIGNED NOT NULL,
`coin_type` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
`amount` int(12) UNSIGNED NOT NULL,
`description` varchar(3500) NOT NULL,
`timestamp` timestamp DEFAULT CURRENT_TIMESTAMP,
Expand Down Expand Up @@ -72,6 +73,7 @@ CREATE TABLE IF NOT EXISTS `players` (
`conditions` blob NOT NULL,
`cap` int(11) NOT NULL DEFAULT '0',
`sex` int(11) NOT NULL DEFAULT '0',
`pronoun` int(11) NOT NULL DEFAULT '0',
`lastlogin` bigint(20) UNSIGNED NOT NULL DEFAULT '0',
`lastip` int(10) UNSIGNED NOT NULL DEFAULT '0',
`save` tinyint(1) NOT NULL DEFAULT '1',
Expand Down Expand Up @@ -791,6 +793,13 @@ CREATE TABLE IF NOT EXISTS `account_sessions` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `kv_store` (
`key_name` varchar(191) NOT NULL,
`timestamp` bigint NOT NULL,
`value` longblob NOT NULL,
PRIMARY KEY (`key_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- Create Account god/god
INSERT INTO `accounts`
(`id`, `name`, `email`, `password`, `type`) VALUES
Expand Down
4 changes: 4 additions & 0 deletions src/account/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
target_sources(${PROJECT_NAME}_lib PRIVATE
account.cpp
account_repository_db.cpp
)
Loading

0 comments on commit 887683e

Please sign in to comment.