Ejemplo n.º 1
0
    public void stopListening()
    {
        Debug.Log("stop listening");

        Bonjour.StartLookup("stoplisten", "second");
        Debug.Log("making the first call");
    }
Ejemplo n.º 2
0
    public void makeTheCall()
    {
        Debug.Log("making the first call");

        Bonjour.StartLookup("listen", "second");
        Debug.Log("making the first call");
    }
Ejemplo n.º 3
0
 void Start()
 {
     if (Application.platform == RuntimePlatform.IPhonePlayer && s_IsFirstEnterGame)
     {
         Debug.Log("initialize!");
         Bonjour.SetAutoRotation(false);
         Bonjour.SetScreenOrientation(3);
         //Bonjour.ShowToolBar();
         Bonjour.InitializeNdPlatform(NdCenter.Instace.AppID, NdCenter.Instace.AppKey);
         if (NdCenter.Instace.IsDebug)
         {
             Bonjour.DebugMode();
         }
     }
     else if (!s_IsFirstEnterGame)
     {
         this.m_IsLogin = true;
         //this.Initialize();
     }
     else
     {
         s_IsFirstEnterGame = false;
         Application.LoadLevel(ClientStringConstants.INITIAL_SCENE_LEVEL_NAME);
     }
 }
Ejemplo n.º 4
0
    public void makeTheCall(string service, string domain)
    {
        //if (!isMac) {

        Bonjour.StartLookup(service, domain);
        //}
    }
Ejemplo n.º 5
0
    private void SendSwitchRequest()
    {
        string uid = Bonjour.GetPlayerID().ToString();
        SwitchAccountRequestParameter request = new SwitchAccountRequestParameter();

        request.AccountID = uid;
        CommunicationUtility.Instance.SwitchAccount(request, this, "OnSwitchResponse", true);
    }
Ejemplo n.º 6
0
    public static void ShowUserCenter()
    {
#if SDK_PP
        Bonjour.showCenterView();
#elif SDK_HM
        Entry.ZHPayShowUserCenter();
#elif SDK_TBT
        SDK.TBUserCenter(0);
#endif
    }
Ejemplo n.º 7
0
 public void Logout()
 {
     if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         if (Bonjour.IsLogined())
         {
             Bonjour.Enter91();
             this.m_IsInPlatform = true;
         }
     }
 }
Ejemplo n.º 8
0
 static void Main(string[] args)
 {
     Bonjour.DireBonjour();
     for (int i = 0; i < 10000; i++)
     {
         if (AForge.Math.Tools.IsPowerOf2(i))
         {
             Console.WriteLine(i + " est une puissance de 2");
         }
     }
 }
Ejemplo n.º 9
0
 public void Login()
 {
     if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         if (Bonjour.IsLogined())
         {
             Bonjour.LoginOut();
         }
         Bonjour.Login();
         this.m_LoginState = LoginState.Logining;
     }
 }
Ejemplo n.º 10
0
    /// <summary>
    /// 展示支付
    /// </summary>
    /// <param name="arg"></param>
    public override void ShowPayment(object[] arg)
    {
        int    num     = (int)(arg[2]);
        int    price   = (int)(arg[4]);
        int    good_id = (int)(arg[1]);
        string pay_id  = "" + (int)(arg[0]);
        string tittle  = "" + num + "个钻石";

#if IOSPP && !UNITY_EDITOR
        Bonjour.exchangeGoods(price, pay_id, tittle, "" + Role.role.GetBaseProperty().m_iPlayerId, channel_id);
#endif
    }
Ejemplo n.º 11
0
 public void Switch()
 {
     this.m_CurrrentOperation = AccountOperationType.Switch;
     if (Bonjour.IsLogined())
     {
         this.SendSwitchRequest();
     }
     else
     {
         NdCenter.Instace.Login();
         this.m_IsLogin = true;
     }
 }
