Example #1
0
    public void lotteryOne()
    {
        if (GuideManager.Instance.currentStep == GuideManager.GUIDE_STEP.LOTTERY)
        {
            GuideLottery.Instance.NextStep();            //抽奖指引 SELECT_3
        }
        if (Obj_MyselfPlayer.GetMe().cardBagList.Count >= Obj_MyselfPlayer.GetMe().bagMax)
        {
//			BoxManager.showBagFullBox("您携带的侠士已经达到上限可以将侠士吸收、出售或者扩充您的背包.");
            BoxManager.showMessageByID((int)MessageIdEnum.Msg74);
            return;
        }
        switch (lotteryType)
        {
        case LOTTERY_TYPE.FRIEND:

            if (Obj_MyselfPlayer.GetMe().fpoint < friendLotteryOneCost)
            {
//				BoxManager.showMessage("侠义点数不足");
                BoxManager.showMessageByID((int)MessageIdEnum.Msg51);
                return;
            }
            break;

        case LOTTERY_TYPE.DIAMOND:
            if (Obj_MyselfPlayer.GetMe().dollar < diamondLotteryOneCost)
            {
//				BoxManager.showMessage("元宝不足");
                BoxManager.showMessageByID((int)MessageIdEnum.Msg52);
                return;
            }
            break;
        }
        NetworkSender.Instance().lotteryCard(lotteryCardDone, lotteryType, 1);
    }
 /// <summary>
 /// 领取奖励
 /// </summary>
 /// <param name="item"></param>
 private void FinishTask(GameObject item)
 {
     for (int i = 0; i < taskList.Count; i++)
     {
         if (taskList[i].templetID == int.Parse(item.name) && taskList[i].state == 1)
         {
             taskId = taskList[i].templetID;
             if (TableManager.GetQuestByID(taskId).RewardPower > 0)
             {
                 if (Obj_MyselfPlayer.GetMe().power == TableManager.GetIdexperienceByID(Obj_MyselfPlayer.GetMe().level).IDPhysicalValue)
                 {
                     //						BoxManager.showMessage("当前体力已满,无法领取");
                     BoxManager.showMessageByID((int)MessageIdEnum.Msg60);
                     return;
                 }
                 else if (Obj_MyselfPlayer.GetMe().power > 0)
                 {
                     BoxManager.showMessageByID((int)MessageIdEnum.Msg161);
                     powerTaskID = taskList[i].templetID;
                     UIEventListener.Get(BoxManager.buttonYes).onClick += SureToGetPower;
                     return;
                 }
             }
             NetworkSender.Instance().sendFinishTask(UpdateTaskList, taskList[i].templetID);
             break;
         }
     }
 }
    public void AddQxzbPVP()
    {
        int openLev = 16;

        if (Obj_MyselfPlayer.GetMe().level < openLev)
        {
            BoxManager.showMessageByID((int)MessageIdEnum.Msg111, openLev.ToString());
            return;
        }
        long nleftTime = Obj_MyselfPlayer.GetMe().qxzbStarTime - ((long)Time.time - Obj_MyselfPlayer.GetMe().cursysTime);

        //群雄争霸未开启提示
        if (nleftTime > 0)
        {
            BoxManager.showMessageByID((int)MessageIdEnum.Msg241);
            return;
        }

        //群雄争霸次数已满

        /*if(Obj_MyselfPlayer.GetMe().nQxzbFightTime == 10)
         * {
         *      BoxManager.showMessageByID((int)MessageIdEnum.Msg242);
         *      return;
         * }*/

        Obj_MyselfPlayer.GetMe().BuyCost = 20;
        BuySth((int)MessageIdEnum.Msg200, (int)BuyType.BuyQxzbPVP);
    }
