DonkeyPunch Community Gaming

Community Forums => DPCG Releases => Topic started by: DirtySanchez on June 24, 2017, 04:00:32 PM

Title: Server Mod Protection by name
Post by: DirtySanchez on June 24, 2017, 04:00:32 PM
A little work I did on a few things in the past that some were asking for me to share.

This allows for you take your server name and whitelist it for your mod to start as well as for the client to play on your server with it.
This does not allow for usage in the editor nor on a server without the proper name or proper set of characters in the name.

Code: [Select]
private ['_reggedOwners'];
_reggedOwners = [
"eXpoch.INFO Tanoa[HTUK]",
"eXpoch.INFO Chernarus[AWG]",
"eXpoch.INFO Chernarus[CG]",
"eXpoch.INFO Altis[DPCG]",
"eXpoch.INFO Altis[RU27]"
];
diag_log "[DonkeyPunch DEBUG]Entering check loop";
DonkeyServerFound = false;
_count = count(_reggedOwners);
for "_s" from 0 to _count-1 do{
_server = _reggedOwners select _s;
if(str serverName find _server > -1)then{
diag_log format["[DonkeyPunch DEBUG]Found Server Partial Name (%1), when compared to actual servername (%2)",_server,serverName];
_s = _count;
DonkeyServerFound = true;
serverLoopFinished = true;
};
if(_s >= (_count-1))then{serverLoopFinished = true;};
};
waitUntil {!isNil "serverLoopFinished"};
if!(DonkeyServerFound)exitWith{
diag_log format["Your server %1, is not a part of the regged server list. Please contact DirtySanchez. DonkeyPunch.INFO for website. TS3.DonkeyPunch.INFO for teamspeak. All DonkeyPunch addons and scripts are the property of DonkeyPunch and without our approval you cannot use/ cannot modify/ cannot redistribute any of our work. This also includes any work provided to the community by the newly formed XLD(eXileLoneDevs) cooperative multi-owner team and it also includes any work done on Anarchy and eXpochA4E. If at any point, we deem you unfit to host any of our releases you can be removed without notice.",serverName];
endMission "Read Your RPT";
};