This is an application and service layer to a L4D2 server, that allows for external events to influence an active server live.
Anything typed in the text box will be sent directly to the server via RCON, with the following exceptions:
reload
- reloads the configuration of the applicationclear
/cls
- clears the console log entirelypause
/unpause
/resume
- if the test service is running, will pause/unpause the test service from generating eventscancel
- cancel all current command eventsrespawn
- respawns all playersaction <actionname> <donor>
- runs this action on the servercommands
- prints the number of events in the queuehelp
- prints out these commands directly to the consoleAll configuration data is stored in a flat file called config.json
. Upon first time running the application, a blank config.json
file will be created for you.
For the most part, these settings are fairly straight forward to fill out. The rest of the sections are explained below.
The actions section is a dictionary with key names that correspond to the RuleName
or SuccessEvent
of a matching rule definition (see Rules section), and the string array
of server commands that should be ran when rules with the given keyname matches.
Acceptable server actions are:
SpawnTank,
SpawnSpitter,
SpawnJockey,
SpawnWitch,
SpawnMob,
SpawnMobSmall,
SpawnMobMedium,
SpawnMobLarge,
SpawnBoomer,
SpawnHunter,
SpawnCharger,
SpawnSmoker,
Lootbox,
SupplyCrate,
HealAllPlayersSmall,
HealAllPlayersLarge,
HealAllPlayersRand,
RespawnAllPlayers,
UppiesPlayers,
RandomPositive,
RandomNegative,
RandomSpecialInfected,
Random
The Random
server action does a coin flip and if heads, will run a RandomPositive
action, if tails, a RandomNegative
action will execute instead.
Here is an example of some actions that are defined in a config file. Names such as "chaos" and "santa" are used in the rules.json
later.
"Actions": {
"chaos": [
"SpawnMobLarge",
"RandomSpecialInfected",
"SpawnCharger"
],
"tank": [
"SpawnTank"
],
"lootbox": [
"Lootbox"
],
"santa": [
"Lootbox",
"Lootbox",
"SupplyCrate"
]
},
These are the ranges for each type of mob spawn size in the server commands list. The Rand
setting is when the mob size is not provided (using SpawnMob
).
These are the weights for each of the negative-based Actions with their weightings from 1-100 on how often they should appear. These are used to calculate what affect is
used when a rule with the action RandomNegative
is executed. If a negative action is not specified, it will not be randomly chosen when RandomNegative
is executed. This field is also used to determine RandomSepcialInfected
roll spawn chances.
rules.json
is an MS RulesEngine formatted file.
The following important notes are:
WorkflowName
has to be one of the services that this application supports. Currently tiltify
or twitch
RuleName
or SuccessEvent
should be the name of one of the actions you have defined in the config.json
file earlier. The system will check for RuleName
matches first and upon failure to match, will check the SuccessEvent
for an action match.Rules can check their input object types against these values to determine actions. These are the types that are supported:
Donation,
Subscription,
Resubscription,
GiftSubscription,
MultiGiftSubscription,
Raid,
ChatCommand
All input objects are data objects that contain the following fields that can be checked against:
The rules can take advantage of some added extensions to the processor to do string based checks. A class named REUtils
is provided to the RulesEngine to help you with string processing.
REUtils.HasValue
- Returns a boolean if the given string has an actual value instead of null/whitespaceREUtils.CheckContains
- Given the input and a string of a value or csv of values, will check if the input contains any of the values in the check. All values will be projected to case-insensitive checks.REUtils.PercentChance
- Given a whole number percentage chance, if the RNG flip is that percentage or lower, returns true[
{
"WorkflowName": "tiltify",
"Rules": [
{
"RuleName": "tank",
"RuleExpressionType": "LambdaExpression",
"Expression": "input1.Type == EventType.Donation AND input1.Amount >= 5.00"
},
{
"RuleName": "santa",
"SuccessEvent": "nothing",
"RuleExpressionType": "LambdaExpression",
"Expression": "input1.Type == EventType.Donation AND REutils.CheckContains(input1.Message, \"help,santa,save\") == true AND input1.Amount > 1.00"
},
{
"RuleName": "EveryCoolAndAwesomeRuleName",
"SuccessEvent": "lootbox",
"RuleExpressionType": "LambdaExpression",
"Expression": "input1.Type == EventType.Donation"
}
]
}
]
In addition to the modifications made in the L4D2Mods directory, the following additional plugins are needed.