Example #4
0
 public void ActiveBtnClicked()
 {
     if (globalLastSelected <= 0)
     {
         Debug.LogError("Global Last Selected Error : " + globalLastSelected);
         return;
     }
     if (activeBtn.transform.FindChild("Sprite").gameObject.GetComponent <UISprite>().spriteName == "update")         //如果是升级
     {
         int consumeType = TableManager.GetFengshuiByID(globalLastSelected).LevelItemId;
         if (TableManager.GetFengshuiByID(globalLastSelected).LevelItemCount > FengShuiData.Instance().SuipianInfor[consumeType])
         {
             BoxManager.showMessageByID((int)MessageIdEnum.Msg183);
             UIEventListener.Get(BoxManager.buttonYes).onClick += GoPVEWindow;
             return;
         }
         NetworkSender.Instance().updateFengshui(UpdateDone, globalLastSelected);
     }
     else
     {
         if (TableManager.GetFengshuiByID(globalLastSelected).GetActivationbyIndex(0) > FengShuiData.Instance().star)
         {
             Debug.Log("Request : " + TableManager.GetFengshuiByID(globalLastSelected).GetActivationbyIndex(0));
             BoxManager.showMessageByID((int)MessageIdEnum.Msg187);
             UIEventListener.Get(BoxManager.buttonYes).onClick += GoPVEWindow;
             return;
         }
         NetworkSender.Instance().activeFengshui(ActiveDone, globalLastSelected);
     }
 }
        public void TestAsyncGetAuthenticationTokenIfUserIsNotLoggedIn()
        {
            BoxManager manager = new BoxManager(ApplicationKey, ServiceUrl, null);
            string ticket;
            ManualResetEvent wait = new ManualResetEvent(false);
            bool callbackWasExecuted = false;
            const int state = 874524489;

            OperationFinished<GetAuthenticationTokenResponse> callback = resp =>
                                                                         	{
                                                                         		Assert.IsNull(resp.Error);

                                                                         		Assert.IsInstanceOfType(typeof (int), resp.UserState);

                                                                         		Assert.AreEqual(state, (int) resp.UserState);

                                                                                Assert.AreEqual(GetAuthenticationTokenStatus.NotLoggedID, resp.Status);

                                                                                Assert.IsEmpty(resp.AuthenticationToken);
                                                                                Assert.IsNull(resp.AuthenticatedUser);

                                                                         		callbackWasExecuted = true;
                                                                         		wait.Reset();
                                                                         	};

            manager.GetTicket(out ticket);

            manager.GetAuthenticationToken(ticket, callback, state);
            wait.WaitOne(30000);

            Assert.IsTrue(callbackWasExecuted, "Callback was not executed. The operation has timed out");
        }
Example #6
0
    public void ChangeDone(bool isSuccess)
    {
        string name = newName.text;

        if (isSuccess)
        {
            mainUILogic.SendMessage("refreshTopBar");
            switch (Obj_MyselfPlayer.GetMe().changeNameType)
            {
            case 1:
//				("更名成功");
                BoxManager.showMessageByID((int)MessageIdEnum.Msg45);
                break;

            case 2:
//				("元宝不足,不能进行更名");
                BoxManager.showMessageByID((int)MessageIdEnum.Msg46);
                break;

            case 3:
//				("新名字中包含敏感词汇,无法进行更名");
                BoxManager.showMessageByID((int)MessageIdEnum.Msg47);
                break;
            }
            Debug.Log("更改名称成功!");
            newName.text = name;
        }
        else
        {
            Debug.Log("更改名称出错");
        }
    }
Example #7
0
    public void Change()
    {
        string   name = newName.text;
        NameType type = CompName(name);

        switch (type)
        {
        case NameType.NameTooShort:
            BoxManager.showMessageByID((int)MessageIdEnum.Msg42);
            break;

        case NameType.NameTooLong:
            BoxManager.showMessageByID((int)MessageIdEnum.Msg43);
            break;

        case NameType.ErrorLetter:
            BoxManager.showMessageByID((int)MessageIdEnum.Msg44);
            break;

        case NameType.NameOK:
            NetworkSender.Instance().sendChangeName(ChangeDone, name);
            break;

        default:
            return;
        }
        Debug.Log("new name: " + name);
    }
        public void TestAsyncGetTicket()
        {
            BoxManager manager = new BoxManager(ApplicationKey, ServiceUrl, null);
            const int someValue = 78435;
            ManualResetEvent wait = new ManualResetEvent(false);
            bool callbackWasExecuted = false;

            OperationFinished<GetTicketResponse> response = resp =>
                                                                {
                                                                    Assert.IsNull(resp.Error);
                                                                    Assert.IsNotNull(resp.Ticket);
                                                                    Assert.IsInstanceOfType(typeof(int), resp.UserState);
                                                                    Assert.AreEqual(GetTicketStatus.Successful,  resp.Status);

                                                                    int userStatus = (int) resp.UserState;
                                                                    Assert.AreEqual(someValue, userStatus);

                                                                    callbackWasExecuted = true;

                                                                    wait.Reset();
                                                                };

            manager.GetTicket(response, someValue);

            wait.WaitOne(30000);

            Assert.IsTrue(callbackWasExecuted, "Callback was not executed. The operation has timed out");
        }
