Commit Graph

26 Commits

Author SHA1 Message Date
SkyratBot
11acb0c634 [MIRROR] Fix startup double runtimes again (#2607)
* 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>
2021-01-10 08:21:34 +01:00
SkyratBot
b8d9874c27 [MIRROR] Converts all A && A.B into A?.B (#1292)
* Converts A && A.B into A?.B (#54342)

Implements the ?. operator, replacing code like A && A.B with A?.B

BYOND Ref:
When reading A?.B, it's equivalent to A && A.B except that A is only evaluated once, even if it's a complex expression like a proc call.

* Converts all A && A.B into A?.B

Co-authored-by: ZeWaka <zewakagamer@gmail.com>
2020-10-13 23:19:25 +02:00
Kyle Spier-Swenson
9d19c4a877 Fix gib_stack_trace printing to runtime logs (#51961)
I forgot a return
2020-07-02 19:18:16 -04: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
Kyle Spier-Swenson
2cace871d8 Handle OoM errors (#43349)
Sometimes a reason 1 restart will work to fix these for servers without
tgs3.

This works on tgs3 even though the api sleeps, this will likely not work on
tgs4. In those cases the world/Reboot call will likely still bring the
server back up to a functional point that an admin can do a tgs restart via
the verb.

There is no point in attempting to notify clients, every attempt at doing
so failed.
2019-04-08 00:03:15 -07:00
vuonojenmustaturska
7504a6a776 Puts the custom error handler behind its own define (#40086)
* henk

* wops forgot a commit

* Update world.dm

* Update _logging.dm

* now it works, tested

* Update _compile_options.dm

* Update _compile_options.dm
2018-09-07 12:02:00 +02:00
Patrick Chieppe
2c8248575a Logging system refactor and improvement (#39521)
* Refactor several log lines to use datum_info_line and atom_loc_line

* Add default return strings from datum_info_line and atom_loc_line

* Add parentheses around atom_loc_line data

* Change more logs to use atom_loc_line

* Add check in atom_loc_line for turfs to avoid calling get_turf on them

* Re-add removed 'at'

* Replace datum_info_line with key_name and atom_loc_line with loc_name

* Refactor logging functions

* Avoid double-logging self-interactions

* Fallback to simple stringification if all else fails in key_name()

* Rewrite muscle spasm logging to use log_message

* Standardize logging of martial arts

* Tweak individual logging panel look

* Fix individual logging panel source

* When I typed || I really meant &&

* Fix Telecomms logging always showing client logs in the panel

* Reverts addition of buggy ownership log to panel

* Remove colon

* Fix missing log_directed_talk tag

* Add warning for missing type in log_direted_talk

* Change warnings to stack_traces

* Add square brackets around fallthrough key_name() case to help parsing

* Allow atom arguments/src in log_*() functions

* Change log_combat call with null argument to log_message

* Change mecha types' log_message() arguments to match atom and mob version

* Add key_name() case for atoms

* Fix resist_grab() unsetting pulledby before log_combat gets a chance to use it

* Fix log_globally logic

* Add logging for hitting objects with items

* Move log_combat() to atoms.dm

* Use utility functions for object stringification in log_combat()

* Use utility functions for object stringification in log_combat()

* Add missing logs for interacting with display cases

* Rewrite log_combat() comment

* Add missing space in log_combat()

* Add logging for hitting grilles barehanded

* Add missing ..()
2018-08-12 21:41:09 +02:00
AnturK
ed3ecbbb54 Readds dropped #endif (#37174) 2018-04-13 23:10:56 -04: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
vuonojenmustaturska
440e888c1f Clean up all sorts of crap, mostly defines (#36105)
* cleanbot

* rejuv

* more crap

* more crap

* still compiles

* clean

* is_crap
2018-03-05 02:07:27 +11:00
Jordan Brown
eef2e403a0 Fix world/Error() trying to read config before it loads 2018-02-15 09:39:03 -05:00
Jordan Brown
1fbea727bd Fix GLOB setup runtimes not affecting the counter (#35644) 2018-02-15 01:53:07 -05: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
Cyberboss
d615b56be4 Revert "Remove unit tests"
This reverts commit 69e27bb76ff78af47d2c1b4b8faf91d8b5f9b128.
2018-01-19 11:55:12 -05:00
Jordan Brown
bf7938cfdf Adds test run mode. Fails travis if it fails (#34198)
* Adds test run

* Add OVERRIDE_LOG_DIRECTORY_PARAMETER

* Fails travis if a test run fails

* Fix travis looping

* Move the unit tests behind a define

* Fix various test run things

* Remove the DEBUG check because that's just you shooting yourself in the foot

* Adds readability spacing. Makes RunUnitTests a generic proc

* Remove unit tests
2018-01-19 11:53:26 -05:00
MrStonedOne
f2985e4856 Adds a system to get a stack trace as a list. 2018-01-18 15:31:22 -08:00
Emmett Gaines
825ab4def4 [512] The great \ref purge (#31824)
* The great \ref purge

* cleanup
2017-10-28 17:20:04 -04:00
Kyle Spier-Swenson
71b37be699 Hacky temp workaround of byond bug preventing logging of stack overflow runtimes (#31900)
* Workaround bug preventing logging of stack overflow runtimes

* I APOLOGIZE FOR NOTHING!
2017-10-20 10:13:48 +13: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
ShizCalev
74f5a8c904 DisplayTimeText mk2 (#30969)
* Adds new helper, DisplayTimeText

* Removed unused define

Thought it would've been nice to have for the future, but I guess it's
fine to go without it.

* CBB

* Revamp

* Early returns

* More cleanup

* Proc cleanup

* Makes fraction only show if seconds is < 1

* Last cleanup

* Revert

* Corrected incorrect round time.

Dunno how nobody ever caught that it was incorrect on live servers, gg.
2017-09-24 19:58:58 -04:00
shizcalev
81e5154a70 Various grammar fixes 2017-09-17 01:46:41 -04:00
Jordan Brown
84b1e3d71e [s] Adds a security token to all admin hrefs (#29839)
There's a certain issue of people spoofing real byond links to admins. Now all links should come with a generated key that is validated when the Topic is run.

Added DEBUG_ADMIN_HREFS to debug this system while we test it (Allows hrefs without tokens and complains about it in the logs)

Just add [HrefToken()] as a parameter to all admin hrefs. Anything that ends up running through VV or Holder will be verified
2017-09-09 12:15:53 +10:00
Jordan Brown
d1ae0a0c95 Adds helpers to avoid << use (#29611) 2017-08-09 00:27:54 -03:00
Jordie0608
69a07b5ecf persistent investigate and game logs separated by round ID 2017-04-27 22:10:51 +10:00
Cyberboss
9e1ef0ffe2 Global variable wrappers (#25325)
* Add the system for managed global variables

* Travis ban old globals

* So you CAN inline proccall, that's neat

* Fix that

* master.dm

* Remove the hack procs

* Move InitGlobals to the proper spot

* configuration.dm

* Fix the missing pre-slash

* clockcult.dm

* This is probably for the best

* Doy

* Fix shit

* Rest of the DEFINES tree

* Fix

* Use global. for access

* Update find_references_in_globals

Always hated that proc

Whoever made it must've bee a r e a l idiot...

* __HELPERS tree

* Move global initialization to master.

Fix the declaration

* database.dm

* Dat newline

* I said DECLARATIVE order!

* Here's something you can chew on @Iamgoofball

* game_modes.dm

* Fix this

* genetics.dm

* flavor_misc.dm

* More stuff

* Do it mso's way. Keep the controllers as global

* Make master actually see it

* Fix

* Finish _globalvars/lists

* Finish the rest of the _globalvars tree

* This is weird

* Migrate the controllers

* SLOTH -> GLOB

* Lighting globals

* round_start_time -> ticker

* PAI card list -> pai SS

* record_id_num -> static

* Diseases list -> SSdisease

* More disease globals to the SS

* More disease stuff

* Emote list

* Better and better

* Bluh

* So much stuff

* Ahh

* Wires

* dview

* station_areas

* Teleportlocs

* blood_splatter_icons

* Stuff and such

* More stuff

* RAD IO

* More stuff and such

* Blob shit

* Changeling stuff

* Add "Balance" to changelogs

* Balance for changelog compiler + Auto Tagging

* Update the PR template

* hivemind_bank

* Bip

* sacrificed

* Good shit

* Better define

* More cult shit

* Devil shit

* Gang shit

* > borers

Fix shit

* Rename the define

* Nuke

* Objectives

* Sandbox

* Multiverse sword

* Announce systems

* Stuff and such

* TC con

* Airlock

* doppllllerrrrrr

* holopads

* Shut up byond you inconsistent fuck

* Sneaky fuck

* Burp

* Bip

* Fixnshit

* Port without regard

* askdlfjs;

* asdfjasoidojfi

* Protected globals and more

* SO MANY

* ajsimkvahsaoisd

* akfdsiaopwimfeoiwafaw

* gsdfigjosidjfgiosdg

* AHHHHHHHHHHHHHHHHHHHHHHH!!!!!

* facerolll

* ASDFASDFASDF

* Removes the unused parts of dmm_suite

* WIP

* Fix quote

* asdfjauwfnkjs

* afwlunhskjfda

* asfjlaiwuefhaf

* SO CLOSE

* wwwweeeeeewwwww

* agdgmoewranwg

* HOLY MOTHER OF FUCK AND THATS JUST HALF THE JOB?!?

* Fix syntax errors

* 100 errors

* Another 100

* So many...

* Ugh

* More shit

* kilme

* Stuuuuuufffff

* ajrgmrlshio;djfa;sdkl

* jkbhkhjbmjvjmh

* soi soi soi

* butt

* TODAY WE LEARNED THAT GLOBAL AND STATIC ARE THE EXACT SAME FUCKING THING

* lllllllllllllllllllllllllllllllllllllllllll

* afsdijfiawhnflnjhnwsdfs

* yugykihlugk,kj

* time to go

* STUFFF!!!

* AAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHHHH!!!!!!!!!!!!!!!!!!!!!!!

* ngoaijdjlfkamsdlkf

* Break time

* aufjsdklfalsjfi

* CONTROL KAY AND PRAY

* IT COMPILEELEELELAKLJFKLDAFJLKFDJLADKJHFLJKAJGAHIEJALDFJ!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

* Goteem

* Fix testing mode

* This does not belong in this PR

* Convert it to a controller

* Eh, fuck this option

* Revert controllerization Ill do it some other time

* Fix

* Working controllerization

* FOR THE LOVE OF CHRIST PROTECT THE LOGS

* Protect admins and deadmins

* Use the inbuilt proc
2017-04-06 23:26:13 -06:00
Leo
9c6803ae19 Ports Paradise error handler, with in game runtime viewer! (#24036)
* Ports paradise error handler, with in game runtime viewer!

* Changes to the old runtime error and removes inerror reference

* Oops

* Adds a wrapper for world.log so it displays both in the runtime diary and in DD window
2017-02-14 11:39:31 +11:00