示例#1
0
 public void showToolBar(ToolBarPlace align)
 {
     if (this.anySDKUser.isFunctionSupported("showToolBar"))
     {
         AnySDKParam param = new AnySDKParam((int)align);
         this.anySDKUser.callFuncWithParam("showToolBar", param);
     }
 }
示例#2
0
 public void submitLoginGameRole(string type)
 {
     if (this.anySDKUser.isFunctionSupported("submitLoginGameRole"))
     {
         Dictionary <string, string> dictionary = new Dictionary <string, string>();
         UserData userData = ModelManager.Instance.Get_userData_X();
         dictionary["dataType"] = type;
         dictionary["roleId"]   = userData.UserId;
         int loginCount = ModelManager.Instance.Get_userData_X().LoginCount;
         if (loginCount < 1)
         {
             dictionary["roleCTime"] = "-1";
             dictionary["roleName"]  = userData.UserId;
         }
         else
         {
             if (type == "2")
             {
                 dictionary["roleCTime"] = ToolsFacade.ServerCurrentTime.ToShortTimeString();
             }
             dictionary["roleName"] = userData.NickName;
         }
         dictionary["roleLevel"] = CharacterDataMgr.instance.GetUserLevel(userData.Exp).ToString();
         dictionary["zoneId"]    = (ModelManager.Instance.Get_curLoginServerInfo().areaId + 1).ToString();
         dictionary["zoneName"]  = ModelManager.Instance.Get_curLoginServerInfo().servername.ToString();
         dictionary["balance"]   = userData.Diamonds.ToString();
         dictionary["partyName"] = "无工会";
         dictionary["vipLevel"]  = "0";
         if (type == "3")
         {
             dictionary["roleCTime"] = ToolsFacade.ServerCurrentTime.ToShortTimeString();
         }
         else
         {
             dictionary["roleLevelMTime"] = "-1";
         }
         AnySDKParam param = new AnySDKParam(dictionary);
         this.anySDKUser.callFuncWithParam("submitLoginGameRole", param);
     }
 }
示例#3
0
    void UserExternalCall(string msg)
    {
        Debug.Log("UserExternalCall(" + msg + ")");
        Dictionary <string, string> dic = AnySDKUtil.stringToDictionary(msg);
        int    code   = Convert.ToInt32(dic["code"]);
        string result = dic["msg"];

        switch (code)
        {
        case (int)UserActionResultCode.kInitSuccess:        //初始化SDK成功回调
            AnySDKUser.getInstance().login();
            break;

        case (int)UserActionResultCode.kInitFail:        //初始化SDK失败回调
            break;

        case (int)UserActionResultCode.kLoginSuccess:        //登陆成功回调
            AnySDKParam param = new AnySDKParam((int)ToolBarPlace.kToolBarBottomLeft);
            if (AnySDKUser.getInstance().isFunctionSupported("showToolBar"))
            {
                AnySDKUser.getInstance().callFuncWithParam("showToolBar", param);
            }

            if (AnySDKUser.getInstance().isFunctionSupported("enterPlatform"))
            {
                AnySDKUser.getInstance().callFuncWithParam("enterPlatform");
            }
            break;

        case (int)UserActionResultCode.kLoginNetworkError: //登陆失败回调
        case (int)UserActionResultCode.kLoginCancel:       //登陆取消回调
        case (int)UserActionResultCode.kLoginFail:         //登陆失败回调
            break;

        case (int)UserActionResultCode.kLogoutSuccess:        //登出成功回调
            break;

        case (int)UserActionResultCode.kLogoutFail:        //登出失败回调
            break;

        case (int)UserActionResultCode.kPlatformEnter:        //平台中心进入回调

            break;

        case (int)UserActionResultCode.kPlatformBack:        //平台中心退出回调
            break;

        case (int)UserActionResultCode.kPausePage:        //暂停界面回调
            break;

        case (int)UserActionResultCode.kExitPage:        //退出游戏回调
            break;

        case (int)UserActionResultCode.kAntiAddictionQuery:        //防沉迷查询回调
            break;

        case (int)UserActionResultCode.kRealNameRegister:        //实名注册回调
            break;

        case (int)UserActionResultCode.kAccountSwitchSuccess:        //切换账号成功回调
            break;

        case (int)UserActionResultCode.kAccountSwitchFail:        //切换账号成功回调
            break;

        case (int)UserActionResultCode.kOpenShop:        //应用汇  悬浮窗点击粮饷按钮回调
            break;

        default:
            break;
        }
    }