forked from VOREStation/VOREStation
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master'
- Loading branch information
Showing
499 changed files
with
43,148 additions
and
5,018 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/*! | ||
* Copyright (c) 2020 Aleksej Komarov | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
/// How many chat payloads to keep in history | ||
#define CHAT_RELIABILITY_HISTORY_SIZE 5 | ||
/// How many resends to allow before giving up | ||
#define CHAT_RELIABILITY_MAX_RESENDS 3 | ||
|
||
#define MESSAGE_TYPE_SYSTEM "system" | ||
#define MESSAGE_TYPE_LOCALCHAT "localchat" | ||
#define MESSAGE_TYPE_PLOCALCHAT "plocalchat" | ||
#define MESSAGE_TYPE_RADIO "radio" | ||
#define MESSAGE_TYPE_NIF "nif" | ||
#define MESSAGE_TYPE_INFO "info" | ||
#define MESSAGE_TYPE_WARNING "warning" | ||
#define MESSAGE_TYPE_VORE "vore" | ||
#define MESSAGE_TYPE_DEADCHAT "deadchat" | ||
#define MESSAGE_TYPE_OOC "ooc" | ||
#define MESSAGE_TYPE_LOOC "looc" | ||
#define MESSAGE_TYPE_ADMINPM "adminpm" | ||
#define MESSAGE_TYPE_MENTORPM "mentorpm" | ||
#define MESSAGE_TYPE_COMBAT "combat" | ||
#define MESSAGE_TYPE_ADMINCHAT "adminchat" | ||
#define MESSAGE_TYPE_PRAYER "prayer" | ||
#define MESSAGE_TYPE_MODCHAT "modchat" | ||
#define MESSAGE_TYPE_RLOOC "rlooc" | ||
#define MESSAGE_TYPE_EVENTCHAT "eventchat" | ||
#define MESSAGE_TYPE_ADMINLOG "adminlog" | ||
#define MESSAGE_TYPE_ATTACKLOG "attacklog" | ||
#define MESSAGE_TYPE_DEBUG "debug" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,78 @@ | ||
//// COOLDOWN SYSTEMS | ||
/* | ||
* We have 2 cooldown systems: timer cooldowns (divided between stoppable and regular) and world.time cooldowns. | ||
* | ||
* When to use each? | ||
* | ||
* * Adding a commonly-checked cooldown, like on a subsystem to check for processing | ||
* * * Use the world.time ones, as they are cheaper. | ||
* | ||
* * Adding a rarely-used one for special situations, such as giving an uncommon item a cooldown on a target. | ||
* * * Timer cooldown, as adding a new variable on each mob to track the cooldown of said uncommon item is going too far. | ||
* | ||
* * Triggering events at the end of a cooldown. | ||
* * * Timer cooldown, registering to its signal. | ||
* | ||
* * Being able to check how long left for the cooldown to end. | ||
* * * Either world.time or stoppable timer cooldowns, depending on the other factors. Regular timer cooldowns do not support this. | ||
* | ||
* * Being able to stop the timer before it ends. | ||
* * * Either world.time or stoppable timer cooldowns, depending on the other factors. Regular timer cooldowns do not support this. | ||
*/ | ||
|
||
|
||
/* | ||
* Cooldown system based on an datum-level associative lazylist using timers. | ||
*/ | ||
|
||
// admin verb cooldowns | ||
#define COOLDOWN_INTERNET_SOUND "internet_sound" | ||
|
||
//TIMER COOLDOWN MACROS | ||
|
||
#define COMSIG_CD_STOP(cd_index) "cooldown_[cd_index]" | ||
#define COMSIG_CD_RESET(cd_index) "cd_reset_[cd_index]" | ||
|
||
#define TIMER_COOLDOWN_START(cd_source, cd_index, cd_time) LAZYSET(cd_source.cooldowns, cd_index, addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(end_cooldown), cd_source, cd_index), cd_time)) | ||
|
||
/// Checks if a timer based cooldown is NOT finished. | ||
#define TIMER_COOLDOWN_RUNNING(cd_source, cd_index) LAZYACCESS(cd_source.cooldowns, cd_index) | ||
|
||
/// Checks if a timer based cooldown is finished. | ||
#define TIMER_COOLDOWN_FINISHED(cd_source, cd_index) (!TIMER_COOLDOWN_RUNNING(cd_source, cd_index)) | ||
|
||
#define TIMER_COOLDOWN_END(cd_source, cd_index) LAZYREMOVE(cd_source.cooldowns, cd_index) | ||
|
||
/* | ||
* Stoppable timer cooldowns. | ||
* Use indexes the same as the regular tiemr cooldowns. | ||
* They make use of the TIMER_COOLDOWN_RUNNING() and TIMER_COOLDOWN_END() macros the same, just not the TIMER_COOLDOWN_START() one. | ||
* A bit more expensive than the regular timers, but can be reset before they end and the time left can be checked. | ||
*/ | ||
|
||
#define S_TIMER_COOLDOWN_START(cd_source, cd_index, cd_time) LAZYSET(cd_source.cooldowns, cd_index, addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(end_cooldown), cd_source, cd_index), cd_time, TIMER_STOPPABLE)) | ||
|
||
#define S_TIMER_COOLDOWN_RESET(cd_source, cd_index) reset_cooldown(cd_source, cd_index) | ||
|
||
#define S_TIMER_COOLDOWN_TIMELEFT(cd_source, cd_index) (timeleft(TIMER_COOLDOWN_RUNNING(cd_source, cd_index))) | ||
|
||
|
||
/* | ||
* Cooldown system based on storing world.time on a variable, plus the cooldown time. | ||
* Better performance over timer cooldowns, lower control. Same functionality. | ||
*/ | ||
|
||
#define COOLDOWN_DECLARE(cd_index) var/##cd_index = 0 | ||
|
||
#define STATIC_COOLDOWN_DECLARE(cd_index) var/static/##cd_index = 0 | ||
|
||
#define COOLDOWN_START(cd_source, cd_index, cd_time) (cd_source.cd_index = world.time + (cd_time)) | ||
|
||
//Returns true if the cooldown has run its course, false otherwise | ||
#define COOLDOWN_FINISHED(cd_source, cd_index) (cd_source.cd_index < world.time) | ||
|
||
#define COOLDOWN_RESET(cd_source, cd_index) cd_source.cd_index = 0 | ||
|
||
#define COOLDOWN_TIMELEFT(cd_source, cd_index) (max(0, cd_source.cd_index - world.time)) | ||
#define COOLDOWN_STARTED(cd_source, cd_index) (cd_source.cd_index != 0) | ||
|
||
#define COOLDOWN_TIMELEFT(cd_source, cd_index) (max(0, cd_source.cd_index - world.time)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#define SEND_TEXT(target, text) DIRECT_OUTPUT(target, text) | ||
#define WRITE_FILE(file, text) DIRECT_OUTPUT(file, text) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
//These are a bunch of regex datums for use /((any|every|no|some|head|foot)where(wolf)?\sand\s)+(\.[\.\s]+\s?where\?)?/i | ||
GLOBAL_DATUM_INIT(is_http_protocol, /regex, regex("^https?://")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/proc/log_href(text) | ||
//WRITE_LOG(GLOB.world_href_log, "HREF: [text]") | ||
WRITE_LOG(href_logfile, "HREF: [text]") | ||
|
||
/** | ||
* Appends a tgui-related log entry. All arguments are optional. | ||
*/ | ||
/proc/log_tgui(user, message, context, | ||
datum/tgui_window/window, | ||
datum/src_object) | ||
var/entry = "" | ||
// Insert user info | ||
if(!user) | ||
entry += "<nobody>" | ||
else if(istype(user, /mob)) | ||
var/mob/mob = user | ||
entry += "[mob.ckey] (as [mob] at [mob.x],[mob.y],[mob.z])" | ||
else if(istype(user, /client)) | ||
var/client/client = user | ||
entry += "[client.ckey]" | ||
// Insert context | ||
if(context) | ||
entry += " in [context]" | ||
else if(window) | ||
entry += " in [window.id]" | ||
// Resolve src_object | ||
if(!src_object && window?.locked_by) | ||
src_object = window.locked_by.src_object | ||
// Insert src_object info | ||
if(src_object) | ||
entry += "\nUsing: [src_object.type] [REF(src_object)]" | ||
// Insert message | ||
if(message) | ||
entry += "\n[message]" | ||
//WRITE_LOG(GLOB.tgui_log, entry) | ||
WRITE_LOG(diary, entry) |
Oops, something went wrong.