Jump to content

[Release] DC Dupe Fix [experimental]


0verHeaT

Recommended Posts

Since a special method for duplicting his own gear on Arms 2 Epoch has become quite popular the last month, I though about a possible way to stop this.
The so-called DC dupe allows any player to dupe their entire gear at any storage unit.
I don't think I have to explain this more clearer cause the most of you guys know how it works.
 
How would you stop the player from duping?
 
My solution:
 
Whenever a player opens his gear menu infront of any storage unit, he sets temporary variable (boolean) to the storage unit. 
After closing the gear dialog the variable is set through publicVariables to false.
That means, if a player has lost his connection the variable can't be set to false and this will be reported to the server logs.
Additionally the server checks if a player has lost the connection after closing the gear dialog (with 'isPlayer' command).
If the 'isPlayer' command does not return a player, we know that he is trying to dupe and we can delete the duped gear.
 
Theoretically this sounds quite convincing, but keep in mind that this is only experimental at the moment.
Thus this script is recommended for advanced server owners only, because it can cause huge errors if it is not installed correctly!
If you find any bugs or errors, please report them here!
 
Link to comment
Share on other sites

I like the idea, but I'd suggest staying away from public vars since they adds to network traffic, this will cause problems on populated servers, since almost everything is kinda a "container" (sry didn't see your code if you whitelist objects to be checked).

 

However, your fix could be applied in a different scope - outside of missionNamespace, these namespace variables persists even while players are not connected to server.

http://killzonekid.com/arma-scripting-tutorials-variables-part-2/

Scroll down to see the goodies.

 

If you want logs, you can just send them to server when duping is detected locally, I guess.

Link to comment
Share on other sites

That's right, the increased network traffic will a problem this solution is causing. I don't know how big these influences are since i did not tested it on a full server.

 

Your idea, to solve this by using namespaces sounds promising. I'm gonna look at this soon to see whether it is possible or not.

Link to comment
Share on other sites

How Come "PVDZE_deb" , and not  "PVDZE_dupe"

 

You can still add _isUnconscious

 

private ["_cTarget","_isOk","_display","_inVehicle","_isUnconscious"];
disableSerialization;
_display = (_this select 0);
_inVehicle = (vehicle player) != player;
_cTarget = cursorTarget;
_isUnconscious = player getVariable ["NORRN_unconscious",false];

if (_isUnconscious) exitWith {
	if (alive player) then {
		if (isPlayer player && _isUnconscious) then {
			_display closeDisplay 1;
			systemChat ( "You unconscious." );
			player setVariable["combattimeout", time + 10, true];
			player setVariable["startcombattimer", 0];
			dayz_combat = 1;
		};
	};
};
if(_inVehicle) then {
	_cTarget = (vehicle player);
};

_isOk = false;
{
	if(!_isOk) then {
		_isOk = _cTarget isKindOf _x;
	};
} forEach ["LandVehicle","Air", "Ship"];

if((locked _cTarget) && _isOk && (((vehicle player) distance _cTarget) < 12)) then {
	cutText [(localize "str_epoch_player_7") , "PLAIN DOWN"];
	_display closeDisplay 1;
};


if (inSafeZone and _cTarget isKindOf "Man" and alive _cTarget and (((vehicle player) distance _cTarget) < 12)) then {
	cutText ["Cannot access other players gear in the safezone." , "PLAIN DOWN"];
	_display closeDisplay 1;	
[_cTarget] spawn {
	private ["_transportMax","_obj"];
	_obj = _this select 0;
	if (vehicle player != player || isPlayer _obj) exitWith {};

	_transportMax = (getNumber (configFile >> "CfgVehicles" >> (typeof _obj) >> "transportMaxWeapons") + getNumber (configFile >> "CfgVehicles" >> (typeof _obj) >> "transportMaxMagazines") + getNumber (configFile >> "CfgVehicles" >> (typeof _obj) >> "transportMaxBackpacks"));
	if (_transportMax < 1 || (typeOf _obj) == "WeaponHolder") exitWith {};

	if (isNil "GearDisplay") then {GearDisplay = false;};
	if (isNil "DupeObject") then {DupeObject = objNull;};
	
	if (GearDisplay/* && _obj == DupeObject*/) exitWith {
		waitUntil {str(FindDisplay 106) == "Display #106"};
		(FindDisplay 106) closeDisplay 0;
		cutText["\n\nPlease wait a moment to open your gear!","PLAIN DOWN"];
	};
	
	waitUntil {str(FindDisplay 106) == "Display #106"};
	
	GearDisplay = true;
	DupeObject = _obj;
	PlayervarName = "DupeVar_" + (getPlayerUID player);
	if (DupeObject getVariable [PlayervarName,false]) then {
		PVDZE_deb = [player,DupeObject,"dcdupe"];
		publicVariableServer "PVDZE_deb";
	};
	uiSleep 0.2;
	DupeObject setVariable [PlayervarName,true,true];

	waitUntil {str(FindDisplay 106) == "No Display"};

	uiSleep 0.2;
	PVDZE_deb = [player,DupeObject,"dupeCheck"];
	publicVariableServer "PVDZE_deb";
	uiSleep 1.2;
	PVDZE_deb = [player,"","dupeVar"];
	publicVariableServer "PVDZE_deb";
	uiSleep 1.4;
	if (DupeObject getVariable [PlayervarName,true]) then {(findDisplay 46) closeDisplay 0;};
	GearDisplay = false;
	DupeObject = objNull;
}; 

Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...