Jump to content

Jamie Booth

Member
  • Posts

    7
  • Joined

  • Last visited

Posts posted by Jamie Booth

  1. If you are experiencing issues with players still appearing at the start location to other players, or when multiple people/vehicles are on the elevator and don't get transported correctly, add the following code to the ELE_fnc_activateElevator as per below:

     

    find

    	{ 
    		detach _x; 
    	} forEach _attachments;
    
    

    replace with

    	{ 
    		detach _x; 
    		_dest = getPosATL _x;
    		_x setPosATL _dest;
    	} forEach _attachments;
    
  2. How does it impact server FPS? I assume the images posted in original post is for player FPS.  As I understand it, ARMA2 has an issue with the number of objects in the mission, regardless on whether they are loaded via the mission.sqf, custom content (sqf) or from the object database.  I'm not quite sure what the magic number is, but from my own testing, a standard mission.sqf (Chernarus) with 8k objects in the database is pretty much the ceiling if you want to maintain decent server FPS.

     

    Taking this into consideration, wouldn't the server need to have all objects loaded where there are active players?  I'd be interested to see the impact on processing this would have.  I thought it was just the number of objects in the database and scripted up an automated conversion of database objects to player content, but that didn't solve the server FPS issue, it did decrease the time required to start the server up however ;)

     

    Very interested to see the Server FPS impact - and I say this as our player base had 17k objects (we now have two servers, a builders - 600 object build limit one and a performance one - 1 plot pole and 50 object build limit).

  3. Sorry for taking so long to reply:

     

    This is what I'm doing for player content:

     - player content is an SQF file which contains the players items they have built on the server which have been transferred from the database

     - I have customised the hive and server_monitor.sqf so that it deletes the custom files first, then it processes the players requests (convert to player content, delete from database) and have a MySQL procedure which re-creates the appropriate files (add a call to player_content.sqf in server_functions.sqf which stores a list of player content files to process, and the player content file [playeruid].sqf in a sub-directory) - I've added the stored procedure as an example on how to do this, though I need to update it after installing vector building.

    BEGIN
    		-- Declare the cursor variables
    		DECLARE v_finished INTEGER DEFAULT 0;
    		DECLARE this_playerUID VARCHAR(20) DEFAULT '';
    		-- Create and run the cursor to be used for the player content files
    		DECLARE curP CURSOR FOR
    			SELECT trim(substring(worldspace, locate('",',worldspace,locate('",',worldspace,locate('",',worldspace,locate('",',worldspace))))+3,17)) 
    			FROM player_content 
    			GROUP BY trim(substring(worldspace, locate('",',worldspace,locate('",',worldspace,locate('",',worldspace,locate('",',worldspace))))+3,17)) 
    			ORDER BY trim(substring(worldspace, locate('",',worldspace,locate('",',worldspace,locate('",',worldspace,locate('",',worldspace))))+3,17)) ASC;
    
    		-- Prepare the event handler for the cursor		
    		DECLARE CONTINUE HANDLER FOR NOT FOUND SET v_finished = 1;
    		
    		-- ---------------------------------------------------------------------------------------------
    		-- Configuration Options defined by Instance Only Modify this block
    		-- ---------------------------------------------------------------------------------------------
    		SET @pci_filePath = 'C:\\\\z\\\\addons\\\\dayz_server\\\\init\\\\pc_init.sqf';
    		SET @pc_directory = 'C:\\\\z\\\\addons\\\\dayz_server\\\\buildings\\\\player_content\\\\\\';
    		-- ---------------------------------------------------------------------------------------------
    		-- DO NOT CHANGE BELOWobject_data
    		-- ---------------------------------------------------------------------------------------------
    
    		-- Make sure other queries will work with this sproc
    		SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
    		
    		-- Keep everything in a transaction to avoid data corruption and Process the tag options in the database
    		START TRANSACTION;
    			-- Archive objects to be delete
    			REPLACE INTO `object_archive` (`ObjectID`,`ObjectUID`,`Instance`,`Classname`,`Datestamp`,`LastUpdated`
    				,`CharacterID`,`Worldspace`,`Inventory`,`Hitpoints`,`Fuel`,`Damage`)
    			SELECT	`ObjectID`,`ObjectUID`,`Instance`,`Classname`,`Datestamp`,`LastUpdated`,`CharacterID`
    				,`Worldspace`,`Inventory`,`Hitpoints`,`Fuel`,`Damage`
    			FROM `object_data`
    			WHERE	LEFT(RIGHT(`worldspace`,2),1) IN (1,2)
    				AND	`worldspace` like '%","%';
    
    			-- Delete objects tagged as delete
    			DELETE FROM `object_data`
    			WHERE	LEFT(RIGHT(`worldspace`,2),1) = 2;
    			
    			-- Move player content to player_content table
    			INSERT INTO `player_content` (`ObjectID`,`ObjectUID`,`Instance`,`Classname`,`Datestamp`
    				,`LastUpdated`,`CharacterID`,`Worldspace`,`Inventory`,`Hitpoints`,`Fuel`,`Damage`)
    			SELECT	`ObjectID`,`ObjectUID`,`Instance`,`Classname`,`Datestamp`,`LastUpdated`,`CharacterID`
    				,`Worldspace`,`Inventory`,`Hitpoints`,`Fuel`,`Damage`
    			FROM `object_data`
    			WHERE	LEFT(RIGHT(`worldspace`,2),1) = 1
    				AND	worldspace like '%","%';
    			
    			-- Delete migrated objects
    			DELETE FROM `object_data`
    			WHERE	LEFT(RIGHT(`worldspace`,2),1) = 1
    				AND	worldspace like '%","%';
    			
    			-- Create the include file for player content
    			SET	@sql_text = CONCAT('SELECT CONCAT(\'[] execVM "\\\\z\\\\addons\\\\dayz_server\\\\buildings\\\\player_content\\\\\',trim(substring(worldspace, locate(\'",\',worldspace,locate(\'",\',worldspace,locate(\'",\',worldspace,locate(\'",\',worldspace))))+3,17)),\'.sqf";\') INTO OUTFILE \'',@pci_filePath,'\' FIELDS TERMINATED BY \',\' ESCAPED BY \'|\' LINES TERMINATED BY \'\\n\' FROM player_content GROUP BY trim(substring(worldspace, locate(\'",\',worldspace,locate(\'",\',worldspace,locate(\'",\',worldspace,locate(\'",\',worldspace))))+3,17)) ORDER BY trim(substring(worldspace, locate(\'",\',worldspace,locate(\'",\',worldspace,locate(\'",\',worldspace,locate(\'",\',worldspace))))+3,17)) ASC');
    			PREPARE stmt1 FROM @sql_text;
    			EXECUTE stmt1;
    			DEALLOCATE PREPARE stmt1;
    			
    			OPEN curP;
    			read_loop: LOOP
    				FETCH curP INTO this_playerUID;
    				IF v_finished = 1 THEN LEAVE read_loop;
    				END IF;
    				SET @sql_text = CONCAT('SELECT CONCAT(\'_bldObj = objNull; _bldObj = createVehicle ["\',classname,\'",\',substring(worldspace,locate(\'[\',worldspace,2), (locate(\']\',worldspace,1)+1) - (locate(\'[\',worldspace,2))),\',[],0,"CAN_COLLIDE"]; _bldObj setDir \',replace(substring(worldspace,locate(\'[\',worldspace)+1, (locate(\'[\',worldspace,2)) - (locate(\'[\',worldspace) + case when worldspace like \'["%\' then 3 else 2 end)),\'"\',\'\'),\'; _bldObj setVectorDirAndUp \',substring(worldspace,locate(\'"[\',worldspace)+1,locate(\']"\',worldspace)-locate(\'"[\',worldspace)),\'; _bldObj setPos \',substring(worldspace,locate(\'[\',worldspace,2), (locate(\']\',worldspace,1)+1) - (locate(\'[\',worldspace,2))),\'; _bldObj addEventHandler ["HandleDamage", {false}]; _bldObj enableSimulation false; // \', objectid) INTO OUTFILE \'',@pc_directory,this_playerUID,'.sqf\' FIELDS TERMINATED BY \',\' ESCAPED BY \'\' LINES TERMINATED BY \'\\n\' FROM player_content WHERE trim(substring(worldspace, locate(\'",\',worldspace,locate(\'",\',worldspace,locate(\'",\',worldspace,locate(\'",\',worldspace))))+3,17)) = "',this_playerUID,'"');
    				PREPARE stmt2 FROM @sql_text;
    				EXECUTE stmt2;
    				DEALLOCATE PREPARE stmt2;
    			END LOOP read_loop;
    			CLOSE curP;
    		COMMIT;
    	END
    
    
    

     - There are three global variables I use: Auto-tag, No-tag and AllObjects.

    /*
    This defines the objects that can be tagged, or not tagged.  all objects is used in player_build_countNearby.sqf and plotObjects.sqf for objects to count (instead of all objects, as map content is not applicable)
    */
     
     autoTagObjects = ["BagFenceRound_DZ","CinderWall_DZ","DeerStand_DZ","DesertCamoNet_DZ","DesertLargeCamoNet_DZ","Fence_corrugated_DZ","ForestCamoNet_DZ","ForestLargeCamoNet_DZ","Fort_RazorWire","Hedgehog_DZ","Land_HBarrier1_DZ","Land_HBarrier3_DZ","Land_HBarrier5_DZ","LightPole_DZ","MetalGate_DZ","MetalFloor_DZ","MetalPanel_DZ","Sandbag1_DZ","SandNest_DZ","Scaffolding_DZ","StickFence_DZ","WoodFloorHalf_DZ","WoodFloorQuarter_DZ","WoodFloor_DZ","WoodLadder_DZ","WoodLargeWallWin_DZ","WoodLargeWall_DZ","WoodLargeWallWin_DZ","WoodRamp_DZ","WoodSmallWallThird_DZ","WoodSmallWallWin_DZ","WoodSmallWall_DZ","WoodStairsRails_DZ","WoodStairsSans_DZ","WoodStairs_DZ"]; // These objects will automatically be tagged for archiving
     noTagObjects = ["CanvasHut_DZ","CinderWallDoorLocked_DZ","CinderWallDoorSmallLocked_DZ","CinderWallDoorSmall_DZ","CinderWallDoor_DZ","FireBarrel_DZ","Generator_DZ","GunRack_DZ","Land_DZE_GarageWoodDoor","Land_DZE_GarageWoodDoorLocked","Land_DZE_LargeWoodDoor","Land_DZE_LargeWoodDoorLocked","Land_DZE_WoodDoor","Land_DZE_WoodDoorLocked","M240Nest_DZ","MetalFloor_Preview_DZ","Plastic_Pole_EP1_DZ","StorageShed_DZ","TentStorage","TentStorageDomed","TentStorageDomed2","VaultStorageLocked","WoodCrate_DZ","Wooden_shed_DZ","WoodShack_DZ"]; // These objects can never be tagged for archiving
     allObjects = ["Plastic_Pole_EP1_DZ","BagFenceRound_DZ","CinderWall_DZ","CinderWallHalf_DZ","DeerStand_DZ","DesertCamoNet_DZ","DesertLargeCamoNet_DZ","Fence_corrugated_DZ","ForestCamoNet_DZ","ForestLargeCamoNet_DZ","Fort_RazorWire","Hedgehog_DZ","Land_HBarrier1_DZ","Land_HBarrier3_DZ","Land_HBarrier5_DZ","LightPole_DZ","MetalGate_DZ","MetalFloor_DZ","MetalPanel_DZ","Sandbag1_DZ","SandNest_DZ","Scaffolding_DZ","StickFence_DZ","WoodFloorHalf_DZ","WoodFloorQuarter_DZ","WoodFloor_DZ","WoodLadder_DZ","WoodLargeWallWin_DZ","WoodLargeWall_DZ","WoodLargeWallWin_DZ","WoodRamp_DZ","WoodSmallWallThird_DZ","WoodSmallWallWin_DZ","WoodSmallWall_DZ","WoodStairsRails_DZ","WoodStairsSans_DZ","WoodStairs_DZ","CanvasHut_DZ","CinderWallDoorLocked_DZ","CinderWallDoorSmallLocked_DZ","CinderWallDoorSmall_DZ","CinderWallDoor_DZ","FireBarrel_DZ","Generator_DZ","GunRack_DZ","Land_DZE_GarageWoodDoor","Land_DZE_GarageWoodDoorLocked","Land_DZE_LargeWoodDoor","Land_DZE_LargeWoodDoorLocked","Land_DZE_WoodDoor","Land_DZE_WoodDoorLocked","M240Nest_DZ","MetalFloor_Preview_DZ","StorageShed_DZ","TentStorage","TentStorageDomed","TentStorageDomed2","VaultStorageLocked","WoodCrate_DZ","Wooden_shed_DZ","WoodShack_DZ","WorkBench_DZ"]
    

    Then it's just a modification to player_selfActions.sqf so they can tag the appropriate objects.  I'll be modifying it further so a player can re-load the sqf objects into the database to modify them and then re-process the conversion to player content for the next restart.  So all of this is automated, the only manual component is for the player to tag their objects in-game.  Note, it's a custom hive and I've had to modify the object_data table to varchar(256).

     

    Cheers,

     

    Jamie

  4. Firstly, love the mod - an excellent add-on for epoch.

     

    I've modified this slightly, so that the owner of the object built within the plot is assigned the ownerID of the plot owner unless it is a safe, in which case it uses the player who built it.  This allows me to monitor player build numbers by plot pole to keep an eye on the object count of the server, as we know arma2 can't handle a large number of objects.  And the plot owner is ultimately responsible for the number of objects built within their plot.  I also use plot management so the plot owner can decide who can do what on the plot without having to tag as friendly all the time.

     

    To assist with build times I've also built in functionality to convert player built objects that don't require any interaction to player content - players can tag an item to remain in the database or be converted to player content - this is to help reduce the load times of the server whilst still being able to have the objects on the map.  In doing that, I provide object counts for the player showing:

     - count of database objects against plot build limit

     - count of player content objects

     - count of objects to delete

     - count of total objects

     

    I guess what I'm saying there, is the UI for plot management is handy, and if you are looking to build this in, then it provide greater flexibility.

  5. Thanks for your help Soul, but that still crashes the server.

     

    I commented out the playeruid, so just think of the xxx's as the player uid number.  It's just debug information I print to the arma.rpt file.

    20:39:41 "CHILD:999:SELECT `evacUID`, `objectUID`, `pilotLocation`, `homeLocation`, `homeDir` FROM `evac_choppers` WHERE `playerUID` = '?' :["xxxxxxxxxxxxx"]:"
    =======================================================
    -------------------------------------------------------
    Exception code: C0000005 ACCESS_VIOLATION at 72B2D2EB
    Allocator: C:\Program Files (x86)\Steam\SteamApps\common\DayZ_Server\dll\tbb4malloc_bi.dll
    graphics:  No
    resolution:  160x120x32
    
    
  6. I'm attempting to use the CHILD:999 and CHILD:998 calls for a custom table, but it crashes the server as well with the following error:

    Exception code: C0000005 ACCESS_VIOLATION at 72D7D2EB
    Allocator: C:\Program Files (x86)\Steam\SteamApps\common\DayZ_Server\dll\tbb4malloc_bi.dll
    graphics:  No
    resolution:  160x120x32
    

    This is using a number of key formats:

    format["CHILD:999:select `evacUID`, `objectUID`, `pilotLocation`, `homeLocation`, `homeDir` from `epoch.evac_choppers` where `playerUID` = ?:[""%1""]:",_playerUID];
    
    format["CHILD:999:select `evacUID`, `objectUID`, `pilotLocation`, `homeLocation`, `homeDir` from `epoch.evac_choppers` where `playerUID` = ?:[%1]:",_playerUID];
    
    format["CHILD:999:select `evacUID`, `objectUID`, `pilotLocation`, `homeLocation`, `homeDir` from `epoch.evac_choppers` where `playerUID` = ?:%1:",_playerUID];
    
    format["CHILD:999:select `evacUID`, `objectUID`, `pilotLocation`, `homeLocation`, `homeDir` from `epoch.evac_choppers` where `playerUID` = ""%1"":",_playerUID];
    
    format["CHILD:999:select `evacUID`, `objectUID`, `pilotLocation`, `homeLocation`, `homeDir` from `epoch.evac_choppers` where `playerUID` = %1:",_playerUID];
    

    I'll either get a server crash, or the call will error.  Any advice?

×
×
  • Create New...