Example #9
0
 //Function that finds the target for the AI to go to.
 private void findTarget()
 {
     objects = new GameObject[0];
     if (!hasBox)
     {
         objects = GameObject.FindGameObjectsWithTag("Box");
         if (objects.Length > 0)
         {
             int which = Random.Range(0, objects.Length);
             target = objects[which].transform;
         }
     }
     else
     {
         BoxManager box = pickedUpObject.GetComponent <BoxManager>();
         if (box.currentColor == Color.red)
         {
             //Debug.Log(containers[0].name + " has the same color as the " + pickedUpObject.name);
             target = containers[0].transform;
         }
         else if (box.currentColor == Color.blue)
         {
             //Debug.Log(containers[1].name + " has the same color as the " + pickedUpObject.name);
             target = containers[1].transform;
         }
     }
 }
Example #10
0
 public void SetBox(Box first, int[] position)
 {
     this.sprites    = first.sprites;
     this.numSprites = first.numSprites;
     this.boxManager = first.boxManager;
     this.position   = position;
 }
Example #11
0
 public BoxAppService(IBoxRepository boxRepository, BoxManager boxManager, UnitOfWork unitOfWork, LogManager logManager)
 {
     _boxRepository = boxRepository;
     _boxManager    = boxManager;
     _unitOfWork    = unitOfWork;
     _logManager    = logManager;
 }
Example #12
0
    public void lotteryTen()
    {
        if (Obj_MyselfPlayer.GetMe().cardBagList.Count >= Obj_MyselfPlayer.GetMe().bagMax)
        {
//			BoxManager.showBagFullBox("您携带的侠士已经达到上限可以将侠士吸收、出售或者扩充您的背包.");
            BoxManager.showMessageByID((int)MessageIdEnum.Msg74);
            return;
        }
        switch (lotteryType)
        {
        case LOTTERY_TYPE.FRIEND:
            if (Obj_MyselfPlayer.GetMe().fpoint < friendLotteryTenCost)
            {
//				BoxManager.showMessage("侠义点数不足");
                BoxManager.showMessageByID((int)MessageIdEnum.Msg51);
                return;
            }
            break;

        case LOTTERY_TYPE.DIAMOND:
            if (Obj_MyselfPlayer.GetMe().dollar < diamondLotteryTenCost)
            {
//				BoxManager.showMessage("元宝不足");
                BoxManager.showMessageByID((int)MessageIdEnum.Msg52);
                return;
            }
            break;
        }
        NetworkSender.Instance().lotteryCard(lotteryCardDone, lotteryType, 10);
    }
    void OnBindLoginRet(bool bSuccess)
    {
        if (bSuccess)
        {
            switch (Obj_MyselfPlayer.GetMe().cyouCode)
            {
            case -1:
//				BoxManager.showMessage("Billing异常");
                BoxManager.showMessageByID((int)MessageIdEnum.Msg24);
                break;

            case 0:
                AccountInfo info = new AccountInfo();
                info.accountId = Obj_MyselfPlayer.GetMe().accountID;
                info.email     = userName;
                info.password  = password;
                AccountManager.Instance.CurAccount = info;
                //清除快速登录的账号--
                PlayerPrefs.DeleteKey("ACCOUNT_ID");
                if (PlayerPrefs.HasKey(HTTPClientAPI.uri.ToString() + "_Guest"))
                {
                    PlayerPrefs.DeleteKey(HTTPClientAPI.uri.ToString() + "_Guest");
                }
                gameObject.SetActive(false);
                if (AccountManager.Instance.completeDalegate != null)
                {
                    AccountManager.Instance.completeDalegate();
                }
//				BoxManager.showMessage("绑定成功!");

                AccountManager.Instance.ShowCurAccountUI(false);
                BoxManager.showMessageByID((int)MessageIdEnum.Msg25);
                break;

            case 1:
//				BoxManager.showMessage("参数不完整");
                BoxManager.showMessageByID((int)MessageIdEnum.Msg26);
                break;

            case 2:
//				BoxManager.showMessage("用户不存在");
                BoxManager.showMessageByID((int)MessageIdEnum.Msg41);                 //不可能出现
                break;

            case 3:
//				BoxManager.showMessage("密码错误");
                BoxManager.showMessageByID((int)MessageIdEnum.Msg152);                 //不可能出现
                break;

            case 99:
//				BoxManager.showMessage("账号系统异常");
                BoxManager.showMessageByID((int)MessageIdEnum.Msg26);
                break;

            default:
                break;
            }
        }
    }
