Forum BigDB Player Object Problem

Discussion and help relating to the PlayerIO database solution, BigDB.

Player Object Problem

Postby randomcomm3nt » October 25th, 2011, 8:58 pm

EDIT: Ignore this, read next post.
Last edited by randomcomm3nt on October 25th, 2011, 9:19 pm, edited 2 times in total.
randomcomm3nt
 
Posts: 5
Joined: October 20th, 2011, 7:58 pm

Re: Documentation Problem

Postby randomcomm3nt » October 25th, 2011, 9:17 pm

Okay, so I'm blind. playerObject is a local variable defined in the example ¬¬

Anyway, now I'm having a little bit of trouble assigning data to a Player Object. My code is:
Code: Select all
PlayerIO.quickConnect.simpleConnect(
            stage,
            "nova-finum-z7twjhqj0itgkgbvbf7ig",   
            username,
            password,
            function(client:Client):void{
               client.bigDB.loadMyPlayerObject(function(obj:DatabaseObject):void{
                  obj.name = "jack";
                  obj.save();
            })
            }, function(e:PlayerIOError):void{
               trace("Error: ", e)
            }
         );


The user is already created, but the player object for him doesn't exist. How do I create one and assign to it?
randomcomm3nt
 
Posts: 5
Joined: October 20th, 2011, 7:58 pm

Re: Player Object Problem

Postby RastaRalle » October 25th, 2011, 9:39 pm

I think loadPlayerObject returns an empty object if the object wasn't created before. so you can assign values to the empty object and save it.
RastaRalle
 
Posts: 63
Joined: August 18th, 2010, 2:46 pm

Re: Player Object Problem

Postby randomcomm3nt » October 25th, 2011, 11:06 pm

Okay so now in my development server I got it to assign values to the player object. The development server window says that the SimpleUser's PlayerObject has variables with values assigned to them. However, on the admin panel it still shows my database as empty. How do I get these variables to persist between games?
randomcomm3nt
 
Posts: 5
Joined: October 20th, 2011, 7:58 pm

Re: Player Object Problem

Postby cjcenizal » October 26th, 2011, 12:23 am

Did you call the save() method on the playerObject?
cjcenizal
Paid Member
 
Posts: 115
Joined: March 29th, 2011, 12:31 am


Return to BigDB