Me and my team are close to finishing our multiplayer strategy game.It's been quite fun working with the playerIO api.
Right now I'm trying to load an object on the server.
For example, say we have a player object that stores an inventory array... inside the array are Objects, like {Name:"Rusty Sword", Type:"Melee Weapon"}
How do I load an object from that array to the server? (This may be really simple, I just have no idea).
For example:
- Code: Select all
DatabaseArray Inventory = player.PlayerObject.GetArray("Inventory");
//And now I want to get the Item from the array:
<Object I want> = Inventory.Get<?>(index); // How do I retrieve it?
//Next I want to check whether the type is "Melee Weapon":
if(<Object>["Type"]=="Melee Weapon"){
//do stuff
}
Thank you!
Fuzzy