Compare commits

..

3 Commits

Author SHA1 Message Date
David Markowitz
c7d01dbb82 Merge branch 'main' into add-sqlite 2024-12-04 00:43:43 -08:00
David Markowitz
9e242995e9 use SQLite types 2024-11-15 01:05:05 -08:00
David Markowitz
0aa1f70540 Use less specific matcher 2024-11-14 12:43:52 -08:00
18 changed files with 762 additions and 321 deletions

2
.gitignore vendored
View File

@@ -112,8 +112,6 @@ CMakeFiles/TargetDirectories.txt
*.sln *.sln
*.recipe *.recipe
CMakeUserPresets.json
# clangd # clangd
.cache .cache
thirdparty/zlib-1.2.11/ thirdparty/zlib-1.2.11/

View File

@@ -20,9 +20,6 @@ set(CMAKE_POLICY_DEFAULT_CMP0063 NEW) # Set CMAKE visibility policy to NEW on p
set(CMAKE_VISIBILITY_INLINES_HIDDEN ON) # Set C and C++ symbol visibility to hide inlined functions set(CMAKE_VISIBILITY_INLINES_HIDDEN ON) # Set C and C++ symbol visibility to hide inlined functions
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: Debug, Release, RelWithDebInfo, MinSizeRel")
set(DLU_CONFIG_DIR ${CMAKE_SOURCE_DIR}/build CACHE PATH "The directory where the server configuration files are stored")
# Read variables from file # Read variables from file
FILE(READ "${CMAKE_SOURCE_DIR}/CMakeVariables.txt" variables) FILE(READ "${CMAKE_SOURCE_DIR}/CMakeVariables.txt" variables)
@@ -74,7 +71,7 @@ if(UNIX)
# For all except Clang and Apple Clang # For all except Clang and Apple Clang
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang") if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options("-static-libgcc" "-lstdc++fs" "-Wno-error=implicit-function-declaration" "-Wno-error=int-conversion") add_compile_options("-static-libgcc" "-lstdc++fs")
endif() endif()
if(${DYNAMIC} AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if(${DYNAMIC} AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
@@ -92,11 +89,10 @@ elseif(WIN32)
add_compile_definitions(_CRT_SECURE_NO_WARNINGS) add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
endif() endif()
# Set the output directories # Our output dir
# ./build/<platform + architecture (x64, x86, aarch64)>/<compiler>/<build_mode>/ #set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) # unfortunately, forces all libraries to be built in series, which will slow down the build process
set(CMAKE_BINARY_DIR ${CMAKE_BINARY_DIR}/${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}/${CMAKE_CXX_COMPILER_ID}/${CMAKE_BUILD_TYPE})
# TODO make this not have to override the build type directories
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR})
@@ -111,15 +107,6 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
# Get DLU config directory
if(DEFINED ENV{DLU_CONFIG_DIR})
set(DLU_CONFIG_DIR $ENV{DLU_CONFIG_DIR})
else()
set(DLU_CONFIG_DIR ${CMAKE_BINARY_DIR})
endif()
message(STATUS "Configuration Directory is ${DLU_CONFIG_DIR}, and the build directory is ${CMAKE_BINARY_DIR}")
find_package(MariaDB) find_package(MariaDB)
# Create a /resServer directory # Create a /resServer directory
@@ -128,11 +115,18 @@ make_directory(${CMAKE_BINARY_DIR}/resServer)
# Create a /logs directory # Create a /logs directory
make_directory(${CMAKE_BINARY_DIR}/logs) make_directory(${CMAKE_BINARY_DIR}/logs)
# Get DLU config directory
if(DEFINED ENV{DLU_CONFIG_DIR})
set(DLU_CONFIG_DIR $ENV{DLU_CONFIG_DIR})
else()
set(DLU_CONFIG_DIR ${PROJECT_BINARY_DIR})
endif()
message(STATUS "Variable: DLU_CONFIG_DIR = ${DLU_CONFIG_DIR}")
# Copy resource files on first build # Copy resource files on first build
set(RESOURCE_FILES "sharedconfig.ini" "authconfig.ini" "chatconfig.ini" "worldconfig.ini" "masterconfig.ini" "blocklist.dcf") set(RESOURCE_FILES "sharedconfig.ini" "authconfig.ini" "chatconfig.ini" "worldconfig.ini" "masterconfig.ini" "blocklist.dcf")
message(STATUS "Checking resource file integrity") message(STATUS "Checking resource file integrity")
include(Utils) include(Utils)
UpdateConfigOption(${DLU_CONFIG_DIR}/authconfig.ini "port" "auth_server_port") UpdateConfigOption(${DLU_CONFIG_DIR}/authconfig.ini "port" "auth_server_port")
UpdateConfigOption(${DLU_CONFIG_DIR}/chatconfig.ini "port" "chat_server_port") UpdateConfigOption(${DLU_CONFIG_DIR}/chatconfig.ini "port" "chat_server_port")

View File