Example #14
0
        private static void ExecuteAPIMethods(string clientId, string clientSecret, string accessToken, string refreshToken)
        {
            try
            {
                // Optionally refresh the user's access token
                var authenticator = new TokenProvider(clientId, clientSecret);
                var oAuthToken = authenticator.RefreshAccessToken(refreshToken);
                accessToken = oAuthToken.AccessToken;

                // Instantiate a BoxManager with your api key and a user's auth token
                var boxManager = new BoxManager(accessToken);

                // Create a new file in the root folder
                boxManager.CreateFile(Folder.Root, "a new file.txt", Encoding.UTF8.GetBytes("hello, world!"));

                // Fetch the root folder
                Folder folder = boxManager.GetFolder(Folder.Root);

                // Find a 'mini' representation of the created file among the root folder's contents
                File file = folder.Files.Single(f => f.Name.Equals("a new file.txt"));

                // Get the file with all properties populated.
                file = boxManager.Get(file);

                // Rename the file
                file = boxManager.Rename(file, "the new name.txt");

                // Create a new subfolder
                Folder subfolder = boxManager.CreateFolder(Folder.Root, "my subfolder");

                // Move the file to the subfolder
                file = boxManager.Move(file, subfolder);

                // Write some content to the file
                using (var stream = new MemoryStream(Encoding.UTF8.GetBytes("goodbye, world!")))
                {
                    file = boxManager.Write(file, stream);
                }

                // Read the contents to a stream
                using (var stream = new MemoryStream())
                {
                    boxManager.Read(file, stream);
                    using (var reader = new StreamReader(stream))
                    {
                        stream.Position = 0;
                        Console.Out.WriteLine("File content: '{0}'", reader.ReadToEnd());
                    }
                }

                // Delete the folder and its contents
                boxManager.Delete(subfolder, recursive: true);

            }
            catch (BoxException e)
            {
                Console.Out.WriteLine(e);
            }
        }
    private void OnBoom()
    {
        Vector3 v = new Vector3( );

        boomPS.GetComponent <Transform> ( ).position = gameObject.GetComponent <Transform> ( ).position;
        particleSystem.Play( );
        BoxManager.Destroy(gameObject);
    }
Example #16
0
 // Use this for initialization
 void Start()
 {
     boxManager = FindObjectOfType<BoxManager>();
     spawn = GameObject.Find("SpawnPoint");
     player = GameObject.Find("Player");
     score = GameObject.Find("ScoreText").GetComponent<Text>();
     boxesRemaining = GameObject.Find("boxesRemaining").GetComponent<Text>();
 }
Example #17
0
 public static BoxManager GetInstance()
 {
     if (instance == null)
     {
         instance = new BoxManager();
     }
     return(instance);
 }
Example #18
0
    /// <summary>
    /// unplug a box
    /// </summary>
    /// <param name="box"></param>
    private void UnplugOneBox(BoxManager box, int index)
    {
        box.transform.SetParent(_aglomeraManager.ParentNormalBox);
        _allBoxManager.RemoveAt(index);

        box.enabled = true;
        box.UnplugFromAglomera(_agloRigid);
    }
Example #19
0
    void Start()
    {
        GameObject gameObj = GameObject.Find("boxex");

        boxManager = gameObj.gameObject.GetComponent <BoxManager>();
        Invoke("findALocationAndAddABox", 0.1f);
        Invoke("findALocationAndAddABox", 0.1f);
    }
 protected BoxApiTestHarness()
 {
     RefreshAccessToken();
         TestConfigInfo testInfo = TestConfigInfo.Get();
         Client = new BoxManager(testInfo.AccessToken, null, BoxManagerOptions.RetryRequestOnceWhenHttp500Received);
         CollaboratingUser = testInfo.CollaboratingUserId;
         MaxWaitInSeconds = 20;
 }
    public void SendPowerDone(bool isSuccess)
    {
        //sendButton.SetActive(false);

        BoxManager.showMessageByID((int)MessageIdEnum.Msg190, uf.name);
        sendButton.transform.GetComponent <UIButton>().isEnabled = false;
        sendButton.transform.FindChild("Label").GetComponent <UILabel>().text = "今日已赠送";
    }
