コード例 #1
0
    public void registerProtocol(C2SProtocol protocol, BumProtocolType type, string url, DispatchProtocolDelegate dispatchCallBack)
    {
        BumProtocolInfo newProtocolInfo = new BumProtocolInfo();

        newProtocolInfo.protocol         = protocol;
        newProtocolInfo.url              = url;
        newProtocolInfo.protocolType     = type;
        newProtocolInfo.dispatchProtocol = dispatchCallBack;

        protocolCluster.Add((int)protocol, newProtocolInfo);
    }
コード例 #2
0
    void doSend(BumProtocolInfo protocolInfo, WWWForm postForm)
    {
        WWW www = null;

        switch (protocolInfo.protocolType)
        {
        case BumProtocolType.eProtocolType_GET: www = new WWW(serverURL + protocolInfo.url); break;

        case BumProtocolType.eProtocolType_POST: www = new WWW(serverURL + protocolInfo.url, postForm); break;

        case BumProtocolType.eProtocolType_POST_WITH_COOKIES:
            BumBase.Assert(BumLogic.clientUser.userConfig.cookieRequestHeader != null);
            www = new WWW(serverURL + protocolInfo.url, postForm.data, BumLogic.clientUser.userConfig.cookieRequestHeader);
            break;
        }

        BumApp.Instance.StartCoroutine(protocolInfo.dispatchProtocol(www));
    }
コード例 #3
0
    public void send(C2SProtocol protocol, WWWForm postForm)
    {
        BumProtocolInfo pi = getProtocolInfo(protocol);

        doSend(pi, postForm);
    }