How can Sync two server player info just like official server?

i can make the necesary code to make this work as y detailed before, ut you need to promise me to share your improvments, we need more new and fresh things to make the community of dayz and opendayz and ours growing :D
 
If you can make the necessary code, i will happy about that.
Don't worry about sharing my improvement and more other things.
Most forum's one of main purpose is sharing information, include this opendayz forum as well.
PS : You can see my avatar(two hamster(?) share a piece of carrot) that picture name is share with friends.;)
 
i appreciate your concern and help.
but, what you stated above is already checked and finished.
hiveExt.ini : checked ok.

I tried to set my Chernarus and Lingor instances up in the same way as this and couldn't get it to work. Although the WSField setting is documented in the HiveExt.ini, it seems that the changes made in HiveExt.dll to support the Bliss schema don't honour the setting. The first query issued to retrieve a players id when they join a server looks like this on my setup:

Code:
select s.`id`, s.`worldspace`, s.`inventory`, s.`backpack`, timestampdiff(minute, s.`start_time`, s.`last_updated`) as `SurvivalTime`, timestampdiff(minute, s.`last_ate`, NOW()) as `MinsLastAte`, timestampdiff(minute, s.`last_drank`, NOW()) as `MinsLastDrank`, s.`model` from `survivor` s join `instance` i on s.`world_id` = i.`world_id` and i.`id` = 1 where s.`unique_id` = 'xxxxxxxx' and s.`is_dead` = 0

Which only returns records for the specified world instance, so regardless of whether there is an existing record for another instance for the joining player, it seems that a new record with a different id and new inventory is always created for the current instance and utilised in subsequent queries.
 
/Phazeshif you right.
I found some server they using bliss and they already do what i want(player info sync).
Now looking for genius to solve this thread.
 
I haven't tested it, but here's a nasty hack that will sync player inventory and backpack between instances using sql triggers. It copies the inventory and backpack fields to another table on survivor update, then updates the survivor records for all instances on logout or disconnect. You could add any other fields you want like medical, is_dead etc.

Code:
create table `master_inventory` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `inventory` varchar(2048) DEFAULT NULL,
  `backpack` varchar(2048) DEFAULT NULL,
  `unique_id` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`id`)
);
 
ALTER TABLE `master_inventory`
ADD UNIQUE INDEX `unique_id_UNIQUE` (`unique_id` ASC) ;
 
delimiter //
CREATE TRIGGER update_master_inventory AFTER UPDATE ON survivor
    FOR EACH ROW
    BEGIN   
    DECLARE CheckExists int;               
    if @DISABLE_TRIGGER is NULL THEN
      SET CheckExists = 0; 
        SELECT count(*) INTO CheckExists from master_inventory WHERE unique_id = NEW.unique_id;
      if CheckExists = 0 then 
          insert into master_inventory (unique_id, inventory, backpack) values (NEW.unique_id, NEW.inventory, NEW.backpack);
        ELSE
          update master_inventory set inventory = NEW.inventory, backpack = NEW.backpack where unique_id = NEW.unique_id;
        END IF;
      END IF;
    END//
delimiter ;
 
delimiter //
CREATE TRIGGER update_survivor_inventory AFTER INSERT ON log_entry
    FOR EACH ROW
    BEGIN
    IF (NEW.log_code_id = 2) || (NEW.log_code_id = 5) THEN
      SET @DISABLE_TRIGGER = 1;
        update survivor s join master_inventory mi on s.unique_id = mi.unique_id set s.inventory = mi.inventory, s.backpack = mi.backpack where s.unique_id = mi.unique_id and s.is_dead = 0;
      SET @DISABLE_TRIGGER = null;
      END IF;
    END//
delimiter ;

Alternatively, thinking about this a bit more, you could just do everything in a log entry trigger without the intermediate table and trigger on survivor update, which will probably be a lot more efficient:

Code:
delimiter //
CREATE TRIGGER update_survivor_inventory AFTER INSERT ON log_entry
    FOR EACH ROW
    BEGIN
      declare backpackValue varchar(2048);
      declare inventoryValue varchar(2048);
      IF (NEW.log_code_id = 2) || (NEW.log_code_id = 5) THEN        
        select s.inventory, s.backpack into inventoryValue, backpackValue from survivor s where unique_id = NEW.unique_id and last_updated = (select max(last_updated) from survivor where unique_id = NEW.unique_id group by unique_id);
        update survivor s set s.inventory = inventoryValue, s.backpack = backpackValue where s.unique_id = NEW.unique_id;
      END IF;
    END//
delimiter ;
 
/Phazeshift wow thanks alot.
I'll try this and will report here.
I have more than 10 instances for my server so i need to modify some clue.
In my case, only instance 1 and instance 101 need to sync for player info.

thanks again your job.(+like)
 
Back
Top