Exemplo n.º 1
0
        void NotifyExtraFunction(string _json_string)
        {
            U3DTypeBaseData resultDat = new U3DTypeBaseData();

            resultDat.StringToData(_json_string);
            U3DTypeSDK.Instance.SendEvent(TypeEventType.Event_EXTRA_FUNCTION, resultDat);
        }
Exemplo n.º 2
0
        public void NotifyUserFriends(string _json_string)
        {
            U3DTypeBaseData resultDat = new U3DTypeBaseData();

            resultDat.StringToData(_json_string);
            U3DTypeSDK.Instance.SendEvent(TypeEventType.EVENT_GET_FRIEND_RESULT, resultDat);
        }
Exemplo n.º 3
0
        public void NotifyShareResult(string _json_string)
        {
            U3DTypeBaseData resultDat = new U3DTypeBaseData();

            resultDat.StringToData(_json_string);
            U3DTypeSDK.Instance.SendEvent(TypeEventType.EVENT_SHARE_RESULT, resultDat);
        }
Exemplo n.º 4
0
        public void NotifyCancelExitGame(string _in_data)
        {
            U3DTypeBaseData resultDat = new U3DTypeBaseData();

            resultDat.StringToData(_in_data);
            U3DTypeSDK.Instance.SendEvent(TypeEventType.EVENT_CANCEL_EXIT_GAME, resultDat);
        }
Exemplo n.º 5
0
        /**收到本地推送相应(非必接)*/
        public void NotifyReceiveLocalPush(string _in_data)
        {
            U3DTypeBaseData resultDat = new U3DTypeBaseData();

            resultDat.StringToData(_in_data);
            U3DTypeSDK.Instance.SendEvent(TypeEventType.EVENT_RECEIVE_LOCAL_PUSH, resultDat);
        }
Exemplo n.º 6
0
        //支付结果响应
        public void NotifyPayResult(string _in_data)
        {
            U3DTypeBaseData resultDat = new U3DTypeBaseData();

            resultDat.StringToData(_in_data);
            U3DTypeSDK.Instance.SendEvent(TypeEventType.EVENT_PAY_RESULT, resultDat);
        }
Exemplo n.º 7
0
        //重新登录响应
        public void NotifyRelogin(string _in_data)
        {
            U3DTypeBaseData resultDat = new U3DTypeBaseData();

            resultDat.StringToData(_in_data);
            U3DTypeSDK.Instance.SendEvent(TypeEventType.EVENT_RELOGIN, resultDat);
        }
Exemplo n.º 8
0
        //更新完毕响应
        public void NotifyUpdateFinish(string _in_data)
        {
            U3DTypeBaseData resultDat = new U3DTypeBaseData();

            resultDat.StringToData(_in_data);
            U3DTypeSDK.Instance.SendEvent(TypeEventType.EVENT_UPDATE_FINISH, resultDat);
        }
Exemplo n.º 9
0
        //登出响应
        public void NotifyLogout(string _in_data)
        {
            U3DTypeBaseData resultDat = new U3DTypeBaseData();

            resultDat.StringToData(_in_data);
            U3DTypeSDK.Instance.SendEvent(TypeEventType.EVENT_LOGOUT, resultDat);
        }
Exemplo n.º 10
0
        //初始化完毕响应
        public void NotifyInitFinish(string _in_data)
        {
            Debug.Log("NotifyInitFinish");
            U3DTypeBaseData resultDat = new U3DTypeBaseData();

            resultDat.StringToData(_in_data);
            U3DTypeSDK.Instance.SendEvent(TypeEventType.EVENT_INIT_FINISH, resultDat);
        }
    public override U3DTypeBaseData GetPlatformData()
    {
        string value = CallGetPlatformData();

        U3DTypeBaseData outData = new U3DTypeBaseData();

        outData.StringToData(value);
        return(outData);
    }
Exemplo n.º 12
0
    public override U3DTypeBaseData GetPlatformData()
    {
        System.Console.WriteLine("CallPlatformData");

        AndroidJavaClass  jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
        AndroidJavaObject jo = jc.GetStatic <AndroidJavaObject>("currentActivity");

        string          value   = jo.Call <string>("CallPlatformData");
        U3DTypeBaseData outData = new U3DTypeBaseData();

        outData.StringToData(value);
        return(outData);
    }
Exemplo n.º 13
0
    void ServerCBK_createOrder(string data, UnityEngine.Object crossData)
    {
        U3DTypeBaseData result = new U3DTypeBaseData();

        result.StringToData(data);
        if (null != result && "" != result.GetData("oid"))
        {
            localPayData.SetData(U3DTypeAttName.BILL_NUMBER, result.GetData("oid"));
        }

        messageStr = data;

        //pay bill
        this.ActionPayCurrentOrder();
    }