@@ -1,191 +1,641 @@
{ {
"version": 6, "version": 6,
"cmakeMinimumRequired": { "cmakeMinimumRequired": {
"major": 3, "major": 3,
"minor": 25, "minor": 25,
"patch": 0 "patch": 0
}, },
"configurePresets": [ "configurePresets": [
{ {
"name": "default", "name": "default",
"displayName": "Default configure step", "displayName": "Default configure step",
"description": "Use 'build' dir and Unix makefiles", "description": "Use 'build' dir and Unix makefiles",
"binaryDir": "${sourceDir}/build", "binaryDir": "${sourceDir}/build",
"generator": "Unix Makefiles", "environment": {
"hidden": true "DLU_CONFIG_DIR": "${sourceDir}/build"
}, },
{ "generator": "Unix Makefiles"
"name": "windows-default", },
"inherits": "default", {
"displayName": "Windows Default Configure Settings", "name": "debug-config",
"description": "Sets build and install directories", "hidden": true,
"generator": "Visual Studio 17 2022", "cacheVariables": {
"condition": { "CMAKE_BUILD_TYPE": "Debug"
"type": "equals", }
"lhs": "${hostSystemName}", },
"rhs": "Windows" {
}, "name": "relwithdebinfo-config",
"hidden": true "hidden": true,
}, "cacheVariables": {
{ "CMAKE_BUILD_TYPE": "RelWithDebInfo"
"name": "windows-msvc", }
"inherits": "windows-default", },
"displayName": "Windows (MSVC)", {
"description": "Create a build using MSVC" "name": "release-config",
}, "hidden": true,
{ "cacheVariables": {
"name": "windows-clang", "CMAKE_BUILD_TYPE": "Release"
"inherits": "windows-default", }
"displayName": "EXPERIMENTAL - Windows (Clang)", },
"description": "Create a build using Clang", {
"toolset": "ClangCL" "name": "clang-config",
}, "hidden": true,
{ "toolchainFile": "${sourceDir}/cmake/toolchains/linux-clang.cmake"
"name": "linux-default", },
"inherits": "default", {
"hidden": true, "name": "gnu-config",
"condition": { "hidden": true,
"type": "equals", "toolchainFile": "${sourceDir}/cmake/toolchains/linux-gnu.cmake"
"lhs": "${hostSystemName}", },
"rhs": "Linux" {
} "name": "windows-msvc",
}, "inherits": "default",
{ "displayName": "[Multi] Windows (MSVC)",
"name": "linux-clang", "description": "Set architecture to 64-bit (b/c RakNet)",
"inherits": "linux-default", "generator": "Visual Studio 17 2022",
"toolchainFile": "${sourceDir}/cmake/toolchains/linux-clang.cmake", "binaryDir": "${sourceDir}/build/msvc",
"displayName": "Linux (Clang)", "architecture": {
"description": "Create a build using the Clang toolchain for Linux" "value": "x64"
}, },
{ "condition": {
"name": "linux-gnu", "type": "equals",
"inherits": "linux-default", "lhs": "${hostSystemName}",
"toolchainFile": "${sourceDir}/cmake/toolchains/linux-gnu.cmake", "rhs": "Windows"
"displayName": "Linux (GNU)", }
"description": "Create a build using the GNU toolchain for Linux" },
}, {
{ "name": "windows-default",
"name": "macos", "inherits": "windows-msvc",
"inherits": "default", "displayName": "Windows only Configure Settings",
"displayName": "MacOS", "description": "Sets build and install directories",
"description": "Create a build for MacOS", "generator": "Ninja",
"condition": { "condition": {
"type": "equals", "type": "equals",
"lhs": "${hostSystemName}", "lhs": "${hostSystemName}",
"rhs": "Darwin" "rhs": "Windows"
} },
} "architecture": {
], "value": "x64"
"buildPresets": [ }
{ },
"name": "default", {
"configurePreset": "default", "name": "linux-config",
"displayName": "Default Build", "inherits": "default",
"description": "Default Build", "hidden": true,
"jobs": 2 "condition": {
} "type": "equals",
], "lhs": "${hostSystemName}",
"testPresets": [ "rhs": "Linux"
{ }
"name": "ci-ubuntu-22.04", },
"configurePreset": "ci-ubuntu-22.04", {
"displayName": "CI Tests on Linux", "name": "linux-clang-debug",
"description": "Runs all tests on a linux configuration", "inherits": [
"execution": { "linux-config",
"jobs": 2 "clang-config",
}, "debug-config"
"output": { ],
"outputOnFailure": true "displayName": "EXPERIMENTAL - [Debug] Linux (Clang)",
} "description": "Create a debug build using the Clang toolchain for Linux",
}, "binaryDir": "${sourceDir}/build/clang-debug"
{ },
"name": "ci-macos-13", {
"configurePreset": "ci-macos-13", "name": "linux-clang-relwithdebinfo",
"displayName": "CI Tests on MacOS", "inherits": [
"description": "Runs all tests on a Mac configuration", "linux-config",
"execution": { "clang-config",
"jobs": 2 "relwithdebinfo-config"
}, ],
"output": { "displayName": "EXPERIMENTAL - [RelWithDebInfo] Linux (Clang)",
"outputOnFailure": true "description": "Create a release build with debug info using the Clang toolchain for Linux",
} "binaryDir": "${sourceDir}/build/clang-relwithdebinfo"
}, },
{ {
"name": "ci-windows-2022", "name": "linux-clang-release",
"configurePreset": "ci-windows-2022", "inherits": [
"displayName": "CI Tests on windows", "linux-config",
"description": "Runs all tests on a windows configuration", "clang-config",
"configuration": "RelWithDebInfo", "release-config"
"execution": { ],
"jobs": 2 "displayName": "EXPERIMENTAL - [Release] Linux (Clang)",
}, "description": "Create a release build using the Clang toolchain for Linux",
"output": { "binaryDir": "${sourceDir}/build/clang-release"
"outputOnFailure": true },
}, {
"filter": { "name": "linux-gnu-debug",
"exclude": { "inherits": [
"name": "((example)|(minigzip))+" "linux-config",
} "gnu-config",
} "debug-config"
} ],
], "displayName": "[Debug] Linux (GNU)",
"workflowPresets": [ "description": "Create a debug build using the GNU toolchain for Linux",
{ "binaryDir": "${sourceDir}/build/gnu-debug"
"name": "ci-windows-2022", },
"displayName": "[Release] Windows (MSVC)", {
"description": "CI workflow preset for Windows", "name": "linux-gnu-relwithdebinfo",
"steps": [ "inherits": [
{ "linux-config",
"type": "configure", "gnu-config",
"name": "windows-msvc" "relwithdebinfo-config"
}, ],
{ "displayName": "[RelWithDebInfo] Linux (GNU)",
"type": "build", "description": "Create a release build with debug info using the GNU toolchain for Linux",
"name": "default" "binaryDir": "${sourceDir}/build/gnu-relwithdebinfo"
}, },
{ {
"type": "test", "name": "linux-gnu-release",
"name": "default" "inherits": [
} "linux-config",
] "gnu-config",
}, "release-config"
{ ],
"name": "ci-ubuntu-22.04", "displayName": "[Release] Linux (GNU)",
"displayName": "[Release] Linux (GNU)", "description": "Create a release build using the GNU toolchain for Linux",
"description": "CI workflow preset for Ubuntu", "binaryDir": "${sourceDir}/build/gnu-release"
"steps": [ },
{ {
"type": "configure", "name": "macos",
"name": "linux-gnu" "inherits": "default",
}, "displayName": "[Multi] MacOS",
{ "description": "Create a build for MacOS",
"type": "build", "condition": {
"name": "default" "type": "equals",
}, "lhs": "${hostSystemName}",
{ "rhs": "Darwin"
"type": "test", },
"name": "ci-ubuntu-22.04" "binaryDir": "${sourceDir}/build/macos"
} }
] ],
}, "buildPresets": [
{ {
"name": "ci-macos-13", "name": "default",
"displayName": "[Release] MacOS", "configurePreset": "default",
"description": "CI workflow preset for MacOS", "displayName": "Default Build",
"steps": [ "description": "Default Build",
{ "jobs": 2
"type": "configure", },
"name": "macos" {
}, "name": "windows-msvc-debug",
{ "inherits": "default",
"type": "build", "configurePreset": "windows-msvc",
"name": "default" "displayName": "[Debug] Windows (MSVC)",
}, "description": "This preset is used to build in debug mode using the MSVC toolchain on Windows",
{ "configuration": "Debug"
"type": "test", },
"name": "default" {
} "name": "windows-msvc-relwithdebinfo",
] "inherits": "default",
} "configurePreset": "windows-msvc",
] "displayName": "[RelWithDebInfo] Windows (MSVC)",
"description": "This preset is used to build in debug mode using the MSVC toolchain on Windows",
"configuration": "RelWithDebInfo"
},
{
"name": "windows-msvc-release",
"inherits": "default",
"configurePreset": "windows-msvc",
"displayName": "[Release] Windows (MSVC)",
"description": "This preset is used to build in release mode using the MSVC toolchain on Windows",
"configuration": "Release"
},
{
"name": "linux-clang-debug",
"inherits": "default",
"configurePreset": "linux-clang-debug",
"displayName": "EXPERIMENTAL - [Debug] Linux (Clang)",
"description": "This preset is used to build in debug mode using the Clang toolchain on Linux",
"configuration": "Debug"
},
{
"name": "linux-clang-relwithdebinfo",
"inherits": "default",
"configurePreset": "linux-clang-relwithdebinfo",
"displayName": "EXPERIMENTAL - [RelWithDebInfo] Linux (Clang)",
"description": "This preset is used to build in release mode with debug info using the Clang toolchain on Linux",
"configuration": "RelWithDebInfo"
},
{
"name": "linux-clang-release",
"inherits": "default",
"configurePreset": "linux-clang-release",
"displayName": "EXPERIMENTAL - [Release] Linux (Clang)",
"description": "This preset is used to build in release mode using the Clang toolchain on Linux",
"configuration": "Release"
},
{
"name": "linux-gnu-debug",
"inherits": "default",
"configurePreset": "linux-gnu-debug",
"displayName": "[Debug] Linux (GNU)",
"description": "This preset is used to build in debug mode using the GNU toolchain on Linux",
"configuration": "Debug"
},
{
"name": "linux-gnu-relwithdebinfo",
"inherits": "default",
"configurePreset": "linux-gnu-relwithdebinfo",
"displayName": "[RelWithDebInfo] Linux (GNU)",
"description": "This preset is used to build in release mode with debug info using the GNU toolchain on Linux",
"configuration": "RelWithDebInfo"
},
{
"name": "linux-gnu-release",
"inherits": "default",
"configurePreset": "linux-gnu-release",
"displayName": "[Release] Linux (GNU)",
"description": "This preset is used to build in release mode using the GNU toolchain on Linux",
"configuration": "Release"
},
{
"name": "macos-debug",
"inherits": "default",
"configurePreset": "macos",
"displayName": "[Debug] MacOS",
"description": "This preset is used to build in debug mode on MacOS",
"configuration": "Debug"
},
{
"name": "macos-relwithdebinfo",
"inherits": "default",
"configurePreset": "macos",
"displayName": "[RelWithDebInfo] MacOS",
"description": "This preset is used to build in release mode with debug info on MacOS",
"configuration": "RelWithDebInfo"
},
{
"name": "macos-release",
"inherits": "default",
"configurePreset": "macos",
"displayName": "[Release] MacOS",
"description": "This preset is used to build in release mode on MacOS",
"configuration": "Release"
}
],
"testPresets": [
{
"name": "default",
"configurePreset": "default",
"execution": {
"jobs": 2
},
"output": {
"outputOnFailure": true
}
},
{
"name": "windows-msvc-test",
"inherits": "default",
"configurePreset": "windows-msvc",
"hidden": true,
"filter": {
"exclude": {
"name": "((example)|(minigzip))+"
}
}
},
{
"name": "windows-msvc-debug",
"inherits": "windows-msvc-test",
"configurePreset": "windows-msvc",
"displayName": "[Debug] Windows (MSVC)",
"description": "Runs all tests on a Windows configuration",
"configuration": "Debug"
},
{
"name": "windows-msvc-relwithdebinfo",
"inherits": "windows-msvc-test",
"configurePreset": "windows-msvc",
"displayName": "[RelWithDebInfo] Windows (MSVC)",
"description": "Runs all tests on a Windows configuration",
"configuration": "RelWithDebInfo"
},
{
"name": "windows-msvc-release",
"inherits": "windows-msvc-test",
"configurePreset": "windows-msvc",
"displayName": "[Release] Windows (MSVC)",
"description": "Runs all tests on a Windows configuration",
"configuration": "Release"
},
{
"name": "linux-clang-debug",
"inherits": "default",
"configurePreset": "linux-clang-debug",
"displayName": "EXPERIMENTAL - [Debug] Linux (Clang)",
"description": "Runs all tests on a Linux Clang configuration",
"configuration": "Release"
},
{
"name": "linux-clang-relwithdebinfo",
"inherits": "default",
"configurePreset": "linux-clang-relwithdebinfo",
"displayName": "EXPERIMENTAL - [RelWithDebInfo] Linux (Clang)",
"description": "Runs all tests on a Linux Clang configuration",
"configuration": "RelWithDebInfo"
},
{
"name": "linux-clang-release",
"inherits": "default",
"configurePreset": "linux-clang-release",
"displayName": "EXPERIMENTAL - [Release] Linux (Clang)",
"description": "Runs all tests on a Linux Clang configuration",
"configuration": "Release"
},
{
"name": "linux-gnu-debug",
"inherits": "default",
"configurePreset": "linux-gnu-debug",
"displayName": "[Debug] Linux (GNU)",
"description": "Runs all tests on a Linux GNU configuration",
"configuration": "Release"
},
{
"name": "linux-gnu-relwithdebinfo",
"inherits": "default",
"configurePreset": "linux-gnu-relwithdebinfo",
"displayName": "[RelWithDebInfo] Linux (GNU)",
"description": "Runs all tests on a Linux GNU configuration",
"configuration": "RelWithDebInfo"
},
{
"name": "linux-gnu-release",
"inherits": "default",
"configurePreset": "linux-gnu-release",
"displayName": "[Release] Linux (GNU)",
"description": "Runs all tests on a Linux GNU configuration",
"configuration": "Release"
},
{
"name": "macos-debug",
"inherits": "default",
"configurePreset": "macos",
"displayName": "[Debug] MacOS",
"description": "Runs all tests on a MacOS configuration",
"configuration": "Debug"
},
{
"name": "macos-relwithdebinfo",
"inherits": "default",
"configurePreset": "macos",
"displayName": "[RelWithDebInfo] MacOS",
"description": "Runs all tests on a MacOS configuration",
"configuration": "RelWithDebInfo"
},
{
"name": "macos-release",
"inherits": "default",
"configurePreset": "macos",
"displayName": "[Release] MacOS",
"description": "Runs all tests on a MacOS configuration",
"configuration": "Release"
}
],
"workflowPresets": [
{
"name": "default",
"steps": [
{
"type": "configure",
"name": "default"
},
{
"type": "build",
"name": "default"
},
{
"type": "test",
"name": "default"
}
]
},
{
"name": "windows-msvc-debug",
"displayName": "[Debug] Windows (MSVC)",
"description": "MSVC debug workflow preset for Windows",
"steps": [
{
"type": "configure",
"name": "windows-msvc"
},
{
"type": "build",
"name": "windows-msvc-debug"
},
{
"type": "test",
"name": "windows-msvc-debug"
}
]
},
{
"name": "windows-msvc-relwithdebinfo",
"displayName": "[RelWithDebInfo] Windows (MSVC)",
"description": "MSVC release with debug info workflow preset for Windows",
"steps": [
{
"type": "configure",
"name": "windows-msvc"
},
{
"type": "build",
"name": "windows-msvc-relwithdebinfo"
},
{
"type": "test",
"name": "windows-msvc-relwithdebinfo"
}
]
},
{
"name": "ci-windows-2022",
"displayName": "[Release] Windows (MSVC)",
"description": "CI workflow preset for Windows",
"steps": [
{
"type": "configure",
"name": "windows-msvc"
},
{
"type": "build",
"name": "windows-msvc-release"
},
{
"type": "test",
"name": "windows-msvc-release"
}
]
},
{
"name": "linux-gnu-debug",
"displayName": "[Debug] Linux (GNU)",
"description": "GNU debug workflow preset for Linux",
"steps": [
{
"type": "configure",
"name": "linux-gnu-debug"
},
{
"type": "build",
"name": "linux-gnu-debug"
},
{
"type": "test",
"name": "linux-gnu-debug"
}
]
},
{
"name": "linux-gnu-relwithdebinfo",
"displayName": "[RelWithDebInfo] Linux (GNU)",
"description": "GNU release with debug info workflow preset for Linux",
"steps": [
{
"type": "configure",
"name": "linux-gnu-relwithdebinfo"
},
{
"type": "build",
"name": "linux-gnu-relwithdebinfo"
},
{
"type": "test",
"name": "linux-gnu-relwithdebinfo"
}
]
},
{
"name": "ci-ubuntu-22.04",
"displayName": "[Release] Linux (GNU)",
"description": "CI workflow preset for Ubuntu",
"steps": [
{
"type": "configure",
"name": "linux-gnu-release"
},
{
"type": "build",
"name": "linux-gnu-release"
},
{
"type": "test",
"name": "linux-gnu-release"
}
]
},
{
"name": "linux-clang-debug",
"displayName": "EXPERIMENTAL - [Debug] Linux (Clang)",
"description": "Clang debug workflow preset for Linux",
"steps": [
{
"type": "configure",
"name": "linux-clang-debug"
},
{
"type": "build",
"name": "linux-clang-debug"
},
{
"type": "test",
"name": "linux-clang-debug"
}
]
},
{
"name": "linux-clang-relwithdebinfo",
"displayName": "EXPERIMENTAL - [RelWithDebInfo] Linux (Clang)",
"description": "Clang release with debug info workflow preset for Linux",
"steps": [
{
"type": "configure",
"name": "linux-clang-relwithdebinfo"
},
{
"type": "build",
"name": "linux-clang-relwithdebinfo"
},
{
"type": "test",
"name": "linux-clang-relwithdebinfo"
}
]
},
{
"name": "linux-clang-release",
"displayName": "EXPERIMENTAL - [Release] Linux (Clang)",
"description": "Clang release workflow preset for Linux",
"steps": [
{
"type": "configure",
"name": "linux-clang-release"
},
{
"type": "build",
"name": "linux-clang-release"
},
{
"type": "test",
"name": "linux-clang-release"
}
]
},
{
"name": "macos-debug",
"displayName": "[Debug] MacOS",
"description": "Release workflow preset for MacOS",
"steps": [
{
"type": "configure",
"name": "macos"
},
{
"type": "build",
"name": "macos-debug"
},
{
"type": "test",
"name": "macos-debug"
}
]
},
{
"name": "macos-relwithdebinfo",
"displayName": "[RelWithDebInfo] MacOS",
"description": "Release with debug info workflow preset for MacOS",
"steps": [
{
"type": "configure",
"name": "macos"
},
{
"type": "build",
"name": "macos-relwithdebinfo"
},
{
"type": "test",
"name": "macos-relwithdebinfo"
}
]
},
{
"name": "ci-macos-13",
"displayName": "[Release] MacOS",
"description": "CI workflow preset for MacOS",
"steps": [
{
"type": "configure",
"name": "macos"
},
{
"type": "build",
"name": "macos-release"
},
{
"type": "test",
"name": "macos-release"
}
]
}
]
} }

