Пример #1
0
    public void Send_WebProtocol()
    {
        if (www != null)
        {
            return;
        }
        else if (Que_NetData.Count == 0)
        {
            isNetworking = false;
            Loadmanager.instance.LoadingUI(isNetworking);

            // 3600초 = 1시간동안 아무 프로토콜안쏘면 getservertime 쏘자
            waitCoroutine = StartCoroutine(coroutine_waitNoneBehaviour(3600f));

            UserEditor.Getsingleton.EditLog("networking : " + isNetworking);
            return;
        }


        netData _net = Que_NetData.Dequeue();

        //여기다 쏘는거 만들고 코루틴으로
        //쏘고 응답받고 www = null 시키고
        StartCoroutine(coroutine_SendProtocol(_net));
    }
Пример #2
0
    public static void SetUnitRef(uint _UnitIdx, uint _ItemIdx, byte _PriceItTp, uint _PriceItNum, del_webResp_0 delfunc)
    {
        if (_PriceItTp == 1)
        {
            webRequest.nowUseGoods = ITEMTYPE.GEM;
        }
        else if (_PriceItTp == 2)
        {
            webRequest.nowUseGoods = ITEMTYPE.GOLD;
        }


        netData _net = new netData();

        _net.set_SendData("UnitIdx", _UnitIdx);
        _net.set_SendData("ItemIdx", _ItemIdx);
        _net.set_SendData("PriceItTp", _PriceItTp);
        _net.set_SendData("PriceItNum", _PriceItNum);


        _net.del_result   = delfunc;
        _net.protocolName = ProtocolName.SetItemRef;

        web_Manager _webMgr = web_Manager.Getsingleton;

        _webMgr.Que_NetData.Enqueue(_net);
        _webMgr.Send_WebProtocol();
    }
Пример #3
0
        public static IEnumerator WebRequest(System.Action <netData> callback, params object[] parameters)
        {
            netData data = new netData();

            data.output  = "";
            data.isError = false;

            string  uri  = null;
            WWWForm form = new WWWForm();

            foreach (var param in parameters)
            {
                try
                {
                    Tuple <string, string> paramData = (Tuple <string, string>)param;
                    if (paramData.Item1 != "target")
                    {
                        form.AddField(paramData.Item1, paramData.Item2);
                    }
                    else
                    {
                        uri = string.Format("{0}?{1}", Constants.LOGIN_SERVER, paramData.Item2);
                    }
                }
                catch (InvalidCastException ex)
                {
                    Debug.Log("Invalid field data type supplied, use Tuple<string, string> to pass in (field, value)");
                }
            }

            if (form.data.Length > 0 & uri != null)
            {
                using (UnityEngine.Networking.UnityWebRequest req = UnityEngine.Networking.UnityWebRequest.Post(uri, form))
                {
                    yield return(req.SendWebRequest());

                    if (req.isNetworkError | req.isHttpError)
                    {
                        data.output  = req.downloadHandler.text;
                        data.isError = true;
                    }
                    else
                    {
                        data.output = req.downloadHandler.text;
                    }
                }
            }
            else if (uri == null)
            {
                Misc.PrintDebugLine("WebHandler", "WebRequest", "No target location specified");
            }


            callback(data);
        }
Пример #4
0
    public static void GetConnectAdress(del_webResp_0 func1)
    {
        netData _net = new netData();

        _net.del_result   = func1;
        _net.protocolName = ProtocolName.GetConnectAdress;         // 요청할 프로토콜이름 설정

        web_Manager _webMgr = web_Manager.Getsingleton;

        _webMgr.Que_NetData.Enqueue(_net);
        _webMgr.Send_WebProtocol();
    }
Пример #5
0
    public static void ClanList(del_webResp_0 delfunc)
    {
        netData _net = new netData();

        _net.del_result   = delfunc;
        _net.protocolName = ProtocolName.ClanList;

        web_Manager _webMgr = web_Manager.Getsingleton;

        _webMgr.Que_NetData.Enqueue(_net);
        _webMgr.Send_WebProtocol();
    }