Example #22
0
        private static void ExecuteAPIMethods(string clientId, string clientSecret, string accessToken, string refreshToken)
        {
            try
            {
                // Optionally refresh the user's access token
                var authenticator = new TokenProvider(clientId, clientSecret);
                var oAuthToken    = authenticator.RefreshAccessToken(refreshToken);
                accessToken = oAuthToken.AccessToken;

                // Instantiate a BoxManager with your api key and a user's auth token
                var boxManager = new BoxManager(accessToken);

                // Create a new file in the root folder
                boxManager.CreateFile(Folder.Root, "a new file.txt", Encoding.UTF8.GetBytes("hello, world!"));

                // Fetch the root folder
                Folder folder = boxManager.GetFolder(Folder.Root);

                // Find a 'mini' representation of the created file among the root folder's contents
                File file = folder.Files.Single(f => f.Name.Equals("a new file.txt"));

                // Get the file with all properties populated.
                file = boxManager.Get(file);

                // Rename the file
                file = boxManager.Rename(file, "the new name.txt");

                // Create a new subfolder
                Folder subfolder = boxManager.CreateFolder(Folder.Root, "my subfolder");

                // Move the file to the subfolder
                file = boxManager.Move(file, subfolder);

                // Write some content to the file
                using (var stream = new MemoryStream(Encoding.UTF8.GetBytes("goodbye, world!")))
                {
                    file = boxManager.Write(file, stream);
                }

                // Read the contents to a stream
                using (var stream = new MemoryStream())
                {
                    boxManager.Read(file, stream);
                    using (var reader = new StreamReader(stream))
                    {
                        stream.Position = 0;
                        Console.Out.WriteLine("File content: '{0}'", reader.ReadToEnd());
                    }
                }

                // Delete the folder and its contents
                boxManager.Delete(subfolder, recursive: true);
            }
            catch (BoxException e)
            {
                Console.Out.WriteLine(e);
            }
        }
Example #23
0
    void Awake()
    {
        GameObject
            IsOnMagnet = null;

        Target     = null;
        boxManager = GameObject.Find("BoxManager").GetComponent <BoxManager>();
        isGameOver = false;
    }
Example #24
0
 public void Init(BoxManager boxes, SensableObjects objs)
 {
     this.boxes = boxes;
     this.allObjects = objs;
     //allObjects.RegisterObject(new SensableObject(gameObject, classification));
     //if(behaviour) {
     //	StartCoroutine(RunStateMachine());
     //}
 }
    public void OnCloseGuide()
    {
        GameObject huodongOver = GuideDirector.Instance.gameObject;

        Destroy(huodongOver);

        BoxManager.show((int)BoxManager.MessageType.NONE, Obj_MyselfPlayer.GetMe().HuodongMiaoshu, ClientConfigure.title);
        UIEventListener.Get(BoxManager.buttonYes).onClick += UpdateUserData;
    }
Example #26
0
    void OnDisable()
    {
        BoxManager.removeMessage();

        ScrollData scData = new ScrollData(scrollBar.scrollValue);

        Obj_MyselfPlayer.GetMe().SetScrollValue(purchase_Key, scData);
        DestroyItems();
    }
 public void goShopWindow()
 {
     BoxManager.removeMessage();
     if (mainLogic == null)
     {
         mainLogic = GameObject.Find("/MainUILogic");
     }
     mainLogic.SendMessage("OnShopWindow");
 }
Example #28
0
    //根据type显示不同Message
    public static void show(int type, string content, string title)
    {
//		title += "WML Test";
        if (content.Contains("<n>"))
        {
            content = content.Replace("<n>", "\n");
        }

        switch (type)
        {
        case 0:
            BoxManager.showMessage(content, title);
            break;

        case 1:
            BoxManager.showConfirmMessage(content, title);
            break;

        case 2:
            BoxManager.showBagFullBox(content, title);
            break;

        case 3:
            BoxManager.showIfGuideBox(content, title);
            break;

        case 4:
            BoxManager.showProcessMessage(content);
            break;

        case 5:
            BoxManager.showWaitingBox(content);
            break;

        case 9:
            BoxManager.showIfGuideBox(content, title);
            break;

        case 6:
        case 7:
        case 8:
        case 10:
        case 11:
        case 13:
            BoxManager.showCustomConfirmBox(content, title, type);
            break;

        case 12:
            BoxManager.showChangeCardBox(content, title);
            break;

        default:
            BoxManager.showMessage(content, title);
            break;
        }
    }
