Beispiel #1
0
    public void Post(UWebRequest request, UWebArg customArgs, UWebMgr.OnWebResponse onResponse, UWebMgr.OnWebError onError, float timeOutInterval)
    {
        UWebRequestProxy proxy = new UWebRequestProxy();

        proxy.m_Request = request;

        if (request.isCompressed)
        {
            customArgs.Add("compress", 1);
        }

        if (m_isUrlArgs)
        {
            proxy.m_UrlArgs    = customArgs.ToString();
            proxy.m_MergedArgs = customArgs.GetMergedArgs();
        }
        else
        {
            proxy.m_Form = customArgs.ToForm();
        }

        proxy.m_OnResponse      = onResponse;
        proxy.m_OnError         = onError;
        proxy.m_TimeOutInterval = timeOutInterval;
        proxy.m_LocalArg        = customArgs.localArg;

        m_RequestQueue.Enqueue(proxy);
    }
Beispiel #2
0
    public void AddArgument(string key, object value)
    {
        if (m_Args == null)
        {
            m_Args = new UWebArg();
        }

        m_Args.Add(key, value);
    }
Beispiel #3
0
    public void Merge(UWebArg arg)
    {
        if (arg == null)
        {
            return;
        }

        foreach (var pair in arg.m_ArgDict)
        {
            Add(pair.Key, pair.Value);
        }

        if (m_LocalArg != null && arg.localArg != null)
        {
            m_LocalArg = arg.localArg;
        }
    }