public static IEnumerator RegisterByName(string name, string password, CrownCallbackJSON callback = null) { JSON parameters = new JSON(); parameters.AddField("name", name); parameters.AddField("password", password); yield return instance.StartCoroutine(Crown.Request("registerByName", parameters, callback, OnLoginByName)); }
public static IEnumerator RegisterByName(string name, string password, CrownCallbackJSON callback = null) { JSON parameters = new JSON(); parameters.AddField("name", name); parameters.AddField("password", password); yield return(instance.StartCoroutine(Crown.Request("registerByName", parameters, callback, OnLoginByName))); }
/* * Login to server and get user main data */ public IEnumerator GetItems(CrownCallbackJSON callback = null) { JSON parameters = new JSON(); parameters.AddField("var1", "teeeeeest55555"); yield return(StartCoroutine(Crown.Request("getPlayerItems", parameters, callback, OnGetItems))); }
static void MergeRecur(JSON left, JSON right) { if (right.type == JSON.Type.OBJECT) { for (int i = 0; i < right.list.Count; i++) { if (right.keys[i] != null) { string key = (string)right.keys[i]; JSON val = (JSON)right.list[i]; if (val.type == JSON.Type.ARRAY || val.type == JSON.Type.OBJECT) { if (left.HasField(key)) { MergeRecur(left[key], val); } else { left.AddField(key, val); } } else { if (left.HasField(key)) { left.SetField(key, val); } else { left.AddField(key, val); } } } } } // else left.list.Add(right.list); }
static void MergeRecur(JSON left, JSON right) { if(right.type == JSON.Type.OBJECT) { for(int i = 0; i < right.list.Count; i++) { if(right.keys[i] != null) { string key = (string)right.keys[i]; JSON val = (JSON)right.list[i]; if(val.type == JSON.Type.ARRAY || val.type == JSON.Type.OBJECT) { if(left.HasField(key)) MergeRecur(left[key], val); else left.AddField(key, val); } else { if(left.HasField(key)) left.SetField(key, val); else left.AddField(key, val); } } } }// else left.list.Add(right.list); }
/* * Login to server and get user main data */ public IEnumerator GetItems(CrownCallbackJSON callback = null) { JSON parameters = new JSON(); parameters.AddField("var1", "teeeeeest55555"); yield return StartCoroutine(Crown.Request("getPlayerItems", parameters, callback, OnGetItems)); }