Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- handlers.Player_device_info = function (args, context) {
- var event = context.playStreamEvent;
- // Check if the event is player_device_info event
- if (event.EventName === "player_device_info" || event.EventName === "player_action_executed") {
- // Access the DeviceModel
- var deviceModel = event.DeviceInfo.DeviceModel;
- // Now you can use the deviceModel as needed
- // For example, you can store it in player data, perform some logic, etc.
- log.info("Device Model of the player: " + deviceModel);
- // You can also update player data with this information
- var updateDataRequest = {
- PlayFabId: currentPlayerId,
- Data: {
- "DeviceModel": deviceModel
- }
- };
- // Update player data
- server.UpdateUserData(updateDataRequest);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement