Revert "Feature/continuumatrice product migration"

This commit is contained in:
Christian Daniel Jensen 2026-11-03 18:51:23 -07:00 • committed by GitHub
parent 533d2f04c1
commit e49d053838
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
150 changed files with 2599 additions and 5304 deletions

View file

@ -2,7 +2,7 @@
#
# provides the servatrice binary
project(ContinuumServatrice VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
project(Servatrice VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
set(servatrice_SOURCES
src/email_parser.cpp
@ -49,7 +49,11 @@ if(CMAKE_HOST_SYSTEM MATCHES "FreeBSD")
endif()
if(APPLE)
# Headless server: no inherited Cockatrice .icns bundle branding.
set(MACOSX_BUNDLE_ICON_FILE appicon.icns)
set_source_files_properties(
${CMAKE_CURRENT_SOURCE_DIR}/resources/appicon.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources
)
set(servatrice_SOURCES ${servatrice_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/resources/appicon.icns)
endif(APPLE)
qt_add_resources(servatrice_RESOURCES_RCC ${servatrice_RESOURCES})
@ -80,7 +84,7 @@ if(${MYSQL_CLIENT_LIBRARIES} MATCHES "NOTFOUND")
FALSE
CACHE INTERNAL ""
)
message(STATUS "MySQL connector NOT FOUND: Continuum-Servatrice won't be able to connect to a MySQL server")
message(STATUS "MySQL connector NOT FOUND: Servatrice won't be able to connect to a MySQL server")
unset(MYSQL_CLIENT_LIBRARIES)
else()
set(MYSQLCLIENT_FOUND
@ -102,20 +106,18 @@ set(DESKTOPDIR
)
# Build servatrice binary and link it
add_executable(continuum-servatrice MACOSX_BUNDLE ${servatrice_MOC_SRCS} ${servatrice_RESOURCES_RCC} ${servatrice_SOURCES})
# Internally keep the original source tree and Source/Protocol type names.
# This target produces only the native Continuum-Servatrice executable.
add_executable(servatrice MACOSX_BUNDLE ${servatrice_MOC_SRCS} ${servatrice_RESOURCES_RCC} ${servatrice_SOURCES})
target_precompile_headers(continuum-servatrice PRIVATE "${CMAKE_SOURCE_DIR}/cmake/pch/qtcore_pch.h")
target_precompile_headers(servatrice PRIVATE "${CMAKE_SOURCE_DIR}/cmake/pch/qtcore_pch.h")
if(CMAKE_HOST_SYSTEM MATCHES "FreeBSD")
target_link_libraries(
continuum-servatrice libcockatrice_deck_list libcockatrice_network_server_remote Threads::Threads ${SERVATRICE_QT_MODULES}
servatrice libcockatrice_deck_list libcockatrice_network_server_remote Threads::Threads ${SERVATRICE_QT_MODULES}
${LIBEXECINFO_LIBRARY}
)
else()
target_link_libraries(
continuum-servatrice libcockatrice_deck_list libcockatrice_network_server_remote Threads::Threads ${SERVATRICE_QT_MODULES}
servatrice libcockatrice_deck_list libcockatrice_network_server_remote Threads::Threads ${SERVATRICE_QT_MODULES}
)
endif()
@ -123,34 +125,35 @@ endif()
if(UNIX)
if(APPLE)
set(MACOSX_BUNDLE_INFO_STRING "${PROJECT_NAME}")
set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.continuum-universes.continuum-servatrice")
set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.cockatrice.${PROJECT_NAME}")
set(MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_NAME}-${PROJECT_VERSION}")
set(MACOSX_BUNDLE_BUNDLE_NAME ${PROJECT_NAME})
set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION})
set(MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION})
install(TARGETS continuum-servatrice BUNDLE DESTINATION ./)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/continuum-servatrice.ini.example DESTINATION ./continuum-servatrice.app/Contents/Resources/)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/continuum-servatrice.sql DESTINATION ./continuum-servatrice.app/Contents/Resources/)
install(TARGETS servatrice BUNDLE DESTINATION ./)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/servatrice.ini.example DESTINATION ./servatrice.app/Contents/Resources/)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/servatrice.sql DESTINATION ./servatrice.app/Contents/Resources/)
else()
# Assume linux
install(TARGETS continuum-servatrice RUNTIME DESTINATION bin/)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/continuum-servatrice.ini.example DESTINATION share/continuum-servatrice/)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/continuum-servatrice.sql DESTINATION share/continuum-servatrice/)
install(TARGETS servatrice RUNTIME DESTINATION bin/)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/servatrice.ini.example DESTINATION share/servatrice/)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/servatrice.sql DESTINATION share/servatrice/)
# No upstream Servatrice desktop/icon registration; it would collide with
# a separate MTG server installation. The server is managed via CLI.
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resources/servatrice.png DESTINATION ${ICONDIR}/hicolor/48x48/apps)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resources/servatrice.svg DESTINATION ${ICONDIR}/hicolor/scalable/apps)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/servatrice.desktop DESTINATION ${DESKTOPDIR})
endif()
elseif(WIN32)
install(TARGETS continuum-servatrice RUNTIME DESTINATION ./)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/continuum-servatrice.ini.example DESTINATION ./)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/continuum-servatrice.sql DESTINATION ./)
install(TARGETS servatrice RUNTIME DESTINATION ./)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/servatrice.ini.example DESTINATION ./)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/servatrice.sql DESTINATION ./)
endif()
if(APPLE)
# these needs to be relative to CMAKE_INSTALL_PREFIX
set(plugin_dest_dir continuum-servatrice.app/Contents/Plugins)
set(qtconf_dest_dir continuum-servatrice.app/Contents/Resources)
set(plugin_dest_dir servatrice.app/Contents/Plugins)
set(qtconf_dest_dir servatrice.app/Contents/Resources)
# Qt plugins: platforms, sqldrivers/mysql, tls (Qt6)
install(
@ -180,7 +183,7 @@ Translations = Resources/translations\")
\"\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/*.dylib\")
set(BU_CHMOD_BUNDLE_ITEMS ON)
include(BundleUtilities)
fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/continuum-servatrice.app\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIR};${MYSQLCLIENT_LIBRARY_DIR}\")
fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/servatrice.app\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIR};${MYSQLCLIENT_LIBRARY_DIR}\")
"
COMPONENT Runtime
)
@ -192,7 +195,7 @@ if(WIN32)
set(qtconf_dest_dir .)
install(
DIRECTORY "$<TARGET_FILE_DIR:continuum-servatrice>/"
DIRECTORY "$<TARGET_FILE_DIR:servatrice>/"
DESTINATION ./
FILES_MATCHING
PATTERN "*.dll"
@ -240,11 +243,8 @@ Translations = Resources/translations\")
\"\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/*.dll\")
set(BU_CHMOD_BUNDLE_ITEMS ON)
include(BundleUtilities)
fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/continuum-servatrice.exe\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIR};${MYSQLCLIENT_LIBRARY_DIR}\")
fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/Servatrice.exe\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIR};${MYSQLCLIENT_LIBRARY_DIR}\")
"
COMPONENT Runtime
)
endif()
# Compatibility build target for existing CI commands. No 'servatrice' executable is emitted.
add_custom_target(servatrice DEPENDS continuum-servatrice)

