Forum PayVault Cannot give free items

Discussion and help relating to the PlayerIO payment solution, PayVault.

Cannot give free items

Postby Vania » April 12th, 2011, 8:41 pm

I have a connection for updates and testing,
made sure this option is checked: "Can Give Vault Items Is allowed to give items into PayVault (without paying)"

But I when I try to give myself some premium items (for testing) I get this error:
"Error: unit_repairtruck is not FreelyGivable from this connection"

For now I set the items to "freely givable" to continue testing.
Vania
 
Posts: 198
Joined: March 24th, 2010, 9:01 pm

Re: Cannot give free items

Postby Henrik » April 12th, 2011, 9:10 pm

That's weird, I'm looking at the code now, and the only way to get that error message is by not having the Can Give Vault Items right on the connection.

Funnily enough, there's also a code comment right there that says we should add more information to the error message about which connection rights that are actually checked. I've added that info now, and hopefully I can get that released tomorrow, which should give us a bit more help in pinning down the cause of the error.

In the meantime, what happens if you add a bool property called FreelyGivable with the value true to the item you're trying to give yourself?
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm

Re: Cannot give free items

Postby Vania » April 12th, 2011, 9:39 pm

In the meantime, what happens if you add a bool property called FreelyGivable with the value true to the item you're trying to give yourself?


Doing this removes the error. But is this the same as marking the item as "FreelyGivable" on creation? I only want VaultItems to be givable by the "admin" connection.
Vania
 
Posts: 198
Joined: March 24th, 2010, 9:01 pm

Re: Cannot give free items

Postby Vania » April 13th, 2011, 7:08 pm

Ok, this was an error in my code. I was connecting with the "admin" connection but then reconnecting using quickconnect, which connects with the "public" connection.

What I was trying to do was to connect with the quickconnect user but using the "admin" connection.
But now I see I can just use the API to give items and coins to my testusers.
Vania
 
Posts: 198
Joined: March 24th, 2010, 9:01 pm

Re: Cannot give free items

Postby Henrik » April 15th, 2011, 12:33 pm

The change to the error message is now live, so if you had had that error today, you would have immediately seen that you tried to give items through the public connection. :-)

With QuickConnect it's only possible to use the connection you specify during setup, and if you make an admin connection, you should probably secure it with an auth so that only you can connect with it.

I hope you removed the IsFreelyGivable property on your items, since that opens it up for exploits and cheats.
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm


Return to PayVault



cron