diff --git a/ANTI_TROLL.md b/ANTI_TROLL.md new file mode 100644 index 00000000000..bc9a67d8aad --- /dev/null +++ b/ANTI_TROLL.md @@ -0,0 +1,40 @@ +## Info on experimental anti-troll system +If activated, a timer is kept for all players. System can be activated in xml config or in the lobby with command: +\admin troll [0,1] + +Timer is increased by the amount of time when +* a player drives in the wrong way +* a player moves below a given speed (troll-max-stop-speed) + +Timer is not increased when the player is hit or rescued (during animation). + +It is decreased (not below 0 obviously) when a player drives in correct direction with at least given speed (troll-min-normal-speed). + +If a player's timer exceeds the warning level (troll-warning-time), they get a warning (troll-warn-message). After that the timer is reset. +If a player got a warning and their timer exceeds the kick level (troll-kick-time), they get kicked. +Warnings and Kicks are logged. + +Config can be controlled in xml file like this: + + + + + + + + + + + + + + + +### Things to note +* The system can be fooled of course, but it should be a lot harder to troll. Testing would be necessary. However, when I set up a test server, most players coming by just wanted to play normally... +* The system should not warn or kick weak players who get lost or stuck on obstacles (too quickly). The current configuration values are most probably not yet perfect. +* Players should probably be informed about the system, because waiting for others (like some pros do when giving weaker players some advice or driving lessons) would be punished, so the system should not be activated in those cases. +* If a player presses UP-key early, the timer is increased during time punishment at the beginning of the race (1 sec). I don't know how to find out if a player is in that state. +* **There may still be bugs** (of course)... ;) diff --git a/CMakeLists.txt b/CMakeLists.txt index 21a1ae43b51..37113dc4b55 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,11 +34,11 @@ CMAKE_DEPENDENT_OPTION(USE_IPV6 "Allow create or connect to game server with IPv option(USE_SYSTEM_WIIUSE "Use system WiiUse instead of the built-in version, when available." OFF) option(USE_SQLITE3 "Use sqlite to manage server stats and ban list." ON) +option(WEB_SUPPORT "Website integration tools" OFF) if(APPLE) CMAKE_DEPENDENT_OPTION(DLOPEN_MOLTENVK "Use dlopen to load MoltenVK for Apple." ON "NOT IOS;NOT SERVER_ONLY" OFF) endif() - CMAKE_DEPENDENT_OPTION(USE_CRYPTO_OPENSSL "Use OpenSSL instead of MbedTLS for cryptography in STK." ON "NOT USE_SWITCH;NOT WIN32" OFF) CMAKE_DEPENDENT_OPTION(BUILD_RECORDER "Build opengl recorder" ON @@ -475,6 +475,11 @@ if(USE_SQLITE3) endif() endif() +# Web support +if(WEB_SUPPORT) + add_definitions(-DENABLE_WEB_SUPPORT) +endif() + # Set some compiler options if(UNIX OR MINGW) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x") diff --git a/FORK_CHANGES.md b/FORK_CHANGES.md new file mode 100644 index 00000000000..cc73679df3b --- /dev/null +++ b/FORK_CHANGES.md @@ -0,0 +1,94 @@ +This page lists the major changes of this repository compared to standard STK code, as of April 2024. Most changes (sadly, not all of them) here are implemented as options, that is, you can disable them and return to standard behaviour. + +You can find more information such as explanations and minor details in [wiki](https://github.com/kimden/stk-code/wiki/). It will be probably filled with even more data in the future. + +## Improved Grand Prix mode + +* Server doesn't become private +* Players can pick karts, join or leave +* Custom scoring systems +* Custom teams (up to 9) +* Standings ingame (short) and in the lobby (longer) +* Anti-troll and team hit punishment systems, by Heuchi1 +* Allows to shuffle the starting grid every race + +## Records, replays and stats + +* Game results for racing and battle modes can be saved to the database, together with game settings and kart statistics +* Public or private record tables can be created using that information +* Ghost replays can be recorded on servers if players agree +* Players who beat server records can be notified (includes separation of times set with different config files) +* Maximum replay size is increased + +## Chat + +* Private chat with an arbitrary set of players +* Teamchat during CTF and soccer which works both ingame and in the lobby +* Messages are never logged, even by the bots (though they pass through the server code) + +## Game configuration, available maps and karts, playing restrictions + +* Game length can be set to a fixed value, or to a certain multiple of default lap number, or to be chosen ingame +* Game direction can be set to forward or reverse, or to be chosen ingame +* For karts and maps, the next game can be customized so that the set of karts/maps available for choice is fixed, or defined by a certain algorithm (including "you have to play this track", "select from $N$ random maps from this set", "you can choose either Adiumy, or whatever is given to you by random of Suzanne and Konqi") +* The same is true for any number of next games, and the server can be set to repeat the customization every number of games + +All of the above settings can be changed arbitrarily when the server already runs, or in the config before the server starts. + +* Servers can be started with other powerup.xml or kart_characteristics.xml files being specified +* It's possible for a server to force certain maps for players to join the server or to join the game, or vice versa, disable certain maps (or all but a certain set of maps). There are various commands to find out which addons you (or other players) have or don't have, to make it easy to deal with the above +* The default setting of number of playable slots (playable places on the server) can be changed with a command +* If the player is unable to play due to imposed restrictions (lacking maps, being out of playable slots), that player doesn't affect the set of available maps, and is given the hourglass icon. + +## Command manager + +Command manager is an entity made to manipulate all existing server commands easier. It supports: + +* commands with voting +* text commands / commands reading external files +* auth commands +* setting permissions for commands without recompiling the code and/or depending on server +* subcommands and different permissions for them +* fixing errors in arguments (usernames, map names) +* showing available commands depending on permissions +* documentation for all commands via `/help` +* huge number of new commands + +All the commands and their descriptions are available in `data/commands.xml`. This file is also used to generate output for `/commands` and `/help`. + +## Moderation and permissions + +* It's possible to disable kicks attempted by the crowned player +* If a player kicks another player, the fact of the kick can be stored in the database table with reports +* Inactive players can be kicked automatically from the lobby too, not only from the game +* A hammer mode is added: players having a password can get a hammer, then they can change server settings and kick players +* There are commands to ban (or unban) a player temporary from a single server by username, as opposed to standard bans which are applied to all servers using the same database, and are usually banning by online id or IP address +* Players are allowed to report something to server owner without reporting other people +* Starting the game can be allowed or forbidden using a command + +## Game modes and their improvements + +These are not implemented as separate modes, but are rather additions to functionality of existing modes: + +* **Soccer tournament** mode: for hosting matches of several soccer games. The rules, the number of games and their duration, allowed arenas, tournament teams can be loaded from a config file. Referees have multiple commands to control the game flow +* **Gnu Elimination** mode: every race, the last (or quitting) non-eliminated player gets eliminated, and eliminated players use the same kart chosen in advance. The last standing player wins + +Separate changes for modes: + +* Soccer games produce a log of all goals / actions that happened (originally made for tournament mode, but can be used without it too), if the score is edited using tournament commands, the game shows it as a message after each goal and at the end +* FFA and CTF scores are preserved per username during the game, so that leaving the game is not punished + +## Other features + +* You can allow only the crowned player to play (speedrun server), or no one at all (chat server) +* Minor `/spectate` changes (you can invoke it ingame, game doesn't start with everyone spectating) +* For a configurable server, you can specify which exact difficulties and modes are allowed +* Players can send a message to the server owner (without reporting anyone else), and the server owner can send one-time messages to specific players +* For private servers, players can be whitelisted so that they can enter any password to join +* Different strategies to determine who scored a goal (allowing or forbidding own goals) +* `max-moveable-objects` is changed to 30 to allow tracks like `addon_bowling` to work +* Server can be customized to reset or preserve many settings like game mode, game length, ..., when everyone leaves it +* Server git version and whether it's modified is shown in `/version` +* Server console allows sending arbitrary messages to players +* Supported player categories aka sets of players (for now only displaying their names, and some minor usage) +* Minor additions in StringUtils used in typo fixing and string parsing \ No newline at end of file diff --git a/NETWORKING.md b/NETWORKING.md index 97ad3dc34ee..42b7c4ff991 100644 --- a/NETWORKING.md +++ b/NETWORKING.md @@ -25,7 +25,7 @@ Than you can just run: It will create that xml configuration file if not found in current directory, you can type `quit` in terminal, than you can edit that file for further configuration as required. ` --network-console` should not be used if you run supertuxkart server later with systemd service, see issue [#4299](https://github.com/supertuxkart/stk-code/issues/4299). -The current server configuration xml looks like this: +The current server configuration xml looks like this (this is only an example, just copying and running server with this config file makes some tracks obligatory and some unplayable, please read carefully): ```xml @@ -60,9 +60,12 @@ The current server configuration xml looks like this: - + + + + @@ -92,6 +95,12 @@ The current server configuration xml looks like this: + + + + + + @@ -99,6 +108,30 @@ The current server configuration xml looks like this: + + + + + + + + + + + + + + + + + + + + + + + + @@ -117,6 +150,9 @@ The current server configuration xml looks like this: + + + @@ -192,9 +228,57 @@ The current server configuration xml looks like this: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ``` @@ -265,7 +349,12 @@ CREATE TABLE IF NOT EXISTS (table name above) os TEXT NOT NULL, -- Operating system of the host connected_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, -- Time when connected disconnected_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, -- Time when disconnected (saved when disconnected) - ping INTEGER UNSIGNED NOT NULL DEFAULT 0 -- Ping of the host + ping INTEGER UNSIGNED NOT NULL DEFAULT 0, -- Ping of the host + packet_loss INTEGER NOT NULL DEFAULT 0, -- Mean packet loss count from ENet (saved when disconnected) + addon_karts_count INTEGER UNSIGNED NOT NULL DEFAULT 0, -- Number of addon karts of the host + addon_tracks_count INTEGER UNSIGNED NOT NULL DEFAULT 0, -- Number of addon tracks of the host + addon_arenas_count INTEGER UNSIGNED NOT NULL DEFAULT 0, -- Number of addon arenas of the host + addon_soccers_count INTEGER UNSIGNED NOT NULL DEFAULT 0 -- Number of addon soccers of the host ) WITHOUT ROWID; ``` @@ -293,7 +382,7 @@ CREATE TABLE IF NOT EXISTS (table name above) If you want to see flags and readable names of countries in the above views, you need to initialize `v(server database version)_countries` table, check [this script](tools/generate-countries-table.py). -For IPv4 and online ID ban list, player reports or IP mapping, you need to create one yourself: +For IPv4 and online ID ban list, player reports or IP mapping (in case your server doesn't communicate with STK addons server, which can do IP mapping instead of your server), you need to create one yourself: ```sql CREATE TABLE ip_ban ( diff --git a/README.md b/README.md index a29e33b138e..d8d4e84b4c0 100644 --- a/README.md +++ b/README.md @@ -1,40 +1,38 @@ -# SuperTuxKart -[![Linux build status](https://github.com/supertuxkart/stk-code/actions/workflows/linux.yml/badge.svg)](https://github.com/supertuxkart/stk-code/actions/workflows/linux.yml) -[![Apple build status](https://github.com/supertuxkart/stk-code/actions/workflows/apple.yml/badge.svg)](https://github.com/supertuxkart/stk-code/actions/workflows/apple.yml) -[![Windows build status](https://github.com/supertuxkart/stk-code/actions/workflows/windows.yml/badge.svg)](https://github.com/supertuxkart/stk-code/actions/workflows/windows.yml) -[![Switch build status](https://github.com/supertuxkart/stk-code/actions/workflows/switch.yml/badge.svg)](https://github.com/supertuxkart/stk-code/actions/workflows/switch.yml) -[![#supertuxkart on the libera IRC network](https://img.shields.io/badge/libera-%23supertuxkart-brightgreen.svg)](https://web.libera.chat/?channels=#supertuxkart) +[![Linux build status](https://github.com/kimden/stk-code/actions/workflows/linux.yml/badge.svg)](https://github.com/kimden/stk-code/actions/workflows/linux.yml) +[![Apple build status](https://github.com/kimden/stk-code/actions/workflows/apple.yml/badge.svg)](https://github.com/kimden/stk-code/actions/workflows/apple.yml) +[![Windows build status](https://github.com/kimden/stk-code/actions/workflows/windows.yml/badge.svg)](https://github.com/kimden/stk-code/actions/workflows/windows.yml) +[![Switch build status](https://github.com/kimden/stk-code/actions/workflows/switch.yml/badge.svg)](https://github.com/kimden/stk-code/actions/workflows/switch.yml) -SuperTuxKart is a free kart racing game. It focuses on fun and not on realistic kart physics. Instructions can be found on the in-game help page. +This repository contains a **modified** version of SuperTuxKart (STK), mainly intended for server-side usage. Most important changes are listed [here](/FORK_CHANGES.md). Standard version of STK can be found [here](https://github.com/supertuxkart/stk-code/), and the changes between it and latest commits of this repo can be found [here](https://github.com/supertuxkart/stk-code/compare/master...kimden:stk-code:command-manager-prototype). -The SuperTuxKart homepage can be found at . There is also our [FAQ](https://supertuxkart.net/FAQ) and information on how get in touch with the [community](https://supertuxkart.net/Community). +## Important branches -Latest release binaries can be found [here](https://github.com/supertuxkart/stk-code/releases/latest), and preview release [here](https://github.com/supertuxkart/stk-code/releases/preview). +* [master](https://github.com/kimden/stk-code/): contains an old but stable version, which cannot be suddenly broken by recent commits (as almost all of them are currently in `command-manager-prototype` branch). -## Hardware Requirements -To run SuperTuxKart, make sure that your computer's specifications are equal or higher than the following specifications: +* [command-manager-prototype](https://github.com/kimden/stk-code/tree/command-manager-prototype): contains all the latest commits, starting from introduction of command manager. As there are too many commits already, it will be merged into `master` branch soon, but not before the long-term database structure and similar important things are defined. -* A graphics card capable of 3D rendering - NVIDIA GeForce 470 GTX, AMD Radeon 6870 HD series card or Intel HD Graphics 4000 and newer. OpenGL >= 3.3 -* You should have a dual-core CPU that's running at 1 GHz or faster. -* You'll need at least 512 MB of free VRAM (video memory). -* System memory: 1 GB -* Minimum disk space: 700 MB -* Ideally, you'll want a joystick with at least 6 buttons. +* [command-manager-2x](https://github.com/kimden/stk-code/tree/command-manager-2x): the branch combining `command-manager-prototype` and [BalanceSTK2](https://github.com/Alayan-stk-2/stk-code/tree/BalanceSTK2), which is currently the source code of 2.X development version. This branch might not have the latest commits, its purpose is to store game results while testing 2.X version. -## License -The software is released under the GNU General Public License (GPL) which can be found in the file [`COPYING`](/COPYING) in the same directory as this file. +* [local-client](https://github.com/kimden/stk-code/tree/local-client): the version of client with some optimizations and edits, used by kimden. For now, this is the only branch of this repo that is really intended for client-side usage. + +There are also several less important branches. --- -## 3D coordinates -A reminder for those who are looking at the code and 3D models: +The software is released under the GNU General Public License (GPL) which can be found in the file [`COPYING`](/COPYING) in the same directory as this file. -SuperTuxKart: X right, Y up, Z forwards +Building instructions can be found in [`INSTALL.md`](/INSTALL.md). -Blender: X right, Y forwards, Z up +Info on experimental anti-troll system can be found in [`ANTI_TROLL.md`](/ANTI_TROLL.md). -The export utilities perform the needed transformation, so in Blender you just work with the XY plane as ground, and things will appear fine in STK (using XZ as ground in the code, obviously). +--- -## Building from source +## About SuperTuxKart -Building instructions can be found in [`INSTALL.md`](/INSTALL.md) +[![#supertuxkart on the libera IRC network](https://img.shields.io/badge/libera-%23supertuxkart-brightgreen.svg)](https://web.libera.chat/?channels=#supertuxkart) + +SuperTuxKart is a free kart racing game. It focuses on fun and not on realistic kart physics. Instructions can be found on the in-game help page. + +The SuperTuxKart homepage can be found at . There is also our [FAQ](https://supertuxkart.net/FAQ) and information on how get in touch with the [community](https://supertuxkart.net/Community). + +Latest release binaries can be found [here](https://github.com/supertuxkart/stk-code/releases/latest), and preview release [here](https://github.com/supertuxkart/stk-code/releases/preview). diff --git a/data/stk_config.xml b/data/stk_config.xml index 8f879af8092..7740f0d1661 100644 --- a/data/stk_config.xml +++ b/data/stk_config.xml @@ -186,7 +186,7 @@ new transform event is generated before maximum time. delta-steering If the steering angle difference exceeds this delta, new transform event is generated before maximum time. --> - @@ -259,7 +259,7 @@ larger than this value. --> + max-moveable-objects="30"/>