Unity 5 IAP + UNET dedicated server. How to differentiate buyers?

I am implementing new Unity IAP system on dedicated server (also using new Unity Networking feature). Quick overview: Client side is responsible only for connecting to server, sending buy requests and receiving updates on number of items player has. Server side maintains connections and is main hub of IAP, from here requests are made to Stores (Apple and Google, atm), and purchases are validated.

Question is: How do I know for which client purchase is done?

We have unique connections, but it seems there is no way to send connection ID to correct ProcessPurchase method execution. And by "correct" I mean method run for one distinct buyer. When I initialise purchase I can supply "payload" as second parameter, with seemingly any input, but in ProcessPurchase I can't get this value back. I tried researching how to save transactionID, but also to no avail.

Any help would be appreciated!

Answers


I went other way around.

IAP system works now on client device and only sends receipt data to dedicated server. Server then checks receipt and sends data over SAME connection message was received on, thus, I don't need any way to save or differentiate users.

Hope this helps to anyone who stumbled across this problem.


Need Your Help

Why do my tests fail when run together, but pass individually?

c# visual-studio-2010 selenium-ide nunit-2.5

When I write a test in Visual Studio, I check that it works by saving, building and then running the test it in Nunit (right click on the test then run).

Print empty string with double quotes instead of single quotes in Python

python string

I have a list I want to pretty print that contains empty lists as well as lists with string members. the problem is that lists that contains strings are printed with double quotes: