Loading server/runtime_javascript_nakama.go +36 −40 Original line number Diff line number Diff line Loading @@ -3348,7 +3348,7 @@ func (n *runtimeJavascriptNakamaModule) storageWrite(r *goja.Runtime) func(goja. writeOp.Collection = collection } if keyIn, ok := dataMap["key"]; ok { keyIn, ok := dataMap["key"] key, ok := keyIn.(string) if !ok { panic(r.NewTypeError("expects 'key' value to be a string")) Loading @@ -3357,9 +3357,8 @@ func (n *runtimeJavascriptNakamaModule) storageWrite(r *goja.Runtime) func(goja. panic(r.NewTypeError("expects 'key' value to be non-empty")) } writeOp.Key = key } if userIDIn, ok := dataMap["userId"]; ok { userIDIn, ok := dataMap["userId"] userIDStr, ok := userIDIn.(string) if !ok { panic(r.NewTypeError("expects 'userId' value to be a string")) Loading @@ -3369,9 +3368,8 @@ func (n *runtimeJavascriptNakamaModule) storageWrite(r *goja.Runtime) func(goja. if err != nil { panic(r.NewTypeError("expects 'userId' value to be a valid id")) } } if valueIn, ok := dataMap["value"]; ok { valueIn, ok := dataMap["value"] valueMap, ok := valueIn.(map[string]interface{}) if !ok { panic(r.NewTypeError("expects 'value' value to be an object")) Loading @@ -3381,9 +3379,8 @@ func (n *runtimeJavascriptNakamaModule) storageWrite(r *goja.Runtime) func(goja. panic(r.NewGoError(fmt.Errorf("failed to convert value: %s", err.Error()))) } writeOp.Value = string(valueBytes) } if versionIn, ok := dataMap["version"]; ok { versionIn, ok := dataMap["version"] version, ok := versionIn.(string) if !ok { panic(r.NewTypeError("expects 'version' value to be a string")) Loading @@ -3392,7 +3389,6 @@ func (n *runtimeJavascriptNakamaModule) storageWrite(r *goja.Runtime) func(goja. panic(r.NewTypeError("expects 'version' value to be a non-empty string")) } writeOp.Version = version } if permissionReadIn, ok := dataMap["permissionRead"]; ok { permissionRead, ok := permissionReadIn.(int64) Loading Loading @@ -4159,7 +4155,7 @@ func (n *runtimeJavascriptNakamaModule) tournamentCreate(r *goja.Runtime) func(g } metadata := f.Argument(5) metadataStr := "" metadataStr := "{}" if metadata != goja.Undefined() && metadata != goja.Null() { metadataMap, ok := f.Argument(5).Export().(map[string]interface{}) if !ok { Loading Loading @@ -5731,7 +5727,7 @@ func getJsUserData(user *api.User) (map[string]interface{}, error) { userData := make(map[string]interface{}) userData["userId"] = user.Id userData["username"] = user.Username userData["displaNname"] = user.DisplayName userData["displayName"] = user.DisplayName userData["avatarUrl"] = user.AvatarUrl userData["langTag"] = user.LangTag userData["location"] = user.Location Loading Loading
server/runtime_javascript_nakama.go +36 −40 Original line number Diff line number Diff line Loading @@ -3348,7 +3348,7 @@ func (n *runtimeJavascriptNakamaModule) storageWrite(r *goja.Runtime) func(goja. writeOp.Collection = collection } if keyIn, ok := dataMap["key"]; ok { keyIn, ok := dataMap["key"] key, ok := keyIn.(string) if !ok { panic(r.NewTypeError("expects 'key' value to be a string")) Loading @@ -3357,9 +3357,8 @@ func (n *runtimeJavascriptNakamaModule) storageWrite(r *goja.Runtime) func(goja. panic(r.NewTypeError("expects 'key' value to be non-empty")) } writeOp.Key = key } if userIDIn, ok := dataMap["userId"]; ok { userIDIn, ok := dataMap["userId"] userIDStr, ok := userIDIn.(string) if !ok { panic(r.NewTypeError("expects 'userId' value to be a string")) Loading @@ -3369,9 +3368,8 @@ func (n *runtimeJavascriptNakamaModule) storageWrite(r *goja.Runtime) func(goja. if err != nil { panic(r.NewTypeError("expects 'userId' value to be a valid id")) } } if valueIn, ok := dataMap["value"]; ok { valueIn, ok := dataMap["value"] valueMap, ok := valueIn.(map[string]interface{}) if !ok { panic(r.NewTypeError("expects 'value' value to be an object")) Loading @@ -3381,9 +3379,8 @@ func (n *runtimeJavascriptNakamaModule) storageWrite(r *goja.Runtime) func(goja. panic(r.NewGoError(fmt.Errorf("failed to convert value: %s", err.Error()))) } writeOp.Value = string(valueBytes) } if versionIn, ok := dataMap["version"]; ok { versionIn, ok := dataMap["version"] version, ok := versionIn.(string) if !ok { panic(r.NewTypeError("expects 'version' value to be a string")) Loading @@ -3392,7 +3389,6 @@ func (n *runtimeJavascriptNakamaModule) storageWrite(r *goja.Runtime) func(goja. panic(r.NewTypeError("expects 'version' value to be a non-empty string")) } writeOp.Version = version } if permissionReadIn, ok := dataMap["permissionRead"]; ok { permissionRead, ok := permissionReadIn.(int64) Loading Loading @@ -4159,7 +4155,7 @@ func (n *runtimeJavascriptNakamaModule) tournamentCreate(r *goja.Runtime) func(g } metadata := f.Argument(5) metadataStr := "" metadataStr := "{}" if metadata != goja.Undefined() && metadata != goja.Null() { metadataMap, ok := f.Argument(5).Export().(map[string]interface{}) if !ok { Loading Loading @@ -5731,7 +5727,7 @@ func getJsUserData(user *api.User) (map[string]interface{}, error) { userData := make(map[string]interface{}) userData["userId"] = user.Id userData["username"] = user.Username userData["displaNname"] = user.DisplayName userData["displayName"] = user.DisplayName userData["avatarUrl"] = user.AvatarUrl userData["langTag"] = user.LangTag userData["location"] = user.Location Loading