question

duartedd avatar image
duartedd asked

postman and playfab,RPG with playfab / unity

i tried using the server api gettitledata and it wouldnt work


{ "code": 401, "status": "Unauthorized", "error": "NotAuthenticated", "errorCode": 1074, "errorMessage": "Missing or invalid X-SecretKey HTTP header" }

it giving me this - i am logging in with a normal player though so i would think i shouldnt be authorized to do server api calls - or am i looking at this incorrectly?

Anyways i am using the session key as t he secretkey var s(without changing it and i gettitledata without issue under the client api its just the gettitledata server api call that im getting this which leads me to believe authorization issues.

any help would be awesome

thanks!

daniel

,

Hello

I am looking into creating an RPG game that will have

a player with 3 characters that he will control all at once and have stats and equipment tied to it

I want to know what the best way to go about integrating this with Playfab would be ( i want as much i can to be modifiable on the server side (cloud) )

what i was thinking was to use titledata to store

Fore each character for that player:

base stats (hp power xp level etc)

currentstats(currenthp,powerwithbonuses,currentxp, currentlevel,totalhp,totalxp etc)

name

items equipped (itemid from the catalog)

damage type (spell,physical,etc)

the player will have

curreency and inventory which i think will work by some normal api calls (wont have to use titledata?)

does this makes sense or would i need to go about another means like an mysql server and try that way?

if the titledata method will work do you have any example json or source code files that i can browse through to see how to implement properly? Specifically ones with multiple subategories

since the keeper will have a base stat which will have the stattype

hope that makes sense

thanks!

daniel

3 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.

duartedd avatar image duartedd commented ·

so I created the JSON file which seems to pass via a validator
so the key is Keeper the value is:


{"keepername": "", "keeperid": "0" ,"currentLevel": "0","currentHP": "0","currentXP":"0","XPtoNextLevel": "0","BaseStats":[ {"StatType": "Power","BaseValue": "1","StatName": "Power"},{"StatType": "Temper","BaseValue": "0","StatName": "Temper"},{"StatType": "HP", "BaseValue": "2","StatName": "HP"},{"StatType": "Cultivation","BaseValue": "0","StatName": "Cultivation"}],"BonusStats": [{"StatType": "bonusPower","BaseValue": "1","StatName": "bonusPower"},{"StatType": "bonusTemper", "BaseValue": "0", "StatName": "bonusTemper" }, { "StatType": "bonusHP", "BaseValue": "0", "StatName": "bonusHP" },{ "StatType": "bonusCultivation","BaseValue": "0", "StatName": "bonusCultivation"}]}

the question is will the API allow these values to change per each of the keepers that each player may have - separate values and all..?

0 Likes 0 ·
duartedd avatar image duartedd commented ·

ok so i dont think i can use titledata for this as it looks more like its used for all players and stored globally rather then per player - i might be able to use playerstatistics or characterstatstics or something to store my creatures

basically doing the same I found updateplayerstatistics ex in postman - so i just change this to to the above and i may be able to use

thinking i ll try the characterstatistics method and just assign an inventory item called creature1 creature2 and creature3 or something to it or whatever the requirement is.

0 Likes 0 ·
duartedd avatar image duartedd commented ·

note i figured out postman had to get the secret key from the admin game manager settings and paste the secret key in to postman to work - all my api calls work without issues now thanks!

0 Likes 0 ·

1 Answer

·
brendan avatar image
brendan answered

Correct - Title Data is global data which is the same value for all players. For data which is custom to each player, you'll need to use Player Data and/or Player Statistics. And yes, to use Server or Admin API calls, you do need to pass in the Secret Key as a header. I'd recommend having a look at these tutorials:

https://api.playfab.com/docs/tutorials/landing-content/using-title-data

https://api.playfab.com/docs/tutorials/landing-players/using-player-data

https://api.playfab.com/docs/tutorials/landing-players/player-statistics

https://api.playfab.com/docs/tutorials/title-management/secret-key-management

1 comment
10 |1200

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

duartedd avatar image duartedd commented ·

Great thanks! Got it. I'll use characters I think that ll work!.

Appreciate your feedback on here Brendan notice you on here answering alot of questions

Thanks again!

Daniel

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.