示例#1
0
    private void Connect(NetRequestInfo info)
    {
        Debug.Log("[NetRequestManager] Request : " + info.Request.Command.ToString() + ", orderID = " + info.OrderID);

        ReqApiBase api = info.Request;

        api.player_id = 0;              // TODO : どこかに保持しておき代入.
        api.debug     = 0;              // TODO : 必要ならば特定条件で 1 に設定するようにする.

        if (api.IsNotReady)
        {
            throw new NotImplementedException();            // 未実装
        }
        string serverURL = "google.co.jp";                  // TODO : API呼び出し用サーバーURL.

        if (string.IsNullOrEmpty(serverURL))
        {
            Debug.LogError("[NetRequestManager] Request Error!! : Server URL is null or empty.");
            return;
        }
        var co = NetConnectManager.SharedInstance.StartConnectPost(NET_TAG,
                                                                   DownloadDataType.NetCommand.GetNetPriority(),
                                                                   serverURL + api.URN,
                                                                   System.Text.Encoding.UTF8.GetBytes(api.ToPostDataWithHash()),
                                                                   DownloadDataType.NetCommand.ToString());

        co.DidLoadDelegate = ConnectFinished(info);
    }
示例#2
0
 /// <summary>
 /// リクエストをキューに貯める
 /// </summary>
 public void RequestToServer(ReqApiBase req)
 {
     m_requestQueue.Add(new NetRequestInfo(req, m_nowOrderID++, req.IsDisplayLoading));
 }
示例#3
0
 public NetRequestInfo(ReqApiBase req, int order, bool bDisplayLoading)
 {
     Request          = req;
     OrderID          = order;
     IsDisplayLoading = bDisplayLoading;
 }