Forum QuickConnect Unable to preload PlayerObject

Discussion and help relating to PlayerIO's QuickConnect feature, including Facebook Connect and Kongregate Connect.

Unable to preload PlayerObject

Postby sidwoo » December 6th, 2010, 6:21 pm

Hi,

in GameStarted() i set
Code: Select all
PreloadPlayerObjects = true;


But then when i join a room with a player i get this error:

Code: Select all
>Error: Unable to preload PlayerObject or PayVault for: simpleTarzan
  Message: You don't have access to load the object with key 'simpleTarzan' since you didn't create it.


Can you tell me why?
sidwoo
 
Posts: 13
Joined: November 23rd, 2010, 5:45 pm

Re: Unable to preload PlayerObject

Postby fox1980 » December 6th, 2010, 6:36 pm

By default, the playerobjects table only let's the creator access it's data.
You probably created that object manually in the admin panel, and now you're trying to access it in the client, so that's why you're getting that error.
fox1980
 
Posts: 206
Joined: April 1st, 2010, 10:39 pm

Re: Unable to preload PlayerObject

Postby Benjaminsen » December 7th, 2010, 11:07 am

You can control which connections have access to what under settings in your game.
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: Unable to preload PlayerObject

Postby sidwoo » December 7th, 2010, 5:17 pm

fox1980 wrote:By default, the playerobjects table only let's the creator access it's data.
You probably created that object manually in the admin panel, and now you're trying to access it in the client, so that's why you're getting that error.


I dont get who the "creator" is.
i did not create it manually but with simpleRegister.
And i tried to access the playerObject from the server.

Shouldnt the server always be allowed to access BigDB Objects?
sidwoo
 
Posts: 13
Joined: November 23rd, 2010, 5:45 pm

Re: Unable to preload PlayerObject

Postby azuanagames » December 7th, 2010, 8:38 pm

Development server gets permission from client, so while debugging you can just open up permissions for the client.

The creator is the user that registered. So the server is not the creator.
azuanagames
 
Posts: 149
Joined: April 29th, 2010, 10:59 pm

Re: Unable to preload PlayerObject

Postby sidwoo » December 7th, 2010, 10:40 pm

ok, i´m a bit confused ... :shock:

what i want is to save the number of games played, games won and games lost of a player in the BigDB.

so in UserJoined i increase the gamesPlayed value
Code: Select all

public override void UserJoined(Player player) {
    int gamesPlayed = player.PlayerObject.GetInt("gamesPlayed", 0) + 1;
    player.PlayerObject.Set("gamesPlayed", gamesPlayed);
    player.PlayerObject.Save();


when a game with 2 players ends i update gamesWon and gamesLost:
Code: Select all
int gamesLost= pl.PlayerObject.GetInt("gamesLost", 0) + 1;
            pl.PlayerObject.Set("gamesLost", gamesLost);
            pl.PlayerObject.Save();


is there anything wrong with this way?

I dont want to save data from the client as i think it could be easily hacked.
But when i have to open rights for th public connection to make the server able to save the data it´s also a security risk :?
sidwoo
 
Posts: 13
Joined: November 23rd, 2010, 5:45 pm

Re: Unable to preload PlayerObject

Postby azuanagames » December 7th, 2010, 10:47 pm

sidwoo wrote:ok, i´m a bit confused ... :shock:

what i want is to save the number of games played, games won and games lost of a player in the BigDB.

so in UserJoined i increase the gamesPlayed value
Code: Select all

public override void UserJoined(Player player) {
    int gamesPlayed = player.PlayerObject.GetInt("gamesPlayed", 0) + 1;
    player.PlayerObject.Set("gamesPlayed", gamesPlayed);
    player.PlayerObject.Save();


when a game with 2 players ends i update gamesWon and gamesLost:
Code: Select all
int gamesLost= pl.PlayerObject.GetInt("gamesLost", 0) + 1;
            pl.PlayerObject.Set("gamesLost", gamesLost);
            pl.PlayerObject.Save();


is there anything wrong with this way?

This is right.

I dont want to save data from the client as i think it could be easily hacked.
But when i have to open rights for th public connection to make the server able to save the data it´s also a security risk :?


Right, but you only open the connection as your developing. Once you release the game you set the security back up.
azuanagames
 
Posts: 149
Joined: April 29th, 2010, 10:59 pm

Re: Unable to preload PlayerObject

Postby Oliver » December 16th, 2010, 1:23 pm

The fact that you have to do lots of workarounds in order to get full permissions on the development server is an issue we're well aware of. You never know, a solution might be right around the corner...

- Oliver
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am


Return to QuickConnect



cron