Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update from the Official Antistasi Community GitHub #1

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Binary file not shown.
8 changes: 4 additions & 4 deletions AntistasiServerUtility/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ class CfgPatches
{
// Meta information for editor
name = "Antistasi Server Utility";
author = "Sparker";
author = "Initial author Sparker - modified by the official antistasi community";
url = "";

// Minimum compatible version. When the game's version is lower, pop-up warning will appear when launching the game.
requiredVersion = 1.60;
requiredVersion = 1.60;
// Required addons, used for setting load order.
// When any of the addons is missing, pop-up warning will appear when launching the game.
requiredAddons[] = {};
Expand All @@ -30,11 +30,11 @@ class CfgFunctions
file = "AntistasiServerUtility\fn_init.sqf";
preInit = 1;
};

class onPlayerConnected
{
file = "AntistasiServerUtility\fn_onPlayerConnected.sqf";
};
};
};
};
};
39 changes: 24 additions & 15 deletions AntistasiServerUtility/fn_init.sqf
Original file line number Diff line number Diff line change
@@ -1,31 +1,40 @@
diag_log "[ASU] Info: AntistasiServerUtility addon: init";

ASU_serverMode = "NONE";
ASU_TSChannelName = ""; // Name of the TFAR channel for this server
ASU_serverMode = "NONE"; // this sets the initial value for the servermode to NONE
ASU_TSChannelName = ""; // Name of the TFAR channel for this server - sets initial value to nill
ASU_TSChannelPassword = ""; // Password of the TFAR channel for this server - sets initial value to nill - added by Bob Murphy 31.03.2020

switch (serverName) do { // Tell me your name!

// Hardcore server
// Where is my RPG!
case "A3-Antistasi Official US 1 - hardcore": {
diag_log "[ASU] Info: hardcore server detected";
ASU_serverMode = "HARDCORE";
ASU_TSChannelName = "Task Force Radio US1";
case "A3-Antistasi Official US 1 - hardcore": { //here has to be the exact name of the game-server
diag_log "[ASU] Info: hardcore server detected"; // this is a custom log line which you can adapt for your needs
ASU_serverMode = "HARDCORE"; // if set to "HARDCORE" this enables the settings in ASU_fnc_onPlayerConnected which can disable ingame channels
ASU_TSChannelName = "Task Force Radio US1"; //here has to be the exact name of the TS channel you intent to use as your radiochannel
ASU_TSChannelPassword = "123"; // added by Bob Murphy 31.03.2020
};

// Casual server
// Don't shoot me or I will cry!
case "A3-Antistasi Official EU 2 - casual": {
ASU_serverMode = "CASUAL";
ASU_TSChannelName = "Task Force Radio EU2";
diag_log "[ASU] Info: casual server detected";
case "A3-Antistasi Official EU 2 - casual": { //here has to be the exact name of the game-server
diag_log "[ASU] Info: casual server detected"; // this is a custom log line which you can adapt for your needs
ASU_serverMode = "CASUAL"; // if set to "HARDCORE" this enables the settings in ASU_fnc_onPlayerConnected which can disable ingame channels
ASU_TSChannelName = "Task Force Radio EU2"; //here has to be the exact name of the TS channel you intent to use as your radiochannel
ASU_TSChannelPassword = "123"; // added by Bob Murphy 31.03.2020
};

default {diag_log format ["[ASU] Error: detected neither hardcore nor casual server! Server name: %1", serverName];
};

default {diag_log format ["[ASU] Error: detected neither hardcore nor casual server! Server name: %1", serverName]; };
};

if (ASU_TSChannelName != "") then {
tf_radio_channel_name = ASU_TSChannelName;
tf_radio_channel_name = ASU_TSChannelName; //for TFAR 0.9.12
tf_radio_channel_password = ASU_TSChannelPassword; //for TFAR 0.9.12
TFAR_Teamspeak_Channel_Name = ASU_TSChannelName; //for TFAR BETA
TFAR_Teamspeak_Channel_Password = ASU_TSChannelPassword; //for TFAR BETA


};

addMissionEventHandler ["PlayerConnected", ASU_fnc_onPlayerConnected];
addMissionEventHandler ["PlayerConnected", ASU_fnc_onPlayerConnected];
11 changes: 9 additions & 2 deletions AntistasiServerUtility/fn_onPlayerConnected.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ params ["_id", "_uid", "_name", "_jip", "_owner", "_hasInterface"];

// Set TS3 channel name for auto move
if (ASU_TSChannelName != "") then {
[missionNamespace, ["tf_radio_channel_name", ASU_TSChannelName]] remoteExecCall ["setVariable", _owner];
[missionNamespace, ["tf_radio_channel_name", ASU_TSChannelName]] remoteExecCall ["setVariable", _owner]; //for TFAR 0.9.12
[missionNamespace, ["TFAR_Teamspeak_Channel_Name", ASU_TSChannelName]] remoteExecCall ["setVariable", _owner]; //for TFAR BETA
};

//Set TS3 channel password for auto move - added by Bob Murphy 31.03.2020
if (ASU_TSChannelName !="") then {
[missionNamespace, ["tf_radio_channel_password", ASU_TSChannelPassword]] remoteExecCall ["setVariable", _owner]; //for TFAR 0.9.12
[missionNamespace, ["TFAR_Teamspeak_Channel_Password", ASU_TSChannelPassword]] remoteExecCall ["setVariable", _owner]; //for TFAR BETA
};

//diag_log "Player connected!";
Expand All @@ -29,4 +36,4 @@ if (ASU_serverMode == "HARDCORE") then {
6-15 = Custom Radio (Is not supported by enableChannel)
*/
[0, false] remoteExecCall ["enableChannel", _owner];
};
};
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Antistasi Server Utility

This is a server side addon we use to customize our servers a bit: set up proper teamspeak channels, disable global chat at the hardcore server, perform performance logging, etc.
This addon is probably of no ineterest for anyone else.
This addon is probably of no interest for anyone else.
The code is now compatible with TFAR 0.9.12 as well as TFAR BETA (updated and tested with version 1.-1.0.325)