public static void SetBelleEvoCountByBit(int index, char bitValue) { PlayerData _playerData = GameManager.gameManager.PlayerDataPool; if (null != _playerData && _playerData.BelleConfigData != null) { string belleCanEvoBeits = _playerData.BelleConfigData.BelleCanEvoBeits; if (belleCanEvoBeits == null) { return; } char[] belleGetArr = belleCanEvoBeits.ToCharArray(); if (index >= 0 && index < belleGetArr.Length) { belleGetArr[index] = bitValue; } _playerData.BelleConfigData.BelleCanEvoBeits = new string(belleGetArr); Obj_MainPlayer _mainPlayer = Singleton <ObjManager> .GetInstance().MainPlayer; if (null != _mainPlayer) { UserConfigData.AddBelleConfigInfo(_mainPlayer.GUID.ToString(), _playerData.BelleConfigData); } } }
public static void UpdateLoginData(GC_LOGIN_RET data) { if (data.Result == (int)GC_LOGIN_RET.LOGINRESULT.SUCCESS) { LoginData.accountData.SetAccountInfo(data.Userid, data.Oid, data.Accesstoken, data.Rapidvalidatecode); LoginData.loginRoleList.Clear(); for (int i = 0; i < data.roleGUIDListCount; i++) { LoginData.loginRoleList.Add(new LoginData.PlayerRoleData( data.roleGUIDListList[i], data.roleTypeListList[i], data.playerNameListList[i], data.roleLevelListList[i] > 0 ? data.roleLevelListList[i] : 1, data.ModelVisualIDList[i], data.WeaponIDList[i], data.WeaponEffectGemList[i])); } LoginData.loginRoleList.Sort(); UserConfigData.AddRoleInfo(); } if (retLogin != null) { retLogin((GC_LOGIN_RET.LOGINRESULT)data.Result, data.Validateresult); } }
/// <summary> /// 根据玩家GUID获得当前对应美人配置 /// </summary> /// <returns></returns> public static BelleConfigData GetBelleConfigDataByGUID() { Dictionary <string, BelleConfigData> _belleConfigData = UserConfigData.GetBelleConfigData(); Obj_MainPlayer _mainPlayer = Singleton <ObjManager> .GetInstance().MainPlayer; BelleConfigData m_belleConfigData = null; if (null != _belleConfigData) { //Debug.Log("fanzhipeng ----------------------------------------------- " + PlayerPreferenceData.LastRoleGUID); // Debug.Log("fanzhipeng --------------------------------------------------- _mainPlayer != null " + _mainPlayer.GUID); if (_belleConfigData.ContainsKey(PlayerPreferenceData.LastRoleGUID.ToString())) { // Debug.Log("fanzhipeng -------------------------------- ContainKye " + _mainPlayer.GUID); m_belleConfigData = _belleConfigData[PlayerPreferenceData.LastRoleGUID.ToString()]; //Debug.Log("fanzhipeng ---------------------------------------------------------------------------- contains"); // Debug.Log("fanzhipeng ------------------------------------------------------------------ m_belleConfigData ==== " + m_belleConfigData.BelleGetBits); } } if (null == _mainPlayer) { //Debug.Log("fanzhipeng ------------------------------------------------- null == _mainPlayer"); } return(m_belleConfigData); }
void OnLoadFastReplayItem(GameObject resItem, object param) { List <string> curFastReply = UserConfigData.GetFastReplyList(); for (int i = 0; i < FastReplyMaxNum; i++) { GameObject FastReplyItem = Utils.BindObjToParent(resItem, m_FastReplyGrid, i < 10 ? ("FastReplyItem" + "0" + i.ToString()) : ("FastReplyItem" + i.ToString())); if (FastReplyItem != null) { FastReplyItemLogic itemLogic = FastReplyItem.GetComponent <FastReplyItemLogic>(); if (itemLogic != null) { if (i + 1 > curFastReply.Count) { itemLogic.Init(i, "", this); } else { if (string.IsNullOrEmpty(curFastReply[i])) { itemLogic.Init(i, "", this); } else { itemLogic.Init(i, curFastReply[i], this); } } m_FastReplyItemList.Add(itemLogic); } } } m_FastReplyGrid.GetComponent <UIGrid>().Reposition(); ChangeMode(); }
public async Task UserConfigControllerSetWithLogic() { var data = new UserConfigApiDataHandler(); var user = StandardUser; var config = UserConfigData.GetFirst(); Logic.Result.Setup(m => m.Execute(It.IsAny <ChangeConfig>())).Returns(true); var controller = new ConfigController(data, Logic) { CurrentUser = StandardUser, CurrentConfig = config }; var result = await controller.Set("TemplateView", "list") as OkObjectResult; result.Should().NotBeNull(); result.Should().BeOfType <OkObjectResult>(); var viewModel = result.Value as ConfigViewModel; viewModel.Success.Should().BeTrue(); Logic.HasExecuted.Should().BeTrue(); data.HasExecuted.Should().BeFalse(); data.HasCommitted.Should().BeTrue(); }
public async Task SimpleNotifyLogicSignup() { var data = new FakeApiDataEntityHandler <NotifyTemplate>(); var logic = new FakeApiLogicHandler(); var cloud = new FakeCloudHandler(); var template = NotifyTemplateData.GetFirst(); var tenant = TenantData.GetFirst(); var config = UserConfigData.GetFirst(); data.Result.Setup(m => m.Execute(It.IsAny <NotifyTemplateByName>())).Returns(template); data.Result.Setup(m => m.Execute(It.IsAny <Loader <Tenant> >())).Returns(tenant); data.Result.Setup(m => m.Execute(It.IsAny <Loader <UserConfig> >())).Returns(config); cloud.Result.Setup(m => m.Execute(It.IsAny <EmailTemplateCmd>())) .Returns(ActionConfirm.CreateSuccess("Sent")); var command = new SimpleNotify { DataHandler = data, CurrentUser = StandardUser, TemplateName = "signup", CloudHandler = cloud, LogicHandler = logic, Model = tenant }; await command.Execute(); cloud.HasExecuted.Should().BeTrue(); data.HasExecuted.Should().BeTrue(); data.HasCommitted.Should().BeFalse(); data.Result.Verify(s => s.Execute(It.IsAny <NotifyTemplateByName>()), Times.Once()); data.Result.Verify(s => s.Execute(It.IsAny <Loader <Tenant> >()), Times.Once()); }
public async Task ChangeConfigLogicConfigSetUnauthorized() { var data = new UserApiDataHandler(); var model = UserData.GetFirst(); var config = UserConfigData.GetFirst(); data.Result.Setup(m => m.Execute(It.IsAny <UserById>())).Returns(model); data.Result.Setup(m => m.Execute(It.IsAny <Persist <User> >())).Returns(model); var command = new ChangeConfig { DataHandler = data, CurrentUser = NonTenantUser, Key = "CANAUTH", Value = "true", ResultConfig = config, UserId = StandardUser.Id }; await command.Execute(); data.HasExecuted.Should().BeTrue(); data.HasCommitted.Should().BeFalse(); data.Result.Verify(s => s.Execute(It.IsAny <Persist <User> >()), Times.Never()); }
public async Task SigninAuthLogicSignup() { var logic = new CoreApiLogicHandler(); logic.Result.Setup(m => m.Execute(It.IsAny <WriteToken>())).Returns(true); var command = new SigninAuth { LogicHandler = logic, Login = StandardUser, Config = UserConfigData.GetFirst(), Tenant = TenantData.GetFirst(), Settings = new FakeSettings() }; await command.Execute(); logic.HasExecuted.Should().BeTrue(); logic.Result.Should().NotBeNull(); command.Result.Verification.Should().BeNullOrEmpty(); command.Result.Key.Should().NotBeNullOrEmpty(); command.Result.Message.Should().BeNullOrEmpty(); command.Result.Config.Should().NotBeNull(); command.Result.Id.Should().NotBeNullOrEmpty(); command.Result.Success.Should().BeTrue(); }
public void WriteShoppingCartInfo() { if (Singleton <ObjManager> .Instance.MainPlayer != null) { UserConfigData.AddShoppingCartInfo(Singleton <ObjManager> .Instance.MainPlayer.GUID.ToString(), this); } }
private bool ReadHeader(BinaryReader reader, UserConfigData config, ref FileFormatClassImpl.FormatVersion version) { try { /* Format Version (4 Byte) */ var version_i = (UInt32)0; version_i |= (UInt32)((UInt32)reader.ReadByte() << 24); version_i |= (UInt32)((UInt32)reader.ReadByte() << 16); version_i |= (UInt32)((UInt32)reader.ReadByte() << 8); version_i |= (UInt32)((UInt32)reader.ReadByte() << 0); /* Profile ID (1 + xx Byte) */ var profile_id_len = reader.ReadByte(); var profile_id_str = Encoding.UTF8.GetString(reader.ReadBytes(profile_id_len)); if (profile_id_str.Length == 0) { return(false); } version = (FileFormatClassImpl.FormatVersion)version_i; config.ProfileID = Guid.Parse(profile_id_str); return(true); } catch { return(false); } }
public uint Execute(PacketDistributed ipacket) { GC_CREATEROLE_RET packet = (GC_CREATEROLE_RET)ipacket; if (null == packet) { return((uint)PACKET_EXE.PACKET_EXE_ERROR); } if (packet.Result == (int)GC_CREATEROLE_RET.CREATEROLE_RESULT.CREATEROLE_SUCCESS) { LoginData.loginRoleList.Add(new LoginData.PlayerRoleData(packet.PlayerGuid, packet.Profession, packet.PlayerName, 1, -1, -1, -1)); PlatformHelper.OnRoleCreate(packet.PlayerName, "1"); UserConfigData.AddRoleInfo(); LoginData.UpdateLoginRoleInfo(packet.PlayerGuid); // LoginData.UpdateLoginRoleInfo中会重置职业,在此重新赋值(过场动画会根据职业进行设置) GameManager.gameManager.PlayerDataPool.EnterSceneCache.Profession = packet.Profession; //第一次创建角色新手关默认启用一个特殊技能 Utils.SetPVXSkillIndexByProfession(packet.Profession); } else { if (null != retCreateRoleFail) { retCreateRoleFail((GC_CREATEROLE_RET.CREATEROLE_RESULT)packet.Result); } } return((uint)PACKET_EXE.PACKET_EXE_CONTINUE); }
private bool ExtractData(byte[] archive_data, UserConfigData config) { try { /* Archive Dataからデータを復元 */ config.Config = new UserConfig(); /* アーカイブ読込 */ using (var archive = new ZipArchive(new MemoryStream(archive_data), ZipArchiveMode.Read, false)) { foreach (var entry in archive.Entries) { using (var entry_s = entry.Open()) { if (entry.Name == UserConfig.CONFIG_FILE_NAME) { /* === UserConfig === */ config.Config.LoadFromStream(entry_s); } else { /* === 不明なファイル === */ using (var reader = new BinaryReader(entry_s)) { config.ExtDataList.Add(entry.Name, reader.ReadBytes((int)entry.Length)); } } } } } return(true); } catch { return(false); } }
public void WriteAllFastReply() { List <string> listFastReplyContent = new List <string>(); foreach (FastReplyItemLogic item in m_FastReplyGrid.GetComponentsInChildren <FastReplyItemLogic>()) { listFastReplyContent.Add(item.ItemStrContent); } UserConfigData.AddFastReplyInfo(listFastReplyContent); }
void UpdateFastReply() { if (m_CurReplyMode == CUR_REPLYMODE.FAST_REPLY) { m_EditButton.SetActive(true); List <string> curFastReply = UserConfigData.GetFastReplyList(); for (int i = 0; i < FastReplyMaxNum; i++) { m_FastReplyItemList[i].ItemStrContent = curFastReply[i]; } } }
public static AuthViewModel GetAuth() { return(new AuthViewModel { Id = UserData.FirstId, Success = true, Message = string.Empty, Verification = "xxx111key", Key = EncryptHelper.Encrypt(UserData.FirstId + Keys.Salty), Config = UserConfigData.GetFirst(), }); }
protected override void SetupDatabase(IDocumentStore store) { store.ExecuteIndex(new UserIndex()); using (var session = store.OpenSession()) { session.Store(UserData.GetFirst()); session.Store(UserConfigData.GetFirst()); session.SaveChanges(); } WaitForIndexing(store); }
void OnEnable() { for (int i = 0; i < m_nMaxFilterLevel; i++) { m_nFilterLevel[i] = false; } if (RestaurantData.m_PlayerRestaurantInfo != null) { int nMyRestLevel = RestaurantData.m_PlayerRestaurantInfo.m_RestaurantLevel - 1; if (nMyRestLevel >= 0 && nMyRestLevel < m_nMaxFilterLevel) { m_nFilterLevel[nMyRestLevel] = true; } } m_bFilterRewardExp = true; m_bFilterRewardCoin = true; m_bFilterRewardMeterial = true; //for (int i = 0; i < m_nMaxFilterLevel; i++) //{ // m_nFilterLevel[i] = PlayerPreferenceData.GetRestaurantFilterLv(i + 1); //} //m_bFilterRewardExp = PlayerPreferenceData.RestaurantFilterExp; //m_bFilterRewardCoin = PlayerPreferenceData.RestaurantFilterCoin; //m_bFilterRewardMeterial = PlayerPreferenceData.RestaurantFilterMeterial; Dictionary <string, RestaurantConfigData> curRestaurantList = UserConfigData.GetRestaurantConfigList(); if (curRestaurantList != null) { //UInt64 PlayerGuid = Singleton<ObjManager>.GetInstance().MainPlayer.GUID; UInt64 PlayerGuid = PlayerPreferenceData.LastRoleGUID; if (curRestaurantList.ContainsKey(PlayerGuid.ToString())) { RestaurantConfigData oRestaurantConfig = curRestaurantList[PlayerGuid.ToString()]; if (oRestaurantConfig != null) { for (int i = 0; i < m_nMaxFilterLevel; i++) { m_nFilterLevel[i] = oRestaurantConfig.GetRestaurantFilterLv(i + 1) != 0 ? true : false; } m_bFilterRewardExp = oRestaurantConfig.RestaurantFilterExp != 0 ? true : false; m_bFilterRewardCoin = oRestaurantConfig.RestaurantFilterCoin != 0 ? true : false; m_bFilterRewardMeterial = oRestaurantConfig.RestaurantFilterMeterial != 0 ? true : false; } } } //FilterFood(); //LoadFoodItem(); }
public UserConfigManager() { userInfo = null; persist = Core.DPM; userInfo = persist.ReadFromLocalFileSystem(DataType.USER_CONFIG, AES_ENCRYPT) as UserConfigData; if (userInfo == null) { userInfo = new UserConfigData(); userInfo.DefaultValue(); } userInfo.mType = DataType.USER_CONFIG; }
/// <summary> /// 添加一个新的BelleConfig /// </summary> public static BelleConfigData SetNewBelleConfigData() { string belleStr = GetBelleStringBitByBelleTable(); string belleMatrixStr = GetBelleStringBitByBelleMatrix(); BelleConfigData curBelleData = new BelleConfigData(0, belleStr, belleStr, belleStr, belleMatrixStr); Obj_MainPlayer _mainPlayer = Singleton <ObjManager> .GetInstance().MainPlayer; if (_mainPlayer != null) { UserConfigData.AddBelleConfigInfo(_mainPlayer.GUID.ToString(), curBelleData); } //Debug.Log("fanzhipeng ----------------------------------------------------- + setNewbelleConfigadata" ); return(curBelleData); }
void SaveRestaurantConfig() { if (null == Singleton <ObjManager> .GetInstance().MainPlayer) { return; } RestaurantConfigData RestaurantConfigData = new RestaurantConfigData(); for (int i = 0; i < m_nMaxFilterLevel; i++) { RestaurantConfigData.SetRestaurantFilterLv(i + 1, m_nFilterLevel[i]? 1:0); } RestaurantConfigData.RestaurantFilterExp = m_bFilterRewardExp? 1:0; RestaurantConfigData.RestaurantFilterCoin = m_bFilterRewardCoin ? 1:0; RestaurantConfigData.RestaurantFilterMeterial = m_bFilterRewardMeterial ? 1:0; UserConfigData.AddRestaurantConfig(Singleton <ObjManager> .GetInstance().MainPlayer.GUID.ToString(), RestaurantConfigData); }
public void ReadShoppingCartInfo() { if (Singleton <ObjManager> .Instance.MainPlayer != null) { UInt64 guid = Singleton <ObjManager> .Instance.MainPlayer.GUID; Dictionary <string, ShoppingCart> playerAllShoppingCart = UserConfigData.GetShoppingCartInfo(); if (playerAllShoppingCart.ContainsKey(guid.ToString())) { ShoppingCart shoppingcart = UserConfigData.GetShoppingCartInfo()[guid.ToString()]; m_CreateTime = shoppingcart.CreateTime; for (int i = 0; i < shoppingcart.GoodsInfo.Count; i++) { m_GoodsInfo.Add(new ShoppingCartItem(shoppingcart.GoodsInfo[i].GoodsId, shoppingcart.GoodsInfo[i].GoodsCount)); } TickCountDown(); } } }
private bool ReadArchiveData(BinaryReader reader, UserConfigData config) { try { /* Archive Data Size (4 byte) */ var archive_data_size = (UInt32)0; archive_data_size |= (UInt32)((UInt32)reader.ReadByte() << 24); archive_data_size |= (UInt32)((UInt32)reader.ReadByte() << 16); archive_data_size |= (UInt32)((UInt32)reader.ReadByte() << 8); archive_data_size |= (UInt32)((UInt32)reader.ReadByte() << 0); /* Archive Data (x byte) */ var archive_data = reader.ReadBytes((int)archive_data_size); return(ExtractData(archive_data, config)); } catch { return(false); } }
public void ServerAutoInfo() { //List<LoginData.PlayerRoleData> curList = new List<LoginData.PlayerRoleData>(); PlayerAuto AutoData = new PlayerAuto(AutoPickUp, AutoInviteTeamAccept, AutoJoinTeamAccept, AutoActivityAccept, (int)(AutoHpPercent * 100), (int)(AutoMpPercent * 100), AutoBuyDrug, AutoNotice, AutoHpID, AutoMpID, AutoIsSelectDrug, AutoEquipGuid, m_AutoSelSkillID); UserConfigData.AddPlayerAuto(GUID.ToString(), AutoData); }
/// <summary> /// 设置当前获得的美人配置 /// </summary> /// <param name="belleCount"></param> public static void SetBelleActiveCount(int belleCount) { Dictionary <string, BelleConfigData> _belleConfigData = UserConfigData.GetBelleConfigData(); Obj_MainPlayer _mainPlayer = Singleton <ObjManager> .GetInstance().MainPlayer; BelleConfigData m_belleConfigData = null; if (null != _mainPlayer && null != _belleConfigData) { if (_belleConfigData.ContainsKey(_mainPlayer.GUID.ToString())) { m_belleConfigData = _belleConfigData[_mainPlayer.GUID.ToString()]; m_belleConfigData.ActiveCount = belleCount; } } UserConfigData.AddBelleConfigInfo(_mainPlayer.GUID.ToString(), m_belleConfigData); }
public async Task ChangeConfigLogicConfigSetDefault(string key, string value) { var data = new UserConfigApiDataHandler(); var config = UserConfigData.GetFirst(); var command = new ChangeConfig { DataHandler = data, CurrentUser = StandardUser, Key = key, Value = value, ResultConfig = config, UserId = StandardUser.Id }; await command.Execute(); data.HasExecuted.Should().BeFalse(); data.HasCommitted.Should().BeFalse(); data.Result.Verify(s => s.Execute(It.IsAny <Persist <UserConfig> >()), Times.Never()); }
public async Task UserConfigControllerGet() { var data = new UserConfigApiDataHandler(); var user = StandardUser; var config = UserConfigData.GetFirst(); var tenant = TenantData.GetFirstDisplay(); data.Result.Setup(m => m.Execute(It.IsAny <TenantDisplayById>())).Returns(tenant); var controller = new ConfigController(data, Logic) { CurrentUser = StandardUser, CurrentConfig = config }; var result = await controller.Get() as OkObjectResult; result.Should().NotBeNull(); result.Should().BeOfType <OkObjectResult>(); result.Value.Should().BeOfType <CurrentViewModel>(); var check = result.Value as CurrentViewModel; check.StorageLimit.Should().Be(tenant.StorageLimit); check.FileCount.Should().Be(tenant.FileCount); check.FileSize.Should().Be(tenant.FileSize); check.UserLimit.Should().Be(tenant.UserLimit); check.Config.TemplateView.Should().Be(config.TemplateView); check.Config.Id.Should().Be(config.Id); check.Config.TenantId.Should().Be(config.TenantId); check.UserCount.Should().Be(0); check.TenantId.Should().Be(config.TenantId); check.Id.Should().Be(user.Id); check.Right.CanSuperuser.Should().BeFalse(); check.Right.CanAdmin.Should().BeFalse(); check.Right.CanAuth.Should().BeFalse(); data.HasExecuted.Should().BeTrue(); data.HasCommitted.Should().BeFalse(); data.Result.Verify(s => s.Execute(It.IsAny <TenantDisplayById>()), Times.Once); }
protected override UserConfigData OnLoad() { var config = new UserConfigData(); var version = (FileFormatClassImpl.FormatVersion) 0; /* ヘッダー情報読み込み */ if (!ReadHeader(reader_, config, ref version)) { return(null); } if (version == FileFormatClassImpl.FormatVersion.Version_Unknown) { return(null); } /* 内容読み込み */ if (!ReadArchiveData(reader_, config)) { return(null); } return(config); }
public async Task ChangeConfigLogicRightSet(string key, string value) { var data = new UserApiDataHandler(); var config = UserConfigData.GetFourth(); data.Result.Setup(m => m.Execute(It.IsAny <Persist <User> >())).Returns(SuperUser); var command = new ChangeConfig { DataHandler = data, CurrentUser = SuperUser, Key = key, Value = value, ResultConfig = config, UserId = SuperUser.Id, ResultUser = SuperUser }; await command.Execute(); data.HasExecuted.Should().BeTrue(); data.HasCommitted.Should().BeFalse(); data.Result.Verify(s => s.Execute(It.IsAny <Persist <User> >()), Times.Once()); }
public void InitAutoInfo() { //先初始化 SetAutoPickUpFlag((int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_PICKUP_TYPE.PICKUP_EQUIP1, false); SetAutoPickUpFlag((int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_PICKUP_TYPE.PICKUP_EQUIP2, false); SetAutoPickUpFlag((int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_PICKUP_TYPE.PICKUP_EQUIP3, false); SetAutoPickUpFlag((int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_PICKUP_TYPE.PICKUP_EQUIP4, false); SetAutoPickUpFlag((int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_PICKUP_TYPE.PICKUP_EQUIP5, false); SetAutoPickUpFlag((int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_PICKUP_TYPE.PICKUP_STUFF, false); SetAutoPickUpFlag((int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_PICKUP_TYPE.PICKUP_OTHER, false); AutoHpID = (int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_DRUG_ID.AUTO_DRUG_START_HP; AutoMpID = (int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_DRUG_ID.AUTO_DRUG_START_MP; ClearAutoSelSkillID(); //读取注册表 Dictionary <string, PlayerAuto> curPlayerAutoList = UserConfigData.GetPlayerAutoList(); UInt64 PlayerGuid = PlayerPreferenceData.LastRoleGUID; if (curPlayerAutoList.ContainsKey(PlayerGuid.ToString())) { PlayerAuto oPlayerAuto = curPlayerAutoList[PlayerGuid.ToString()]; if (oPlayerAuto != null) { //AutoComabat = oPlayerAuto.AutoFightOpenToggle == 1? true : false; AutoPickUp = oPlayerAuto.AutoPickUp; AutoInviteTeamAccept = oPlayerAuto.AutoInviteTeamAccept == 1? true : false; AutoJoinTeamAccept = oPlayerAuto.AutoJoinTeamAccept == 1 ? true : false; AutoActivityAccept = oPlayerAuto.AutoJoinActivity == 1 ? true : false; AutoHpPercent = (float)oPlayerAuto.AutoHpPercent / 100; AutoMpPercent = (float)oPlayerAuto.AutoMpPercent / 100; AutoBuyDrug = oPlayerAuto.AutoBuyDrug == 1 ? true : false; //AutoRadius = oPlayerAuto.AutoRadius; AutoNotice = oPlayerAuto.AutoNotice; AutoHpID = oPlayerAuto.AutoHpID; AutoMpID = oPlayerAuto.AutoMpID; AutoIsSelectDrug = oPlayerAuto.AutoIsSelectDrug == 1 ? true : false; AutoEquipGuid = oPlayerAuto.AutoEquipGuid; //m_AutoSelSkillID.Clear(); /*for( int i = 0 ; i < oPlayerAuto.AutoSkillID.Length ; ++i) * { * m_AutoSelSkillID.Add( oPlayerAuto.AutoSkillID[i]); * } */ m_AutoSelSkillID = oPlayerAuto.AutoSkillID; UpdateSelectDrug(); } } if (PlayerFrameLogic.Instance()) { PlayerFrameLogic.Instance().InitAutoFight(); } if (null != FunctionButtonLogic.Instance()) { FunctionButtonLogic.Instance().UpdateAutoFightBtnState(); } m_nCopySceneExitTime = -1; }
public uint Execute(PacketDistributed ipacket) { GC_SYN_ATTR packet = (GC_SYN_ATTR)ipacket; if (null == packet) { return((uint)PACKET_EXE.PACKET_EXE_ERROR); } //enter your logic //判断是MainPlayer还是其他Obj Obj_MainPlayer _mainPlayer = Singleton <ObjManager> .GetInstance().MainPlayer; PlayerData playerDataPool = GameManager.gameManager.PlayerDataPool; //血量 bool isHpChange = false; if (packet.HasCurHp) { playerDataPool.MainPlayerBaseAttr.HP = packet.CurHp; isHpChange = true; } if (packet.HasMaxHP) { playerDataPool.MainPlayerBaseAttr.MaxHP = packet.MaxHP; #if UNITY_ANDROID // 台湾安卓渠道特有,提交血量排行榜数据 if (PlatformHelper.IsChannelTW()) { PlatformHelper.SubmitRankScore(Games.GlobeDefine.GameDefine_Globe.GOOGLEPLAY_RANK_TYPE.HP, playerDataPool.MainPlayerBaseAttr.MaxHP); } #endif isHpChange = true; } if (isHpChange && _mainPlayer != null) { _mainPlayer.OptHPChange(); } //法力 bool isMpChange = false; if (packet.HasCurMp) { playerDataPool.MainPlayerBaseAttr.MP = packet.CurMp; isMpChange = true; } if (packet.HasMaxMP) { playerDataPool.MainPlayerBaseAttr.MaxMP = packet.MaxMP; isMpChange = true; } if (isMpChange && _mainPlayer != null) { _mainPlayer.OptMPChange(); } //怒气 bool isXpChange = false; if (packet.HasCurXp) { playerDataPool.MainPlayerBaseAttr.XP = packet.CurXp; isXpChange = true; } if (packet.HasMaxXP) { playerDataPool.MainPlayerBaseAttr.MaxXP = packet.MaxXP; isXpChange = true; } if (isXpChange && _mainPlayer != null) { _mainPlayer.OptXPChange(); } //等级 if (packet.HasCurLev) { // 更新配置文件 playerDataPool.MainPlayerBaseAttr.Level = packet.CurLev; if (_mainPlayer) { for (int i = 0; i < LoginData.loginRoleList.Count; i++) { if (LoginData.loginRoleList[i].guid == _mainPlayer.GUID) { LoginData.loginRoleList[i].level = packet.CurLev; UserConfigData.AddRoleInfo(); break; } } _mainPlayer.OptLevelChange(); if (LivingSkillLogic.Instance() != null) { LivingSkillLogic.Instance().UpdatePlayerStamina(); } _mainPlayer.UpdateSelectDrug(); } } // 经验 if (packet.HasCurExp) { playerDataPool.MainPlayerBaseAttr.Exp = packet.CurExp; if (_mainPlayer) { _mainPlayer.OnExpChange(); } //神器强化界面 if (EquipShenQiStrength.Instance() != null) { EquipShenQiStrength.Instance().UpdateExpShow(); } } if (packet.HasOffLineExp) { playerDataPool.MainPlayerBaseAttr.OffLineExp = packet.OffLineExp; if (null != _mainPlayer) { _mainPlayer.OnOffLineExpChange(); } } //体能 if (packet.HasCurStamina) { playerDataPool.MainPlayerBaseAttr.CurStamina = packet.CurStamina; if (LivingSkillLogic.Instance() != null) { LivingSkillLogic.Instance().UpdatePlayerStamina(); } } //金钱 if (packet.HasCurMoney) { playerDataPool.Money.SetMoney(MONEYTYPE.MONEYTYPE_COIN, packet.CurMoney); #if UNITY_ANDROID // 台湾安卓渠道特有,提交金币排行榜数据 if (PlatformHelper.IsChannelTW()) { PlatformHelper.SubmitRankScore(Games.GlobeDefine.GameDefine_Globe.GOOGLEPLAY_RANK_TYPE.GOLD_COINS, packet.CurMoney); } #endif if (BackPackLogic.Instance()) { BackPackLogic.Instance().UpdateMoneyInfo(); } if (FlyWingRoot.Instance()) { FlyWingRoot.Instance().UpdateMoneyInfo(); } // if (SwordsManController.Instance() != null) // { // SwordsManController.Instance().UpdateCoin(); // } if (CangKuLogic.Instance()) { CangKuLogic.Instance().UpdateBackPack_Money(); } //神器强化界面 if (EquipShenQiStrength.Instance() != null) { EquipShenQiStrength.Instance().UpdateMoneyShow(); } if (GemLogic.Instance() != null) { GemLogic.Instance().UpdateMoneyInfo(); } if (null != GUIData.delMoneyChanged) { GUIData.delMoneyChanged(); } if (RestaurantController.Instance() != null) { RestaurantController.Instance().UpdateMoneyInfo(); } if (EquipStrengthenLogic.Instance() != null) { EquipStrengthenLogic.Instance().UpdateMoneyInfo(); } if (SkillLevelUpRoot.Instance() != null) { SkillLevelUpRoot.Instance().UpdateSkillInfo(); } } //元宝 if (packet.HasCurYuanBao) { playerDataPool.Money.SetMoney(MONEYTYPE.MONEYTYPE_YUANBAO, packet.CurYuanBao); if (BackPackLogic.Instance()) { BackPackLogic.Instance().UpdateMoneyInfo(); } if (YuanBaoShopLogic.Instance()) { YuanBaoShopLogic.Instance().UpdateYuanBaoInfo(); } if (DailyLuckyDrawLogic.Instance()) { DailyLuckyDrawLogic.Instance().UpdateMoney(); } if (CangKuLogic.Instance()) { CangKuLogic.Instance().UpdateBackPack_Money(); } //神器强化界面 if (EquipShenQiStrength.Instance() != null) { EquipShenQiStrength.Instance().UpdateMoneyShow(); } if (null != GUIData.delMoneyChanged) { GUIData.delMoneyChanged(); } } //绑定元宝 if (packet.HasCurBDYuanBao) { playerDataPool.Money.SetMoney(MONEYTYPE.MONEYTYPE_YUANBAO_BIND, packet.CurBDYuanBao); if (FashionLogic.Instance() != null) { FashionLogic.Instance().UpdateRuby(); } if (BackPackLogic.Instance()) { BackPackLogic.Instance().UpdateMoneyInfo(); } if (YuanBaoShopLogic.Instance()) { YuanBaoShopLogic.Instance().UpdateYuanBaoInfo(); } if (DailyLuckyDrawLogic.Instance()) { DailyLuckyDrawLogic.Instance().UpdateMoney(); } if (CangKuLogic.Instance()) { CangKuLogic.Instance().UpdateBackPack_Money(); } if (RestaurantController.Instance() != null) { RestaurantController.Instance().UpdateMoneyInfo(); } if (null != GUIData.delMoneyChanged) { GUIData.delMoneyChanged(); } } // if (packet.HasSwordsManScore) // { // playerDataPool.SwordsManScore = packet.SwordsManScore; // if (SwordsManController.Instance() != null) // { // SwordsManController.Instance().UpdateSwordsManScore(); // } // } if (packet.HasReputation) { playerDataPool.Reputation = packet.Reputation; } //是否在战斗状态 if (packet.HasIsInCombat && _mainPlayer != null) { bool oldCombat = _mainPlayer.InCombat; _mainPlayer.InCombat = (packet.IsInCombat == 1 ? true:false); if (!_mainPlayer.InCombat && oldCombat) { _mainPlayer.LastLeaveCombatTime = Time.time; } else if (_mainPlayer.InCombat && !oldCombat) { _mainPlayer.LastLeaveCombatTime = 0.0f; } } //经验 血 蓝 变化时 更新主角属性界面 if (packet.HasCurHp || packet.HasCurMp || packet.HasCurExp) { if (RoleViewLogic.Instance() != null) { RoleViewLogic.Instance().UpdateCurAttr(); } } if (packet.HasGuildDKP) { playerDataPool.GuildDKP = packet.GuildDKP; if (GuildShopLogic.Instance() != null) { GuildShopLogic.Instance().UpdateGuildDKP(); } } return((uint)PACKET_EXE.PACKET_EXE_CONTINUE); }