View File

@@ -45,14 +45,11 @@ if (UNIX)
elseif (WIN32) elseif (WIN32)
include(FetchContent) include(FetchContent)
set(WITH_GTEST OFF CACHE BOOL "" FORCE)
set(ZLIB_ENABLE_TESTS OFF CACHE BOOL "" FORCE)
# TODO Keep an eye on the zlib repository for an update to disable testing. Don't forget to update CMakePresets # TODO Keep an eye on the zlib repository for an update to disable testing. Don't forget to update CMakePresets
FetchContent_Declare( FetchContent_Declare(
zlib zlib
URL https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.2.2.zip URL https://github.com/madler/zlib/archive/refs/tags/v1.2.11.zip
URL_HASH MD5=2cf9199fb785ea579a2a9905a75c38b3 URL_HASH MD5=9d6a627693163bbbf3f26403a3a0b0b1
) )
# Disable warning about no project version. # Disable warning about no project version.
@@ -63,6 +60,7 @@ elseif (WIN32)
FetchContent_MakeAvailable(zlib) FetchContent_MakeAvailable(zlib)
set(ZLIB_INCLUDE_DIRS ${zlib_SOURCE_DIR} ${zlib_BINARY_DIR}) set(ZLIB_INCLUDE_DIRS ${zlib_SOURCE_DIR} ${zlib_BINARY_DIR})
set_target_properties(zlib PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_INCLUDE_DIRS}")
add_library(ZLIB::ZLIB ALIAS zlib) add_library(ZLIB::ZLIB ALIAS zlib)
else () else ()
message( message(

View File

@@ -1,6 +1,6 @@
#include "ZCompression.h" #include "ZCompression.h"
#include "zlib-ng.h" #include "zlib.h"
namespace ZCompression { namespace ZCompression {
int32_t GetMaxCompressedLength(int32_t nLenSrc) { int32_t GetMaxCompressedLength(int32_t nLenSrc) {
@@ -9,41 +9,41 @@ namespace ZCompression {
} }
int32_t Compress(const uint8_t* abSrc, int32_t nLenSrc, uint8_t* abDst, int32_t nLenDst) { int32_t Compress(const uint8_t* abSrc, int32_t nLenSrc, uint8_t* abDst, int32_t nLenDst) {
zng_stream zInfo = { 0 }; z_stream zInfo = { 0 };
zInfo.total_in = zInfo.avail_in = nLenSrc; zInfo.total_in = zInfo.avail_in = nLenSrc;
zInfo.total_out = zInfo.avail_out = nLenDst; zInfo.total_out = zInfo.avail_out = nLenDst;
zInfo.next_in = const_cast<Bytef*>(abSrc); zInfo.next_in = const_cast<Bytef*>(abSrc);
zInfo.next_out = abDst; zInfo.next_out = abDst;
int nErr, nRet = -1; int nErr, nRet = -1;
nErr = zng_deflateInit(&zInfo, Z_DEFAULT_COMPRESSION); // zlib function nErr = deflateInit(&zInfo, Z_DEFAULT_COMPRESSION); // zlib function
if (nErr == Z_OK) { if (nErr == Z_OK) {
nErr = zng_deflate(&zInfo, Z_FINISH); // zlib function nErr = deflate(&zInfo, Z_FINISH); // zlib function
if (nErr == Z_STREAM_END) { if (nErr == Z_STREAM_END) {
nRet = zInfo.total_out; nRet = zInfo.total_out;
} }
} }
zng_deflateEnd(&zInfo); // zlib function deflateEnd(&zInfo); // zlib function
return(nRet); return(nRet);
} }
int32_t Decompress(const uint8_t* abSrc, int32_t nLenSrc, uint8_t* abDst, int32_t nLenDst, int32_t& nErr) { int32_t Decompress(const uint8_t* abSrc, int32_t nLenSrc, uint8_t* abDst, int32_t nLenDst, int32_t& nErr) {
// Get the size of the decompressed data // Get the size of the decompressed data
zng_stream zInfo = { 0 }; z_stream zInfo = { 0 };
zInfo.total_in = zInfo.avail_in = nLenSrc; zInfo.total_in = zInfo.avail_in = nLenSrc;
zInfo.total_out = zInfo.avail_out = nLenDst; zInfo.total_out = zInfo.avail_out = nLenDst;
zInfo.next_in = const_cast<Bytef*>(abSrc); zInfo.next_in = const_cast<Bytef*>(abSrc);
zInfo.next_out = abDst; zInfo.next_out = abDst;
int nRet = -1; int nRet = -1;
nErr = zng_inflateInit(&zInfo); // zlib function nErr = inflateInit(&zInfo); // zlib function
if (nErr == Z_OK) { if (nErr == Z_OK) {
nErr = zng_inflate(&zInfo, Z_FINISH); // zlib function nErr = inflate(&zInfo, Z_FINISH); // zlib function
if (nErr == Z_STREAM_END) { if (nErr == Z_STREAM_END) {
nRet = zInfo.total_out; nRet = zInfo.total_out;
} }
} }
zng_inflateEnd(&zInfo); // zlib function inflateEnd(&zInfo); // zlib function
return(nRet); return(nRet);
} }
} }

View File

@@ -4,6 +4,8 @@
#include "Game.h" #include "Game.h"
#include "Logger.h" #include "Logger.h"
#include "zlib.h"
AssetManager::AssetManager(const std::filesystem::path& path) { AssetManager::AssetManager(const std::filesystem::path& path) {
if (!std::filesystem::is_directory(path)) { if (!std::filesystem::is_directory(path)) {
throw std::runtime_error("Attempted to load asset bundle (" + path.string() + ") however it is not a valid directory."); throw std::runtime_error("Attempted to load asset bundle (" + path.string() + ") however it is not a valid directory.");
@@ -80,7 +82,7 @@ bool AssetManager::HasFile(const char* name) {
if (fixedName.rfind("client\\res\\", 0) != 0) fixedName = "client\\res\\" + fixedName; if (fixedName.rfind("client\\res\\", 0) != 0) fixedName = "client\\res\\" + fixedName;
uint32_t crc = crc32b(0xFFFFFFFF, reinterpret_cast<uint8_t*>(const_cast<char*>(fixedName.c_str())), fixedName.size()); uint32_t crc = crc32b(0xFFFFFFFF, reinterpret_cast<uint8_t*>(const_cast<char*>(fixedName.c_str())), fixedName.size());
crc = crc32b(crc, reinterpret_cast<uint8_t*>(const_cast<char*>("\0\0\0\0")), 4); crc = crc32b(crc, reinterpret_cast<Bytef*>(const_cast<char*>("\0\0\0\0")), 4);
for (const auto& item : this->m_PackIndex->GetPackFileIndices()) { for (const auto& item : this->m_PackIndex->GetPackFileIndices()) {
if (item.m_Crc == crc) { if (item.m_Crc == crc) {
@@ -128,7 +130,7 @@ bool AssetManager::GetFile(const char* name, char** data, uint32_t* len) {
} }
int32_t packIndex = -1; int32_t packIndex = -1;
uint32_t crc = crc32b(0xFFFFFFFF, reinterpret_cast<uint8_t*>(const_cast<char*>(fixedName.c_str())), fixedName.size()); uint32_t crc = crc32b(0xFFFFFFFF, reinterpret_cast<uint8_t*>(const_cast<char*>(fixedName.c_str())), fixedName.size());
crc = crc32b(crc, reinterpret_cast<uint8_t*>(const_cast<char*>("\0\0\0\0")), 4); crc = crc32b(crc, reinterpret_cast<Bytef*>(const_cast<char*>("\0\0\0\0")), 4);
for (const auto& item : this->m_PackIndex->GetPackFileIndices()) { for (const auto& item : this->m_PackIndex->GetPackFileIndices()) {
if (item.m_Crc == crc) { if (item.m_Crc == crc) {

View File

@@ -505,7 +505,6 @@ void EntityManager::UpdateGhosting(Entity* player) {
if (collectionId != 0) { if (collectionId != 0) {
collectionId = static_cast<uint32_t>(collectionId) + static_cast<uint32_t>(Game::server->GetZoneID() << 8); collectionId = static_cast<uint32_t>(collectionId) + static_cast<uint32_t>(Game::server->GetZoneID() << 8);
if (missionComponent->HasCollectible(collectionId)) { if (missionComponent->HasCollectible(collectionId)) {
continue; continue;
} }

View File

@@ -1,152 +1,152 @@
CREATE TABLE IF NOT EXISTS accounts ( CREATE TABLE IF NOT EXISTS accounts (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(35) NOT NULL UNIQUE, name TEXT NOT NULL UNIQUE,
password TEXT NOT NULL, password TEXT NOT NULL,
gm_level INT UNSIGNED NOT NULL DEFAULT 0, gm_level BIGINT NOT NULL DEFAULT 0,
locked BOOLEAN NOT NULL DEFAULT FALSE, locked INTEGER NOT NULL DEFAULT FALSE,
banned BOOLEAN NOT NULL DEFAULT FALSE, banned INTEGER NOT NULL DEFAULT FALSE,
play_key_id INT NOT NULL DEFAULT 0, play_key_id INTEGER NOT NULL DEFAULT 0,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP(), created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP(),
mute_expire BIGINT UNSIGNED NOT NULL DEFAULT 0 mute_expire BIGINT NOT NULL DEFAULT 0
); );
CREATE TABLE IF NOT EXISTS charinfo ( CREATE TABLE IF NOT EXISTS charinfo (
id BIGINT NOT NULL PRIMARY KEY, id BIGINT NOT NULL PRIMARY KEY,
account_id INT NOT NULL REFERENCES accounts(id), account_id INTEGER NOT NULL REFERENCES accounts(id),
name VARCHAR(35) NOT NULL, name TEXT NOT NULL,
pending_name VARCHAR(35) NOT NULL, pending_name TEXT NOT NULL,
needs_rename BOOLEAN NOT NULL DEFAULT FALSE, needs_rename INTEGER NOT NULL DEFAULT FALSE,
prop_clone_id BIGINT UNSIGNED AUTO_INCREMENT UNIQUE, prop_clone_id BIGINT AUTO_INCREMENT UNIQUE,
last_login BIGINT UNSIGNED NOT NULL DEFAULT 0, last_login BIGINT NOT NULL DEFAULT 0,
permission_map BIGINT UNSIGNED NOT NULL DEFAULT 0 permission_map BIGINT NOT NULL DEFAULT 0
); );
CREATE TABLE IF NOT EXISTS charxml ( CREATE TABLE IF NOT EXISTS charxml (
id BIGINT NOT NULL PRIMARY KEY REFERENCES charinfo(id), id BIGINT NOT NULL PRIMARY KEY REFERENCES charinfo(id),
xml_data LONGTEXT NOT NULL xml_data TEXT NOT NULL
); );
CREATE TABLE IF NOT EXISTS command_log ( CREATE TABLE IF NOT EXISTS command_log (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
character_id BIGINT NOT NULL REFERENCES charinfo(id), character_id BIGINT NOT NULL REFERENCES charinfo(id),
command VARCHAR(256) NOT NULL command TEXT NOT NULL
); );
CREATE TABLE IF NOT EXISTS friends ( CREATE TABLE IF NOT EXISTS friends (
player_id BIGINT NOT NULL REFERENCES charinfo(id), player_id BIGINT NOT NULL REFERENCES charinfo(id),
friend_id BIGINT NOT NULL REFERENCES charinfo(id), friend_id BIGINT NOT NULL REFERENCES charinfo(id),
best_friend BOOLEAN NOT NULL DEFAULT FALSE, best_friend INTEGER NOT NULL DEFAULT FALSE,
PRIMARY KEY (player_id, friend_id) PRIMARY KEY (player_id, friend_id)
); );
CREATE TABLE IF NOT EXISTS leaderboard ( CREATE TABLE IF NOT EXISTS leaderboard (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
game_id INT UNSIGNED NOT NULL DEFAULT 0, game_id INTEGER NOT NULL DEFAULT 0,
last_played TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP(), last_played DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP(),
character_id BIGINT NOT NULL REFERENCES charinfo(id), character_id BIGINT NOT NULL REFERENCES charinfo(id),
time BIGINT UNSIGNED NOT NULL, time BIGINT NOT NULL,
score BIGINT UNSIGNED NOT NULL DEFAULT 0 score BIGINT NOT NULL DEFAULT 0
); );
CREATE TABLE IF NOT EXISTS mail ( CREATE TABLE IF NOT EXISTS mail (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
sender_id INT NOT NULL DEFAULT 0, sender_id INTEGER NOT NULL DEFAULT 0,
sender_name VARCHAR(35) NOT NULL DEFAULT '', sender_name TEXT NOT NULL DEFAULT '',
receiver_id BIGINT NOT NULL REFERENCES charinfo(id), receiver_id BIGINT NOT NULL REFERENCES charinfo(id),
receiver_name VARCHAR(35) NOT NULL, receiver_name TEXT NOT NULL,
time_sent BIGINT UNSIGNED NOT NULL, time_sent BIGINT NOT NULL,
subject TEXT NOT NULL, subject TEXT NOT NULL,
body TEXT NOT NULL, body TEXT NOT NULL,
attachment_id BIGINT NOT NULL DEFAULT 0, attachment_id BIGINT NOT NULL DEFAULT 0,
attachment_lot INT NOT NULL DEFAULT 0, attachment_lot INTEGER NOT NULL DEFAULT 0,
attachment_subkey BIGINT NOT NULL DEFAULT 0, attachment_subkey BIGINT NOT NULL DEFAULT 0,
attachment_count INT NOT NULL DEFAULT 0, attachment_count INTEGER NOT NULL DEFAULT 0,
was_read BOOLEAN NOT NULL DEFAULT FALSE was_read INTEGER NOT NULL DEFAULT FALSE
); );
CREATE TABLE IF NOT EXISTS object_id_tracker ( CREATE TABLE IF NOT EXISTS object_id_tracker (
last_object_id BIGINT UNSIGNED NOT NULL DEFAULT 0 PRIMARY KEY last_object_id BIGINT NOT NULL DEFAULT 0 PRIMARY KEY
); );
CREATE TABLE IF NOT EXISTS pet_names ( CREATE TABLE IF NOT EXISTS pet_names (
id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
pet_name TEXT NOT NULL, pet_name TEXT NOT NULL,
approved INT UNSIGNED NOT NULL approved INTEGER NOT NULL
); );
CREATE TABLE IF NOT EXISTS play_keys ( CREATE TABLE IF NOT EXISTS play_keys (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
key_string CHAR(19) NOT NULL UNIQUE, key_string TEXT NOT NULL UNIQUE,
key_uses INT NOT NULL DEFAULT 1, key_uses INTEGER NOT NULL DEFAULT 1,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP(), created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP(),
active BOOLEAN NOT NULL DEFAULT TRUE active INTEGER NOT NULL DEFAULT TRUE
); );
CREATE TABLE IF NOT EXISTS properties ( CREATE TABLE IF NOT EXISTS properties (
id BIGINT NOT NULL PRIMARY KEY, id BIGINT NOT NULL PRIMARY KEY,
owner_id BIGINT NOT NULL REFERENCES charinfo(id), owner_id BIGINT NOT NULL REFERENCES charinfo(id),
template_id INT UNSIGNED NOT NULL, template_id INTEGER NOT NULL,
clone_id BIGINT UNSIGNED REFERENCES charinfo(prop_clone_id), clone_id BIGINT REFERENCES charinfo(prop_clone_id),
name TEXT NOT NULL, name TEXT NOT NULL,
description TEXT NOT NULL, description TEXT NOT NULL,
rent_amount INT NOT NULL, rent_amount INTEGER NOT NULL,
rent_due BIGINT NOT NULL, rent_due BIGINT NOT NULL,
privacy_option INT NOT NULL, privacy_option INTEGER NOT NULL,
mod_approved BOOLEAN NOT NULL DEFAULT FALSE, mod_approved INTEGER NOT NULL DEFAULT FALSE,
last_updated BIGINT NOT NULL, last_updated BIGINT NOT NULL,
time_claimed BIGINT NOT NULL, time_claimed BIGINT NOT NULL,
rejection_reason TEXT NOT NULL, rejection_reason TEXT NOT NULL,
reputation BIGINT UNSIGNED NOT NULL, reputation BIGINT NOT NULL,
zone_id INT NOT NULL zone_id INTEGER NOT NULL
); );
CREATE TABLE IF NOT EXISTS ugc ( CREATE TABLE IF NOT EXISTS ugc (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
account_id INT NOT NULL REFERENCES accounts(id), account_id INTEGER NOT NULL REFERENCES accounts(id),
character_id BIGINT NOT NULL REFERENCES charinfo(id), character_id BIGINT NOT NULL REFERENCES charinfo(id),
is_optimized BOOLEAN NOT NULL DEFAULT FALSE, is_optimized INTEGER NOT NULL DEFAULT FALSE,
lxfml MEDIUMBLOB NOT NULL, lxfml BLOB NOT NULL,
bake_ao BOOLEAN NOT NULL DEFAULT FALSE, bake_ao INTEGER NOT NULL DEFAULT FALSE,
filename TEXT NOT NULL DEFAULT ('') filename TEXT NOT NULL DEFAULT ('')
); );
CREATE TABLE IF NOT EXISTS properties_contents ( CREATE TABLE IF NOT EXISTS properties_contents (
id BIGINT NOT NULL PRIMARY KEY, id BIGINT NOT NULL PRIMARY KEY,
property_id BIGINT NOT NULL REFERENCES properties(id), property_id BIGINT NOT NULL REFERENCES properties(id),
ugc_id INT NULL REFERENCES ugc(id), ugc_id INTEGER NULL REFERENCES ugc(id),
lot INT NOT NULL, lot INTEGER NOT NULL,
x FLOAT NOT NULL, x DOUBLE NOT NULL,
y FLOAT NOT NULL, y DOUBLE NOT NULL,
z FLOAT NOT NULL, z DOUBLE NOT NULL,
rx FLOAT NOT NULL, rx DOUBLE NOT NULL,
ry FLOAT NOT NULL, ry DOUBLE NOT NULL,
rz FLOAT NOT NULL, rz DOUBLE NOT NULL,
rw FLOAT NOT NULL rw DOUBLE NOT NULL
); );
CREATE TABLE IF NOT EXISTS activity_log ( CREATE TABLE IF NOT EXISTS activity_log (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
character_id BIGINT NOT NULL REFERENCES charinfo(id), character_id BIGINT NOT NULL REFERENCES charinfo(id),
activity INT NOT NULL, activity INTEGER NOT NULL,
time BIGINT UNSIGNED NOT NULL, time BIGINT NOT NULL,
map_id INT NOT NULL map_id INTEGER NOT NULL
); );
CREATE TABLE IF NOT EXISTS bug_reports ( CREATE TABLE IF NOT EXISTS bug_reports (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
body TEXT NOT NULL, body TEXT NOT NULL,
client_version TEXT NOT NULL, client_version TEXT NOT NULL,
other_player_id TEXT NOT NULL, other_player_id TEXT NOT NULL,
selection TEXT NOT NULL, selection TEXT NOT NULL,
submitted TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP() submitted DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP()
); );
CREATE TABLE IF NOT EXISTS servers ( CREATE TABLE IF NOT EXISTS servers (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
name TEXT NOT NULL, name TEXT NOT NULL,
ip TEXT NOT NULL, ip TEXT NOT NULL,
port INT NOT NULL, port INTEGER NOT NULL,
state INT NOT NULL, state INTEGER NOT NULL,
version INT NOT NULL DEFAULT 0 version INTEGER NOT NULL DEFAULT 0
); );

View File

@@ -1,8 +1,8 @@
CREATE TABLE IF NOT EXISTS player_cheat_detections ( CREATE TABLE IF NOT EXISTS player_cheat_detections (
id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
account_id INT REFERENCES accounts(id), account_id INTEGER REFERENCES accounts(id),
name TEXT REFERENCES charinfo(name), name TEXT REFERENCES charinfo(name),
violation_msg TEXT NOT NULL, violation_msg TEXT NOT NULL,
violation_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP(), violation_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP(),
violation_system_address TEXT NOT NULL violation_system_address TEXT NOT NULL
); );

View File

@@ -1,9 +1,9 @@
DROP TABLE IF EXISTS `player_cheat_detections`; DROP TABLE IF EXISTS `player_cheat_detections`;
CREATE TABLE IF NOT EXISTS player_cheat_detections ( CREATE TABLE IF NOT EXISTS player_cheat_detections (
id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
account_id INT REFERENCES accounts(id), account_id INTEGER REFERENCES accounts(id),
name TEXT NOT NULL, name TEXT NOT NULL,
violation_msg TEXT NOT NULL, violation_msg TEXT NOT NULL,
violation_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP(), violation_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP(),
violation_system_address TEXT NOT NULL violation_system_address TEXT NOT NULL
); );

View File

@@ -1,5 +1,5 @@
CREATE TABLE IF NOT EXISTS accounts_rewardcodes ( CREATE TABLE IF NOT EXISTS accounts_rewardcodes (
account_id INT NOT NULL REFERENCES accounts(id) ON DELETE CASCADE, account_id INTEGER NOT NULL REFERENCES accounts(id) ON DELETE CASCADE,
rewardcode INT NOT NULL, rewardcode INTEGER NOT NULL,
PRIMARY KEY (account_id, rewardcode) PRIMARY KEY (account_id, rewardcode)
); );

View File

@@ -1 +1 @@
ALTER TABLE behaviors MODIFY behavior_info LONGTEXT DEFAULT NULL; ALTER TABLE behaviors MODIFY behavior_info TEXT DEFAULT NULL;

View File

@@ -1 +1 @@
ALTER TABLE bug_reports ADD reporter_id INT NOT NULL DEFAULT 0; ALTER TABLE bug_reports ADD reporter_id INTEGER NOT NULL DEFAULT 0;

View File

@@ -1 +1 @@
ALTER TABLE properties ADD COLUMN performance_cost DOUBLE(20, 15) DEFAULT 0.0; ALTER TABLE properties ADD COLUMN performance_cost DOUBLE DEFAULT 0.0;

View File

@@ -1,11 +1,11 @@
ALTER TABLE properties_contents ALTER TABLE properties_contents
ADD COLUMN model_name TEXT NOT NULL DEFAULT "", ADD COLUMN model_name TEXT NOT NULL DEFAULT "",
ADD COLUMN model_description TEXT NOT NULL DEFAULT "", ADD COLUMN model_description TEXT NOT NULL DEFAULT "",
ADD COLUMN behavior_1 INT NOT NULL DEFAULT 0, ADD COLUMN behavior_1 INTEGER NOT NULL DEFAULT 0,
ADD COLUMN behavior_2 INT NOT NULL DEFAULT 0, ADD COLUMN behavior_2 INTEGER NOT NULL DEFAULT 0,
ADD COLUMN behavior_3 INT NOT NULL DEFAULT 0, ADD COLUMN behavior_3 INTEGER NOT NULL DEFAULT 0,
ADD COLUMN behavior_4 INT NOT NULL DEFAULT 0, ADD COLUMN behavior_4 INTEGER NOT NULL DEFAULT 0,
ADD COLUMN behavior_5 INT NOT NULL DEFAULT 0; ADD COLUMN behavior_5 INTEGER NOT NULL DEFAULT 0;
UPDATE properties_contents SET model_name = CONCAT("Objects_", lot, "_name") WHERE model_name = ""; UPDATE properties_contents SET model_name = CONCAT("Objects_", lot, "_name") WHERE model_name = "";
CREATE TABLE IF NOT EXISTS behaviors (id INT NOT NULL, behavior_info TEXT NOT NULL); CREATE TABLE IF NOT EXISTS behaviors (id INTEGER NOT NULL, behavior_info TEXT NOT NULL);

View File

@@ -1 +1 @@
ALTER TABLE accounts MODIFY play_key_id INT DEFAULT 0; ALTER TABLE accounts MODIFY play_key_id INTEGER DEFAULT 0;

View File

@@ -1 +1 @@
ALTER TABLE accounts MODIFY play_key_id INT DEFAULT NULL; ALTER TABLE accounts MODIFY play_key_id INTEGER DEFAULT NULL;

View File

@@ -1,12 +1,12 @@
ALTER TABLE leaderboard ALTER TABLE leaderboard
ADD COLUMN tertiaryScore FLOAT NOT NULL DEFAULT 0, ADD COLUMN tertiaryScore DOUBLE NOT NULL DEFAULT 0,
ADD COLUMN numWins INT NOT NULL DEFAULT 0, ADD COLUMN numWins INTEGER NOT NULL DEFAULT 0,
ADD COLUMN timesPlayed INT NOT NULL DEFAULT 1, ADD COLUMN timesPlayed INTEGER NOT NULL DEFAULT 1,
MODIFY time INT NOT NULL DEFAULT 0; MODIFY time INTEGER NOT NULL DEFAULT 0;
/* Can only ALTER one column at a time... */ /* Can only ALTER one column at a time... */
ALTER TABLE leaderboard CHANGE score primaryScore FLOAT NOT NULL DEFAULT 0; ALTER TABLE leaderboard CHANGE score primaryScore DOUBLE NOT NULL DEFAULT 0;
ALTER TABLE leaderboard CHANGE time secondaryScore FLOAT NOT NULL DEFAULT 0 AFTER primaryScore; ALTER TABLE leaderboard CHANGE time secondaryScore DOUBLE NOT NULL DEFAULT 0 AFTER primaryScore;
/* A bit messy, but better than going through a bunch of code fixes all to be run once. */ /* A bit messy, but better than going through a bunch of code fixes all to be run once. */
UPDATE leaderboard SET UPDATE leaderboard SET
@@ -15,4 +15,4 @@ UPDATE leaderboard SET
/* Do this last so we dont update entry times erroneously */ /* Do this last so we dont update entry times erroneously */
ALTER TABLE leaderboard ALTER TABLE leaderboard
CHANGE last_played last_played TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP() ON UPDATE CURRENT_TIMESTAMP(); CHANGE last_played last_played DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP() ON UPDATE CURRENT_TIMESTAMP();