Example #1
0
        /// <summary>
        /// 載入玩家道具(全部)資料
        /// </summary>
        public byte[] LoadPlayerItem(string account)
        {
            PlayerData playerData = new PlayerData();

            playerData.ReturnCode    = "S400";
            playerData.ReturnMessage = "";

            try
            {
                PlayerDataLogic playerDataLogic = new PlayerDataLogic();
                playerData = playerDataLogic.LoadPlayerItem(account);
            }
            catch (Exception e)
            {
                playerData.ReturnCode    = "S499";
                playerData.ReturnMessage = e.Message;
                throw e;
            }
            return(TextUtility.SerializeToStream(playerData));
        }
Example #2
0
        /// <summary>
        /// 更新玩家(道具)裝備狀態
        /// </summary>
        /// <param name="account"></param>
        /// <param name="itemID"></param>
        /// <param name="isEquip"></param>
        /// <returns></returns>
        public byte[] SortPlayerItem(string account, string jString)
        {
            PlayerData playerData = new PlayerData();

            playerData.ReturnCode    = "S400";
            playerData.ReturnMessage = "";

            try
            {
                PlayerDataLogic playerDataLogic = new PlayerDataLogic();
                playerData = playerDataLogic.SortPlayerItem(account, jString);
            }
            catch (Exception e)
            {
                playerData.ReturnCode    = "S499";
                playerData.ReturnMessage = "(UI)玩家資料未知例外情況! " + e.Message;
                throw e;
            }
            return(TextUtility.SerializeToStream(playerData));
        }
Example #3
0
        /// <summary>
        /// 更新玩家(道具)裝備狀態
        /// </summary>
        /// <param name="account"></param>
        /// <param name="itemID"></param>
        /// <param name="isEquip"></param>
        /// <returns></returns>
        public byte[] UpdatePlayerItem(string account, Int16 itemID, bool isEquip)
        {
            PlayerData playerData = new PlayerData();

            playerData.ReturnCode    = "S400";
            playerData.ReturnMessage = "";

            try
            {
                PlayerDataLogic playerDataLogic = new PlayerDataLogic();
                playerData = playerDataLogic.UpdatePlayerItem(account, itemID, isEquip);
            }
            catch (Exception e)
            {
                playerData.ReturnCode    = "S499";
                playerData.ReturnMessage = "(UI)玩家資料未知例外情況! " + e.Message;
                throw e;
            }
            return(TextUtility.SerializeToStream(playerData));
        }
Example #4
0
        /// <summary>
        /// 更新 玩家(TeamUpdate時)資料
        /// </summary>
        public byte[] UpdatePlayerData(string account, string miceAll, string team)
        {
            PlayerData playerData = new PlayerData();

            playerData.ReturnCode    = "S400";
            playerData.ReturnMessage = "";

            try
            {
                PlayerDataLogic playerDataLogic = new PlayerDataLogic();
                playerData = playerDataLogic.UpdatePlayerData(account, miceAll, team);
            }
            catch (Exception e)
            {
                playerData.ReturnCode    = "S499";
                playerData.ReturnMessage = "(UI)玩家資料未知例外情況! " + e.Message;
                throw e;
            }
            return(TextUtility.SerializeToStream(playerData));
        }
Example #5
0
        /// <summary>
        /// 更新 玩家(GameOver時)資料
        /// </summary>
        public byte[] UpdateGameOver(string account, Int16 score, byte exp, Int16 maxCombo, int maxScore, Int16 lostMice, int killMice, int battleResult, string item)
        {
            PlayerData playerData = new PlayerData();

            playerData.ReturnCode    = "S400";
            playerData.ReturnMessage = "";

            try
            {
                PlayerDataLogic playerDataLogic = new PlayerDataLogic();
                playerData = playerDataLogic.UpdateGameOver(account, score, exp, maxCombo, maxScore, lostMice, killMice, battleResult, item);
            }
            catch (Exception e)
            {
                playerData.ReturnCode    = "S499";
                playerData.ReturnMessage = "(UI)玩家資料未知例外情況! " + e.Message;
                throw e;
            }
            return(TextUtility.SerializeToStream(playerData));
        }
Example #6
0
        /// <summary>
        /// 更新 玩家全部資料
        /// </summary>
        public byte[] UpdatePlayerData(string account, byte rank, byte exp, Int16 maxCombo, int maxScore, int sumScore, Int16 sumLost, int sumKill, string item, string miceAll, string team, string friend)
        {
            PlayerData playerData = new PlayerData();

            playerData.ReturnCode    = "S400";
            playerData.ReturnMessage = "";

            try
            {
                PlayerDataLogic playerDataLogic = new PlayerDataLogic();
                playerData = playerDataLogic.UpdatePlayerData(account, rank, exp, maxCombo, maxScore, sumScore, sumLost, sumKill, item, miceAll, team, friend);
            }
            catch (Exception e)
            {
                playerData.ReturnCode    = "S499";
                playerData.ReturnMessage = "(UI)玩家資料未知例外情況! " + e.Message;
                throw e;
            }
            return(TextUtility.SerializeToStream(playerData));
        }