View file

@ -1,593 +0,0 @@
; Continuum-Servatrice configuration file
;
; This is the main configuration file for Continuum-Servatrice; while using a configuration is not mandatory,
; you may want to customize some aspects of your continuum-servatrice instance, like its name, port or the way
; users can authenticate to the server.
;
; Can be passed to continuum-servatrice with --config /path/to/continuum-servatrice.ini
[server]
; This is the name that continuum-servatrice exposes to the users; the default value is pretty boring
name="My Continuum-Servatrice server"
; Multiple continuum-servatrice servers can run on the same host using the same database; each server instance
; must have a different id; the default id is 1
id=1
; The IP address continuum-servatrice will listen on for clients; defaults to "any" to listen on all the interfaces,
; a specific IPv4/v6 addresses can be used, eg for localhost-only 127.0.0.1 for IPv4 or ::1 for IPv6.
host=any
; The TCP port number Continuum-Servatrice will listen on for clients; default is 4757;
; Will be removed in the future, use websocket connection instead
port=4757
; Continuum-Servatrice can scale up to serve big number of users using more than one parallel thread of execution;
; If your server is hosting a lot of players and they frequently report of being unable to login or
; long delays (lag), you may want to try increasing this value; default is 1.
; Set to 0 to disable the tcp server.
number_pools=1
; Continuum-Servatrice can listen for clients on websockets, too. Multiple connection pools are available but
; unfortunately, due to a Qt limitation, they must run in the same execution thread.
; Set to 0 to disable the websocket server.
websocket_number_pools=1
; The IP address continuum-servatrice will listen on for websockets clients; defaults to "any"
websocket_host=any
; The TCP port number continuum-servatrice will listen on for websockets clients; default is 4758
websocket_port=4758
; If websockets are served through a reverse proxy (e.g. nginx), the real client address can be
; read from an HTTP header such as X-Real-IP or X-Forwarded-For. A comma-separated X-Forwarded-For
; list resolves to its rightmost entry, which is the one the proxy appended. The header is ONLY
; trusted when the websocket connection itself originates from an address listed in
; security/trusted_sources (default 127.0.0.1,::1), so that clients cannot spoof their address to
; bypass bans or rate limits.
web_socket_ip_header=
; When database is enabled, continuum-servatrice writes the server status in the "update" database table; this
; setting defines every how many milliseconds continuum-servatrice will update its status; default is 15000 (15 secs)
statusupdate=15000
; Do you want continuum-servatrice to write important events and errors to a logfile? Default is 1 (yes).
writelog=1
; Choose a name for the log file, if enabled; you can specify an absolute path or a path relative to
; the continuum-servatrice executable; the default file name is server.log (in the same path as continuum-servatrice)
; Note: When running continuum-servatrice under windows you will need to use double backslashes between folder locations
; [ex: C:\\Temp\\server.log ]
logfile=continuum-servatrice.log
; You may want to log only certain messages in the logfile. The default log level is extremely verbose.
; This setting should contain a comma-separated list of strings that will be selectively logged.
; All other lines will be excluded from the log. Default is empty; example: "Registration,_Login,foobar"
logfilters=""
; Set the time interval in seconds that continuum-servatrice will use to communicate with each connected client
; to verify the client has not timed out. Defaults is 1 seconds
clientkeepalive=1
; Maximum time in seconds a player can stay inactive with there client not even responding to pings, before is
; considered disconnected; default is 15
max_player_inactivity_time=15
; More modern clients generate client IDs based on specific client side information. Enable this option to
; require that clients report the client ID in order to log into the server. Default is false
requireclientid=false
; You can limit the types of clients that connect to the server by requiring different features be available
; on the client. This setting can contain a comma-seperated list of features. if any of the features
; listed in this line are not available on the client the client will be denied access to the server upon
; attempting to log in. Example: "client_id,client_ver,websocket"
requiredfeatures=""
; You can define custom warnings that users are sent when the moderation staff uses the right client warn user
; menu option. This list is comma seperated that each item will appear in the drop down list for staff members
; to choose from. Each entry may optionally carry a recommended starting intervention level (see the moderator
; guide) by appending "|" and the level number. Entries without an explicit level default to intervention
; level 1. Example: "Flaming,Foul Language"
officialwarnings="Abusive Language|1,Calling Out User|1,Causing Drama|1,Cheating|2,Disrespecting Staff|1,Disrupting a Draft|1,Inappropriate Avatar|3,Inappropriate Game Name|1,Kicking Without Valid Reason|1,Spamming|1,Targeted Harassment|2"
; Maximum time in seconds a player can stay connected but idle. Default is 3600 (0 = disabled)
; Clients will be notified at the 90% time period of pending disconnection if they do not take action.
idleclienttimeout=3600
[authentication]
; Continuum-Servatrice can authenticate users connecting. It currently supports 3 different authentication methods:
; * none: no authentication, accept every user;
; * password: require users to specify a common password to log in;
; * sql: authenticate users against the "users" table of the database;
; Please note that only the "sql" method permits to have registered users and store their data on the server.
method=none
; if the chosen authentication method is password, here you can define the password your users will use to log in
password=123456
; Accept only registered users? default is false (accept unregistered users)
regonly=false
[users]
; The minimum length a username can be
minnamelength=6
; The maximum length a username can be
maxnamelength=12
; If a username should be allowed to contain lowercase chars [a-z]
allowlowercase=true
; If a username should be allowed to conatain uppercase chars [A-Z]
allowuppercase=true
; If a username should be allowed to contain numbers [0-9]
allownumerics=true
; Define punctuation allowed in usernames
allowedpunctuation=_.-
; If a username can begin with punctuation defined in allowedpunctuation
allowpunctuationprefix=false
; Disallow usernames containing these words. This list is comma seperated, e.g.
; "admin,user,name"
disallowedwords="admin"
; Overwrite the words shown to the user when they enter a wrong username,
; use \n to start a new line. Neither the real wordlist nor the disallowed
; expressions will be sent to the user if this is set.
; In the old versions of the client this list will be prefaced with
; "can not contain any of the following words:"
; example:
;displaydisallowedwords="no attempts at impersonating staff\nno unparliamentary language\nno references to controversial figures\nstaff reserves the right to remove accounts deemed inappropriate"
; Setting it to nothing will simply hide the list:
;displaydisallowedwords=
; Disallow usernames matching these regular expressions. This list is comma
; separated, e.g. "\\w+\\d+,\\d{2}user", hence you cannot use commas in your
; expressions. Backslashes must be escaped, so `\w+\d+` becomes `\\w+\\d+`.
; WARNING: Complex expressions can be harmful to performance. Please make sure
; your expressions are considered well formed. See this page for info:
; http://www.regular-expressions.info/catastrophic.html
disallowedregexp=""
; Define minimum password length
; Default 6.
minpasswordlength = 6
[registration]
; Continuum-Servatrice can process registration requests to add new users on the fly.
; Enable this feature? Default false.
;enabled=false
; Require users to provide an email address in order to register. Default true.
;requireemail=true
; Require email activation. Newly registered users will receive an activation token by email,
; and will be required to input back this token on cockatrice at the first login to get their
; account activated. Default true.
;requireemailactivation=true
; Set this number to the maximum number of accounts any one user can use to create new accounts
; using the same email address. 0 = Unlimited number of accounts (default).
;maxaccountsperemail=0
; You can prevent users from using certain mail domains for registration. This setting contains a
; comma-seperated list of email provider domains that you would like to prevent users from using
; during registration. Comparison's are implicit, so placing an entry such as mail.com will also
; prevent users from registering accounts with providers such as gmail.com and hotmail.com
; Example: "10minutemail.com,gmail.com"
;emailproviderblacklist=""
; You can require users to only use certain email domains for registration. This setting is a
; comma-separated list of email provider domains that you have explicitly audited and require
; the use of in order to create an account. Comparison's are explicit, so you must specify the
; domain in completion, such as gmail.com and hotmail.com. Email whitelist is checked before
; Email blacklist is checked, so an email cannot be in both setting configurations.
; Example: "gmail.com,hotmail.com,icloud.com"
;emailproviderwhitelist=""
[forgotpassword]
; Continuum-Servatrice can process reset password requests allowing users to reset their account
; passwords in the event they forget it. Should this feature be enabled? Default: false.
; enable=false
; Reset password request should not be allowed to stay valid forever. This settings
; informs continuum-servatrice how long a players reset password reset token is valid for (in minutes).
; Default: 60
; tokenlife=60
; Continuum-Servatrice can challenge users that are making reset password requests to answer
; questions in regards to their account to help validate they are the true owner of the account.
; Should this feature be enabled? Default: false
; enablechallenge=false
; Email subject for the reset password emails
; subject="Continuumatrice reset password token"
; Reset password email body. You can use these tags here: %username %token
; They will be substituted with the actual values in the email
;
; body="Hi %username,\r\nthanks for reaching out to us with your password reset request for our Continuumatrice server.\r\nHere's your unique token in order to reset your account password in the app:\r\n\r\n%token\r\n\r\nHappy gaming!"
[smtp]
; Enable the internal smtp client to send registration emails. If you would like to
; use some other method to send email activation tokens set this value to false. Otherwise
; setting it to true (default) the server will send canned generated emails containing
; activation tokens for you during update intervals. Setting this to false will require
; you to either manually activate user accounts or manually send users the activation token
; by whatever means.
enableinternalsmtpclient=true
; Connectin type: currently supported method are "tcp" and "ssl"; tls is autodetected if available
connection=tcp
; Accept all certificates: in ssl mode, enable this if your server is using an invalid/self signed certificate
acceptallcerts=false;
; Hostname or IP addres of the smtp server
host=localhost
; Smtp port number of the smtp server. Usual values are 25 or 587 for tcp, 465 for ssl
port=25
; Username: this typically matches the "from" email address
username=root@localhost
; Password for the username
password=foobar
; Sender email address: the "from" email address
email=root@localhost
; Sender email name
name="Continuumatrice server"
; Maximum number of attempts to deliver a given e-mail before giving up.
; If the smtp server is unreachable or repeatedly rejects a message, the server
; will retry with an exponentially growing delay up to this many times, then drop
; the message from the queue and log the failure. Default: 5
maxretries=5
; Initial retry delay in seconds between delivery attempts. Doubles with each
; failed attempt (capped at 30 minutes). Default: 60
retrydelay=60
; Email subject
subject="Continuumatrice server account activation token"
; Email body. You can use these tags here: %username %token
; They will be substituted with the actual values in the email
;
body="Hi %username, thank our for registering on our Continuumatrice server\r\nHere's the activation token you need to supply for activating your account:\r\n\r\n%token\r\n\r\nHappy gaming!"
[database]
; Database type. Valid values are:
; * none: no database;
; * mysql: mysql or compatible database;
type=none
; Prefix used in he database for table names; default is continuum_servatrice
prefix=continuum_servatrice
; Database connection parameter: server hostname or IP
hostname=localhost
; Database connection parameter: database name
database=continuum_servatrice
; Database connection parameter: database user
user=continuum_servatrice
; Database connection parameter: database user's password
password=foobar
[rooms]
; A continuum-servatrice server can expose to the users different "rooms" to chat and create games. Rooms can be defined
; with two different methods:
; config: rooms are defined in this configuration (see the following example)
; sql: rooms are defined in the "rooms" table of the database
method=config
; Example configuration for a server with rooms configured in the configuration file. Number of rooms defined
roomlist\size=1
; Room name for the room number 1
roomlist\1\name="General room"
; Room description for the room number 1
roomlist\1\description="Play anything here."
; Rooms can restrict the level of user that can join. Current supported options are none, registered, moderator, administrator.
; Default is none.
roomlist\1\permissionlevel=none
; Rooms can restrict the permission level of users that can join, Currnetly supported options are none, privileged, vip, and donator.
; Default is none.
roomlist\1\privilegelevel=none
; Wether to make users autojoin this room when connected to the server
roomlist\1\autojoin=true
; Message displayed to each user when he joins room number 1
roomlist\1\joinmessage="This message is only here to show that rooms can have a join message."
; The number of chat history messages to save that gets presented to a user joining the room
roomlist\1\chathistorysize=100
; Number of game types allowed (defined) in the room number 1
roomlist\1\game_types\size=3
; Name of the three game types for the room number 1
roomlist\1\game_types\1\name="GameType1"
roomlist\1\game_types\2\name="GameType2"
roomlist\1\game_types\3\name="GameType3"
; Optional chat channels for room number 1, in addition to the implicit Main
; channel every room has. Each channel needs a stable ASCII id, a display name
; (server data, like the room name) and an access level. Supported levels, from
; least to most restrictive, are: public, registered, judge, moderator, admin
; and developer. Access is evaluated against the member's user flags, not as a
; ladder: a moderator channel admits moderators (admins hold the moderator
; flag alongside the admin flag, so they are admitted too), an admin channel
; admits only admins, and a developer channel admits only developers and
; admins. In particular, developers cannot read moderator or admin channels.
; A judge channel additionally admits moderators.
; Public channels are visible to every room member.
;
; Write access defaults to the read level, so by default a channel is readable
; and writable by the same members. Set writeaccess higher for read-mostly
; channels (e.g. a developer news feed readable by everyone but writable only
; by developers). Members who can read but not write see the channel with a
; disabled message input.
;
; banner is an optional static notice shown at the top of the channel, similar
; to the room joinmessage on Main. Empty or unset = none.
roomlist\1\channels\size=3
roomlist\1\channels\1\id=looking-for-players
roomlist\1\channels\1\displayname="Looking for players"
roomlist\1\channels\1\access=public
roomlist\1\channels\1\banner="Find opponents here. Be friendly!"
roomlist\1\channels\2\id=moderators
roomlist\1\channels\2\displayname="Moderators"
roomlist\1\channels\2\access=moderator
roomlist\1\channels\3\id=developer-news
roomlist\1\channels\3\displayname="Developer news"
roomlist\1\channels\3\access=public
roomlist\1\channels\3\writeaccess=developer
roomlist\1\channels\3\banner="Official announcements from the developers."
[game]
; Maximum time in seconds all players in a game can stay inactive before the game is automatically closed;
; default is 120
max_game_inactivity_time=120
; All actions during a game are recorded and stored in the database as a replay that all participants of
; the game can go back to and review after the game is closed. This can require a fairly large amount of
; storage to save all the information. Disable this option to prevent the storing of replay data in
; the database. Default value is true.
store_replays=true
; Allow users to create a new game and join it as a judge. The host will be able to execute any action on
; the cards of every player. This is needed in order to support some games (eg. Werewolf).
; Default off to prevent abuse on servers that are mostly running other games.
allow_create_as_judge=false
[security]
; You may want to restrict the number of users that can connect to your server at any given time.
enable_max_user_limit=false
; Maximum number of users that can connect to the server, default is 500.
max_users_total=500
; Maximum number of users that can connect to the server using a tcp connection, default is 500.
max_users_tcp=500
; Maximum number of users that can connect to the server using a websocket connection, default is 500.
max_users_websocket=500
; Maximum number of users that can connect from the same IP address; useful to avoid bots, default is 4
max_users_per_address=4
; Maximum number of failed login attempts from a single IP address before that
; address is temporarily locked out. Default is 5; set to 0 to disable.
max_login_attempts_per_ip=5
; Length in seconds of the sliding window used for the login lockout. Default is 900 (15 minutes).
login_attempt_window_seconds=900
; Maximum number of account registrations from a single IP address within the window below.
; Default is 2; set to 0 to disable.
max_registrations_per_ip=2
; Length in seconds of the registration window. Default is 3600 (1 hour).
registration_window_seconds=3600
; Maximum number of forgot-password requests from a single IP address within the window below.
; Default is 3; set to 0 to disable.
max_forgot_password_requests_per_ip=3
; Length in seconds of the forgot-password window. Default is 3600 (1 hour).
forgot_password_window_seconds=3600
; How strictly new authentication features are enforced. Possible values:
; * legacy: accounts that still use the legacy 1000-round SHA-512 hash keep logging in with it
; (they are served the legacy salt, never a challenge-response nonce) and are never
; auto-migrated to scrypt. Already-migrated scrypt rows keep logging in via
; challenge-response. New credentials may use either format;
; * mixed: accept both legacy hashes and challenge-response authentication (default);
; * strict: only accept challenge-response authentication from clients that support it,
; and reject plain password submissions. Legacy accounts are migrated to scrypt
; automatically on their next successful login. Strict only constrains
; registered SQL accounts: guest/unregistered logins and servers with
; authentication/method set to none or password are unaffected, since
; they have no stored verifier to challenge against.
;
; Note: anyone holding only the legacy salt+hash of a not-yet-migrated account
; (e.g. from a wire capture of an old client, or an old database dump) can log in
; with it and then set a brand new password of their choosing. Before
; challenge-response a captured hash yielded a session, but changing the password
; still required the plaintext old password. There is no way around this without
; a plaintext proof at migration time, so not-yet-migrated rows should be treated
; accordingly.
;
; Challenge-response verifiers are scrypt (RFC 7914, N=32768, r=8, p=1) stored as
; "$scrypt$<n>$<r>$<p>$<salt>$<verifier>". The stored verifier is password-equivalent:
; plaintext passwords never reach the client configuration and never go over the wire, but
; a database dump yields credentials that can answer a login challenge directly.
authentication_strictness=mixed
; Optional key that seals the legacy password backup (64 hex characters).
; Migrating an account to scrypt normally strands old clients, which can only present
; the legacy hash. With a key configured, the server keeps that hash encrypted next to
; the scrypt verifier, so old clients can still log in during the window below without
; the database holding a fast-crackable hash in the clear.
; Generate with: openssl rand -hex 32
; If unset there is no downgrade path at all: a migrated account keeps only a scrypt
; verifier, and an administrator's password reset stores a verifier too, so pre-challenge
; clients cannot log in with the temporary password either. Set the key if you still serve
; them. Rotating the key invalidates existing backups (they become unusable immediately;
; expired ones are still purged).
legacy_backup_key=
; Days a legacy password backup may go unused before it is purged from the database.
; Logging in with an old client refreshes the window; backups that are never touched
; age out. Default 180.
legacy_backup_ttl_days=180
; You may want to allow an unlimited number of users from a trusted source. This setting can contain a
; comma-separed list of IP addresses which will allow an unlimited number of connections from each of the
; IP addresses listed (ignoring the max_users_per_address). Entries must be exact IP addresses; hostnames, prefixes
; and subnets are ignored. Default is "127.0.0.1,::1"; example: "192.73.233.244,81.4.100.74"
trusted_sources="127.0.0.1,::1"
; Continuum-Servatrice can avoid users from flooding rooms with large number of messages in an interval of time.
; This setting defines the length in seconds of the considered interval; default is 10
message_counting_interval=10
; Maximum size in characters of all messages in an interval before new messages gets dropped; default is 1000
max_message_size_per_interval=1000
; Maximum number of messages in an interval before new messages gets dropped; default is 10
max_message_count_per_interval=10
; Maximum number of games a single user can create; default is 5; set to -1 to disable; 0 disallows game creation
max_games_per_user=5
; Continuum-Servatrice can avoid users from flooding games with large number of game commands in an interval of time.
; This setting defines the length in seconds of the considered interval; default is 10
command_counting_interval=10
; Maximum number of game commands in an interval before new commands gets dropped; default is 20
max_command_count_per_interval=20
[reporting]
; Maximum number of user reports a single user can file per day; default is 10; set to 0 to disable the limit
max_reports_per_day=10
; Maximum number of report comments a single user can post per hour; default is 30; set to 0 to disable the limit
max_comments_per_hour=30
[metrics]
; Command containers that take longer than this many milliseconds are logged
; as slow commands. Set to 0 to disable the log line. A latency spike produces
; one warning per slow container with no rate limiting of its own -- a bad
; patch can briefly flood the log, which is how you notice it.
slow_command_ms=500
; Each socket pool thread runs a watchdog heartbeat. If a heartbeat arrives
; this many milliseconds late, the stall is logged and exposed as
; continuum-servatrice_eventloop_* metrics in the Developer tab. Set to 0 to disable
; the watchdogs.
stall_warn_ms=2000
[logging]
; Admin/Moderators can query the stored logs for information when looking up reports by various players. This
; option can allow or disallow them from doing so.
; !!NOTE!! Enabling this feature puts a very high CPU and DISK load on the server, enable with caution.
enablelogquery=false
; Continuum-Servatrice can log user messages to the database table cockatrice_log.
; These messages can come from different sources; each source can be enabled separately.
; Log user messages inside chat rooms
log_user_msg_room=false
; Log user messages inside games
log_user_msg_game=false
; Log user messages in private chats
log_user_msg_chat=false
; Log user messages coming from other servers in the network
log_user_msg_isl=false
[audit]
; Continuum-Servatrice can record certain actions being performed in the database for server operators to better understand
; if some one may be abusing application functionality. Enabling auditing will allow continuum-servatrice to record any
; of the below enabled audit functionality to be recorded.
; Default: true
enable_audit=true
; Continuum-Servatrice can record when users attempt a new account registration. Should we enable auditing for this action?
; Default: true
enable_registration_audit=true
; Continuum-Servatrice can record when a users attempts to reset the account password. Should we enable auditing for this action?
; Default: true
enable_forgotpassword_audit=true
; EXPERIMENTAL - NOT WORKING YET
; The following settings are relative to the server network functionality, that is not yet complete.
; Avoid enabling it unless you are willing to test it and help its development.
[servernetwork]
; Continuum-Servatrice servers can connect themselves and build a network. This settins enable the ability of continuum-servatrice
; of waiting for other server's connections and connect to other servers. Other servers can be defined in the
; "servers" table of the database. Default is 0 (disabled)
active=0
; The TCP port number Continuum-Servatrice will listen on for other servers; default is 14757
port=14757
; Server-to-server communication needs a valid certificate in PEM format. Enter its filename in this setting
ssl_cert=ssl_cert.pem
; Filename of the private key for the server-to-server certificate
ssl_key=ssl_key.pem
[deck_share]
; How many days a created deck share link remains valid before it expires.
; Default: 7
expiry_days=7
; How often (in minutes) the server checks for and removes expired deck shares.
; A value of 0 disables the automatic cleanup.
; Default: 60
cleanup_interval=60
; Maximum number of decks a single share link can contain.
; Default: 50
max_decks_per_share=50
; Maximum number of share links a single user may create per day.
; A value of 0 disables the limit.
; Default: 50
max_shares_per_day=50

