Commit Graph

48 Commits

Author SHA1 Message Date
Jordan Brown
cd22f91ddf 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.
2021-01-10 00:04:58 -03:00
TiviPlus
0eaab0bc54 Grep for space indentation (#54850)
#54604 atomizing
Since a lot of the space indents are in lists ill atomize those later
2020-11-30 12:48:40 -05:00
Tad Hardesty
89b4e01680 Fix various issues with browser statpanel (#53263)
* Keep tab buttons in view when scrolled down
* Unfocus tab buttons after click so scrollbar keeps working
* Fix some subsystem stat entries
* Improve key passthrough
* Fix runtimes from nulls in AI connected_robot list
* Add missing info in MC tab for global/config/etc.
* Fix #53298 by including turf in alt-click menu
2020-08-29 23:51:42 -03:00
Aleksej Komarov
0e1b20e6db tgchat (#52426)
Replaces goonchat with a tgui based chat panel

    Fixes #52898
    Fixes #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.
2020-08-14 13:21:40 +12:00
Kyle Spier-Swenson
8df93ba39e [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
2020-08-12 13:51:43 +12:00
jdawg1290
62676e72a8 Force LF line endings with gitattributes and convert repo (#52266)
Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
2020-07-16 03:02:40 +03:00
MrPerson
f7eb2c905b Unicode awareness Part 2 -- copytext() (#48512)
* 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
2020-01-18 13:07:22 +13:00
spookydonut
4e8ff18b07 Fix Travis grep script to use PCRE to actually match things (#47065)
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.
2019-10-19 10:21:05 -07:00
AnturK
6c2a6e8d64 Supresses policy file runtime but messages admins about it. 2019-07-07 21:28:21 +02:00
JJRcop
938789d0a7 [READY] Blocked words tell you which ones (#44728)
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
2019-06-29 21:09:56 +12:00
Unknown
62edbcf64f Satisfies the fruit 2019-06-19 19:48:08 -06:00
Unknown
8e65bb63c4 Config 2019-06-19 18:39:34 -06:00
AnturK
69ac935bde Upgrades policy config + policy verb. (#44296)
* Upgrades policy config + policy verb.

* Better example and proper default value.

* hr on top

* Cleanup
2019-06-10 11:51:25 -04:00
TheChosenEvilOne
a66126d7e3 Add map voting (#44244)
- Add map voting
- Rename config option for preferred map weighted map selection
2019-06-04 23:55:14 +02:00
Tad Hardesty
55db6f8761 Remove misleading THIS_PROC_TYPE macro 2019-03-06 18:28:42 -08:00
Mike Long
8dc15f30d1 Fixes errant capitalization based compile error 2018-10-13 18:35:04 -04:00
Mike Long
ca088fbe19 Fixes gamemode reports to not generate duplicates when there's a gamemode subtype. 2018-10-13 18:28:56 -04:00
kevinz000
230e47c0ea Configuration entry refactor! (#39608)
* Config entry refactor

* Fixes

* Update configuration.dm
2018-08-10 15:44:14 -04:00
kevinz000
5f4b418eaa Movespeed Modification System (#39181)
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.
2018-08-09 16:55:15 -04:00
Jordan Brown
09860c0169 Fixes config loading (#39126)
* Aww geez rick

* breh
2018-07-14 03:06:08 -04:00
Jordan Brown
6afa81c207 Adds world parameter to change the config directory (#39073) 2018-07-13 17:04:15 -07:00
Jordan Brown
f7450d20c7 Trims config entries (#38973) 2018-07-08 18:51:15 -04:00
Jordan Brown
256c1de736 Adds config deprecation system (#38667) 2018-06-27 17:09:29 +03:00
Jordan Brown
fda578cc22 Legacy config warning only happens if any legacy configs are present (#38421) 2018-06-12 19:19:00 -07:00
Bjorn Neergaard
d7966ced09 Use a rust DLL for logging (#36858)
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.
2018-04-11 10:01:31 +12:00
Jordan Brown
115dc80813 Fix an error message grammer 2018-04-09 12:48:32 -05:00
Jordan Brown
9e81c92e4c Fix config loading exploit (#36286) 2018-03-10 14:51:32 -06:00
Tad Hardesty
bbe4d12d13 Support stations with multiple z-levels (#35339)
* 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
2018-02-15 10:21:25 +01:00
Kyle Spier-Swenson
f94f49009a Fixes map configuration values for nonexistent maps applying to box
This caused box'es min pop to get set to 50 because all of the servers still had cere defined with that limitation.
2018-02-09 18:12:05 -06:00
Robustin
ee87af19f0 Disentangles Command Reports from Metagame (#35192)
* False report fix

* Less Accurate Command Report
2018-02-04 02:10:20 -06:00
Jordan Brown
30f3156ce2 Rename /datum/config_entry/var/value to config_entry_value (#34699)
This works around some vv-fu you can use to pass in a config_entry to a proc that reads the value var of some other datum. Byond is stupid enough to actually read it, so it must be uniquely named.
2018-01-24 16:40:28 -05:00
Jordan Brown
015258d01c Config dir again except this time it works (#34606)
* Revert "Revert "Fix config_dir usage (#34469)""

* Make config exist before world/New but not load it until then
2018-01-21 19:32:12 +01:00
oranges
48575ccf70 Revert "Fix config_dir usage (#34469)"
This reverts commit 7be3d32290.
2018-01-19 01:26:40 +00:00
Jordan Brown
7be3d32290 Fix config_dir usage (#34469)
* Makes things use GLOB.config_dir

* GLOB.config_dir => global.config.directory

* Fix /datum/configuration
2018-01-19 11:55:09 +13:00
Cyberboss
6fe468e3b4 Moves load_motd to config controller 2018-01-15 10:44:25 -05:00
Jordan Brown
b9b9495071 Fixes configuration not loading 2018-01-10 20:10:32 -05:00
Jordan Brown
dcfa5ad867 Stops the config warnings when there's no config.txt 2018-01-09 10:54:44 -05:00
Jordan Brown
059a07aac6 Fixes LoadEntries return value 2017-12-15 10:50:58 -05:00
Jordan Brown
8c537ea377 Adds config inclusion system (#33307)
* Adds config inclusion system

* Revert debug code

* Fix bad braces

* Remove unused var

* Tested, working

* Config fixes
2017-12-14 18:23:10 -05:00
Robustin
a1b2c1bf02 Simpler way to standardize reports 2017-12-05 11:16:51 -05:00
Emmett Gaines
825ab4def4 [512] The great \ref purge (#31824)
* The great \ref purge

* cleanup
2017-10-28 17:20:04 -04:00
ACCount
5c7b3d20e6 Fixes ValidateAndSet being called with non-string values 2017-10-18 06:02:55 +03:00
Jordan Brown
0d6d6efaca Makes config loading messages consistent 2017-10-08 16:17:23 -04:00
Jordan Brown
961cd07284 Fixes adding bad config entries (#31390) 2017-10-07 20:13:51 -04:00
JJRcop
f8951911b1 Hosts can lock config options from admins (#31254)
* Hosts can lock config options from admins

* Optimization of LoadEntries

a very very very small one
2017-10-05 08:58:55 +13:00
Jordan Brown
dd10fd56a2 Maplist is loaded regardless of maprotation config setting (#31172)
* Uncomments map rotation in default config

* Maplist is loaded regardless of maprotation config setting

Also logs loading of the map file
2017-10-02 09:27:23 +13:00
Cyberboss
49e2e4daac Fixes config reading exploit 2017-09-30 10:30:19 -04:00
Jordan Brown
4178c209f1 Configuration datum refactor (#30763)
* Configuration datum refactor

* More WIP

* New easier on the eyes format

* More WIP

* Finished config.txt

* Fucktons more WIP

* The end of conversion draws near...

* Add all this shit

* Done converting entries finally

* Hunting down compile errors

* More WIP

* MORE CONVERSIONS

* More WIP

* More WIP

* Oh shit only 90 errors this time!

* IT COMPILES!!!

* Fixes world start runtimes
2017-09-29 15:36:51 +13:00