Example #29
0
    IEnumerator RequestServerList()
    {
        List <ServerDetail> servers = GetComponent <SplashController> ().servers;

        Debug.Log("Updating Server List...");

        www = new WWW(url);

        yield return(www);

        if (!string.IsNullOrEmpty(www.error))
        {
            Debug.LogError(www.error);
        }
        else
        {
            serverList = www.text;
        }
        string[] alldataRow = serverList.Split('\n');

        foreach (string line in alldataRow)
        {
            if (String.IsNullOrEmpty(line))
            {
                continue;
            }
            string[] strCol = line.Split('\t');
            if (strCol.Length == 0)
            {
                continue;
            }
            string skey = strCol [0];
            if (string.IsNullOrEmpty(skey))
            {
                yield return(0);
            }
            ServerDetail sd = new ServerDetail(strCol);
            servers.Add(sd);
        }
        if (servers.Count > 0)
        {
            this.GetComponent <SplashController> ().LoadingProgress.GetComponent <UISlider> ().sliderValue = 1.0f;
            BoxManager.removeMessage();
            this.GetComponent <SplashController> ().DownloadListFinish();
            this.GetComponent <SplashController> ().UIForLoadServer(false);
            this.enabled = false;
            //use updated server
        }
        else
        {
//			BoxManager.showMessage("获取服务器列表失败,请重试",ClientConfigure.title);
            BoxManager.showMessageByID((int)MessageIdEnum.Msg145);
            UIEventListener.Get(BoxManager.buttonYes).onClick += Reconnect;
            //generator server list failed; use local server list
        }
    }
    // Start is called before the first frame update
    void Start()
    {
        transform.gameObject.SetActive(true);
        rend      = GetComponent <Renderer>();
        parent    = gameObject.GetComponentInParent <BoxManager>();
        txt       = textObject.GetComponent <TextMeshPro>();
        boxNumber = 400;

        setOriginals();
    }
Example #31
0
    public void sendFreeLotteryRequest()
    {
        if (Obj_MyselfPlayer.GetMe().cardBagList.Count >= Obj_MyselfPlayer.GetMe().bagMax)
        {
//			BoxManager.showBagFullBox("您携带的侠士已经达到上限可以将侠士吸收、出售或者扩充您的背包.");
            BoxManager.showMessageByID((int)MessageIdEnum.Msg74);
            return;
        }
        NetworkSender.Instance().freeLotteryOnce(sendFreeLotteryDone);
    }
        public void TestSyncGetTicket()
        {
            BoxManager manager = new BoxManager(ApplicationKey, ServiceUrl, null);
            string ticket;

            GetTicketStatus operationStatus = manager.GetTicket(out ticket);

            Assert.AreEqual(GetTicketStatus.Successful, operationStatus);
            Assert.IsNotNull(ticket);
        }
Example #33
0
        protected BoxApiTestHarness()
        {
            RefreshAccessToken();
            TestConfigInfo testInfo = TestConfigInfo.Get();

            Client                     = GetClient(testInfo.AccessToken, null);
            CollaboratingUser          = testInfo.CollaboratingUserId;
            CollaboratingUserEmail     = testInfo.CollaboratingUserEmail;
            MaxQuarterSecondIterations = 80;
        }
    void Ret_OnGet(bool bSuccess)
    {
        if (bSuccess)
        {
            GameObject.FindWithTag("main_controller").SendMessage("updateUserInfo");
            CloseWindow();
//            BoxManager.showMessageByID((int)MessageIdEnum.Msg135);
            BoxManager.showMessageByID((int)MessageIdEnum.Msg150);
        }
    }
    public void ShowHeroCardInfo(GameObject btn)
    {
        long         leaderGuid = Obj_MyselfPlayer.GetMe().GetTeamLeaderCardID();
        UserCardItem card       = Obj_MyselfPlayer.GetMe().GetUserCardByGUID(leaderGuid);

        if (card != null)
        {
            BoxManager.showCardInfoMessage(card);
        }
    }
    public void ReceivePowerDone(bool isSuccess)
    {
        //acceptButton.SetActive(false);
        //acceptButton.transform.FindChild("Label").GetComponent<UILabel>().text = "今日已接受";
        //您已获得{0}赠送的2点体力<n>今天还可接受{1}名好友的赠送哦
        string num = (10 - Obj_MyselfPlayer.GetMe().receive_power_time).ToString();

        BoxManager.showMessageByID((int)MessageIdEnum.Msg191, uf.name, num);
        acceptButton.transform.GetComponent <UIButton>().isEnabled = false;
    }
