Ejemplo n.º 1
0
        public void pull(SDKCorePluginCustomCallbackDelegate fp, string fieldname, object fieldvalue)
        {
            var propertyInfo = this.GetType().GetProperty(fieldname);

            if (propertyInfo != null)
            {
                if (propertyInfo.PropertyType == typeof(ArrayList))
                {
                    ArrayList a = (ArrayList)propertyInfo.GetValue(this, null);

                    while (a.IndexOf(fieldvalue) >= 0)
                    {
                        a.Remove(fieldvalue);
                    }
                    propertyInfo.SetValue(this, a, null);


                    string stringToSend = "{\"field\":\"" + fieldname + "\",\"value\":\"" + fieldvalue + "\"}";
                    SDKCorePlugin.SDKCorePluginSendRequest(ColibryUserRequestSigns.PULL, ColibryUserCmds.PULL, stringToSend, sdkResponse, fp);
                }
                else
                {
                    Debug.Log("Property is not ArrayList" + fieldname);
                }
            }
            else
            {
                Debug.Log("No such property " + fieldname);
            }
        }
Ejemplo n.º 2
0
        public void testpurchaseiOS(SDKCorePluginCustomCallbackDelegate fp, string receipt, string productid)
        {
            string modifiedString = receipt.Replace("\"", "'");
            string testString     = "{\"receipt-data\":\"" + modifiedString + "\",\"product-id\":\"" + productid + "\",\"bid\":\"" + SDKCorePlugin.SDKCoreGetBundleIdentifier() + "\"}";

            SDKCorePlugin.SDKCorePluginSendRequest(ColibryIapRequestSigns.TEST_PURCHASE_IOS, ColibryIapCmds.TEST_PURCHASE_IOS, testString, sdkResponse, fp);
        }
Ejemplo n.º 3
0
        public void testpurchaseAndroid(SDKCorePluginCustomCallbackDelegate fp, string key, string signature, string receipt)
        {
            string testString = "{\"key\":\"" + key + "\",\"signature\":\"" + signature + "\",\"receipt\":" + receipt + "}";

            Debug.Log(testString);

            SDKCorePlugin.SDKCorePluginSendRequest(ColibryIapRequestSigns.TEST_PURCHASE_ANDROID, ColibryIapCmds.TEST_PURCHASE_ANDROID, testString, sdkResponse, fp);
        }
Ejemplo n.º 4
0
 public void signIn(SDKCorePluginCustomCallbackDelegate fp, string idtype, string id)
 {
     if (idtype == "login")
     {
         SDKCorePlugin.SDKCorePluginSendRequest(ColibryUserRequestSigns.SIGN_IN, ColibryUserCmds.SIGN_IN, "{\"type\":\"" + idtype + "\",\"id\":" + id + "}", sdkResponse, fp);
     }
     else
     {
         SDKCorePlugin.SDKCorePluginSendRequest(ColibryUserRequestSigns.SIGN_IN, ColibryUserCmds.SIGN_IN, "{\"type\":\"" + idtype + "\",\"id\":\"" + id + "\"}", sdkResponse, fp);
     }
 }
Ejemplo n.º 5
0
        public void entitysave(SDKCorePluginCustomCallbackDelegate fp, Entity inobject)
        {
            string customsign = inobject.id + "." + ColibryEntitiesRequestSigns.ENTITY_SAVE;

            customsign = AddToSign(customsign);
            string requeststring = "";
            string objectstring  = inobject.ToJSON().serialized;

            requeststring = "{\"collection\":\"" + collectionname + "\",\"object\":" + objectstring + "}";
            SDKCorePlugin.SDKCorePluginSendRequest(customsign, ColibryEntitiesCmds.ENTITY_SAVE, requeststring, sdkResponse, fp);
        }
Ejemplo n.º 6
0
        //for entity
        public void entitycreate(SDKCorePluginCustomCallbackDelegate fp, Entity inobject)
        {
            string customsign = AddToSignObjectHashCode(inobject, ColibryEntitiesRequestSigns.ENTITY_CREATE);

            customsign = AddToSign(customsign);
            string requeststring = "";
            string objectstring  = inobject.ToJSON().serialized;

            EntityDictionary.Add(customsign, inobject);

            requeststring = "{\"collection\":\"" + collectionname + "\",\"p\":" + flagIsPrivate + ",\"object\":" + objectstring + "}";
            SDKCorePlugin.SDKCorePluginSendRequest(customsign, ColibryEntitiesCmds.ENTITY_CREATE, requeststring, sdkResponse, fp);
        }
