Notifications
Clear all

Edit user

4 Posts
2 Users
0 Reactions
710 Views
(@roman-zhu)
Posts: 10
Active Member
Topic starter
 

Hello.
I need to edit customData and inventory(add/update) of loggedUser..
What i must do after including reference to api?

 
Posted : 04/07/2014 4:58 pm
(@skaredcreations)
Posts: 805
Prominent Member Admin
 

To edit a user you use UpdateUser (to set a value for custom data you just set it with loggedUser.customData["dataKey"]) and for inventory for both and update you use UpdateInventory (if the passed item has an Id greater than zero then the webservice will update it, else it will create a new one). You can take a look how it works for both these methods in the demo scene included in the package.

FRANCESCO CROCETTI @ SKARED CREATIONS

 
Posted : 04/07/2014 5:14 pm
(@roman-zhu)
Posts: 10
Active Member
Topic starter
 

I mean server-side

 
Posted : 04/07/2014 6:21 pm
(@skaredcreations)
Posts: 805
Prominent Member Admin
 

Oh, ok so after including the file /lib/api.php at top of your file, you have to use the classes to make changes to the database, please take a look at the code in the functions wsUpdate (in users.php) and wsSave (in inventory.php), their use is pretty easy.

FRANCESCO CROCETTI @ SKARED CREATIONS

 
Posted : 04/07/2014 6:37 pm
Share: