private bool lua_PostWebRequest(string url, string postdata, LuaFunction func) { if (webrequests.Count > 3) { return(false); } AsyncWebRequest req = new AsyncWebRequest(url, postdata); webrequests.Add(req); Plugin callerplugin = Plugin.CurrentPlugin; req.OnResponse += (r) => { try { func.Call(r.ResponseCode, r.Response); } catch (Exception ex) { //Debug.LogError(string.Format("Error in webrequest callback: {0}", ex)); Logger.Error(string.Format("Error in webrequest callback ({0})", callerplugin), ex); } }; return(true); }
private bool lua_SendWebRequest(string url, LuaFunction func) { AsyncWebRequest req = new AsyncWebRequest(url); webrequestQueue.Enqueue(req); Plugin callerplugin = Plugin.CurrentPlugin; req.OnResponse += (r) => { try { func.Call(r.ResponseCode, r.Response); } catch (Exception ex) { //Debug.LogError(string.Format("Error in webrequest callback: {0}", ex)); Logger.Error(string.Format("Error in webrequest callback ({0})", callerplugin), ex); } }; return(true); }
private bool lua_SendWebRequest(string url, LuaFunction func) { if (webrequests.Count > 3) { return false; } AsyncWebRequest req = new AsyncWebRequest(url); webrequests.Add(req); Plugin callerplugin = Plugin.CurrentPlugin; req.OnResponse += (r) => { try { func.Call(r.ResponseCode, r.Response); } catch (Exception ex) { //Debug.LogError(string.Format("Error in webrequest callback: {0}", ex)); Logger.Error(string.Format("Error in webrequest callback ({0})", callerplugin), ex); } }; return true; }
private bool lua_PostWebRequest(string url, string postdata, LuaFunction func) { AsyncWebRequest req = new AsyncWebRequest(url, postdata); webrequestQueue.Enqueue(req); Plugin callerplugin = Plugin.CurrentPlugin; req.OnResponse += (r) => { try { func.Call(r.ResponseCode, r.Response); } catch (Exception ex) { //Debug.LogError(string.Format("Error in webrequest callback: {0}", ex)); Logger.Error(string.Format("Error in webrequest callback ({0})", callerplugin), ex); } }; return true; }