示例#1
0
    static int IsSocket(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 0);
        bool o = NetWriter.IsSocket();

        LuaScriptMgr.Push(L, o);
        return(1);
    }
示例#2
0
 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);
     }
 }
示例#3
0
文件: Net.cs 项目: xueshibing/Scut
 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);
     }
 }
示例#4
0
 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));
     }
 }
示例#5
0
文件: Net.cs 项目: zhukaixy/Scut
    /// <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);
        }
    }
示例#6
0
    /// <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);
        }
    }
示例#7
0
    /// <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);
        }
    }
示例#8
0
    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!!!");
        }
    }