static int IsSocket(IntPtr L) { LuaScriptMgr.CheckArgsCount(L, 0); bool o = NetWriter.IsSocket(); LuaScriptMgr.Push(L, o); return(1); }
public void Send(int actionId, int actionRespId, LuaInterface.LuaFunction callback, LuaFramework.ByteBuffer param) { if (NetWriter.IsSocket()) { SocketRequest(actionId, actionRespId, param, callback, HeadFormater, false); } else { //HttpRequest(gameAction, actionParam, HeadFormater, bShowLoading); } }
public void Request(int actionId, INetCallback callback, object userData, bool bShowLoading) { if (NetWriter.IsSocket()) { SocketRequest(actionId, callback, userData, bShowLoading); } else { HttpRequest(actionId, callback, userData, bShowLoading); } }
static int IsSocket(IntPtr L) { try { ToLua.CheckArgsCount(L, 0); bool o = NetWriter.IsSocket(); LuaDLL.lua_pushboolean(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
/// <summary> /// Send /// </summary> /// <param name="actionId"></param> /// <param name="userData"></param> /// <param name="bShowLoading"></param> public void Send(int actionId, object userData, bool bShowLoading = true) { GameAction gameAction = ActionFactory.Create(actionId); if (gameAction == null) { throw new ArgumentException(string.Format("Not found {0} of GameAction object.", actionId)); } if (NetWriter.IsSocket()) { SocketRequest(gameAction, userData, HeadFormater, bShowLoading); } else { HttpRequest(gameAction, userData, HeadFormater, bShowLoading); } }
/// <summary> /// Send /// </summary> /// <param name="actionId"></param> /// <param name="callback"></param> /// <param name="actionParam"></param> /// <param name="bShowLoading"></param> public void Send(int actionId, Action <ActionResult> callback, ActionParam actionParam, bool bShowLoading = true) { GameAction gameAction = ActionFactory.Create(actionId); if (gameAction == null) { throw new ArgumentException(string.Format("Not found {0} of GameAction object.", actionId)); } gameAction.Callback += callback; if (NetWriter.IsSocket()) { SocketRequest(gameAction, actionParam, HeadFormater, bShowLoading); } else { HttpRequest(gameAction, actionParam, HeadFormater, bShowLoading); } }
/// <summary> /// Send /// </summary> /// <param name="actionId"></param> /// <param name="callback"></param> /// <param name="actionParam"></param> /// <param name="bShowLoading"></param> public void Send(int actionId, byte[] actionParam, bool bShowLoading = true) { byte[] boby = actionParam; GameAction gameAction = ActionFactory.Create(actionId); if (gameAction == null) { throw new ArgumentException(string.Format("Not found {0} of GameAction object.", actionId)); } //if (SceneChangeManager.mInstance != null) // SceneChangeManager.mInstance.ShowLoading(true); if (NetWriter.IsSocket()) { SocketRequest(gameAction, boby, HeadFormater, bShowLoading); } else { //HttpRequest(gameAction, boby, HeadFormater, bShowLoading); } }
public void Send(int actionId, Action <ActionResult> callback, Google.Protobuf.IMessage pbData, bool bShowLoading = true) { GameAction gameAction = ActionFactory.Create(actionId); if (gameAction == null) { throw new ArgumentException(string.Format("Not found {0} of GameAction object.", actionId)); } //if (SceneChangeManager.mInstance != null) // SceneChangeManager.mInstance.ShowLoading(true); gameAction.Callback += callback; if (NetWriter.IsSocket()) { SocketRequest(gameAction, pbData, HeadFormater, bShowLoading); } else { //HttpRequest(gameAction, pbData, HeadFormater, bShowLoading); Debug.LogError("must be socket!!!"); } }