* Word Filter Fix Round Two: JSON Decoding Debauchery (#68975)
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Yeah, you need to json_decode the results again, again, again. This is three JSON decodes, I believe? I could be wrong. Anyways, we add another json_decode here as well to not runtime on initialization (as well as have the word filter work most likely).
Tested on local, did not see the runtime that @ ShizCalev brought up in https://github.com/tgstation/tgstation/pull/68905#issuecomment-1204557463 (after verifying where it would be seen on master). Should be good now. Again.
* Word Filter Fix Round Two: JSON Decoding Debauchery
Co-authored-by: san7890 <the@san7890.com>
* Take Two: The word filter now verbosely describes config failure (Rust-g 1.0.2 Edition) (#68690)
A resuscitation of #67474 since Arm is not presently able to do it.
rustg_read_toml_file has backwards dependency to support older cases that checked for lack of list (the old sign the rust fn went wrong).
Fixes#67446
The configuration for the word filter now verbosely describes the error from the bad toml to the logs, allowing problems with it to be identified quicker and resolved.
Why It's Good For The Game
BLAZING
Ferris warning
Changelog
cl Armhulen/Armhulenn/Bazelart/Tralezab, san7890
admin: Word filters incorrectly set up will now have their errors actually described. Please, tell your server ops when you see it so they may fix the configuration.
server: Rust-g on this codebase is now on the 1.0.2 version, prepare accordingly.
/cl
I also bump rust-g's DLL to 1.0.2 in this PR as well.
* Take Two: The word filter now verbosely describes config failure (Rust-g 1.0.2 Edition)
Co-authored-by: san7890 <the@san7890.com>
* Fixes some mapping errors not using the mapping error log. (#64114)
Should help prevent #64066 from reoccurring.
* Fixes some mapping errors not using the mapping error log.
Co-authored-by: ShizCalev <ShizCalev@users.noreply.github.com>
* The word filter will now be less scared of double or trailing spaces (#62703)
It kept on tripping because the RegEx expression was malformed due to an absence of words in to_join_on_whitespace_splits, which caused it to filter out spaces that were at the beginning or at the end of a message, or if there was two spaces one by the other.
Also prevents people from sending a message that's only spaces in OOC, because that's a little silly.
* The word filter will now be less scared of double or trailing spaces
Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com>
* Map load unit testing and directory whitelisting - Mojave Sun is a really cool downstream, like and subscribe for longer PR names. oranges was here and made this github PR name much longer, thereby proving once and for all that upstreams do add value to the downstream not just endless amounts of refactoring because we can't write any api's in a modular fashion the first time around so have to update them later to be modular. Anyway do you think a taco counts as a sandwich? (#62620)
About The Pull Request
This is a fix for map not load anymore because of security changes
Why It's Good For The Game
Maps are good as they encourage gameplay and differentiate ss13 from a classic MUD game
Changelog
cl
add: unit test for map load
add: directory param to map load + whitelist for data and _maps
add: advertising for mojave sun in tg commit logs
/cl
* Map load unit testing and directory whitelisting - Mojave Sun is a really cool downstream, like and subscribe for longer PR names. oranges was here and made this github PR name much longer, thereby proving once and for all that upstreams do add value to the downstream not just endless amounts of refactoring because we can't write any api's in a modular fashion the first time around so have to update them later to be modular. Anyway do you think a taco counts as a sandwich?
Co-authored-by: AndrewL97 <andrewjlove97@gmail.com>
* [s] Security vulnerability patch (#62568)
About The Pull Request
In my personal, subjective opinion; trialmins should not, in fact, be able to read and delete server/box configuration files on a whim.
cl
server: Patches multiple(?) arbitrary file related vulnerabilities
/cl
* [s] Security vulnerability patch
Co-authored-by: TheFakeElon <59686430+TheFakeElon@users.noreply.github.com>
* Updated interactions
* Update interaction_menu.dm
* Colors
* Update interaction_menu.dm
* Update interaction_menu.dm
* Update interaction_menu.dm
* Better code for all.
* Update interaction_component.dm
* Removes support for TARGET SPEAK and USER SPEAK due to instability.
* Update interactions.dm
* Update interaction_component.dm
* Enables you to interact from a distance again.
* Fix word bounds on filters, where they would only be applied at the beginning (#61714)
* Fix word bounds on filters, where they would only be applied at the beginning
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
* Change the word filter configuration to allow providing reasons, fix emotes not working in filters, and implement separate OOC/IC/PDA filters (#61606)
* Change the word filter configuration to allow providing reasons, fix emotes not working in filters, and implement separate OOC/IC/PDA filters
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
* Add support for multiple MOTD in config (#61589)
## About The Pull Request
Changes "motd.txt" from being hardcoded to being a list of files which are read sequentially.
CC @ MrStonedOne for config changes
## Why It's Good For The Game
On production, our MOTDs contain several individual sections:
- Active Trial Admin threads
- General game information
- MRP specific information
I want to automate number 1, I want number 2 to be shared among all servers, and I want number 3 to be shared among all MRP servers.
* Add support for multiple MOTD in config
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
* tgui Preferences Menu + total rewrite of the preferences backend
* nah, we dont need to ping those people
* trying to remove the funny stuff
* unmodularizing this
* prefs reset
* this may need to be reverted, who knows
* okay, this part
* perhaps
* EEEEEEEEE
* unsanitary
* E
* Stage 1 + loadout system
* more fixes
* E
* I mean, it launches?
* More fixes and reorganisation
* E
* customisation code is spaget.
* disable ERP prefs
* Update erp_preferences.dm
* Update erp_preferences.dm
* E
* Slowly getting there
* It may be time for help :)
* tri...colors... help
* preferences now pass preferences
* Update dna.dm
* Fuck this man
* missing savefile return, set_species works, removed dumb stuff from updateappearance
* https://github.com/Skyrat-SS13/Skyrat-tg/pull/8199
* https://github.com/Skyrat-SS13/Skyrat-tg/pull/8224
* https://github.com/tgstation/tgstation/pull/61519
* https://github.com/Skyrat-SS13/Skyrat-tg/pull/8278
* e
* le butonAZARAK HELLO
* hhh
* Proper recognition where it's due, MrMelbert!
* EEEE
* examine block
* Better gen hit sounds from whitedream
* final loadout touches, more bug fixes im sure to come
* i said there would be bugfixes
* Update LoadoutManager.js
* Missing preferences in the html menu
* LIVE TESTING PHASE BABY
* Update LoadoutManager.js
* EEE
* LAUNCH TEST FIRE
* Update job.dm
* Update new_player.dm
* 50gb DAY ONE PATCH
* EEE
* Update preferences.dm
* buggle fixes
* Update examine.dm
* >LOOC starts on
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
Co-authored-by: jjpark-kb <55967837+jjpark-kb@users.noreply.github.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
Co-authored-by: Azarak <azarak10@gmail.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>
* 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>
* 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>
* Unicode support Part 2 -- copytext()
This is the transition of all copytext() calls to be unicode aware and also some nearby calls in the same functions. Most things are just replacing copytext() with copytext_char() as a terrible character limiter but a few others were slightly more involved.
I replaced a ton of
````
var/something = sanitize(input())
something = copytext(something, 1, MAX_MESSAGE_LEN)
````
with a single stripped_input() call. stripped_input() already calls html_encode(), trim(), and some other sanitization so there shouldn't be any major issues there.
This is still VERY rough btw; DNA is a mess, the status displays are complete ass, there's a copytext() in code\datums\shuttles.dm that I'm not sure what to do with, and I didn't touch anything in the tools folder. I haven't tested this much at all yet, I only got it to compile earlier this morning. There's also likely to be weird bugs until I get around to fixing length(), findtext(), and the rest of the string procs.
* Makes the code functional
* Assume color hex strings are always # followed by ascii.
Properly encodes and decodes the stuff in mob_helpers.dm which fixes some issues there.
* Removes ninjaspeak since it's unused
Several of the greps were missing the `-P` switch which caused them to
fail to match things. The EOL grep also wasn't working right so I
replaced it with the one I added to TGMC.
About The Pull Request
Same premise as #44712 but using a simple regex replace and also on the client side
Closes#44712
I was gonna PR it to #44712 but half way through I realized I had already replaced nearly all of bobbah's changes, and after I was finished the branches shared nothing.
Why It's Good For The Game
The delta is way smaller and simpler
Should solve the DoS concerns without needing a limit on bad chats because it's not a loop it's on the client side
Changelog
cl JJRcop and Bobbahbrown
tweak: When attempting to say a blocked word in character you will be notified which ones were blocked.
/cl
In preparation of pixel movement, I want to refactor our slowdown system to something more modular, and something that doesn't require /quite/ as many proccalls/calculations a tick. The way this works is intended to only have things recalculate when it's necessary, rather than calling it every move.
However, I've left movement_delay() in, as without completely redoing a lot of code it's not /quite/ ready at this point to tear it out completely, but I'm hoping everything can be transitioned over to this system later.
By moving our logging to a DLL we see a drop in CPU/real time of 2-3 orders of magnitude. This is due to BYOND opening and closing file handles on every write, causing incredible amounts of unneeded overhead. The logging library also handles timestamps for us, further increasing performance gains.
This library will also allow for further offloading in the future, such as completely replacing file2text() and friends.
A pre-compiled DLL is bundled, but Linux users will have to compile manually. Directions can be found at the rust-g repo.
Log output is enhanced with millisecond time stamps:
[2018-04-01 15:56:23.522] blah blah blah
This includes runtimes as well, which benefit from the same timestamp improvements and no longer have hacky splitting code to add their own timestamps.
Log shutdown is handled in a dedicated proc called as late as possible, as rust-g integration expands this will be factored out into a generic native code shutdown proc.
* Remove ZLEVEL_STATION_PRIMARY
* Add Up and Down traits for use by ladders and chasms
* Give map_config creation its own proc
* Combine LoadConfig and ValidateJSON and remove transition_config
* Make space linkage a z-level trait
* Remove ZLEVEL_EMPTY_SPACE
* Update uses of GetFullMapPath
* Handle multi-Z stations and load Lavaland and Reebe at runtime
* Remove unused space maps
* Fix inappropriate z-expansion in map reader, improve logging
* Update comments relating to z-level configuration
* Add Lavaland and Reebe to ALL_MAPS