Ejemplo n.º 7
0
        public void signAdd(SDKCorePluginCustomCallbackDelegate fp, string idtype, string id)
        {
            string requeststring = "";

            if (idtype == "login")
            {
                requeststring = "{\"type\":\"" + idtype + "\",\"id\":" + id + "}";
            }
            else
            {
                requeststring = "{\"type\":\"" + idtype + "\",\"id\":\"" + id + "\"}";
            }
            SDKCorePlugin.SDKCorePluginSendRequest(ColibryUserRequestSigns.SIGN_ADD, ColibryUserCmds.SIGN_ADD, requeststring, sdkResponse, fp);
        }
Ejemplo n.º 8
0
        public void entitydelete(SDKCorePluginCustomCallbackDelegate fp, Entity inobject)
        {
            JSON   roottosend = new JSON();
            string customsign = inobject.id + "." + ColibryEntitiesRequestSigns.ENTITY_DELETE;

            customsign = AddToSign(customsign);
            string requeststring = "";

            roottosend["id"] = inobject.id;
            string objectstring = roottosend.serialized;

            requeststring = "{\"collection\":\"" + collectionname + "\",\"object\":" + objectstring + "}";

            SDKCorePlugin.SDKCorePluginSendRequest(customsign, ColibryEntitiesCmds.ENTITY_DELETE, requeststring, sdkResponse, fp);
        }
Ejemplo n.º 9
0
        public void entitypull(SDKCorePluginCustomCallbackDelegate fp, Entity inobject, string fieldname, object fieldvalue)
        {
            JSON roottosend = inobject.pull(fieldname, fieldvalue);

            if (roottosend != null)
            {
                string customsign = inobject.id + "." + ColibryEntitiesRequestSigns.ENTITY_PULL;
                customsign = AddToSign(customsign);
                string requeststring = "";
                roottosend["id"] = inobject.id;
                string objectstring = roottosend.serialized;

                requeststring = "{\"collection\":\"" + collectionname + "\",\"object\":" + objectstring + "}";

                SDKCorePlugin.SDKCorePluginSendRequest(customsign, ColibryEntitiesCmds.ENTITY_PULL, requeststring, sdkResponse, fp);
            }
        }
Ejemplo n.º 10
0
        public void entitiesfind(SDKCorePluginCustomCallbackDelegate fp, string searchstring)
        {
            JSON roottosend = new JSON();

            if (searchstring != "" && searchstring != null)
            {
                roottosend.serialized = searchstring;
            }

            string requeststring;

            requeststring = "{\"collection\":\"" + collectionname + "\",\"p\":" + flagIsPrivate + ",\"object\":" + roottosend.serialized + "}";

            string customsign = AddToSign(ColibryEntitiesRequestSigns.ENTITIES_FIND);

            SDKCorePlugin.SDKCorePluginSendRequest(customsign, ColibryEntitiesCmds.ENTITIES_FIND, requeststring, sdkResponse, fp);
        }
Ejemplo n.º 11
0
        public void entityunset(SDKCorePluginCustomCallbackDelegate fp, Entity inobject, string fieldname)
        {
            JSON roottosend = inobject.unsetValue(fieldname);

            if (roottosend != null)
            {
                string customsign = inobject.id + "." + ColibryEntitiesRequestSigns.ENTITY_UNSET;
                customsign = AddToSign(customsign);
                string requeststring = "";
                roottosend["id"] = inobject.id;
                string objectstring = roottosend.serialized;

                requeststring = "{\"collection\":\"" + collectionname + "\",\"object\":" + objectstring + "}";

                SDKCorePlugin.SDKCorePluginSendRequest(customsign, ColibryEntitiesCmds.ENTITY_UNSET, requeststring, sdkResponse, fp);
            }
            else
            {
                Debug.Log("No such property " + fieldname);
            }
        }