View file

@ -1,424 +0,0 @@
-- Schema file for Continuum-Servatrice database.
-- This schema file is using the default table prefix "continuum_servatrice",
-- to match the "prefix=continuum_servatrice" default setting in continuum-servatrice.ini
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
-- Every time the database schema changes, the schema version number
-- must be incremented. Also remember to update the corresponding
-- number in servatrice/src/servatrice_database_interface.h
CREATE TABLE IF NOT EXISTS `continuum_servatrice_schema_version` (
`version` int(7) unsigned NOT NULL,
PRIMARY KEY (`version`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;
INSERT INTO continuum_servatrice_schema_version VALUES(40);
-- users and user data tables
CREATE TABLE IF NOT EXISTS `continuum_servatrice_users` (
`id` int(7) unsigned zerofill NOT NULL auto_increment,
-- Bitfield of staff levels: 1 = admin (implies moderator), 2 = moderator,
-- 4 = judge, 8 = developer. Operators set these by hand with
-- "UPDATE continuum_servatrice_users SET admin = ...".
`admin` tinyint(1) NOT NULL,
`name` varchar(35) NOT NULL,
`realname` varchar(255) NOT NULL,
`password_sha512` varchar(255) NOT NULL,
`password_legacy_backup` varchar(255) NOT NULL DEFAULT '',
`password_legacy_backup_used_at` datetime DEFAULT NULL,
`email` varchar(255) NOT NULL,
`country` char(2) NOT NULL,
`avatar_bmp` mediumblob NOT NULL,
`registrationDate` datetime NOT NULL,
`active` tinyint(1) NOT NULL,
`token` binary(16),
`clientid` varchar(15) NOT NULL,
`adminnotes` mediumtext NOT NULL,
`privlevel` enum("NONE","VIP","DONATOR") NOT NULL,
`privlevelStartDate` datetime NOT NULL,
`privlevelEndDate` datetime NOT NULL,
`passwordLastChangedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`force_password_change` tinyint(1) NOT NULL DEFAULT 0,
`leftPawnColorOverride` varchar(255),
`rightPawnColorOverride` varchar(255),
`card_art_params` TEXT DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`),
KEY `token` (`token`),
KEY `email` (`email`),
INDEX `idx_admin` (`admin`),
INDEX `idx_active` (`active`),
INDEX `idx_privlevel` (`privlevel`),
INDEX `idx_clientid` (`clientid`),
INDEX `idx_pawnColorOverrides` (`leftPawnColorOverride`, `rightPawnColorOverride`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `continuum_servatrice_decklist_files` (
`id` int(7) unsigned zerofill NOT NULL auto_increment,
`id_folder` int(7) unsigned zerofill NOT NULL,
`id_user` int(7) unsigned NULL,
`name` varchar(50) NOT NULL,
`upload_time` datetime NOT NULL,
`content` text NOT NULL,
`is_public` tinyint(1) NOT NULL DEFAULT 0,
`banner_card_name` varchar(255) NULL,
`banner_card_provider` varchar(32) NULL,
`color_identity` varchar(5) NULL,
`tags` text NULL,
PRIMARY KEY (`id`),
KEY `FolderPlusUser` (`id_folder`,`id_user`),
FOREIGN KEY(`id_user`) REFERENCES `continuum_servatrice_users`(`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;
-- Temporary deck shares: a named bundle of decks that can be fetched by
-- anyone who knows the (unguessable) token, until the share expires.
CREATE TABLE IF NOT EXISTS `continuum_servatrice_deck_share` (
`id` int(7) unsigned zerofill NOT NULL auto_increment,
`token` varchar(64) COLLATE utf8mb4_bin NOT NULL,
`name` varchar(64) NOT NULL,
`created_by` int(7) unsigned NULL,
`created_at` datetime NOT NULL,
`expires_at` datetime NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `token` (`token`),
KEY `expires_at` (`expires_at`),
FOREIGN KEY(`created_by`) REFERENCES `continuum_servatrice_users`(`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;
-- Individual decks inside a share bundle. Content is materialized at share
-- time so expiring/deleting a share can cascade cleanly. The metadata columns
-- are nullable because Qt's MySQL driver binds empty QStrings as NULL when
-- using prepared statements.
CREATE TABLE IF NOT EXISTS `continuum_servatrice_deck_share_item` (
`id` int(7) unsigned zerofill NOT NULL auto_increment,
`share_id` int(7) unsigned zerofill NOT NULL,
`name` varchar(50) NOT NULL,
`tags` text NULL,
`banner_card` varchar(255) NULL,
`game_format` varchar(50) NULL,
`color_identity` varchar(5) NULL,
`content` text NOT NULL,
`position` int(7) NOT NULL,
PRIMARY KEY (`id`),
KEY `share_id` (`share_id`),
FOREIGN KEY(`share_id`) REFERENCES `continuum_servatrice_deck_share`(`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `continuum_servatrice_decklist_folders` (
`id` int(7) unsigned zerofill NOT NULL auto_increment,
`id_parent` int(7) unsigned zerofill NOT NULL,
`id_user` int(7) unsigned NULL,
`name` varchar(30) NOT NULL,
`is_public` tinyint(1) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
KEY `ParentPlusUser` (`id_parent`,`id_user`),
FOREIGN KEY(`id_user`) REFERENCES `continuum_servatrice_users`(`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `continuum_servatrice_ignorelist` (
`id_user1` int(7) unsigned NOT NULL,
`id_user2` int(7) unsigned NOT NULL,
UNIQUE KEY `key` (`id_user1`, `id_user2`),
FOREIGN KEY(`id_user1`) REFERENCES `continuum_servatrice_users`(`id`) ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY(`id_user2`) REFERENCES `continuum_servatrice_users`(`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `continuum_servatrice_buddylist` (
`id_user1` int(7) unsigned NOT NULL,
`id_user2` int(7) unsigned NOT NULL,
UNIQUE KEY `key` (`id_user1`, `id_user2`),
FOREIGN KEY(`id_user1`) REFERENCES `continuum_servatrice_users`(`id`) ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY(`id_user2`) REFERENCES `continuum_servatrice_users`(`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;
-- rooms
CREATE TABLE IF NOT EXISTS `continuum_servatrice_rooms` (
`id` int(7) unsigned NOT NULL auto_increment,
`name` varchar(50) NOT NULL,
`descr` varchar(255) NOT NULL,
`permissionlevel` enum('NONE','REGISTERED','MODERATOR','ADMINISTRATOR') NOT NULL,
`privlevel` enum('NONE','PRIVILEGED','VIP','DONATOR') NOT NULL,
`auto_join` tinyint(1) default 0,
`join_message` varchar(255) NOT NULL,
`chat_history_size` int(4) NOT NULL,
`id_server` tinyint(3) NOT NULL DEFAULT 1,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `continuum_servatrice_rooms_gametypes` (
`id_room` int(7) unsigned NOT NULL,
`name` varchar(50) NOT NULL,
`id_server` tinyint(3) NOT NULL DEFAULT 1,
FOREIGN KEY(`id_room`) REFERENCES `continuum_servatrice_rooms`(`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `continuum_servatrice_rooms_channels` (
`id_room` int(7) unsigned NOT NULL,
`id_server` tinyint(3) NOT NULL DEFAULT 1,
`channel_id` varchar(50) NOT NULL,
`display_name` varchar(50) NOT NULL,
`access_level` ENUM('public','registered','judge','moderator','admin','developer') NOT NULL DEFAULT 'public',
`write_access_level` ENUM('public','registered','judge','moderator','admin','developer') NULL DEFAULT NULL,
`banner_message` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`id_room`, `id_server`, `channel_id`),
FOREIGN KEY(`id_room`) REFERENCES `continuum_servatrice_rooms`(`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;
-- games
CREATE TABLE IF NOT EXISTS `continuum_servatrice_games` (
`room_name` varchar(255) NOT NULL,
`id` int(7) unsigned NOT NULL auto_increment,
`descr` varchar(50) default NULL,
`creator_name` varchar(35) NOT NULL,
`password` tinyint(1) NOT NULL,
`game_types` varchar(255) NOT NULL,
`player_count` tinyint(3) NOT NULL,
`time_started` datetime default NULL,
`time_finished` datetime default NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `continuum_servatrice_games_players` (
`id_game` int(7) unsigned zerofill NOT NULL,
`player_name` varchar(35) NOT NULL,
FOREIGN KEY(`id_game`) REFERENCES `continuum_servatrice_games`(`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;
-- Note: an empty row with id_game = NULL is created when the game is created,
-- and then updated when the game ends with the full replay data.
CREATE TABLE IF NOT EXISTS `continuum_servatrice_replays` (
`id` int(7) NOT NULL AUTO_INCREMENT,
`id_game` int(7) unsigned NULL,
`duration` int(7) NOT NULL,
`replay` mediumblob NOT NULL,
PRIMARY KEY (`id`),
FOREIGN KEY(`id_game`) REFERENCES `continuum_servatrice_games`(`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `continuum_servatrice_replays_access` (
`id_game` int(7) unsigned NOT NULL,
`id_player` int(7) unsigned NOT NULL,
`replay_name` varchar(255) NOT NULL,
`do_not_hide` tinyint(1) NOT NULL,
KEY `id_player` (`id_player`),
FOREIGN KEY(`id_game`) REFERENCES `continuum_servatrice_games`(`id`) ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY(`id_player`) REFERENCES `continuum_servatrice_users`(`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;
-- server administration
-- Note: unused table
CREATE TABLE IF NOT EXISTS `continuum_servatrice_servers` (
`id` mediumint(8) unsigned NOT NULL,
`ssl_cert` text NOT NULL,
`hostname` varchar(255) NOT NULL,
`address` varchar(255) NOT NULL,
`game_port` mediumint(8) unsigned NOT NULL,
`control_port` mediumint(9) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `continuum_servatrice_uptime` (
`id_server` tinyint(3) NOT NULL,
`timest` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`uptime` int(11) NOT NULL,
`users_count` int(11) NOT NULL,
`mods_count` int(11) NOT NULL DEFAULT 0,
`mods_list` TEXT,
`games_count` int(11) NOT NULL,
`rx_bytes` int(11) NOT NULL,
`tx_bytes` int(11) NOT NULL,
PRIMARY KEY (`timest`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `continuum_servatrice_servermessages` (
`id_server` tinyint(3) not null default 1,
`timest` datetime NOT NULL default '0000-00-00 00:00:00',
`message` text,
PRIMARY KEY (`timest`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `continuum_servatrice_sessions` (
`id` int(9) NOT NULL AUTO_INCREMENT,
`user_name` varchar(35) NOT NULL,
`id_server` tinyint(3) NOT NULL,
`ip_address` varchar(45) NOT NULL,
`start_time` datetime NOT NULL,
`end_time` datetime DEFAULT NULL,
`clientid` varchar(15) NOT NULL,
`connection_type` ENUM('tcp', 'websocket'),
PRIMARY KEY (`id`),
KEY `username` (`user_name`),
INDEX `idx_start_time` (`start_time`),
INDEX `idx_clientid` (`clientid`),
INDEX `idx_ip_address` (`ip_address`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;
-- server moderation
CREATE TABLE IF NOT EXISTS `continuum_servatrice_bans` (
`user_name` varchar(35) NOT NULL,
`ip_address` varchar(45) NOT NULL,
`id_admin` int(7) unsigned zerofill NOT NULL,
`time_from` datetime NOT NULL,
`minutes` int(6) NOT NULL,
`reason` text NOT NULL,
`visible_reason` text NOT NULL,
`clientid` varchar(15) NOT NULL,
PRIMARY KEY (`user_name`,`time_from`),
KEY `time_from` (`time_from`,`ip_address`),
KEY `ip_address` (`ip_address`),
INDEX `idx_user_name` (`user_name`),
FOREIGN KEY(`id_admin`) REFERENCES `continuum_servatrice_users`(`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `continuum_servatrice_warnings` (
`user_id` int(7) unsigned NOT NULL,
`user_name` varchar(35) NOT NULL,
`mod_name` varchar(35) NOT NULL,
`reason` text NOT NULL,
`time_of` datetime NOT NULL,
`clientid` varchar(15) NOT NULL,
PRIMARY KEY (`user_id`,`time_of`),
INDEX `idx_time_of` (`time_of`),
INDEX `idx_user_name` (`user_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `continuum_servatrice_reports` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`reporter_id` int(7) unsigned NULL,
`reporter_name` varchar(35) NOT NULL,
`reported_user_id` int(7) unsigned NULL,
`reported_user_name` varchar(35) NOT NULL,
`game_id` int(7) unsigned NULL,
`room_id` int(7) unsigned NULL,
`category` varchar(255) NOT NULL,
`description` text NOT NULL,
`chat_log` mediumtext NULL,
`created_at` datetime NOT NULL,
`resolution_time` datetime NULL,
`status` enum('open','assigned','resolved','dismissed') NOT NULL DEFAULT 'open',
`assigned_to` int(7) unsigned NULL,
`resolved_by` int(7) unsigned NULL,
`resolution_note` text,
`notified` tinyint(1) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
INDEX `idx_status` (`status`),
INDEX `idx_created` (`created_at`),
INDEX `idx_reporter_id_created` (`reporter_id`, `created_at`),
INDEX `idx_reported_user_name` (`reported_user_name`),
INDEX `idx_status_created` (`status`, `created_at`),
FOREIGN KEY (`reporter_id`) REFERENCES `continuum_servatrice_users`(`id`) ON DELETE SET NULL ON UPDATE CASCADE,
FOREIGN KEY (`reported_user_id`) REFERENCES `continuum_servatrice_users`(`id`) ON DELETE SET NULL ON UPDATE CASCADE,
FOREIGN KEY (`assigned_to`) REFERENCES `continuum_servatrice_users`(`id`) ON DELETE SET NULL ON UPDATE CASCADE,
FOREIGN KEY (`resolved_by`) REFERENCES `continuum_servatrice_users`(`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `continuum_servatrice_report_comments` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`report_id` int(11) unsigned NOT NULL,
`author_name` varchar(35) NOT NULL,
`author_id` int(7) unsigned NULL,
`comment_text` text NOT NULL,
`created_at` datetime NOT NULL,
`is_moderator` tinyint(1) NOT NULL DEFAULT 0,
`notified` tinyint(1) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
INDEX `idx_report_id` (`report_id`),
INDEX `idx_notified` (`notified`),
FOREIGN KEY (`report_id`) REFERENCES `continuum_servatrice_reports`(`id`) ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY (`author_id`) REFERENCES `continuum_servatrice_users`(`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `continuum_servatrice_log` (
`log_time` datetime NOT NULL,
`sender_id` int(7) unsigned NULL,
`sender_name` varchar(35) NOT NULL,
`sender_ip` varchar(45) NOT NULL,
`log_message` text NOT NULL,
`target_type` ENUM('room', 'game', 'chat', 'room_channel'),
`target_id` int(7) NULL,
`target_name` varchar(50) NOT NULL,
`channel` varchar(50) NULL,
KEY `sender_name` (`sender_name`),
KEY `sender_ip` (`sender_ip`),
KEY `target_id` (`target_id`),
KEY `target_name` (`target_name`),
INDEX `idx_log_time` (`log_time`),
FOREIGN KEY(`sender_id`) REFERENCES `continuum_servatrice_users`(`id`) ON DELETE CASCADE ON UPDATE CASCADE
-- No FK on target_id, it can be zero
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `continuum_servatrice_activation_emails` (
`name` varchar(35) NOT NULL,
FOREIGN KEY(`name`) REFERENCES `continuum_servatrice_users`(`name`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `continuum_servatrice_user_analytics` (
`id` int(7) unsigned zerofill NOT NULL,
`client_ver` varchar(35) NOT NULL,
`last_login` datetime NOT NULL,
`notes` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
INDEX `idx_last_login` (`last_login`),
FOREIGN KEY(`id`) REFERENCES `continuum_servatrice_users`(`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `continuum_servatrice_donations` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`username` varchar(35) DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
`payment_pre_fee` double DEFAULT NULL,
`payment_post_fee` double DEFAULT NULL,
`term_length` int(11) DEFAULT NULL,
`date` varchar(255) DEFAULT NULL,
`pp_type` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `continuum_servatrice_forgot_password` (
`id` int(7) unsigned zerofill NOT NULL auto_increment,
`name` varchar(35) NOT NULL,
`requestDate` datetime NOT NULL default '0000-00-00 00:00:00',
`emailed` tinyint(1) NOT NULL default 0,
PRIMARY KEY (`id`),
KEY `user_name` (`name`),
INDEX `idx_emailed` (`emailed`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `continuum_servatrice_audit` (
`id` int(7) unsigned zerofill NOT NULL auto_increment,
`id_server` tinyint(3) NOT NULL,
`name` varchar(35) NOT NULL,
`ip_address` varchar(45) NOT NULL,
`clientid` varchar(15) NOT NULL,
`incidentDate` datetime NOT NULL default '0000-00-00 00:00:00',
`action` varchar(35) NOT NULL,
`results` ENUM('fail', 'success') NOT NULL DEFAULT 'fail',
`details` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
KEY `user_name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `continuum_servatrice_card_art_name_rules` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`card_name` varchar(255) NOT NULL,
`card_provider_id` varchar(255) NOT NULL,
`mode` enum('ALLOW','DENY') NOT NULL,
`reason` varchar(255) DEFAULT NULL,
`created_by` int(7) unsigned DEFAULT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `uniq_provider_card_name` (`card_provider_id`, `card_name`),
KEY `idx_mode` (`mode`),
FOREIGN KEY (`created_by`) REFERENCES `continuum_servatrice_users`(`id`)
ON DELETE SET NULL
ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci;

View file

@ -130,8 +130,8 @@ void myMessageOutput2(QtMsgType /*type*/, const QMessageLogContext &, const QStr
int main(int argc, char *argv[])
{
QCoreApplication app(argc, argv);
QCoreApplication::setOrganizationName("Continuum Universes Studio");
QCoreApplication::setApplicationName("Continuum-Servatrice");
QCoreApplication::setOrganizationName("Cockatrice");
QCoreApplication::setApplicationName("Servatrice");
QCoreApplication::setApplicationVersion(VERSION_STRING);
QCommandLineParser parser;
@ -188,7 +188,7 @@ int main(int argc, char *argv[])
rng = new RNG_SFMT(CryptoUtil::randomUInt64());
std::cerr << "Continuum-Servatrice " << VERSION_STRING << " starting." << std::endl;
std::cerr << "Servatrice " << VERSION_STRING << " starting." << std::endl;
std::cerr << "-------------------------" << std::endl;
if (testRandom) {

View file

@ -1270,9 +1270,9 @@ QString Servatrice::getDBTypeString() const
QString Servatrice::getDBPrefixString() const
{
if (QProcessEnvironment::systemEnvironment().contains("DATABASE_URL")) {
return {"continuum_servatrice"};
return {"cockatrice"};
}
return settingsCache->value("database/prefix", "continuum_servatrice").toString();
return settingsCache->value("database/prefix").toString();
}
QString Servatrice::getDBHostNameString() const
@ -1419,7 +1419,7 @@ QHostAddress Servatrice::getServerTCPHost() const
int Servatrice::getServerTCPPort() const
{
return settingsCache->value("server/port", 4757).toInt();
return settingsCache->value("server/port", 4747).toInt();
}
int Servatrice::getNumberOfWebSocketPools() const
@ -1442,7 +1442,7 @@ int Servatrice::getServerWebSocketPort() const
if (QProcessEnvironment::systemEnvironment().contains("PORT")) {
return QProcessEnvironment::systemEnvironment().value("PORT").toInt();
}
return settingsCache->value("server/websocket_port", 4758).toInt();
return settingsCache->value("server/websocket_port", 4748).toInt();
}
bool Servatrice::getISLNetworkEnabled() const

View file

@ -27,7 +27,7 @@ SettingsCache::SettingsCache(const QString &fileName, QSettings::Format format,
QString SettingsCache::guessConfigurationPath()
{
const QString fileName = "continuum-servatrice.ini";
const QString fileName = "servatrice.ini";
if (QFile::exists(qApp->applicationDirPath() + "/portable.dat")) {
qDebug() << "Portable mode enabled";
return fileName;
@ -43,7 +43,7 @@ QString SettingsCache::guessConfigurationPath()
#ifdef Q_OS_UNIX
// /etc
guessFileName = "/etc/continuum-servatrice/" + fileName;
guessFileName = "/etc/servatrice/" + fileName;
if (QFile::exists(guessFileName)) {
return guessFileName;
}