Ejemplo n.º 12
0
    public static int GetCurrentLoginState()
    {
#if SDK_91
        // TODO: API:返回账号状态:0表示未登陆、1表示游客登陆、2表示普通账号登陆
        return(CGetCurrentLoginState());
#elif SDK_PP
        return(Bonjour.PPLoginState());
#elif SDK_HM
        return(Entry.ZHPayIsLogined() ? 1 : 0);
#elif SDK_TBT
        return(SDK.TBIsLogined() ? 1 : 0);
#endif
        return(0);
    }
Ejemplo n.º 13
0
    public static void SDKLogin()
    {
#if SDK_HM
        if (GetCurrentLoginState() != 0)
        {
            if (!TcpIPNetwork.Inst.Connected || !LoginSender)
            {
                OnSDKLogin(HMUserID, HMValidateToken);
            }
        }
#endif
        if (LoginLocked)
        {
            Debug.LogWarning("SDKLogin:LoginLocked");
            return;
        }
        Debug.LogWarning("******SDKLogin:LoginNotLocked");
        TcpIPNetwork.Inst.Close(false);
        if (GetCurrentLoginState() != 0)
        {
            SDKLogout(1);
        }
#if SDK_91
        // TODO: API:账号登陆
        if (Inst.mFirstLogin)
        {
            CSDKLogin();
            Inst.mFirstLogin = false;
        }
        else
        {
            CSDKSelAccount();
        }
#elif SDK_PP
        //if(!Bonjour.LoginViewShowing)
        {
            Debug.Log("*****SDKLogin.SDKLogin");
            Bonjour.showLoginView();
            Bonjour.LoginViewShowing = true;
        }
#elif SDK_HM
        Entry.ZHPayStartLogin();
#elif SDK_AB
        Entry.showLoginView();
#elif SDK_TBT
        SDK.TBLogin(0);
#endif
        TcpIPNetwork.Inst.ConnectServer(SharedGlobalParams.LoginHost, SharedGlobalParams.LoginPort);
        LoginLocked = true;
    }
Ejemplo n.º 14
0
    private void OnMountResponse(Hashtable response)
    {
        MountAccountResponseParameter param = new MountAccountResponseParameter();

        param.InitialParameterObjectFromHashtable(response);
        if (param.FailType.HasValue)
        {
            this.m_MountFailListener.Invoke((MountFailType)((int)param.FailType.Value));
        }
        else
        {
            string uid = Bonjour.GetPlayerID().ToString();
            this.MountAccount(uid);
        }
    }
Ejemplo n.º 15
0
 public void Initialize()
 {
     if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         if (Bonjour.IsLogined())
         {
             Application.LoadLevel(ClientStringConstants.INITIAL_SCENE_LEVEL_NAME);
         }
         else
         {
             NdCenter.Instace.Login();
             this.m_IsLogin = true;
         }
     }
 }
Ejemplo n.º 16
0
    public static int SDKLogout(int param)
    {
        int ret = 0;

#if SDK_91
        // TODO: API:注销,返回错误码,param: 0,表示注销;1,表示注销,并清除自动登录
        ret = CSDKLogout(param);
#elif SDK_PP
        Bonjour.PPlogout();
#elif SDK_HM
        Entry.ZHPayStartLogout();
#elif SDK_TBT
        SDK.TBLogout();
#endif
        return(ret);
    }
Ejemplo n.º 17
0
    public static void SDKInit(SDKEventHandler callback, string callObjName)
    {
        OnInited = callback;
#if SDK_91
        // TODO: API:SDK初始化
        CSDKInit(SDKConst.appid, SDKConst.appKey, mDebug);
#elif SDK_PP
        Bonjour.initSDK(SDKConst.appid, SDKConst.appKey, true, 100, true, true, true, "", true, true, false, false, callObjName);
#elif SDK_HM
#elif SDK_AB
        Entry.initSDK(SDKConst.appid.ToString(), SDKConst.appKey, 1);
#elif SDK_TBT
        SDK.TBSetUseOldLoadingMode(isUseOldMode);
        isUseOldMode = !isUseOldMode;
        SDK.TBInit(SDKConst.appid);
#endif
    }
