* Drastic Lag Mitigation Subsystem: SSlag_switch (#59717)
Requested by oranges and inspired by the upcoming event. A new subsyetem, non-processing (for now), aimed at providing some toggle switches that can be flipped as a last ditch effort to save some CPU cycles by sacrificing some non-critical mechanics. Below you can see each individual toggle.
Screenshot of the admin panel:
image
Surely there are more opportunities for toggles I missed, but adding new ones is not very difficult at all.
Why It's Good For The Game
Better performance during extreme pop, I hope.
Changelog
cl
code: Introduces the Lag Switch subsystem for when a smoother experience is worth trading a few bells and whistles for. Performance enhancement measures can be togged by admins with the Show Lag Switches admin verb or enabled automatically at a pop amount set via config.
config: Added a new config var: number/auto_lag_switch_pop
* Drastic Lag Mitigation Subsystem: SSlag_switch
* mirrored the changes to the modular file
Co-authored-by: Wayland-Smithy <64715958+Wayland-Smithy@users.noreply.github.com>
Co-authored-by: Useroth <37159550+Useroth@users.noreply.github.com>
* Add $reset directive to config processor for setting a config entry to default value
* Update game_options.dm
Co-authored-by: Bobbahbrown <bobbahbrown@gmail.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
* Port: fixes of SStimer subsystem from RU SS220 Paradise (#59718)
Unobvious problem spot
#define BUCKET_POS(timer) (((round((timer.timeToRun - SStimer.head_offset) / world.tick_lag)+1) % BUCKET_LEN)||BUCKET_LEN)
With tick_lag equal to 0.1, 0.25, 0.5, rounding of division is normal. But at other values it may be shifted either more or less due to the specifics of floating-point storage and processing. Numbers 0.1, 0.25, 0.5 have blank mantissa, unlike others which lead to numbers such as 245.0000004 when divided.
PS: tick_lag is rounded to the first two decimal places.
Fixes
Rewrote the circular doubly linked list to a regular doubly linked list, because it could cause timers to loop infinitely.
Fixed re-creation of a bucket if the timer does not have a callback.
Added debug stat indicator RST to MC SStimer.
Added optional ability to log dump all timers on crash.
Fixed subsystem logic when a bucket position is misplaced due to division and rounding inaccuracy. The system now captures such rounding errors and restores the correct timer position.
References
[RU] SS220 Paradise port process from TGstation and fixes:
ss220-space/Paradise#5ss220-space/Paradise#10ss220-space/Paradise#26ss220-space/Paradise#32ss220-space/Paradise#37
Contributors
@ semoro: fixes
@ Bizzonium: port
Changelog
cl Semoro and azizonkg
fix: Ported fixes of SStimer subsystem from RU SS220 Paradise
config: Added a new config var: flag/log_timers_on_bucket_reset
/cl
* Port: fixes of SStimer subsystem from RU SS220 Paradise
Co-authored-by: Aziz Chynaliev <azizonkg@gmail.com>
* Refactors dbcore and limits the maximum amount of concurrent async queries to a variable amount (#59676)
Refactors dbcore to work off a subsystem if executed async and limits the maximum amount of concurrent async queries to 25.
This has been tested locally on a mysql docker image and there were no crashes (as long as you didn't run it with debug extools) + data was getting recorded fine.
Why It's Good For The Game
May or may not resolve terry crashes, however, each query creates a new thread which takes up 2mb, preventing the game from using that 2mb. This can lead to ooms if they stack up, e.g. due to poor connectivity. This solves that issue.
maintainer note: this did not actually resolve the crashes, but has value anyway. Crashes were sidestepped fixed by finding out Large Address Awareness works
cl
refactor: Refactors dbcore.dm to possibly resolve the crashes that happen on Terry.
/cl
* Refactors dbcore and limits the maximum amount of concurrent async queries to a variable amount
Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com>
* SDQL Spells & Menu to Give Them to Players (#58118)
SDQL spells are spells that execute an SDQL query. This requires a config flag to be enabled in game_options.txt. When enabled, admins with debug verbs have the ability to open a menu allowing them to define all the relevant vars for the spell, including icons and spell requirements.
It also fixes a bug with superuser SDQL queries always runtime if they try to call a proc.
Co-authored-by: Emmett Gaines <ninjanomnom@ gmail.com>
Co-authored-by: Aleksej Komarov <stylemistake@ gmail.com>
* Adds SDQL Spells & a Menu to Give Them to Players - Take 2: Commit Cleanup
Co-authored-by: Y0SH1M4S73R <legoboyo@earthlink.net>
Co-authored-by: Emmett Gaines <ninjanomnom@ gmail.com>
Co-authored-by: Aleksej Komarov <stylemistake@ gmail.com>
* Renews Maintenance Drones
* And these have conflicts too, but you can't see them
* Skyrat Map Updates (Adding Supermatter Room Area)
Co-authored-by: Jonathan Rubenstein <jrubcop@gmail.com>
Co-authored-by: Funce <funce.973@gmail.com>
* Implements a new auto-tagging system for ID card which adds a config to auto-flag them as an intern. (#58236)
About The Pull Request
ID cards when equipped will check the player's living hours if the USE_LOW_LIVING_HOUR_INTERN flag is set. If their living hours is less than the first of the following (checked in order from 1st to 3rd until a valid value is found):
Config USE_LOW_LIVING_HOUR_INTERN_HOURS
Config USE_EXP_RESTRICTIONS_HEADS_HOURS
Hardcoded 15 hours
Then their ID card is tagged as Intern Assignment, unless they're a Head of Staff in which case they become an Assignment-in-Training.
PDAs, Wallets and Tablets also update any ID cards they hold, so equipping a PDA, Tablet or Wallet will also update any ID cards inside it.
This occurs automatically, even if the card does not belong to the owner. This only occurs when the user's assigned_role is a station job.
* Implements a new auto-tagging system for ID card which adds a config to auto-flag them as an intern.
Co-authored-by: Timberpoes <silent_insomnia_pp@hotmail.co.uk>
* Sets up ambition logging baseline framework
* That's one line, how did I write it
* Have to rewrite all the logs!
* I don't know what I'm doing anymore
* I think this is the last thing
* Log ambition is now added to config
* Ambition flag now correctly checks for the ambition flag
* Okay /here/ we go
* No more lowercase ckeys in admin chat
* Admin actions are now logged too
* Changed the population scaling coefficients minimal values to 0. (#56522)
## About The Pull Request
So, there on the downstream we've encountered a problem with the security officer slots jumping to 12 every time the round starts, regardless of what we set them to in the configs.
In the configs it says that you can set the coefficients to 0 to disable scaling, and upon investigation, it seems that all the scaling coefficients suffer from similar problem.
https://github.com/tgstation/tgstation/blob/master/config/game_options.txt#L198
the `min_val` in the config entry datums is 1 on each of them, leading to unexpected behaviour
## Why It's Good For The Game
It fixes certain config values leading to unexpected and unwanted behaviour
* Changed the population scaling coefficients minimal values to 0.
Co-authored-by: Useroth <37159550+Useroth@users.noreply.github.com>
* Adds logging to uplinks, spellbooks, and the codex ciatrix (#56450)
* Initial logging
* Bugfix and adds uplink logging to config file
* Another bugfix
* Adds logging to uplinks, spellbooks, and the codex ciatrix
Co-authored-by: TemporalOroboros <TemporalOroboros@gmail.com>
* Added the SQL logging.. waf
* I dont know why CI does not like my sql......
* I think i fixed the sql....
* Attempt #1 to make linter happy
* Shhh linter, it will be over soon
Just breath into this cloth... ignore the chloroform smell.
(Add a Preprocesser statement, to make the SpacemanDMM linter ignore the SQL code in a mob atom obj, that causes it to trigger its hard coded test for stoplag.
This only does not trigger on other SQL, as there is hard coded exception in SpacemanDMM that ignores the other objects. the better fix would be to update SpacemanDMM to add this into the exclusion. but this change at least allows the PR to be merged finally)
Co-authored-by: MissFox <github@aesir.org.uk>
* Fix startup double runtimes again (#56047)
Prevents runtimes that occur before /world/New is called from runtiming in /world/Error due to lack of the config being loaded.
* Fix startup double runtimes again
Co-authored-by: Jordan Brown <Cyberboss@users.noreply.github.com>
* Add config for discord bot prefix (#55400)
This allows you to set this in config, save having to hardcode it
I also fixed a mistake where only one message was changed in the
messaging from the account linking system
* Add config for discord bot prefix
Co-authored-by: oranges <email@oranges.net.nz>
* Remove the hyphen from the default value of the github url string (no longer -tg-station) (#55136)
* Remove the hyphen from the default value of the github url string (no longer -tg-station)
Co-authored-by: Bobbahbrown <bobbahbrown@gmail.com>
* Fixes and a little cleanup.
* False by default.
* Apply suggestions from code review
Co-authored-by: Azarak <azarak10@gmail.com>
* Modularization and comments.
* #include
Co-authored-by: Azarak <azarak10@gmail.com>
* Fix erroneous logging of config errors for str_list configuration type (#54676)
Fixed issue brought up by @ Cyberboss wherein the new ``str_list`` config type doesn't properly return true after setting the values and as a result has an erroneous error pop up in the config error log.
* Fix erroneous logging of config errors for str_list configuration type
Co-authored-by: Bobbahbrown <bobbahbrown@gmail.com>
* Adds a living time config to the panic bunker (#54341)
* Adds a living time value to the panic bunker, so you can keep people out based on time spent playing the game
* updates the admin verb, and enables %minutes% as an option
* Makes a proc call more clear
Co-authored-by: Jared-Fogle <35135081+Jared-Fogle@ users.noreply.github.com>
* than
Co-authored-by: Jared-Fogle <35135081+Jared-Fogle@ users.noreply.github.com>
* Adds a living time config to the panic bunker
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: Jared-Fogle <35135081+Jared-Fogle@ users.noreply.github.com>
* Overhauls discord verification system (#53289)
This completely replaces the previous verification system, for one that
will interoperate with a discord redbot instance that uses the cogs
located at you github.com/optimumtact/orangescogs
This cuts out several steps in the system, but it also leaves alone the
existing notify system (which just uses a file list of discord ids) as a
record of who to notify
SQL changes required for the new database system
Version 5.10, 7 August 2020, by oranges
Changes how the discord verification process works.
Adds the discord_links table, and migrates discord id entries from
player table to the discord links table in a once off operation and then
removes the discord id on the player table
The user connects to any tg server, and uses the "Verify Discord
Account" verb, this generates a six word one time use token, with a 4
hour time validity period (defined as 4 hours from the timestamp value)
in the discord links table.
This one time token, and the ckey of the user are stored in
discord_links
At this point the entire DM side is done, this is all it does
* Overhauls discord verification system
Co-authored-by: oranges <email@oranges.net.nz>
* tgchat (#52426)
Replaces goonchat with a tgui based chat panel
Fixes#52898Fixes#52663
It is as fast as goonchat was (if not faster in certain circumstances), and is very extensible. It has all the necessary code for sorting messages into categories, which means that one of the next features will be multiple tab support.
Additional features that you will get with tgchat right now:
Massively faster server-side performance compared to goonchat, especially if batching multiple messages to one client.
Message persistence across rounds and reconnects. (All messages are stored client-side in IndexedDB)
More robust scroll tracking. If you scroll up, it will not change the scroll position on new messages like goonchat did.
Multiple message combining. (Currently set to combine up to 5 messages over last 5 seconds).
If using the highlighting feature, it highlights the whole message as well as the matching word.
"Now playing" widget, with preview of the song title, a knob for adjusting the volume and a stop button.
Architecture is as following:
```
to_chat() -+
|
SSchat
(queue, batching)
|
window.send_message()
|
v
+-------------+
| tgui-panel |
|+-----------+|
|| tgchat ||
|+-----------+|
+-------------+
```
Subsystem is basically goonchat, but without all the garbage that slows the servers down (string concatenation, double urlencoding, sanitizing, etc). Now, instead of all that, it's being slowed down by json_encode in /datum/tgui_window/proc/send_message, which IMO is completely worth it, and allows sending various templates and widgets to tgchat.
/datum/tgui_window abstracts the whole window away from you, establishes a nice message-passing interface between DM and JS, with two message queues on each side, automatically loads js/css assets for you, basically does everything. You as a developer only have to worry about sending/receiving messages and write javascript.
tgui-panel is a slimmed down version of tgui, and functions as a container for various widgets, and tgchat is one of them. It of course can be expanded with more stuff.
It's also a separate entry point and a JS bundle, so it's not bloating the main tgui bundle, and is currently sitting at about 230kB.
* tgchat
Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
* [Ready] CDN browser assets! (#52681)
Rewrites the asset_cache system to handle sending assets to a CDN via a webroot.
see https://github.com/MrStonedOne/tgstation/blob/asset-cdn/code/modules/asset_cache/readme.md
Fixed a lot of bugs with assets, removed some dead code.
Changes:
Moved asset cache code to transport datums, the currently loaded one is located at SSassets.transport, asset cache calls made before the config is loaded use the simple browse_rsc transport.
Added subsystem call for when the config loads or reloads.
Added a webroot CDN asset transport. assets are saved to a file in a format based on the file's hash (currently md5).
Assets that don't use get_asset_url or get_url_mappings (such as browser assets referred to by static html files like changelog.html or static css files) can be saved to browse_rsc even when in cdn asset mode by setting legacy to TRUE on the datum returned by register_assets
Added a system for saving assets on a cdn in a hash based namespace (folder), assets within the same namespace will always be able to refer to each other by relative names. (used to allow cdn'ing font awesome without having to make something that regenerates it's css files.).
The simple/namespaced asset cache datum helper will handle generating a namespace composed of the combined md5 of everything in the same datum, as well as registering them properly.
Moved external resource from a snowflake loaded file to a config entry, added it to resources.txt
To ensure the system breaks in local testing in any situation that wouldn't work in cdn mode, the simple transport will mutate the filenames of non-legacy and non-namespaced assets and return this with get_asset_url.
Simple transport's passive send of all roundstart assets to all clients is now a config that defaults to off. this is to break race conditions during local testings from devs accidentally relying on this instead of using send() properly.
cl
refactor: Interface assets (js/css/images) can now be managed using an external webserver instead of byond's one at a time file transfer queue.
admin: Adds admin verb toggle-cdn that allows admins to disable the external webserver asset transport and revert to the old system. Useful if the webserver backing this goes down (thanks cloudflare).
config: New config file, resources.txt, (must be loaded by an $include statement from the main config)
server: The external_rsc_urls.txt config has been moved to the main config system.
/cl
Porting notes:
Interface webpages must refer to their assets (css/js/image/etc) by a generated url, or the asset must register itself as a legacy asset. The system is designed to break in localtest (on simple/legacy mode) in most situations that would break in cdn mode.
Requires latest tgui.
The webserver must set the proper CORS headers for font files or font awesome (and other fonts) won't load.
/tg/'s webserver config: https://gist.github.com/MrStonedOne/523388b2f161af832292d98a8aad0eae
* [Ready] CDN browser assets!
Co-authored-by: Kyle Spier-Swenson <kyleshome@gmail.com>
* CentCom Galactic Ban DB: Bigger and Better Edition (#52588)
Admins will now be able to look up a player's bans from several other servers via the player panel.
My hope is that porting this to as many servers as possible will encourage more servers to make their bans publicly viewable so they can be included in this system. Direct access to a server's database is not required (or even supported).
Supported servers:
BeeStation
/vg/station
OracleStation
FTL13
Fulpstation
TGMC
Planned support (WIP):
World Server
Yogstation
Halo: SSE
Any other server willing to make their bans publicly visible.
API: https://centcom.melonmesa.com
Source: https://github.com/bobbahbrown/CentCom
Changelog
cl ike709 and bobbahbrown
add: Admins can now see your bans on (some) other servers.
/cl
* CentCom Galactic Ban DB: Bigger and Better Edition
Co-authored-by: ike709 <ike709@users.noreply.github.com>
* CentCom Galactic Ban DB (#52519)
* CentCom Galactic Ban DB
* Sanitize and config
* Apparently TG has a http_request datum
* Tweaks
* An excellent suggestion
* Turns out BYOND is better at JSON parsing than I thought it was
* Fun fact: 4 out of 5 UIs don't bother to do this
* CentCom Galactic Ban DB
Co-authored-by: ike709 <ike709@users.noreply.github.com>
* basic antag items
hey
based
game is on
ree
e
brings back good sprites
eueuuee
eeeeeeeeeeeeeeeeeeee
more
tgui baby
FINALLY
e
Small changes
adds better point s
Finishing touch!
FINISHED
ANTAG FINISHED. FUCKING. FINALLY
grammer
E
E?
* rebuilt tgui
* gamemode fixes
* i love inconsistent var names
* sprootes
* ath review
Co-authored-by: ATH1909 <42606352+ATH1909@users.noreply.github.com>
* Automatic changelog compile [ci skip]
* a shit ton of changes
* Apply suggestions from code review
Co-authored-by: Qustinnus <Floydje123@hotmail.com>
Co-authored-by: ATH1909 <42606352+ATH1909@users.noreply.github.com>
* sprootes
* more changes ree
* Fixes and upgrades
* sprootes done
* dmdoc compliance
* Apply suggestions from code review
Co-authored-by: Rohesie <rohesie@gmail.com>
* Apply suggestions from code review
Co-authored-by: Rohesie <rohesie@gmail.com>
* mewtewnew revieww ~~
* e
* Automatic changelog compile [ci skip]
* e
* Apply suggestions from code review
Co-authored-by: Rohesie <rohesie@gmail.com>
* E
* autodoc
* E
* Apply suggestions from code review
Co-authored-by: Rohesie <rohesie@gmail.com>
* removed Destroy()
* * 0.5
* bugsquash
* e
* changes to ashlord's rite
* e
e
* e?
* the fuck
* adds station wide alerts for ascension events
* fixes an autodoc
* tgui
* e
e
* removes a redundant line of code
* sickly blade is now normal size item
* changes a line of code in flesh
* no revives for ghouls!
* uwu
* Update code/modules/antagonists/eldritch_cult/eldritch_knowledge.dm
Co-authored-by: nemvar <47324920+nemvar@users.noreply.github.com>
* E
* E2
* Automatic changelog compile [ci skip]
* Makes eldritch cult into HERETICS
* Apply suggestions from code review
Co-authored-by: Rohesie <rohesie@gmail.com>
* E
* unfucks medallions code
* long live list loops
* E
* E
* i love my git crashing
* Magics
* E
* removes TRAIT_GHOUL since it was redundant
* Update code/modules/mob/living/carbon/inventory.dm
Co-authored-by: Rohesie <rohesie@gmail.com>
* Update code/modules/mob/living/carbon/inventory.dm
Co-authored-by: Rohesie <rohesie@gmail.com>
* Update code/modules/mob/living/carbon/human/species.dm
Co-authored-by: Rohesie <rohesie@gmail.com>
* Update code/modules/mob/living/carbon/human/species.dm
Co-authored-by: Rohesie <rohesie@gmail.com>
* Update code/modules/mob/living/carbon/human/human_update_icons.dm
Co-authored-by: Rohesie <rohesie@gmail.com>
* fixies uwu
* hopefully i fixed all return ..()
* E
* EEEEEEE
* wormie now is refactored
* removes destroy
* Update code/modules/surgery/bodyparts/bodyparts.dm
Co-authored-by: Rohesie <rohesie@gmail.com>
* Automatic changelog compile [ci skip]
* Update code/modules/mob/living/simple_animal/eldritch_demons.dm
Co-authored-by: Rohesie <rohesie@gmail.com>
* Update code/modules/antagonists/eldritch_cult/knowledge/rust_lore.dm
Co-authored-by: Rohesie <rohesie@gmail.com>
* Update code/modules/antagonists/eldritch_cult/knowledge/rust_lore.dm
Co-authored-by: Rohesie <rohesie@gmail.com>
* E
* E
* Update code/modules/mob/living/simple_animal/eldritch_demons.dm
Co-authored-by: Rohesie <rohesie@gmail.com>
* Update code/modules/antagonists/eldritch_cult/knowledge/rust_lore.dm
Co-authored-by: Rohesie <rohesie@gmail.com>
* Update code/modules/mob/living/simple_animal/eldritch_demons.dm
Co-authored-by: Rohesie <rohesie@gmail.com>
* Update code/modules/mob/living/simple_animal/eldritch_demons.dm
Co-authored-by: Rohesie <rohesie@gmail.com>
* E
* E?
* E
* one more
* k
* OH SHIT OH FUCK
* replaces ROLE_ECULT with ROLE_HERETIC and fixes preferences
* REE
* fleshy fixes
* fixes summonings
* REE
* texture fix
* fixes a stupid fucking runtime that i noticed coz i forgot people can be borged. FUCK
* grammer
* nullrods can now remove runes
* HOLY SHIT, HOTFIX NERF
* E
* E
* TEMPORARY SOLUTION TO MAKE HERETICS SPAWN NATURALLY
* Update code/modules/antagonists/eldritch_cult/eldritch_antag.dm
Co-authored-by: Rohesie <rohesie@gmail.com>
* Update code/modules/antagonists/eldritch_cult/eldritch_book.dm
Co-authored-by: Rohesie <rohesie@gmail.com>
* Update code/modules/antagonists/eldritch_cult/eldritch_effects.dm
Co-authored-by: Rohesie <rohesie@gmail.com>
* Update code/modules/antagonists/eldritch_cult/eldritch_items.dm
Co-authored-by: Rohesie <rohesie@gmail.com>
* SECOND TEMPORARY FIX
* fixes fixes fixes fixes
* i hope this no longer will qdel summons
* E
* please push this asap
* E
* buffs sickly blade to 17 damage and only allowes culties to use it
* Explanations uwu
* examine changes ree
* e
* E
* )
* E
* E
* Ash fix
* changes to mad touch
* replaces e_cult with heretics and fixes protect objective to suceed when someone suicides
* E
* makes worm code use COMSIG_MOVABLE_MOVED
* replaces bad var names
* makes eldritch knowledge an assoc list
* E
* Update code/modules/mob/living/simple_animal/eldritch_demons.dm
Co-authored-by: Rohesie <rohesie@gmail.com>
* what the fuck
* the fuck
* fixies
* EEE
* fixes
* e
* fixes
* mansus grasp slight buff
* changes overall changes
* E
* logging
* changes the eldritch armor into a nicer looking kryson robes
* tgui bundle
* QOL sprites and a spell to contract armsy
* SPRITES
* readds rust floors
* Fixes pointed out by anturk
* E
* E
* E
* Apply suggestions from code review
Co-authored-by: Rohesie <rohesie@gmail.com>
* Cleanup
* Fixes
* E
* EEEEEEEEEEE
* makes heretics a little bit more common
* Update code/modules/antagonists/eldritch_cult/knowledge/flesh_lore.dm
Co-authored-by: Rohesie <rohesie@gmail.com>
* EEE
* eee
* E
* E
* Init
* Makes shit more readable
* h
* e
* E
* wounds compatibility patch
* hnng
* rusty better sprite
* turn
* Apply suggestions from code review
Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
* E
* further renames e
* E
* JS side
* changes reee
* e
* E
* yeesh
* e
* E
* pr
* e
* E
* changes re
* AAAAAAAAAAAAAA
* e
* antag huud
* e
* e
* hnnng
* hnng
* HNNNNG final patch - LAST TESTMERGABLE COMMIT
* HNNG NEVERMIND THIS IS THE LAST TESTMERGABLE COMMIT DONT LISTEN TO LIES BELOW
* e
* FINAL PATCH - MERGE READY
Adds defines, buffs blood siphon a bit so it can utilize wounds and replaces ROLE_CULTIST with ROLE_HERETIC
* forgot about a single debug line aaa
* hnnnhng
* hng
* a!
* aaa
* applies code review
* e
Co-authored-by: ATH1909 <42606352+ATH1909@users.noreply.github.com>
Co-authored-by: Changelogs <action@github.com>
Co-authored-by: Qustinnus <Floydje123@hotmail.com>
Co-authored-by: Rohesie <rohesie@gmail.com>
Co-authored-by: nemvar <47324920+nemvar@users.noreply.github.com>
Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
CHAT_NEW_GAME_NOTIFICATIONS
I can't find the commit that untied the original config to the announcement, but this is how it originally was: db68cd1#diff-d91ba57ba114207ed6985097e129dd9cR137
Whoever did it obviously didn't read the send2irc (now send2chat) doc comment
Closes#51416