Page MenuHomeFeedback Tracker

Magazines are not synced between client / server with addMagazine/addMagazineCargo
Need More Info, WishlistPublic

Description

It seems when addMagazine or addMagazineCargo is used on the local player owned object (uniform,backpack,vest) it won't be present on the server with getMagazineCargo unless the player then drops and picks up the magazine again.

As per the documentation the effects of this scripting command requires the arguments to be local but the effects are global. So these magazines should be present on the server.

This may be intended functionality because this isn't reproducible using global variants of these scripting commands however when you are working with a local unit on the player client and are adding magazines in a forEach Loop, you don't want to lagg the network and send a global command to add a magazine for each mag.

Details

Legacy ID
3144312811
Severity
None
Resolution
Reopened
Reproducibility
Always
Category
Multiplayer
Steps To Reproduce
  1. On the server add a Mission Event Handler "HandleDisconnect" and have it return true. Have it print out the contents of the unit's backpack,vest,uniform with getMagazineCargo.
  1. On the client run a player addMagazine ""; with a test magazine classname. It should add a magazine into the cargo of either your vest,backpack,uniform.
  1. Logout of the game to the lobby and check your test output on the server. It won't print out the magazine classname.
  1. Reproduce the same steps except drop the magazine on step 2 on the ground and pick it up again. And this time when you logout the server will print out the magazine name.

Event Timeline

Deathlyrage edited Additional Information. (Show Details)
Deathlyrage set Category to Multiplayer.
Deathlyrage set Reproducibility to Always.
Deathlyrage set Severity to None.
Deathlyrage set Resolution to Reopened.
Deathlyrage set Legacy ID to 3144312811.May 7 2016, 7:20 PM

Thanks for pointing this out with addMagazine and I've corrected BIKI description https://community.bistudio.com/wiki/addMagazine. As for addMagazineCargo, it is supposed to have local effect, which is correctly documented on BIKI.

Let me know if this is satisfactory so I can resolve this ticket.

Ok Thanks, that's fine.

You can close this report.

I have retested this again and for some reason addMagazine effect appears to be global again, that is few hours later. Reverted changes to BIKI, changing to feedback, this needs more investigation.

I believe the best result would be fixing addMagazine so it's effects are global when used on a local argument, as per Arma 2 functionality. This prevents spamming of global commands over the network in a forEach loop for example.

But this is exactly how it is now after second testing, only for some reason it failed the first time I tested. Need more feedback.

Yeah it seems to be happening randomly that the effect isn't global and sometimes it is. This is even given the server enough time to sync / process the command.

Replacing all my addMagazine commands with addMagazineGlobal result in mass duplication of items and creating invalid combinations of items in inventories. I remember having this problem with addMagazineGlobal in the past. When i call it once on the client, the item duplicates by the number of people on the server. I'm going to have to stick with addMagazine for the time being.

This also happends randomly when i call addMagazineGlobal on the server once for a remote argument, the item duplicates by the number of people on the server.

neokika added a subscriber: neokika.May 7 2016, 7:20 PM

@Deathlyrage Can you please provide repro steps? I'm unable to reproduce this issue when executing the command only where a unit is local, I see no duplication of magazines.

@neokikka I can confirm what Deathlyrage is saying about addMagazineGlobal dupes. I was testing it with 1 HC and 1 player on dedi and it was adding 2 mags instead of one. I guess with just 1 client on dedi you will not see duplication