Ejemplo n.º 12
0
        public void setValue(SDKCorePluginCustomCallbackDelegate fp, string fieldname, object fieldvalue)
        {
            var propertyInfo = this.GetType().GetProperty(fieldname);

            if (propertyInfo != null)
            {
                propertyInfo.SetValue(this, fieldvalue, null);
                JSON root       = new JSON();
                JSON roottosend = new JSON();

                ColibrySerializeHelper.getProperty(this, propertyInfo, root, propertyInfo.Name);
                roottosend["field"] = fieldname;
                roottosend["value"] = root[propertyInfo.Name];

                string stringToSend = roottosend.serialized;
                SDKCorePlugin.SDKCorePluginSendRequest(ColibryUserRequestSigns.SET_VALUE, ColibryUserCmds.SET_VALUE, stringToSend, sdkResponse, fp);
            }
            else
            {
                Debug.Log("No such property " + fieldname);
            }
        }
Ejemplo n.º 13
0
        public void entitiescreate(SDKCorePluginCustomCallbackDelegate fp)
        {
            JSON roottosend = new JSON();
            //custom class array
            List <JSON> jsonarray = new List <JSON>();

            foreach (var value in EntityDictionary.Values)
            {
                jsonarray.Add((value as Entity).ToJSON());
            }

            roottosend["arr"] = jsonarray.ToArray();


            string requeststring;

            requeststring = "{\"collection\":\"" + collectionname + "\",\"p\":" + flagIsPrivate + ",\"object\":" + roottosend.serialized + "}";

            string customsign = AddToSign(ColibryEntitiesRequestSigns.ENTITIES_CREATE);

            SDKCorePlugin.SDKCorePluginSendRequest(customsign, ColibryEntitiesCmds.ENTITIES_CREATE, requeststring, sdkResponse, fp);
        }
Ejemplo n.º 14
0
        public void saveUser(SDKCorePluginCustomCallbackDelegate fp, params string[] list)
        {
            JSON   root    = getFieldsValuesJsonObject();
            JSON   newroot = new JSON();
            string result;

            for (int i = 0; i < list.Length && list[i] != null; i++)
            {
                Debug.Log(list[i]);
                //ключ существует
                if (root.fields.ContainsKey(list[i]))
                {
                    newroot[list[i]] = root[list[i]];
                }
            }

            result = newroot.serialized;

            Debug.Log(result);

            SDKCorePlugin.SDKCorePluginSendRequest(ColibryUserRequestSigns.SAVE_USER, ColibryUserCmds.SAVE_USER, result, sdkResponse, fp);
        }
Ejemplo n.º 15
0
 public void saveUser(SDKCorePluginCustomCallbackDelegate fp)
 {
     SDKCorePlugin.SDKCorePluginSendRequest(ColibryUserRequestSigns.SAVE_USER, ColibryUserCmds.SAVE_USER, getFieldsValuesJsonObject().serialized, sdkResponse, fp);
 }
Ejemplo n.º 16
0
 public void usersfind(SDKCorePluginCustomCallbackDelegate fp, string searchstring)
 {
     SDKCorePlugin.SDKCorePluginSendRequest(ColibryUserRequestSigns.USERS_FIND, ColibryUserCmds.USERS_FIND, searchstring, sdkResponse, fp);
 }
Ejemplo n.º 17
0
        public void getValue(SDKCorePluginCustomCallbackDelegate fp, string fieldname)
        {
            string stringToSend = "{\"field\":\"" + fieldname + "\"}";

            SDKCorePlugin.SDKCorePluginSendRequest(ColibryUserRequestSigns.GET_VALUE, ColibryUserCmds.GET_VALUE, stringToSend, sdkResponse, fp);
        }
Ejemplo n.º 18
0
 public void loadUser(SDKCorePluginCustomCallbackDelegate fp)
 {
     SDKCorePlugin.SDKCorePluginSendRequest(ColibryUserRequestSigns.LOAD_USER, ColibryUserCmds.LOAD_USER, "", sdkResponse, fp);
 }
Ejemplo n.º 19
0
 public void signOut(SDKCorePluginCustomCallbackDelegate fp)
 {
     SDKCorePlugin.SDKCorePluginSendRequest(ColibryUserRequestSigns.SIGN_OUT, ColibryUserCmds.SIGN_OUT, "", sdkResponse, fp);
 }