Exemplo n.º 14
0
    void RenderInline()
    {
        int i = 1;

        inline_s_a = GUI.TextField(arr_LOCATION[i++], inline_s_a, 300);
        inline_s_b = GUI.TextField(arr_LOCATION[i++], inline_s_b, 300);

        if (GUI.Button(arr_LOCATION[i++], ">>>inline<<<"))
        {
            U3DTypeBaseData data = new U3DTypeBaseData();
            data.StringToData(inline_s_b);
            U3DTypeSDK.Instance.DoAnyFunction(inline_s_a, data);
        }

        if (GUI.Button(arr_LOCATION[i++], ">>>返回主菜单<<<"))
        {
            current_ui_model = UI_MENU;
        }
    }
Exemplo n.º 15
0
    //
    /////server logic///////
    /// ;
    void ServerCBK_login(string data, UnityEngine.Object crossData)
    {
        U3DTypeBaseData result = new U3DTypeBaseData();

        result.StringToData(data);
        if (null == result.attMap())
        {
            Debug.Log("error string to data in server cbk login");
        }
        if (null != result && "" != result.GetData("uid"))
        {
            U3DTypeBaseData userinfo = U3DTypeSDK.Instance.GetUserData();
            userinfo.SetData(U3DTypeAttName.USER_ID, result.GetData("uid"));
            userinfo.SetData(U3DTypeAttName.USER_TOKEN, result.GetData("token"));

            ActionGetAccount();
        }
        current_ui_model = UI_MENU;         // go to menu
        messageStr       = data;
    }
Exemplo n.º 16
0
    void ServerCBK_getAccount(string data, UnityEngine.Object crossData)
    {
        Debug.Log("ServerCBK_getAccount is :" + data);
        U3DTypeBaseData result = new U3DTypeBaseData();

        result.StringToData(data);
        if (null != result)
        {
            Debug.Log("null != result :");
            if (0 != result.GetInt("code"))
            {
                Debug.Log("AcitonCreatAccount:");
                AcitonCreatAccount();
            }
            else
            {
                Debug.Log("localUserData is ///////:" + U3DTypeSDK.Instance.GetUserData().DataToString());
                if (null == localUserData)
                {
                    localUserData = U3DTypeSDK.Instance.GetUserData();
                }
                localUserData.SetData(U3DTypeAttName.USER_ID, result.GetData("uid"));
                localUserData.SetData(U3DTypeAttName.USER_TOKEN, result.GetData("token"));

                //以下内容请开发者如实填写实际内容,demo仅供参考
                //如果没有该内容,请填"0"
                localUserData.SetData(U3DTypeAttName.ROLE_TYPE, "createRole");
                localUserData.SetData(U3DTypeAttName.SAVED_BALANCE, "0");
                localUserData.SetData(U3DTypeAttName.USER_NAME, "qudaoyonghu_001");
                localUserData.SetData(U3DTypeAttName.USER_HEAD_ID, "head_001");
                localUserData.SetData(U3DTypeAttName.USER_HEAD_URL, "head_url_001");
                localUserData.SetData(U3DTypeAttName.VIP_LEVEL, "v10");
                localUserData.SetData(U3DTypeAttName.PARTY_NAME, "gonghui");
                localUserData.SetData(U3DTypeAttName.ROLE_ID, "role_001");
                localUserData.SetData(U3DTypeAttName.ROLE_NAME, "role_name_001");
                localUserData.SetData(U3DTypeAttName.ROLE_LEVEL, "99");
                localUserData.SetData(U3DTypeAttName.ROLE_CREATE_TIME, "1234567890");
                localUserData.SetData(U3DTypeAttName.ROLE_LEVELUP_TIME, "2345678901");
                localUserData.SetData(U3DTypeAttName.ZONE_ID, "zone_1");
                localUserData.SetData(U3DTypeAttName.SERVER_ID, "1");
                localUserData.SetData(U3DTypeAttName.SERVER_NAME, "server_name");
                localUserData.SetData(U3DTypeAttName.EXTRA, "1");
                //end
                U3DTypeSDK.Instance.UpdatePlayerInfo();
                Debug.Log("UpdatePlayerInfo is ///////:" + U3DTypeSDK.Instance.GetUserData().DataToString());

                localUserData.attMap()["data"] = result.attMap()["data"];

                int tempBalance = getUserBalance();
                if (userBalance != tempBalance)
                {
                    StopRepeatRequestIntoAccount();
                    userBalance = tempBalance;
                }
                messageStr = "id " + result.GetData("uid") + "update余额 " + userBalance;

                //				U3DTypeSDK.Instance.GetUserData() ;
                //				U3DTypeSDK.Instance.UpdatePlayerInfo();

                Debug.Log("U3DTypeSDK.Instance.GetUserData() is :" + U3DTypeSDK.Instance.GetUserData().DataToString());
            }
        }
    }