Forum BigDB Property does not exist

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

Property does not exist

Postby Basti » April 9th, 2013, 1:12 pm

Hi!

Since yesterday i have some Problems with BigDB. When acessing the player objects _sometimes_ i get this exception:

Code: Select all
System.Exception: Property does not exist: sector
    at PlayerIOClient.Internal.DBCoreObject`1[K].DeepGet (System.String property, Boolean throwOnMissing) [0x00000] in <filename unknown>:0
    at PlayerIOClient.DatabaseObject.GetString (System.String propertyExpression) [0x00000] in <filename unknown>:0
    at PlayerIOManager+<ConnectToSector>c__AnonStorey9.<>m__4 (PlayerIOClient.DatabaseObject dbObj) [0x00000] in <filename unknown>:0
    at PlayerIOClient.Internal.PlayerIOChannel+LoadMyPlayerObjectCaller`1[T].success (PlayerIOClient.Internal.LoadMyPlayerObjectOutput output) [0x00000] in <filename unknown>:0
    at PlayerIOClient.Internal.PlayerIOChannel+UnityWWW+<call>d__ff`3[PlayerIOClient.Internal.PlayerIOChannel+LoadMyPlayerObjectArgs,PlayerIOClient.Internal.PlayerIOChannel+LoadMyPlayerObjectOutput,PlayerIOClient.PlayerIOError].MoveNext () [0x00000] in <filename unknown>:0


This is the code where this exception is thrown:

Code: Select all
MyClient.BigDB.LoadMyPlayerObject(delegate(DatabaseObject dbObj)
        {
            DBObject = dbObj;
            Debug.Log("Accessing dbobject");

            string sector = "";
            string roomType = "";

            if(isNewUser)
            {
                Debug.Log("NEW USER");
                sector = "01";
                roomType = "ShipsPlayerCreation";
            }
            else
            {
                Debug.Log("RETURNING USER");
                sector = dbObj.GetString("sector");
                roomType = "ShipsSector";

                Application.LoadLevelAsync(sector);
                Debug.Log("Load Sector: " + sector);
            }
           
           
            // Create or join the room / sector
            PlayerIOManager.MyClient.Multiplayer.CreateJoinRoom(
                        sector,                       //Room id. If set to null a random roomid is used
                        roomType,                     //The room type started on the server
                        true,                         //Should the room be visible in the lobby?
                        null,
                        null,

                        // If we joined the room successfully this method is called
                        delegate(Connection connection)
                        {
                            Debug.Log("Joined Room.");
                            PlayerIOManager.joinedRoom = true;

                            PlayerIOManager.ServerConnection = connection;
                            PlayerIOManager.ServerConnection.OnMessage += PlayerIOManager.handlemessage;
                        },

                        // otherwise this method is called.
                        delegate(PlayerIOError error)
                        {
                            Debug.LogError("ERROR could not join the room " + sector);
                            Debug.LogError(error.Message);
                        }
                    );
        });       
    }


The property definetly exists on the Object, i looked it up in the BigDB web-interface. Am i doing something wrong? I found an old thread regarding the same problem here: http://playerio.com/forum/post42209. But that didn't help me.

Thanks in advance!
Basti
 
Posts: 11
Joined: August 1st, 2012, 1:08 pm

Re: Property does not exist

Postby Henrik » April 10th, 2013, 6:29 pm

You can use the Contains method in your code to check that the property really exists at that point in time:

http://playerio.com/documentation/refer ... t#Contains

Maybe that will help you debug the issue?
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm

Re: Property does not exist

Postby Basti » April 11th, 2013, 8:10 am

Thanks, i will try that. The strange thing is, that the problem occured mostly when running the game on android.
Basti
 
Posts: 11
Joined: August 1st, 2012, 1:08 pm

Re: Property does not exist

Postby Basti » April 11th, 2013, 1:41 pm

The problem has vanished into thin air...today its working flawlessly. Haven't changed anything in the code, so no idea what the reason was.

Thanks anyway!
Basti
 
Posts: 11
Joined: August 1st, 2012, 1:08 pm


Return to BigDB