Пример #6
0
    public static void SearchUserClan(byte _SearchKind, string _SearchID, del_webResp_0 delfunc)
    {
        //확인할 유저아이디 저장

        if (_SearchKind == 1)         //유저이름
        {
            if (!string.Equals(UserDataManager.instance.user.user_Users.NkNm, _SearchID))
            {
                //확인할 유저아이디 순차적으로 큐에저장
                UserDataManager.instance.Que_OtherUserIDs.Enqueue(_SearchID);
            }
        }
        else if (_SearchKind == 4)         //유저아이디
        {
            if (!string.Equals(UserDataManager.instance.user.user_Users.NkNm, _SearchID))
            {
                //확인할 유저아이디 순차적으로 큐에저장
                UserDataManager.instance.Que_OtherUserIDs.Enqueue(_SearchID);
            }
        }
        else if (_SearchKind == 2)        //클랜이름
        {
            if (!string.Equals(UserDataManager.instance.user.clan_Clans.ClanName, _SearchID))
            {
                //확인할 클랜이름 순차적으로 큐에저장
                UserDataManager.instance.Que_OtherUserIDs.Enqueue(_SearchID);
            }
        }
        else if (_SearchKind == 3)         //클랜아이디
        {
            if (UserDataManager.instance.user.clan_Clans.ClanID != Convert.ToUInt32(_SearchID))
            {
                //확인할 클랜아이디 순차적으로 큐에저장
                UserDataManager.instance.Que_OtherUserIDs.Enqueue(_SearchID);
            }
        }


        netData _net = new netData();

        _net.set_SendData("SearchKnd", _SearchKind);
        _net.set_SendData("SearchID", _SearchID);

        _net.del_result   = delfunc;
        _net.protocolName = ProtocolName.SearchUserClan;

        web_Manager _webMgr = web_Manager.Getsingleton;

        _webMgr.Que_NetData.Enqueue(_net);
        _webMgr.Send_WebProtocol();
    }
Пример #7
0
    public static void GameStart(int _btIdx, del_webResp_0 delfunc)
    {
        netData _net = new netData();

        _net.set_SendData("BtIdx", _btIdx);

        _net.del_result   = delfunc;
        _net.protocolName = ProtocolName.GameStart;

        web_Manager _webMgr = web_Manager.Getsingleton;

        _webMgr.Que_NetData.Enqueue(_net);
        _webMgr.Send_WebProtocol();
    }
Пример #8
0
    public static void FriendPostInvite(uint _InviteUserID, del_webResp_0 delfunc)
    {
        netData _net = new netData();

        _net.set_SendData("InviteUserID", _InviteUserID);

        _net.del_result   = delfunc;
        _net.protocolName = ProtocolName.FriendPostInvite;

        web_Manager _webMgr = web_Manager.Getsingleton;

        _webMgr.Que_NetData.Enqueue(_net);
        _webMgr.Send_WebProtocol();
    }
Пример #9
0
    public static void SetWords(string _Words, del_webResp_0 delfunc)
    {
        netData _net = new netData();

        _net.set_SendData("Words", _Words);

        _net.del_result   = delfunc;
        _net.protocolName = ProtocolName.SetWords;

        web_Manager _webMgr = web_Manager.Getsingleton;

        _webMgr.Que_NetData.Enqueue(_net);
        _webMgr.Send_WebProtocol();
    }
Пример #10
0
    public static void GetCooponReward(string _CpNum, del_webResp_0 delfunc)
    {
        netData _net = new netData();

        _net.set_SendData("CpNum", _CpNum);

        _net.del_result   = delfunc;
        _net.protocolName = ProtocolName.GetCooponReward;

        web_Manager _webMgr = web_Manager.Getsingleton;

        _webMgr.Que_NetData.Enqueue(_net);
        _webMgr.Send_WebProtocol();
    }