Ejemplo n.º 18
0
 public void Buy(string purchaseID, string productID, string name, double price, double originalPrice, int quantity, string description)
 {
     if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         this.m_BuyError = null;
         if (Bonjour.IsLogined())
         {
             Bonjour.UniPay(purchaseID, productID, name, price, price, quantity, description);
             this.m_BuyState = BuyState.Buying;
         }
         else
         {
             this.m_BuyState = BuyState.Fail;
             this.m_BuyError = "Not Login yet!";
         }
     }
 }
Ejemplo n.º 19
0
    public static int SDKUniPayAsyn(string cooOrderSerial, int productId, string productName, float productPrice, int productCount, int zoneID, string roleID)
    {
        int ret = 0;

#if SDK_91
        // TODO: API:异步支付(订单号,道具ID,道具名,价格,数量,分区:不超过20个英文或数字的字符串)
        ret = CSDKUniPayAsyn(cooOrderSerial, roleID, productName, productPrice, productCount, zoneID.ToString());
#elif SDK_PP
        string userID = SharedLoginGameKeys.Inst.UserID;
        Bonjour.exchangeGoods(productPrice, cooOrderSerial, productName, userID + "," + roleID, zoneID);
#elif SDK_HM
        Entry.ZHPayStartOrder(cooOrderSerial, productName, Text.SharedShowStrings.斗战西游.ToString(), (int)productPrice, Entry.ZHPayGetUserId() + "," + roleID);
#elif SDK_AB
        Entry.checkoutWithOrder(cooOrderSerial, productId, (int)productPrice, SDKUserName + "," + roleID, "");
#elif SDK_TBT
        lastOrderNumber = cooOrderSerial;
        SDK.TBPayRMB((int)productPrice, cooOrderSerial, SDK.TBUserID() + "," + roleID);
#endif
        return(ret);
    }
Ejemplo n.º 20
0
    /// <summary>
    /// 初始化
    /// </summary>
    public override void Init()
    {
#if IOSPP && !UNITY_EDITOR
        Bonjour.initSDK(APP_ID, APP_KEY, paramIsNSlogData, paramRechargeAmount, paramIsLongComet, paramIsLogOutPushLoginView, paramIsOpenRecharge, "close recharge message", paramIsDeviceOrientationLandscapeLeft, paramIsDeviceOrientationLandscapeRight, paramIsDeviceOrientationPortrait, paramIsDeviceOrientationPortraitUpsideDown, paramSendMsgNotiClass);
#endif
    }
Ejemplo n.º 21
0
    /// <summary>
    /// 显示PP用户中心
    /// </summary>
    public void ShowPlatformCenter()
    {
#if IOSPP && !UNITY_EDITOR
        Bonjour.showCenterView();
#endif
    }
Ejemplo n.º 22
0
    /// <summary>
    /// 登出
    /// </summary>
    public override void ShowLogout()
    {
#if IOSPP && !UNITY_EDITOR
        Bonjour.PPlogout();
#endif
    }
Ejemplo n.º 23
0
    /// <summary>
    /// 展示帐号登录
    /// </summary>
    public override void ShowLogin()
    {
#if IOSPP && !UNITY_EDITOR
        Bonjour.showLoginView();
#endif
    }
Ejemplo n.º 24
0
 /// <summary>
 /// 登录回调
 /// </summary>
 /// <param name="paramNoti"></param>
 void U3D_loginCallBack(string paramNoti)
 {
     //System.Console.WriteLine("username:"******"U3D_loginCallBack------token" + paramNoti + "-userid:" + Bonjour.currentUserId());
     SendAgent.SendAccountIOSPPLogin(Bonjour.currentUserId(), paramNoti);
 }
Ejemplo n.º 25
0
 public void turnOffVideoRecord()
 {
     Bonjour.StartLookup("VideoRecordOff", "second");
 }