question

Hotpopot avatar image
Hotpopot asked

in multiPlayer mode how to store the data to manage items droped on the scene,In multiplayer gaming mode how to store the data to manage items dropped to the scene

In multiplayer gaming modewhen an enemy was killed,loot will drop to the scene。

1)handle the msg from masterClient with EvaluateRandomResultTable ,return the item info to masterClient,

at this time, not directly use GrantItemsToUser to give rewards,

2)masterClient recive the droped item info and broadcast it to other clients,

3)when an other clients send the collect item msg to server,how can i check the it is cheat msg or not。

I have no idea how to store the item data,In this case, shoud i use the PlayerInventory Api?

I hope I have explained the problem clearly, thank you for your answer.

,

In multiplayer gaming mode when an enemy was killed,loot will drop to the scene。

1)handle the msg from masterClient with EvaluateRandomResultTable ,return the item info to masterClient,

at this time, not directly use GrantItemsToUser to give rewards,

2)masterClient recive the droped item info and broadcast it to other clients,

3)when an other clients send the collect item msg to server,how can i check the it is cheat msg or not。

I have no idea how to store the item data,In this case, shoud i use the PlayerInventory Api?

I hope I have explained the problem clearly, thank you for your answer.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Hernando avatar image
Hernando answered

It is recommended that you manage and grant dropped items in CloudScript.

At the beginning of the game,have the masterClient collect all users' PlayFabID and post them to CloudScript as parameters when the enemy is killed. You may have noticed that Server.GrantItemsToUser in CloudScript can grant items to any player as long as the player's PlayFabID is provided. So, you can call EvaluateRandomResultTable in CloudScript. The items is then granted to the player based on the result of the evaluation of the random result table.

In other words, do not broadcast data between clients, but instead calculate and grant items to them through the server. We cannot guarantee the accuracy of data transfer between clients without server supervision.

However, this way can not avoid the cheating behavior of MasterClient, and needs to check the inputs from the MasterClient, this thread can help give you more help:https://community.playfab.com/questions/8637/security-on-updating-statistics-from-client-cloud.html

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hotpopot avatar image Hotpopot commented ·

thank you ~

I found the items in user's inventory can add constom data.

I can use it to mark the item is on the scene ground or was collected in player's backpack,

for example I create a <“b_Collected”, " false"> kv-pair to mean it is still on the ground。

when player offline (or leave the scene) I would travel all Items in inventory to delete the items witch the ‘b_Collected’ value is false. I found the server func RevokeInventoryItems could work(limit to delete 25 items once call),

is there a faster way to instead?

0 Likes 0 ·
Hernando avatar image Hernando Hotpopot commented ·

If the scenario is like this, you could use a Shared Group Data with Cloud Script to manage the items. Shared Group Data is a simple way a for players to share some information with a tightly constrained list of other players. Then grant the player with cloudscript when the player makes the picking items, Instead of granting them items and then remove them.

However, if grant item is called is too frequent, it will hit the limit of number of API request rate. In that case, you should to use a custom game server and have it aggregate the information about items picked up, so that rather than a player getting ten or twenty grant item calls, it would be one grant items call per user.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.