Пример #11
0
    public static void SetTutoBit(byte _BitIdx, del_webResp_0 delfunc)
    {
        netData _net = new netData();

        _net.set_SendData("BitIdx", _BitIdx);

        _net.del_result   = delfunc;
        _net.protocolName = ProtocolName.SetTutoBit;

        web_Manager _webMgr = web_Manager.Getsingleton;

        _webMgr.Que_NetData.Enqueue(_net);
        _webMgr.Send_WebProtocol();
    }
Пример #12
0
    public static void ClanOut(uint _OutUserID, del_webResp_0 delfunc)
    {
        netData _net = new netData();

        _net.set_SendData("OutUserID", _OutUserID);

        _net.del_result   = delfunc;
        _net.protocolName = ProtocolName.ClanOut;

        web_Manager _webMgr = web_Manager.Getsingleton;

        _webMgr.Que_NetData.Enqueue(_net);
        _webMgr.Send_WebProtocol();
    }
Пример #13
0
    public static void GetServerList(string _CtrCd, del_webResp_0 delfunc)
    {
        netData _net = new netData();

        _net.set_SendData("CtrCd", _CtrCd);

        _net.del_result   = delfunc;
        _net.protocolName = ProtocolName.GetServerList;

        web_Manager _webMgr = web_Manager.Getsingleton;

        _webMgr.Que_NetData.Enqueue(_net);
        _webMgr.Send_WebProtocol();
    }
Пример #14
0
    public static void GetReferenceDB(List <int> _dataIdxLst, del_webResp_0 delfunc)
    {
        netData _net = new netData();

        _net.set_SendData("DataIdxLst", _dataIdxLst);

        _net.del_result   = delfunc;
        _net.protocolName = ProtocolName.GetReferenceDB;

        web_Manager _webMgr = web_Manager.Getsingleton;

        _webMgr.Que_NetData.Enqueue(_net);
        _webMgr.Send_WebProtocol();
    }
Пример #15
0
    public static void GetAdDoubleRwd(AdDoubleRewardType _AdKnd, del_webResp_0 delfunc)
    {
        netData _net = new netData();

        _net.set_SendData("AdKnd", (int)_AdKnd);

        _net.del_result   = delfunc;
        _net.protocolName = ProtocolName.GetAdDoubleRwd;

        web_Manager _webMgr = web_Manager.Getsingleton;

        _webMgr.Que_NetData.Enqueue(_net);
        _webMgr.Send_WebProtocol();
    }
Пример #16
0
    public static void GameEnd(int _endKey, bool _winFlg, del_webResp_0 delfunc)
    {
        netData _net = new netData();

        _net.set_SendData("EndKey", _endKey);
        _net.set_SendData("WinFlg", _winFlg);

        _net.del_result   = delfunc;
        _net.protocolName = ProtocolName.GameEnd;

        web_Manager _webMgr = web_Manager.Getsingleton;

        _webMgr.Que_NetData.Enqueue(_net);
        _webMgr.Send_WebProtocol();
    }
Пример #17
0
    public static void FriendAdd(uint _FrUserID, string _FrToken, del_webResp_0 delfunc)
    {
        netData _net = new netData();

        _net.set_SendData("FrUserID", _FrUserID);
        _net.set_SendData("FrToken", _FrToken);

        _net.del_result   = delfunc;
        _net.protocolName = ProtocolName.FriendAdd;

        web_Manager _webMgr = web_Manager.Getsingleton;

        _webMgr.Que_NetData.Enqueue(_net);
        _webMgr.Send_WebProtocol();
    }
Пример #18
0
    public static void ClanBodWrite(string _BodTxt, del_webResp_0 delfunc)
    {
        netData _net = new netData();

        _net.set_SendData("BodTxt", _BodTxt);


        _net.del_result   = delfunc;
        _net.protocolName = ProtocolName.ClanBodWrite;

        web_Manager _webMgr = web_Manager.Getsingleton;

        _webMgr.Que_NetData.Enqueue(_net);
        _webMgr.Send_WebProtocol();
    }
