Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from kimden:master #34

Open
wants to merge 194 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
194 commits
Select commit Hold shift + click to select a range
d9c0f60
Allow users into server based on addons count
kimden Oct 27, 2019
7b7b556
Fix bugs
kimden Oct 28, 2019
918ef22
Merge https://github.com/supertuxkart/stk-code
kimden Oct 30, 2019
85c8e67
Merge a high ping workaround from https://github.com/supertuxkart/stk…
kimden Oct 31, 2019
bb0ac22
Merge https://github.com/supertuxkart/stk-code
kimden Nov 1, 2019
2f68ba5
Merge https://github.com/supertuxkart/stk-code
kimden Nov 2, 2019
6367ee7
Merge https://github.com/supertuxkart/stk-code again
kimden Nov 17, 2019
f263080
Merge https://github.com/supertuxkart/stk-code
kimden Nov 30, 2019
6b9ae3b
Merge https://github.com/supertuxkart/stk-code with some addon count …
kimden Dec 3, 2019
cff6275
Added possibility to force players have certain tracks; added restric…
kimden Dec 4, 2019
cac7dfd
Fixed bugs, added possibility to *not* list some tracks
kimden Dec 4, 2019
389719c
Add possibility to race without official tracks
kimden Dec 4, 2019
8633da9
Fix bugs
kimden Dec 4, 2019
7a9a58e
Fix another bug causing CE
kimden Dec 4, 2019
d52a30e
Merge https://github.com/supertuxkart/stk-code
kimden Dec 6, 2019
55ecc4d
Merge https://github.com/supertuxkart/stk-code
kimden Dec 11, 2019
199a4d5
Change max-moveable-objects to 30
kimden Dec 11, 2019
dfbe44b
Merge https://github.com/supertuxkart/stk-code
kimden Dec 14, 2019
b4ea806
Remove unused code and fix NETWORKING.md
kimden Dec 14, 2019
6cf3b2c
Merge https://github.com/supertuxkart/stk-code.
kimden Dec 18, 2019
6a051ff
Merge https://github.com/supertuxkart/stk-code
kimden Dec 19, 2019
0fd09d1
Merge https://github.com/supertuxkart/stk-code
kimden Dec 24, 2019
55da39c
Trying to support additional /help messages
kimden Dec 24, 2019
875d88c
Fix bugs, move readOrLoadFromFile to gameSetup
kimden Dec 24, 2019
076f603
Fix bugs
kimden Dec 24, 2019
36fb129
Fixed my weak knowledge of linker
kimden Dec 24, 2019
f1c1767
Merge https://github.com/supertuxkart/stk-code
kimden Dec 25, 2019
bb1ed58
Add /commands
kimden Dec 25, 2019
e1d1df0
Remove unimplemented /installpack from commands list
kimden Dec 25, 2019
a62c5a1
Merge https://github.com/supertuxkart/stk-code
kimden Dec 26, 2019
a024a2c
Merge https://github.com/supertuxkart/stk-code
kimden Dec 31, 2019
68e2185
Create final 1.1 branch
Benau Jan 3, 2020
42508b3
Merge branch '1.1' of https://github.com/supertuxkart/stk-code
kimden Jan 3, 2020
6f0f029
Added sleeping server possibility and verbose output for the reason p…
kimden Jan 11, 2020
f209a47
Fix m_min_start_game_players for sleeping server
kimden Jan 11, 2020
b3ea43f
Fix m_official_karts_threshold for sleeping server
kimden Jan 11, 2020
d462bc5
Merge https://github.com/supertuxkart/stk-code up to ipv6 mapping
kimden Jan 16, 2020
27c81be
Added useless gnu elimination commands
kimden Jan 20, 2020
8a39bf7
Make handleServerCommand non-const (how to make it const back?) for e…
kimden Jan 20, 2020
d1862fe
Make m_gnu_elimination a pointer
kimden Jan 20, 2020
1fdc916
Added chat commands for restricted messaging
kimden Jan 24, 2020
5367bd0
Forbid /to with no parameters
kimden Jan 25, 2020
049344e
Added responses to /to and /public
kimden Jan 25, 2020
d2e6a21
Fixed available commands
kimden Jan 25, 2020
0048b62
Merge https://github.com/supertuxkart/stk-code
kimden Feb 2, 2020
50dc014
Merge https://github.com/supertuxkart/stk-code
kimden Feb 10, 2020
e3bac07
Add false-ip to be able to use floating IP
kimden Feb 11, 2020
24f6b67
Add more false ip
kimden Feb 11, 2020
d188972
Fix typo
kimden Feb 11, 2020
26746b0
Added gnu elimintation except of kart choice and results
kimden Feb 13, 2020
2aa2aec
Fixed CE bugs
kimden Feb 13, 2020
8cfa6fb
Fixed bugs
kimden Feb 16, 2020
0c5ccaa
Initial working version of gnu elimination
kimden Feb 16, 2020
f3979d7
Add fixed lap count servers possibility
kimden Feb 19, 2020
0f85c0e
Merge https://github.com/supertuxkart/stk-code
kimden Feb 20, 2020
3df1aaf
Merge https://github.com/supertuxkart/stk-code
kimden Feb 24, 2020
761ac77
Fix gnu elimination kart choice when nothing selected and some labels
kimden Mar 2, 2020
7db3110
Fix absent gnu kart choice in gnu elimination
kimden Mar 3, 2020
d749850
Fix bots choosing gnu
kimden Mar 3, 2020
53e4e54
Fix absense of choice for gnu
kimden Mar 3, 2020
ca4aae4
Fix CE
kimden Mar 3, 2020
5cf92e4
Create custom message for incompatible data refusal (terminal only)
kimden Mar 3, 2020
e8ffea3
Store race results in a table inside db
kimden Mar 3, 2020
ca2eb1b
Fix typo
kimden Mar 3, 2020
616bc36
Fixed table name and a bug
kimden Mar 4, 2020
0151b37
Add direction to results table
kimden Mar 4, 2020
bd564c3
Fix a bug
kimden Mar 4, 2020
0009cb8
Merge https://github.com/supertuxkart/stk-code
kimden Mar 6, 2020
a344710
Make RaceManager singleton as it should be in the correct merge
kimden Mar 6, 2020
4401b73
Add possibility of any kart elimination
kimden Mar 7, 2020
fd5239b
Paint bots in boring colors
kimden Mar 8, 2020
f668e0c
Fix a bug
kimden Mar 8, 2020
6f77986
Add beating the record message
kimden Mar 8, 2020
af6cf0b
Make hours visible
kimden Mar 8, 2020
4496a7c
Fix bugs
kimden Mar 8, 2020
11fcfea
Fix bugs and style, add /record
kimden Mar 8, 2020
aff1fa0
Fix empty message bug
kimden Mar 8, 2020
99d42bb
Add possibility of partly configurable servers
kimden Mar 14, 2020
20018b8
Shorten lines
kimden Mar 14, 2020
7a79ce1
Merge https://github.com/supertuxkart/stk-code
kimden Mar 14, 2020
abdc16a
Change query statement when telling if the time is the new record
kimden Mar 15, 2020
f46499c
Fix the required number of players to start for sleeping server
kimden Mar 16, 2020
d800179
Fix the same bug but properly
kimden Mar 16, 2020
3800cff
Merge https://github.com/supertuxkart/stk-code
kimden Mar 22, 2020
33766a8
Fix sql quotes for records storing
kimden Mar 24, 2020
79b6266
Inform players about gnu kart choice
kimden Mar 24, 2020
129d195
Add a note for a player entering a server with gnu elimination
kimden Mar 24, 2020
1bf92cd
Reset server to initial mode/difficulty when it's empty and is in nor…
kimden Mar 27, 2020
3080bfa
Avoid gnu elimination with non-racing modes
kimden Mar 27, 2020
eef5bf8
Made something to make only host play, no success
kimden Mar 28, 2020
1a88897
Merge https://github.com/supertuxkart/stk-code
kimden Mar 29, 2020
baf8265
Merge https://github.com/supertuxkart/stk-code
kimden Apr 3, 2020
b53f069
Add team chat for CTF/soccer
kimden Apr 4, 2020
3fb46da
Merge branch 'master' of https://github.com/kimden/stk-code
kimden Apr 4, 2020
3669b03
Revert 20bcd1a as it seems to break powerup compatibility
kimden Apr 6, 2020
1967810
Merge https://github.com/supertuxkart/stk-code
kimden Apr 6, 2020
4935178
Fix bug in /teamchat
kimden Apr 6, 2020
e5e1252
Create FORK_CHANGES.md
kimden Apr 7, 2020
2503116
Add /tell-ing to server owner
kimden Apr 8, 2020
725966c
Merge https://github.com/supertuxkart/stk-code
kimden Apr 17, 2020
a448e43
Merge https://github.com/supertuxkart/stk-code
kimden Apr 26, 2020
1de4ea8
Add possibility of tracking kicks
kimden Apr 27, 2020
0164412
Merge https://github.com/supertuxkart/stk-code
kimden Apr 28, 2020
ba333ae
Add soccer tournament mode
kimden May 1, 2020
a57852a
Fix random track selection in soccer tournament, make results precise
kimden May 2, 2020
2b4558f
Remove redundant debug output, update help
kimden May 5, 2020
e14355b
Fix stupid compilation error
kimden May 5, 2020
a011405
Add temporary bans and referee control for tournament, generalize abi…
kimden May 11, 2020
99eb335
Merge https://github.com/supertuxkart/stk-code, with both /teamchat a…
kimden May 11, 2020
b02a934
Allow customizable grand prix scoring in server config
kimden May 15, 2020
f079d57
Merge https://github.com/supertuxkart/stk-code with no start if every…
kimden May 15, 2020
1345b11
Fix wrong merge
kimden May 15, 2020
2b2542f
Make /spectate not affect track choice, adapt it for tournament, fix …
kimden May 16, 2020
b2ae6f5
Allow to count own goals differently
kimden May 30, 2020
c2e98c4
Merge https://github.com/supertuxkart/stk-code
kimden May 30, 2020
5208048
Add expose-mobile option
kimden May 30, 2020
d0a6e66
Initial commit on June tournament changes
kimden May 31, 2020
89e1d63
Added tokens, hammer mode, fix role command, allow limit track choice
kimden Jul 14, 2020
c929262
Merge https://github.com/supertuxkart/stk-code
kimden Jul 14, 2020
3c2ac23
Make changes description more clear in README.md
kimden Jul 15, 2020
a125d4e
Change token label
kimden Jul 21, 2020
0998e8f
Merge 1.2-rc1 from https://github.com/supertuxkart/stk-code
kimden Jul 21, 2020
c469667
Add possibility to forbid kicks
kimden Jul 25, 2020
3ea1f8f
Generalize tournament mode
kimden Aug 3, 2020
9c0d78b
Merge https://github.com/supertuxkart/stk-code
kimden Aug 24, 2020
d3d8092
Merge https://github.com/supertuxkart/stk-code
kimden Aug 28, 2020
2a79bf5
Fix wrong merge
kimden Aug 28, 2020
7c1a485
Finally fix wrong merge and add /register command
kimden Sep 1, 2020
7c4a346
Soccer tournament logging, gnu elimination rewritten, minor fixes
kimden Nov 7, 2020
d8d2f70
Merge https://github.com/supertuxkart/stk-code
kimden Nov 7, 2020
16bd27f
Allow recording replays, add initial support for server-to-player del…
kimden Dec 20, 2020
d359ab5
Merge https://github.com/supertuxkart/stk-code
kimden Dec 20, 2020
16f7c6a
Apply changes
kimden May 24, 2021
a700c26
Merge https://github.com/supertuxkart/stk-code
kimden May 24, 2021
1930ee5
Update version
kimden May 24, 2021
b49ce26
Add /moreaddons, /clear, fix tournament assets requirements, allow to…
kimden Jun 21, 2021
08cb630
Merge https://github.com/supertuxkart/stk-code
kimden Jun 21, 2021
2d3347e
Update version to 210621
kimden Jun 21, 2021
7d72ab9
Add wildcard search in /admin team (#3)
heuchi Jun 21, 2021
f46d15c
Make all chat requirements taken into account
kimden Jun 21, 2021
c987583
Add /muteall for soccer tournament spectators
kimden Jun 21, 2021
2add2d4
Allow loading parts of server config from another (common) file
kimden Jun 22, 2021
6af6eb9
Fix reading external config path
kimden Jun 22, 2021
01cbc92
Fix directories' wrong paths due to bad previous external-config commits
kimden Jun 22, 2021
17e62b4
Fix wrong call of loadServerConfig
kimden Jun 22, 2021
ef32613
Do not overwrite server config it if uses another config file
kimden Jun 22, 2021
b3cb4be
Fix previous attempts to not overwrite two-file config
kimden Jun 22, 2021
b39f34b
Automatically kick trolls (#2)
heuchi Jun 24, 2021
3f40f3e
Allow specifying powerup config as a command line parameter
kimden Jun 25, 2021
14f55bd
Fix compilation errors
kimden Jun 25, 2021
cfcad15
Fix another compilation error
kimden Jun 25, 2021
6af7e6d
Fix compilation error part 3
kimden Jun 25, 2021
aaaac8a
Fix powerup config name for all function calls
kimden Jun 25, 2021
837ea11
Fix kart color update while using wildcards for /admin team (#3)
kimden Jun 26, 2021
a647e07
Change playeraddonscore to actual numbers
kimden Jul 18, 2021
8b8cd2c
Allow to change between game length restrictions using commands
kimden Jul 23, 2021
45e2df6
Fix extra parameters
kimden Jul 23, 2021
6ec6399
Fix formatting numbers in /admin length messages
kimden Jul 28, 2021
20d3a7d
Add default values for gp scoring
kimden Aug 9, 2021
79d7961
Fix several sql queries to avoid injections
kimden Aug 11, 2021
9e24d15
Fix compilation and logic errors
kimden Aug 11, 2021
945fab8
Fix more compilation errors
kimden Aug 11, 2021
6e0d762
Try to print full sql statement to the log in case it was successfull…
kimden Aug 13, 2021
1281b21
Try to allow crowned players to manipulate game length and track queu…
kimden Aug 13, 2021
3017ddb
Change deadline for spectating from 90% to 250m to go
kimden Aug 16, 2021
4373b80
Fix shuffling the GP grid
kimden Aug 17, 2021
5e8e479
Fixed the file that was unsaved locally
kimden Aug 17, 2021
76eac53
Merge https://github.com/supertuxkart/stk-code (6d29bb2)
kimden Aug 18, 2021
2b0e9ff
Add missing ifdef for sqlite
kimden Aug 18, 2021
3ffc784
Fix build status and separate info on anti-troll system
kimden Aug 18, 2021
005d0b1
Speed up getRecord()
kimden Sep 1, 2021
6edbd8b
Also speed up retrieving records in storeResults()
kimden Sep 1, 2021
7182b9d
Team-GP: announce and/or punish teammate hits (#4)
heuchi Sep 3, 2021
7005abe
Fix formatting a bit, send team-gp-punishment-mode-changing message t…
kimden Sep 3, 2021
fff0997
Merge https://github.com/supertuxkart/stk-code (9f62ca8)
kimden Sep 3, 2021
00f56c4
Change version to 1.3-rc1 210903
kimden Sep 3, 2021
64a451c
Fix server-only bots crashing on startup
kimden Sep 6, 2021
e39e497
Update Networking.md (#6)
iluvatyr Sep 20, 2021
0b2fc61
Merge https://github.com/supertuxkart/stk-code (fd7564d, 1.3)
kimden Sep 28, 2021
18d4525
Merge https://github.com/supertuxkart/stk-code
kimden Nov 1, 2021
2dc6546
Allow to end tournament games with non-integer number of minutes auto…
kimden Nov 5, 2021
fb929de
Fix a typo
kimden Nov 5, 2021
4d3beae
Allow to select 0 minutes goals for the sake of less-than-minute games
kimden Nov 5, 2021
6811c41
Merge https://github.com/supertuxkart/stk-code (0a99c66) and change m…
kimden Dec 20, 2021
31ba129
Try to replace only-host-riding with max-players-in-game = 1 in terms…
kimden Dec 20, 2021
6fe2ba9
Try to fix maps missing due to spectators who lack slots
kimden Dec 21, 2021
f40fb02
Fix CE
kimden Dec 21, 2021
f800fb4
Set canRace to out-of-slots players to false
kimden Dec 21, 2021
cccac2f
Make spectators_by_limit stored in memory instead of being calculated…
kimden Dec 21, 2021
5f0a4e3
Make spectators_by_limit a set of raw pointers temporarily as there i…
kimden Dec 21, 2021
d444c90
Fix wrong prototype
kimden Dec 21, 2021
6409e31
Merge https://github.com/supertuxkart/stk-code up to 854c31b
kimden Mar 5, 2022
55b67e4
Punish use of anchor (anvil) against teammates in Team GP (#13)
heuchi Mar 5, 2022
f2f1f79
Update readme and fork changes to reflect latest commits and branches
kimden Apr 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions ANTI_TROLL.md
Original file line number Diff line number Diff line change
@@ -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:

<!-- Set values for anti-troll system -->
<!-- If true, use anti troll system
This can also be controlled with server command:
\admin troll [0,1] -->
<use-anti-troll-system value="true" />
<!-- Warn string to show to player -->
<troll-warn-message value="WARNING: You troll, you get kicked !!" />
<!-- Warn player that drives backwards or stopps for given time -->
<troll-warning-time value="7.0" />
<!-- Kick player that drives backwards or stopps for given time -->
<troll-kick-time value="10.0" />
<!-- Minimum speed in correct direction to decrease wrong-way timer -->
<troll-min-normal-speed value="12.0" />
<!-- A player going slower than this is considered stopping -->
<troll-max-stop-speed value="5.0" />

### 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)... ;)
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down
94 changes: 94 additions & 0 deletions FORK_CHANGES.md
Original file line number Diff line number Diff line change
@@ -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
97 changes: 93 additions & 4 deletions NETWORKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<?xml version="1.0"?>
<server-config version="6" >
Expand Down Expand Up @@ -60,9 +60,12 @@ The current server configuration xml looks like this:
<!-- Password for private server, leave empty for a public server. -->
<private-server-password value="" />

<!-- Message of today shown in lobby, you can enter encoded XML words here or a file.txt and let STK load it. -->
<!-- Message of today shown in lobby, you can enter here encoded XML words or a .txt file and let STK load it. -->
<motd value="" />

<!-- Help message shown after sending /help. You can enter here the message or a .txt file and let STK load it. -->
<help value="" />

<!-- If this value is set to false, the server will ignore chat messages from all players. -->
<chat value="true" />

Expand Down Expand Up @@ -92,13 +95,43 @@ The current server configuration xml looks like this:

<!-- Time to wait before entering kart selection screen if satisfied min-start-game-players below for owner less or ranked server. -->
<start-game-counter value="60" />

<!-- If this value is set to true, a message is send to everybody if a player makes a teammate explode. -->
<show-teammate-hits value="false" />

<!-- Punish teammate hits? If set to true players get an anvil when they hit teammates. -->
<teammate-hit-mode value="false" />

<!-- Clients below this value will be rejected from joining this server. It's determined by number of official karts in client / number of official karts in server -->
<official-karts-threshold value="1" />

<!-- Clients below this value will be rejected from joining this server. It's determined by number of official tracks in client / number of official tracks in server, setting this value too high will prevent android players from joining this server, because STK android apk has some official tracks removed. -->
<official-tracks-threshold value="0.7" />

<!-- Clients below this value will be rejected from joining this server. It's determined by number of addon karts in client -->
<addon_karts_threshold value="0" />

<!-- Clients below this value will be rejected from joining this server. It's determined by number of addon tracks in client -->
<addon_tracks_threshold value="0" />

<!-- Clients below this value will be rejected from joining this server. It's determined by number of addon arenas in client -->
<addon_arenas_threshold value="0" />

<!-- Clients below this value will be rejected from joining this server. It's determined by number of addon soccer fields in client -->
<addon_soccers_threshold value="0" />

<!-- Tracks needed to enter the server, leave empty for no restriction. -->
<must-have-tracks value="hacienda xr591 addon_animtrack_1 minigolf" />

<!-- List of tracks that can be played on a server, leave empty for no restriction or put 'not' before the list to name tracks that cannot be played. -->
<only-played-tracks value="not abyss snowtuxpeak addon_minigolf" />

<!-- Use fixed lap count, negative or zero to disable. -->
<fixed-lap-count value="-1" />

<!-- If this value is set to true, players and the server must have at least one common official track. -->
<official-tracks-needed value="true" />

<!-- Only auto start kart selection when number of connected player is larger than or equals this value, for owner less or ranked server, after start-game-counter reaches 0. -->
<min-start-game-players value="2" />

Expand All @@ -117,6 +150,9 @@ The current server configuration xml looks like this:
<!-- If true, the server owner can config the difficulty and game mode in the GUI of lobby. This option cannot be used with owner-less or grand prix server, and will be automatically turned on if the server was created using the in-game GUI. The changed difficulty and game mode will not be saved in this config file. -->
<server-configurable value="false" />

<!-- Description of modes and difficulties that can be set on a configurable server. Doesn't affect initial mode and doesn't affect unconfigurable servers. Use the format "d0123 m012345678". -->
<available-modes value="d0123 m012345678" />

<!-- If true, players can live join or spectate the in-progress game. Currently live joining is only available if the current game mode used in server is FFA, CTF or soccer, also official-karts-threshold will be made 1.0. If false addon karts will use their original hitbox other than tux, all players having it restriction applies. -->
<live-spectate value="true" />

Expand Down Expand Up @@ -192,9 +228,57 @@ The current server configuration xml looks like this:
<!-- If true this server will auto add / remove AI connected with network-ai=x, which will kick N - 1 bot(s) where N is the number of human players. Only use this for non-GP racing server. -->
<ai-handling value="false" />

<!-- If true no one can start a race and everyone should use the server for sleeping/chatting only. -->
<sleeping-server value="false" />

<!-- IP that should be used to connect to a server, set 0 for a default IP. You need this only if the server's IP shouldn't be used for some reason (e.g. blocking) and there is another IP ('good') that points to the same server. In this case, you should write a good IP here as a number. Only IPv4 is supported. -->
<false-ip value="0" />

<!-- When true, stores race results in a separate table for each server. -->
<store-results value="false" />

<!-- When non-empty, server is telling whether a player has beaten a server record, records are taken from the table specified in this field. So it can be the results table for this server or for all servers hosted on the machine.-->
<records-table-name value="" />

<!-- When true, stores the info about each forced kick in a database (if it exists). -->
<track-kicks value="false" />

<!-- When true, the server allows changing teams freely. -->
<free-teams value="false" />

<!-- When true, the server has the functionality to host soccer tournaments. Rules may change so better ask STK players about the actual rules. -->
<soccer-tournament value="false" />

<!-- List of players and judges. Use the format "R red red red B blue blue blue J judge judge" where the category is preceded by its letter. Categories can be empty or absent and can go in any order. -->
<soccer-tournament-players value="" />

<!-- A string given to a peer if it has incompatible data, so that it can know why it cannot enter, empty to disable. -->
<incompatible-advice value="Well, you have incompatible data!" />

<!-- If true and no track is selected, then an addon track can be picked. -->
<random-selects-addons value="false" />

<!-- If non-empty, these tracks are played in the order until the list ends. Can be useful for grands prix. -->
<tracks-queue value="" />

<!-- A custom Grand Prix scoring system to be used, empty for default. -->
<grand-prix-scoring value="" />

<!-- For a private server, a list of players who can enter with any password. Works only for online accounts. -->
<white-list value="kimden" />

<!-- If true, all mobile peers get a corresponding icon into the name. -->
<expose-mobile value="true" />

<!-- Specifies how to count own goals: standard - last touching player is counted, no-own-goals - last touching player of scoring team is counted if existing, advanced - as standard for now. -->
<soccer-goals-policy value="standard" />

<!-- If true this server will allow AI instance to be connected from anywhere. (other than LAN network only) -->
<ai-anywhere value="false" />

<!-- If true, the server owner can kick players, either via the UI button or using /kick command. -->
<kicks-allowed value="true" />

</server-config>

```
Expand Down Expand Up @@ -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;
```

Expand Down Expand Up @@ -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
(
Expand Down
Loading