Forum BigDB player.GetPlayerObject() sometimes fails to get called

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

player.GetPlayerObject() sometimes fails to get called

Postby SmallJoker » December 8th, 2014, 9:23 pm

Hello,

The forum style is totally messed up, so I did not look if there are already topics about my problem.

However. The client connects to a room called "Lobby" and there it can load a specific room. I need to use the player.GetPlayerObject() callback or player.PlayerObject but both fail to load.

When the client directly connects to a non-Lobby room , it runs fine and I can not notice any troubles.

Could someone please eplain me why a simple code like
Code: Select all
player.GetPlayerObject(delegate(DatabaseObject o) {
   player.Send("status", "Got object");
});
fails? (Yes, I've already tried with "PreloadPlayerObjects = true;")
SmallJoker
 
Posts: 50
Joined: March 28th, 2012, 12:22 pm

Re: player.GetPlayerObject() sometimes fails to get called

Postby Henrik » December 9th, 2014, 12:01 am

Do you get any errors in the error callback?
Henrik
.IO
 
Posts: 1832
Joined: January 4th, 2010, 1:53 pm

Re: player.GetPlayerObject() sometimes fails to get called

Postby SmallJoker » December 9th, 2014, 7:30 pm

There isn't any error callback for player.GetPlayerObject() and the error log does not contain any error releated to this problem.

PS: The Forum style +/- works again.
SmallJoker
 
Posts: 50
Joined: March 28th, 2012, 12:22 pm

Re: player.GetPlayerObject() sometimes fails to get called

Postby SmallJoker » December 12th, 2014, 7:56 pm

Update:

I tried those codes and they do not throw any errors.:
Code: Select all
PlayerIO.BigDB.Load("PlayerObjects", player.ConnectUserId, delegate(DatabaseObject o) {
   bool found = false;
   if (o != null) found = o.ExistsInDatabase;
   if (!found) return;
   initPlayer(player, o);
}, delegate(PlayerIOError err) {
   throw new Exception("Impossible to load PlayerObject of " + player.ConnectUserId);
});


initPlayer() is not even called.
SmallJoker
 
Posts: 50
Joined: March 28th, 2012, 12:22 pm

Re: player.GetPlayerObject() sometimes fails to get called

Postby SmallJoker » December 14th, 2014, 7:09 pm

Sorry for the trouble.
I didn't notice the client already disconnected from the lobby when the messages should be sent back.

Topic closed.
SmallJoker
 
Posts: 50
Joined: March 28th, 2012, 12:22 pm


Return to BigDB



cron