Jump to content

[Release] DC Dupe Fix [experimental]

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!

Share this post

Link to post
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.


Scroll down to see the goodies.


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

Share this post

Link to post
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.

Share this post

Link to post
Share on other sites

How Come "PVDZE_deb" , and not  "PVDZE_dupe"


You can still add _isUnconscious


private ["_cTarget","_isOk","_display","_inVehicle","_isUnconscious"];
_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;

Share this post

Link to post
Share on other sites

i would make it were

["<OCG - REMOTE>: %1, Duping is a non-excusable offence! Stop it or you will be banned!",(name _player)];
["<OCG - REMOTE>: %1,%2, Duping is a non-excusable offence! Stop it or you will be banned!",(name _player),(getPlayerUID player)];

Share this post

Link to post
Share on other sites

Which filter does !="PVDZE_dupe" go in and which line?


I followed the steps exactly, the server just hangs after loading up and I can't get in....

Edited by Tricks

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Advertisement
  • Supporters
  • Discord

  • Create New...