Пример #19
0
    public static void SetOption(byte _LggCd, byte _ClanPush, del_webResp_0 delfunc)
    {
        netData _net = new netData();

        _net.set_SendData("LggCd", _LggCd);
        _net.set_SendData("ClanPush", _ClanPush);

        _net.del_result   = delfunc;
        _net.protocolName = ProtocolName.SetOption;

        web_Manager _webMgr = web_Manager.Getsingleton;

        _webMgr.Que_NetData.Enqueue(_net);
        _webMgr.Send_WebProtocol();
    }
Пример #20
0
    public static uint nowSearchRankingUnitIdx = 0;             // 랭킹 검색시 현재 랭킹 검색하고 있는 유닛인덱스

    #region Protocol : CheckServer (서버상태 알기)
    public static void CheckServer(byte _MktIdx, int _ver, byte _LggCd, del_webResp_0 delfunc)
    {
        netData _net = new netData(ProtocolName.CheckServer);

        _net.set_SendData("MktIdx", _MktIdx);
        _net.set_SendData("ver", _ver);
        _net.set_SendData("LggCd", _LggCd);

        _net.del_result   = delfunc;
        _net.protocolName = ProtocolName.CheckServer;
        web_Manager _webMgr = web_Manager.Getsingleton;

        _webMgr.Que_NetData.Enqueue(_net);
        _webMgr.Send_WebProtocol();
    }
Пример #21
0
    public static void ClanGiveUnit(uint _UnitIdx, byte _MemIdx, del_webResp_0 delfunc)
    {
        netData _net = new netData();

        _net.set_SendData("UnitIdx", _UnitIdx);
        _net.set_SendData("MemIdx", _MemIdx);

        _net.del_result   = delfunc;
        _net.protocolName = ProtocolName.ClanGiveUnit;

        web_Manager _webMgr = web_Manager.Getsingleton;

        _webMgr.Que_NetData.Enqueue(_net);
        _webMgr.Send_WebProtocol();
    }
Пример #22
0
    public static void ClanJoinAccept(ushort _BodIdx, uint _JoinUserID, del_webResp_0 delfunc)
    {
        netData _net = new netData();

        _net.set_SendData("BodIdx", _BodIdx);
        _net.set_SendData("JoinUserID", _JoinUserID);


        _net.del_result   = delfunc;
        _net.protocolName = ProtocolName.ClanJoinAccept;

        web_Manager _webMgr = web_Manager.Getsingleton;

        _webMgr.Que_NetData.Enqueue(_net);
        _webMgr.Send_WebProtocol();
    }
Пример #23
0
    public static void ClanSetStep(byte _MemIdx, byte _CnRank, del_webResp_0 delfunc)
    {
        netData _net = new netData();

        _net.set_SendData("MemIdx", _MemIdx);
        _net.set_SendData("CnRank", _CnRank);


        _net.del_result   = delfunc;
        _net.protocolName = ProtocolName.ClanSetStep;

        web_Manager _webMgr = web_Manager.Getsingleton;

        _webMgr.Que_NetData.Enqueue(_net);
        _webMgr.Send_WebProtocol();
    }
Пример #24
0
    public static void SetUseUnitIdx(uint _UnitIdx1, uint _UnitIdx2, uint _UnitIdx3, del_webResp_0 delfunc)
    {
        netData _net = new netData();

        _net.set_SendData("UnitIdx1", _UnitIdx1);
        _net.set_SendData("UnitIdx2", _UnitIdx2);
        _net.set_SendData("UnitIdx3", _UnitIdx3);

        _net.del_result   = delfunc;
        _net.protocolName = ProtocolName.SetUseUnitIdx;

        web_Manager _webMgr = web_Manager.Getsingleton;

        _webMgr.Que_NetData.Enqueue(_net);
        _webMgr.Send_WebProtocol();
    }
