diff --git a/GameFiles/GameInterface/_integration_t6_file_bus.gsc b/GameFiles/GameInterface/_integration_t6_file_bus.gsc new file mode 100644 index 000000000..bf3a9a1d2 --- /dev/null +++ b/GameFiles/GameInterface/_integration_t6_file_bus.gsc @@ -0,0 +1,73 @@ +/********************************************************************************* + * DISCLAIMER: * + * * + * This script is optional and not required for * + * standard functionality. To use this script, a third-party * + * plugin named "t6-gsc-utils" must be installed on the * + * game server in the "*\storage\t6\plugins" folder * + * * + * The "t6-gsc-utils" plugin can be obtained from the GitHub * + * repository at: * + * https://github.com/fedddddd/t6-gsc-utils * + * * + * Please make sure to install the plugin before running this * + * script. * + *********************************************************************************/ + +/********************************************************************************* + * FUNCTIONALITY: * + * * + * This script extends the game interface to support the "file" * + * bus mode for Plutonium T6, which allows the game server and IW4M-Admin * + * to communicate via files, rather than over rcon using * + * dvars. * + * * + * By enabling the "file" bus mode, IW4M-Admin can send * + * commands and receive responses from the game server by * + * reading and writing to specific files. This provides a * + * flexible and efficient communication channel. * + * * + * Make sure to configure the server to use the "file" bus * + * mode and set the appropriate file path to * + * establish the communication between IW4M-Admin and the * + * game server. * + * * + * The wiki page for the setup of the game interface, and the bus mode * + * can be found on GitHub at: * + * https://github.com/RaidMax/IW4M-Admin/wiki/GameInterface#configuring-bus-mode * + *********************************************************************************/ + +Init() +{ + thread Setup(); +} + +Setup() +{ + level waittill( level.notifyTypes.sharedFunctionsInitialized ); + level.overrideMethods[level.commonFunctions.getInboundData] = ::GetInboundData; + level.overrideMethods[level.commonFunctions.getOutboundData] = ::GetOutboundData; + level.overrideMethods[level.commonFunctions.setInboundData] = ::SetInboundData; + level.overrideMethods[level.commonFunctions.setOutboundData] = ::SetOutboundData; + scripts\_integration_base::_SetDvarIfUninitialized( level.commonKeys.busdir, GetDvar("fs_homepath") ); +} + +GetInboundData(location) +{ + return readFile( location); +} + +GetOutboundData(location) +{ + return readFile( location ); +} + +SetInboundData(location, data ) +{ + writeFile( location, data ); +} + +SetOutboundData(location, data ) +{ + writeFile(location, data ); +} diff --git a/IW4MAdmin.sln b/IW4MAdmin.sln index 1b05d620f..e46ad4273 100644 --- a/IW4MAdmin.sln +++ b/IW4MAdmin.sln @@ -87,6 +87,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GameInterface", "GameInterf GameFiles\GameInterface\_integration_t6.gsc = GameFiles\GameInterface\_integration_t6.gsc GameFiles\GameInterface\_integration_t6zm_helper.gsc = GameFiles\GameInterface\_integration_t6zm_helper.gsc GameFiles\GameInterface\example_module.gsc = GameFiles\GameInterface\example_module.gsc + GameFiles\GameInterface\_integration_t6_file_bus.gsc = GameFiles\GameInterface\_integration_t6_file_bus.gsc EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AntiCheat", "AntiCheat", "{AB83BAC0-C539-424A-BF00-78487C10753C}"