I'm creating a restricted client/connection named "guest" with PlayerIO via PLayerIO.connect() when an anonymous player first loads the swf- it then uses this connection to display some global and public stats about the game.
If the player then logs into facebook I am trying to re-establish a new client/connection named "public" with the known user (which has save/create permissions). However when I try this I get an error saying that the current connection is still "guest" and prevents me from writing to BigDB because of the permissions restrictions.
Is it possible to refresh/recreate a client/connection to PlayerIO in this way?
my code looks something like this:
- Code: Select all
public var client:Client
public function connect(thisUserId:String = "guest"):void {
var myConnection:String = thisUserId =="guest"?"guest":"public"
PlayerIO.connect(stage,GAME_ID,myConnection,thisUserId,"", connectResponse)
}
protected function connectResponse(thisClient:Client):void{
trace('connected'); // connection established
client = thisClient
}
I call the same function to create both the guest and public connections.
Cheers,
JMC