Upcoming changes to game badges

We need a UserOwnsAsset method to go alongside PlayerOwnsAsset (or optionally allow overloading of player instance with userId) – part of the reason developers are misusing UserHasBadge is because it doesn’t require the user to be in-game, unlike PlayerOwnsAsset.

This is actually a pretty annoying issue that extends past badges – it’d be great if badges could be the first step in modernizing all methods not directly related to the game that require a player object to take UserId instead.

Edit:
###Methods that need to be updated

  • MarketplaceService:PlayerOwnsAsset(Player, assetId) → MarketplaceService:UserOwnsAsset(userId, assetId)
  • Player:GetRankInGroup(groupId) → GroupService:GetUserRankInGroup(userId, groupId)
  • Player.GetRoleInGroup(groupId) → GroupService:GetUserRoleInGroup(userId, groupId)
  • Or, if the above data is easy to get at the same time, combine into a single method that returns both
  • Player:IsInGroup(groupId) → GroupService:UserIsInGroup(userId, groupId)
  • Deprecate GamePassService:PlayerHasPass(Player, assetId)
  • Wiki page already encourages PlayerOwnsAsset, but it’s not technically deprecated yet

###Potential need for change:

  • Player:IsFriendsWith(userId) → Players:IsUserFriendsWith(userId, userId)
  • Can’t really think of why this would be needed when neither user is in-game, but maybe someone else has a use case

###Should not change:

  • AssetService:CreatePlaceInPlayerInventoryAsync(Player, …)
  • Developers shouldn’t be able to spam users’ inventories with places when they’ve never even joined their game
19 Likes