hi,
i really want to get the player name on the server side.
Can i retrieve it from the PlayerObject?
If yes, how?
by sidwoo » December 9th, 2010, 5:38 pm
by Henrik » December 9th, 2010, 5:54 pm
client.bigDB.loadMyPlayerObject(function(playerobject:DatabaseObject):void{
if (!playerobject.Contains("Username")) {
playerobject.Set("Username", "the value of the username here...");
playerobject.Save();
}
})
var username = player.PlayerObject.GetString("Username");
by sidwoo » December 9th, 2010, 6:22 pm
by Benjaminsen » December 9th, 2010, 7:33 pm
sidwoo wrote:ah ok, so save the name to the DB from the client ... it´s a bit weird that you have to do it this way instead of just having access to the player name on the server.
I´ll try it this way, thx!
by HAnz » February 25th, 2011, 6:02 pm
client.bigDB.loadMyPlayerObject(function(playerobject:DatabaseObject):void{
if (playerobject.Username == null) {
playerobject.Username = "the value of the username here...";
playerobject.save();
}
})