Loading CHANGELOG.md +3 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,9 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr ### Added - Add subscription validation APIs and runtime functions for Google and Apple. ### Changed - Improved runtime handling of non-persisted purchases and subscriptions. ## [3.12.0] - 2022-05-22 ### Added - Add "FriendsBlock" function to all runtimes. Loading server/runtime_javascript_nakama.go +16 −4 Original line number Diff line number Diff line Loading @@ -8099,8 +8099,14 @@ func getJsValidatedPurchaseData(purchase *api.ValidatedPurchase) map[string]inte validatedPurchaseMap["store"] = purchase.Store.String() validatedPurchaseMap["providerResponse"] = purchase.ProviderResponse validatedPurchaseMap["purchaseTime"] = purchase.PurchaseTime.Seconds if purchase.CreateTime != nil { // Create time is empty for non-persisted purchases. validatedPurchaseMap["createTime"] = purchase.CreateTime.Seconds } if purchase.UpdateTime != nil { // Update time is empty for non-persisted purchases. validatedPurchaseMap["updateTime"] = purchase.UpdateTime.Seconds } validatedPurchaseMap["environment"] = purchase.Environment.String() validatedPurchaseMap["seenBefore"] = purchase.SeenBefore Loading @@ -8118,8 +8124,14 @@ func getJsSubscriptionData(subscription *api.ValidatedSubscription) map[string]i validatedSubMap["store"] = subscription.Store.String() validatedSubMap["purchaseTime"] = subscription.PurchaseTime.Seconds validatedSubMap["expiryTime"] = subscription.ExpiryTime.Seconds if subscription.CreateTime != nil { // Create time is empty for non-persisted subscriptions. validatedSubMap["createTime"] = subscription.CreateTime.Seconds } if subscription.UpdateTime != nil { // Update time is empty for non-persisted subscriptions. validatedSubMap["updateTime"] = subscription.UpdateTime.Seconds } validatedSubMap["environment"] = subscription.Environment.String() validatedSubMap["active"] = subscription.Active Loading server/runtime_lua_nakama.go +16 −4 Original line number Diff line number Diff line Loading @@ -2606,8 +2606,14 @@ func purchaseToLuaTable(l *lua.LState, p *api.ValidatedPurchase) *lua.LTable { validatedPurchaseTable.RawSetString("store", lua.LString(p.Store.String())) validatedPurchaseTable.RawSetString("provider_response", lua.LString(p.ProviderResponse)) validatedPurchaseTable.RawSetString("purchase_time", lua.LNumber(p.PurchaseTime.Seconds)) if p.CreateTime != nil { // Create time is empty for non-persisted purchases. validatedPurchaseTable.RawSetString("create_time", lua.LNumber(p.CreateTime.Seconds)) } if p.UpdateTime != nil { // Update time is empty for non-persisted purchases. validatedPurchaseTable.RawSetString("update_time", lua.LNumber(p.UpdateTime.Seconds)) } validatedPurchaseTable.RawSetString("environment", lua.LString(p.Environment.String())) validatedPurchaseTable.RawSetString("seen_before", lua.LBool(p.SeenBefore)) Loading @@ -2627,8 +2633,14 @@ func subscriptionToLuaTable(l *lua.LState, p *api.ValidatedSubscription) *lua.LT validatedSubscriptionTable.RawSetString("original_transaction_id", lua.LString(p.OriginalTransactionId)) validatedSubscriptionTable.RawSetString("store", lua.LString(p.Store.String())) validatedSubscriptionTable.RawSetString("purchase_time", lua.LNumber(p.PurchaseTime.Seconds)) if p.CreateTime != nil { // Create time is empty for non-persisted subscriptions. validatedSubscriptionTable.RawSetString("create_time", lua.LNumber(p.CreateTime.Seconds)) } if p.UpdateTime != nil { // Update time is empty for non-persisted subscriptions. validatedSubscriptionTable.RawSetString("update_time", lua.LNumber(p.UpdateTime.Seconds)) } validatedSubscriptionTable.RawSetString("environment", lua.LString(p.Environment.String())) validatedSubscriptionTable.RawSetString("expiry_time", lua.LNumber(p.ExpiryTime.Seconds)) validatedSubscriptionTable.RawSetString("active", lua.LBool(p.Active)) Loading Loading
CHANGELOG.md +3 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,9 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr ### Added - Add subscription validation APIs and runtime functions for Google and Apple. ### Changed - Improved runtime handling of non-persisted purchases and subscriptions. ## [3.12.0] - 2022-05-22 ### Added - Add "FriendsBlock" function to all runtimes. Loading
server/runtime_javascript_nakama.go +16 −4 Original line number Diff line number Diff line Loading @@ -8099,8 +8099,14 @@ func getJsValidatedPurchaseData(purchase *api.ValidatedPurchase) map[string]inte validatedPurchaseMap["store"] = purchase.Store.String() validatedPurchaseMap["providerResponse"] = purchase.ProviderResponse validatedPurchaseMap["purchaseTime"] = purchase.PurchaseTime.Seconds if purchase.CreateTime != nil { // Create time is empty for non-persisted purchases. validatedPurchaseMap["createTime"] = purchase.CreateTime.Seconds } if purchase.UpdateTime != nil { // Update time is empty for non-persisted purchases. validatedPurchaseMap["updateTime"] = purchase.UpdateTime.Seconds } validatedPurchaseMap["environment"] = purchase.Environment.String() validatedPurchaseMap["seenBefore"] = purchase.SeenBefore Loading @@ -8118,8 +8124,14 @@ func getJsSubscriptionData(subscription *api.ValidatedSubscription) map[string]i validatedSubMap["store"] = subscription.Store.String() validatedSubMap["purchaseTime"] = subscription.PurchaseTime.Seconds validatedSubMap["expiryTime"] = subscription.ExpiryTime.Seconds if subscription.CreateTime != nil { // Create time is empty for non-persisted subscriptions. validatedSubMap["createTime"] = subscription.CreateTime.Seconds } if subscription.UpdateTime != nil { // Update time is empty for non-persisted subscriptions. validatedSubMap["updateTime"] = subscription.UpdateTime.Seconds } validatedSubMap["environment"] = subscription.Environment.String() validatedSubMap["active"] = subscription.Active Loading
server/runtime_lua_nakama.go +16 −4 Original line number Diff line number Diff line Loading @@ -2606,8 +2606,14 @@ func purchaseToLuaTable(l *lua.LState, p *api.ValidatedPurchase) *lua.LTable { validatedPurchaseTable.RawSetString("store", lua.LString(p.Store.String())) validatedPurchaseTable.RawSetString("provider_response", lua.LString(p.ProviderResponse)) validatedPurchaseTable.RawSetString("purchase_time", lua.LNumber(p.PurchaseTime.Seconds)) if p.CreateTime != nil { // Create time is empty for non-persisted purchases. validatedPurchaseTable.RawSetString("create_time", lua.LNumber(p.CreateTime.Seconds)) } if p.UpdateTime != nil { // Update time is empty for non-persisted purchases. validatedPurchaseTable.RawSetString("update_time", lua.LNumber(p.UpdateTime.Seconds)) } validatedPurchaseTable.RawSetString("environment", lua.LString(p.Environment.String())) validatedPurchaseTable.RawSetString("seen_before", lua.LBool(p.SeenBefore)) Loading @@ -2627,8 +2633,14 @@ func subscriptionToLuaTable(l *lua.LState, p *api.ValidatedSubscription) *lua.LT validatedSubscriptionTable.RawSetString("original_transaction_id", lua.LString(p.OriginalTransactionId)) validatedSubscriptionTable.RawSetString("store", lua.LString(p.Store.String())) validatedSubscriptionTable.RawSetString("purchase_time", lua.LNumber(p.PurchaseTime.Seconds)) if p.CreateTime != nil { // Create time is empty for non-persisted subscriptions. validatedSubscriptionTable.RawSetString("create_time", lua.LNumber(p.CreateTime.Seconds)) } if p.UpdateTime != nil { // Update time is empty for non-persisted subscriptions. validatedSubscriptionTable.RawSetString("update_time", lua.LNumber(p.UpdateTime.Seconds)) } validatedSubscriptionTable.RawSetString("environment", lua.LString(p.Environment.String())) validatedSubscriptionTable.RawSetString("expiry_time", lua.LNumber(p.ExpiryTime.Seconds)) validatedSubscriptionTable.RawSetString("active", lua.LBool(p.Active)) Loading