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

Command manager #5

Open
wants to merge 846 commits into
base: master
Choose a base branch
from
Open

Command manager #5

wants to merge 846 commits into from

Conversation

kimden
Copy link
Owner

@kimden kimden commented Sep 8, 2021

Work on command manager is still in progress, don't hurry to merge it into your server as most existing commands are not added yet. Changes are intended to separate handling commands from server_lobby.cpp and possibly add new functionality.

Agreement

By creating a pull request in stk-code, you hereby agree to dual-license your contribution as
GNU General Public License version 3 or any later version and
Mozilla Public License version 2 or any later version.

This includes your previous contribution(s) under the same name of contributor.

Keep the above statement in the pull request comment for agreement.

@kimden kimden added the T: improvement New feature or request label Sep 8, 2021
kimden added a commit that referenced this pull request Jun 1, 2023
… config names, disconnection time

Please note that the results table schema may change later before merging #5. In this commit, the changes are:
- added items TEXT, kart_color REAL, is_quit INTEGER
- result stores kart's race time independently of whether it's a quit or not
- config stores kart characteristics file name, items stores powerup file name, empty if the name is default.
One may need to change NULL values in config and items to an empty string.
kimden and others added 26 commits July 25, 2023 02:39
…upon pressing

Also known as "Team GP no addons /queue pf addon start bug"
…oked

Example: /installaddon any-track-id any positive number of words
By default it sorts according to the number of maps corresponding to the current game mode (never by karts)
Also remove the useless function parameter
1.3 changelog completed
Not displaying a win message when there is only one kart was intended behaviour. A win requires the possibility of a loss. However, displaying the finishing rank with only one kart is ugly.
Testing with high reduce-turn-max, skidding looks fine with steer values that would have previously gone out of boundaries. No further fix is needed.
Also add more explicit error logging for this case.
… be played

Map history per tournament game can be viewed with /history, /history (index) (map id) tells the server to remember that the arena played in game index was (map id). By default, the server takes the last played map during /game X, but sometimes that needs to be overridden.
- Set the minimum sound volume to 0.025f instead of effectively 0.1f. This is particularly helpful for headphone users.
- Make the step between each volume setting exponential.
- Add parameters to remember the parameters of the audio spinners.
- Increase the default number of values the audio spinners can take from 10 to 15. Old config files will keep using 10.
- Set the default values to 10 (spinners), which translates to 0.2678 (volume fraction) instead of 0.6 (previous default)
- Fix a bug that made the last lap SFX played only if music was on.
- Fix the behavior of the music volume adjustment when the last lap SFX is played. Previously, the music volume was only adjusted when the music volume was above a certain threshold, but when it was above that threshold, the adjustment was too strong.
- If there is 2 or 3 karts in the GP, karts in 2nd and (if any) 3rd place display a sad animation
- If there is 4 karts in the GP, the kart in 3rd displays a sad animation
- If there is 5 karts or more in the GP, all karts on the podium display a happy animation

The first kart in the GP always displays a happy animation even if alone.
CodingJellyfish and others added 28 commits July 29, 2024 11:38
This commit introduces structure GameInfo that collects information about the
game before, during, and after it. It is then used to save much many values
related to game results into database.

Results table structure was done from scratch, and if you try to run with an
older version of the database, it will tell you either to update it, or to
disable the warning. Old CMake parameters USE_RECORDS_V* and ENABLE_RECORDS_V*
are removed. Databases are expected to adhere to the new structure, which is
not supposed to be changed for a long time.

Docs folder contains the description of the database changes, and how to update
the tables to the latest version.

To obtain more info about the game, some classes have to be changed a bit. In
particular, soccer goals and CTF captures are now stored in the database, and
the info about players joining and leaving the game.

What should be done later in addition to these changes?
* Adding the ability to configure what should be stored in the database -
not everyone wants soccer/ctf information, and for some settings like
time-limited soccer that could be too many data saved.
* Logging the failed SQL queries (for retrying to invoke them)
* More documentation
* Some code refactoring will happen
- Save a per-player list of favorite tracks in the players config file
- Read said lists and setup a matching track group
- New logic for the isInGroup function to ensure favorite tracks are correctly detected and displayed in the track selection screen
- Switch the active list of favorite tracks when switching the active player profile
- Clarify some unclear comments
The UI works simply by ticking a checkbox in the track and GP screen and then selecting a track icon to switch its favorite status. The checkbox is always unticked by default when entering the screen. Changes are saved in the current player profile.