Example #37
0
 void OnGetDollarBtn()
 {
     if (Obj_MyselfPlayer.GetMe().cardBagList.Count >= Obj_MyselfPlayer.GetMe().bagMax)
     {
         //			BoxManager.showBagFullBox("您携带的侠士已经达到上限可以将侠士吸收、出售或者扩充您的背包.");
         BoxManager.showMessageByID((int)MessageIdEnum.Msg74);
         return;
     }
     NetworkSender.Instance().RequestGetMonthCardDollar(GetMonthCardDollarDone);
 }
        public void TestAsyncGetTicketWithNoCallbackDelegate()
        {
            BoxManager manager = new BoxManager(ApplicationKey, ServiceUrl, null);

            try
            {
                manager.GetTicket(null);

                Assert.Fail("GetTicket(null) call has to fail");
            }
            catch (Exception ex)
            {
                Assert.IsInstanceOfType(typeof(ArgumentException), ex);
            }
        }
Example #39
0
    // Use this for initialization
    void Start()
    {
        speed = 75.0f;
        boxManager = FindObjectOfType<BoxManager>();

        if (item == GameObject.Find("ItemBox1"))
            boxesToGive = 1;

        if (item == GameObject.Find("ItemBox2"))
            boxesToGive = 2;

        if (item == GameObject.Find("ItemBox3"))
            boxesToGive = 3;

        if (item == GameObject.Find("ItemBoxRand"))
            boxesToGive = Random.Range(0,5);
    }
        public void TestAsyncGetAuthenticationToken()
        {
            BoxManager manager = new BoxManager(ApplicationKey, ServiceUrl, null);
            string ticket;
            ManualResetEvent wait = new ManualResetEvent(false);
            bool callbackWasExecuted = false;
            const int state = 874532489;

            OperationFinished<GetAuthenticationTokenResponse> callback = resp =>
                                                                         	{
                                                                                Assert.IsNull(resp.Error);

                                                                                Assert.IsInstanceOfType(typeof(int), resp.UserState);

                                                                                Assert.AreEqual(state, (int) resp.UserState);

                                                                                Assert.AreEqual(GetAuthenticationTokenStatus.Successful, resp.Status);

                                                                                Assert.IsNotNull(resp.AuthenticationToken);
                                                                                Assert.IsNotNull(resp.AuthenticatedUser);

                                                                                Assert.IsNotNull(resp.AuthenticatedUser.Email);
                                                                                Assert.IsNotNull(resp.AuthenticatedUser.Login);
                                                                                StringAssert.IsMatch(Login, resp.AuthenticatedUser.Login);
                                                                                Assert.AreNotEqual(0, resp.AuthenticatedUser.AccessID);
                                                                                Assert.AreNotEqual(0, resp.AuthenticatedUser.ID);
                                                                                //Assert.AreNotEqual(0, resp.AuthenticatedUser.MaxUploadSize);
                                                                                Assert.AreNotEqual(0, resp.AuthenticatedUser.SpaceAmount);
                                                                                Assert.AreNotEqual(0, resp.AuthenticatedUser.SpaceUsed);

                                                                         		callbackWasExecuted = true;
                                                                         		wait.Reset();
                                                                         	};

            manager.GetTicket(out ticket);

            SubmitAuthenticationInformation(ticket);

            manager.GetAuthenticationToken(ticket, callback, state);
            wait.WaitOne(30000);

            Assert.IsTrue(callbackWasExecuted, "Callback was not executed. The operation has timed out");
        }
        public void TestSyncGetAuthenticationTokenIfUserIsNotLoggedIn()
        {
            BoxManager manager = new BoxManager(ApplicationKey, ServiceUrl, null);
            string ticket;
            string token;
            User user;

            manager.GetTicket(out ticket);

            GetAuthenticationTokenStatus status = manager.GetAuthenticationToken(ticket, out token, out user);

            Assert.AreEqual(GetAuthenticationTokenStatus.NotLoggedID, status);

            Assert.IsEmpty(token);
            Assert.IsNull(user);
        }
        public void TestSyncGetAuthenticationTokenWithWrongTicket()
        {
            BoxManager manager = new BoxManager(ApplicationKey, ServiceUrl, null);
            string ticket;
            string token;
            User user;

            manager.GetTicket(out ticket);

            SubmitAuthenticationInformation(ticket);

            GetAuthenticationTokenStatus status = manager.GetAuthenticationToken(Guid.Empty.ToString(), out token, out user);

            Assert.AreEqual(GetAuthenticationTokenStatus.Failed, status);

            Assert.IsEmpty(token);
            Assert.IsNull(user);
        }
        protected void InitializeContext()
        {
            BoxManager manager = new BoxManager(ApplicationKey, ServiceUrl, null);
            string ticket;
            string token;
            User user;

            manager.GetTicket(out ticket);

            SubmitAuthenticationInformation(ticket);

            manager.GetAuthenticationToken(ticket, out token, out user);

            Context = new TestContext
                      	{
                      		AuthenticatedUser = user,
                      		Manager = manager,
                      		Ticket = ticket,
                      		Token = token
                      	};
        }
