Forum Scripting Unity, Kongregate, and Player.IO - Saving DatabaseObject

Post your problems and discussions relating to scripting in Unity here.

Unity, Kongregate, and Player.IO - Saving DatabaseObject

Postby TheJakeAO » April 2nd, 2013, 4:54 pm

Player.IO is working fine as a database solution for my Unity-based game. Everything works perfectly in editor, web-player, iOS, Android, and PC, but when I upload the web-player build to Kongregate I can no longer save database objects. My save data function is below, and everything works perfectly everywhere but on Kongregate. Is Player.IO not compatible with web-player in some cases or for some odd reasons? I attempted both to use the DatabaseObject.Save() as well as the BigDB.SaveChanges() functions, and neither work. Everything loads from the server with no problems, it's just saving that doesn't work properly.

Code: Select all
    public void vSaveData( )
    {
        if( !CServer.m_fOnline || CGlobals.Instance.m_userData.DatabaseObject == null )
        {
            return;
        }

#if UNITY_WEBPLAYER
        CGlobals.Instance.m_userData.m_Client.BigDB.SaveChanges( false, true, new DatabaseObject[] { CGlobals.Instance.m_userData.DatabaseObject }, null );
#else
        CGlobals.Instance.m_userData.DatabaseObject.Save( false, false );
#endif
        Debug.Log( "Saved Data to DB\n" + CGlobals.Instance.m_userData.DatabaseObject.ToString( ) );
    }
TheJakeAO
 
Posts: 1
Joined: February 28th, 2013, 11:37 pm

Re: Unity, Kongregate, and Player.IO - Saving DatabaseObject

Postby Benjaminsen » April 4th, 2013, 8:08 pm

It should work perfectly in the web player. Start a web debugger to see if it's requesting some non found crossdomain.xml file or some such.
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark


Return to Scripting



cron