From 0625ba6504f61758ddb441e5513d386e007cf84b Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Mon, 3 Oct 2011 15:27:21 +0300 Subject: [PATCH] Client-server protocol description update --- server/protocol.txt | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/server/protocol.txt b/server/protocol.txt index 64a4200c0b..27d4721ff5 100644 --- a/server/protocol.txt +++ b/server/protocol.txt @@ -2,8 +2,13 @@ Description: Sent when client opens Downloader Request: ID, CountriesV, PurchasesV { "ID":"12345", // unique client id - "CountriesVersion":1, - "PurchasesVersion":1 + "Cmd":"VersionCheck", + "Params": + { + "CountriesV":1, // local version of countries file on the client + "PurchasesV":1, // local version of purchases file on the client + "ClientV":1 // client version + } } Response: Credit [, CountriesV, Countries, PurchasesV, Purchases] { @@ -11,14 +16,18 @@ Response: Credit [, CountriesV, Countries, PurchasesV, Purchases] "CountriesV":2, // optional, latest version of countries list "Countries":{...}, // optional, latest countries list with new prices and new countries "PurchasesV":2, // optional, latest inapp purchases list version - "StoreIDS":["123","456","789"] // optional, latest inapp purchases IDS + "Purchases":["123","456","789"] // optional, latest inapp purchases IDS } Description: Sent by client to validate payment and add credits Request: ID, Receipt { "ID":"12345", - "Receipt":"ASD24@#$!@$%" // base 64 encoded app store receipt to validate and store on our server + "Cmd":"ValidatePayment", + "Params": + { + "Receipt":"ASD24@#$!@$%" // base 64 encoded app store receipt to validate and store on our server + } } Response: Credit [, Error] { @@ -27,10 +36,14 @@ Response: Credit [, Error] } Description: Sent by client to add some credit by entering friend promo code or any other public promo code -Request: ID, PromoCode +Request: ID, Code { "ID":"12345", - "PromoCode":"123asdREWR24ad" + "Cmd":"ValidatePromoCode", + "Params": + { + "Code":"123asdREWR24ad" + } } Response: Credit [, Error] { @@ -42,7 +55,11 @@ Description: Sent by client when he tries to download the country Request: ID, Country { "ID":"12345", - "Country":"Belarus" + "Cmd":"Download", + "Params": + { + "Country":"Belarus" + } } Response: Country[, Url | Error] { @@ -55,7 +72,7 @@ Description: Client requests own "Bring friend" code once, which should be enter Request: ID, FriendCode { "ID":"12345", - "FriendCode":"" + "Cmd":"FriendCode", } Response: FriendCode {