Example #44
0
File: Game1.cs Project: KEZI/Kod
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here
            //TitleScreen = new TitleScreen(Content, new EventHandler(TitleScreenEvent));

            Zelda = new Hero();
            BackgroundOne = new Sprite();
            BackgroundTwo = new Sprite();
            BackgroundThree = new Sprite();
            BGMan = new BackgroundManager();
            BoxOne = new Sprite();
            BoxTwo = new Sprite();
            BoxThree = new Sprite();
            BoxMan = new BoxManager();

            // Create a new SpriteBatch, which can be used to draw textures.
            SBatch = new SpriteBatch(GraphicsDevice);

            //CurrentScreen = TitleScreen;

            base.Initialize();
        }
Example #45
0
 public BoxAvoidance(BoxManager newBoxes, float distance)
 {
     boxes = newBoxes;
     predictionTime = distance;
 }
 protected static void DeleteFolder(BoxManager manager, long folderID)
 {
     manager.DeleteObject(folderID, ObjectType.Folder);
 }
Example #47
0
 public void Awake()
 {
     singleton = this;
     displayLayer = -1;
 }
 protected static CreateFolderResponse CreateFolder(BoxManager manager, string folderName)
 {
     return manager.CreateFolder(folderName, 0, false);
 }
        public void TestSyncGetAuthenticationToken()
        {
            BoxManager manager = new BoxManager(ApplicationKey, ServiceUrl, null);
            string ticket;
            string token;
            User user;

            manager.GetTicket(out ticket);

            SubmitAuthenticationInformation(ticket);

            GetAuthenticationTokenStatus status = manager.GetAuthenticationToken(ticket, out token, out user);

            Assert.AreEqual(GetAuthenticationTokenStatus.Successful, status);

            Assert.IsNotNull(token);
            Assert.IsNotNull(user);

            Assert.IsNotNull(user.Email);
            Assert.IsNotNull(user.Login);
            StringAssert.IsMatch(Login, user.Login);
            Assert.AreNotEqual(0, user.AccessID);
            Assert.AreNotEqual(0, user.ID);
            //Assert.AreNotEqual(0, user.MaxUploadSize);
            Assert.AreNotEqual(0, user.SpaceAmount);
            Assert.AreNotEqual(0, user.SpaceUsed);
        }
        protected static UploadFileResponse UploadTemporaryFile(BoxManager manager)
        {
            byte[] fileContent = Encoding.UTF8.GetBytes(Guid.Empty.ToString());

            return UploadTemporaryFile(manager, fileContent, 0);
        }
        public void TestAsyncGetAuthenticationTokenWithNoCallbackDelegate()
        {
            BoxManager manager = new BoxManager(ApplicationKey, ServiceUrl, null);
            string ticket;

            manager.GetTicket(out ticket);

            SubmitAuthenticationInformation(ticket);

            try
            {
                manager.GetAuthenticationToken(ticket, null);

                Assert.Fail("GetAuthenticationToken(ticket, null) has to fail");
            }
            catch (Exception ex)
            {
                Assert.IsInstanceOfType(typeof(ArgumentException), ex);
            }
        }
Example #52
0
	void Start ()
    {
        instance = this;
        boxPrefab = Resources.Load("Box") as GameObject;
        SpawnBoxes();
	}
 protected static void DeleteTemporaryFile(BoxManager manager, long objectID)
 {
     manager.DeleteObject(objectID, ObjectType.File);
 }
        protected static UploadFileResponse UploadTemporaryFile(BoxManager manager, byte[] fileContent, long folderID)
        {
            string tempFileName = Path.GetTempFileName();

            System.IO.File.WriteAllBytes(tempFileName, fileContent);

            return manager.AddFile(tempFileName, 0);
        }