The display of tracks inside groups is not automatically refreshed.
- Immediately refresh the display of tracks inside group after favoriting or unfavoriting a track
- Sort tracks according to favorite status, displaying favorite tracks first
- Add heart as a badge overlay option, and use it to mark favorite tracks
- Remove debug prints
In startSelection, assets are erased only after the spectators are determined.
If a spectator doesn't have the picked map, it's not loaded, but the spectator
mode stays afterwards.
- In the pause menu, the buttons are part of ribbon widgets. Under certain conditions, the game could incorrectly select the underlying back button as active instead of its ribbon. Because the icon buttons that constitute a ribbon widget don't have their x or y property set, a check that x or y are not negative ensures that keyboard navigation doesn't select them.
- The multiplayer focus dispatcher button is made invisible if there is only one player in the kart selection screen.
- Add a getName() function to the Widget class, to help when debugging GUI.
- Avoid dereferencing null pointer
- Remove some unused variables
Classic Coal:
- Make the default spinner background color slightly darker

Cartoon Coal:
- Make the spinner fill darker than the default spinner background color, instead of lighter
- Make the background color of spinners, buttons, and focused checkboxes somewhat darker
Grey backgrounds are fundamentally problematic when trying to display colored texts. This commit improves perceived contrast, but compromises are made to not change the style of the skins too much.

Classic coal:
- Make the background slightly less transparent and slightly darker
- Make the neutral list blue darker and the red lighter

Cartoon coal:
- Make the neutral list blue darker, the neutral red lighter, the focused blue slightly darker and the focused red darker
This is simply a copy of the screen_other icon, but it's much better than using the default classic theme icon.
- Allow a track to be separately added to the set of 'battle arena' groups and 'soccer arena' groups
- Update the track removal routine to properly cleanup if a track is present in multiple sets of groups
- Use a new enum and split functions to avoid duplicating code
- Fix a crash introduced in 7f78b5b when a track present in a custom group is not available.
…rototype

As the merged changes include fixing 5138 in the main repo which was already kind of fixed here, I had to take a bit of care
Hopefully nothing breaks
Both KartTeam and temporary teams are still present, but now ServerLobby ensures
that their values correspond to each other. In particular:
 - you can use commands on temporary teams also on soccer/ctf teams now
 - you can change the set of available teams in racing/ffa with /availableteams
 - when changing from racing/ffa to soccer/ctf, /randomteams 2 is done
 - when changing from soccer/ctf to racing/ffa, teams are cleared
 - unlike standard implementation, soccer team is not just "not sent", it is
   defined as KART_TEAM_NONE in racing/ffa
 - you can set an absent team in soccer/ctf, but that will trigger a new
   ASM_NO_TEAM spectate mode, which goes away if the mode becomes racing/ffa
 - as another spectate mode was added, I also added /spectate 2 which allows
   you to skip games but also not watch them. Yes, it goes against the command
   name, but sometimes it's really needed. Without arguments /spectate still
   goes between 0 and 1.
 - probably something else was done, I forgot already. Hoping nothing crashes
* Update upload artifavt version

* Update download artifavt version
* Rewrite NewsManager

* Add open link function

* Small fixes

* Try fix build crash

* Try fix build crash #2

* Try fix build crash #3

* Fix multiple error message & Add empty indicator

Hope the build would pass since the actions in the pr isn't updated yet
Top-level command blocks from 'base' config are ignored if a top-level command
block exists in 'custom' config. Only 1-level nesting is possible for now, I'll
probably add more later if needed.
Default commands.xml does NOT make /randomteams votable. Most of commands will
be made "possibly-votable" later. Current threshold for votable /randomteams
is 0.6, unfortunately, thresholds are hardcoded for now, it will also be
changed.
@kimden kimden added P1: critical Urgent or very important C: Commands / Permissions Related to command manager labels Oct 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Commands / Permissions Related to command manager P1: critical Urgent or very important T: improvement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.