Пример #25
0
    public static void ClanInvite(uint _InviteUserID, del_webResp_0 delfunc)
    {
        //사용하는 제화타입 저장
        nowUseGoods = ITEMTYPE.GOLD;

        netData _net = new netData();

        _net.set_SendData("InviteUserID", _InviteUserID);

        _net.del_result   = delfunc;
        _net.protocolName = ProtocolName.ClanInvite;

        web_Manager _webMgr = web_Manager.Getsingleton;

        _webMgr.Que_NetData.Enqueue(_net);
        _webMgr.Send_WebProtocol();
    }
Пример #26
0
    public static void GetAuthentication(int _Ver, byte _PlfID, string _lgnKey, del_webResp_0 func1)
    {
        netData _net = new netData();

        _net.set_SendData("Ver", _Ver);
        _net.set_SendData("PlfID", _PlfID);
        _net.set_SendData("LgnKey", _lgnKey);


        _net.del_result   = func1;
        _net.protocolName = ProtocolName.GetAuthentication;         // 요청할 프로토콜이름 설정

        web_Manager _webMgr = web_Manager.Getsingleton;

        _webMgr.Que_NetData.Enqueue(_net);
        _webMgr.Send_WebProtocol();
    }
Пример #27
0
    public static void PostRecv(uint _PostIdx, uint _Month, bool _Accept, del_webResp_0 delfunc)
    {
        netData _net = new netData();

        _net.set_SendData("PostIdx", _PostIdx);
        _net.set_SendData("Month", _Month);
        _net.set_SendData("Accept", _Accept);


        _net.del_result   = delfunc;
        _net.protocolName = ProtocolName.PostRecv;

        web_Manager _webMgr = web_Manager.Getsingleton;

        _webMgr.Que_NetData.Enqueue(_net);
        _webMgr.Send_WebProtocol();
    }
Пример #28
0
    public static void ClanPersonsCntUp(int _Price, del_webResp_0 delfunc)
    {
        //사용하는 제화타입 저장
        nowUseGoods = ITEMTYPE.GEM;

        netData _net = new netData();

        _net.set_SendData("Price", _Price);

        _net.del_result   = delfunc;
        _net.protocolName = ProtocolName.ClanPersonsCntUp;

        web_Manager _webMgr = web_Manager.Getsingleton;

        _webMgr.Que_NetData.Enqueue(_net);
        _webMgr.Send_WebProtocol();
    }
Пример #29
0
    public static void ClanSetBuf(byte _BufType, uint _Price, del_webResp_0 delfunc)
    {
        webRequest.nowUseGoods = ITEMTYPE.GEM;

        netData _net = new netData();

        _net.set_SendData("BufType", _BufType);
        _net.set_SendData("Price", _Price);

        _net.del_result   = delfunc;
        _net.protocolName = ProtocolName.ClanSetBuf;

        web_Manager _webMgr = web_Manager.Getsingleton;

        _webMgr.Que_NetData.Enqueue(_net);
        _webMgr.Send_WebProtocol();
    }
Пример #30
0
    public static void SetItBoxUnLock(int _btSlotIdx, del_webResp_0 delfunc)
    {
        //사용하는 제화타입 저장
        nowUseGoods = ITEMTYPE.GEM;

        netData _net = new netData();

        _net.set_SendData("BtSlotIdx", _btSlotIdx);

        _net.del_result   = delfunc;
        _net.protocolName = ProtocolName.SetItBoxUnLock;

        web_Manager _webMgr = web_Manager.Getsingleton;

        _webMgr.Que_NetData.Enqueue(_net);
        _webMgr.Send_WebProtocol();
    }
Пример #31
0
 public int sceUtilityGetNetParam(int conf, int param, netData* data)
 {
     PointerUtils.StoreStringOnPtr("Temp", Encoding.UTF8, data[0].asString, 128);
     //throw(new NotImplementedException());
     return 0;
 }