| | |
| | | ConfigManager.Instance.LoadConfigByType(typeof(T));
|
| | | }
|
| | |
|
| | | public List<T> GetValues()
|
| | | public static List<U> GetKeys()
|
| | | {
|
| | | if (!isInit)
|
| | | {
|
| | | Debug.LogError(typeof(U).Name + " 没有初始化 GetKeys");
|
| | | return null; // 或者抛出异常,视情况而定
|
| | | }
|
| | | List<U> result = new List<U>();
|
| | | result.AddRange(dic.Keys);
|
| | | return result;
|
| | | }
|
| | |
|
| | |
|
| | | public static List<T> GetValues()
|
| | | {
|
| | | if (!isInit)
|
| | | {
|
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using Cysharp.Threading.Tasks; |
| | | using System.Reflection; |
| | | |
| | | |
| | | public class ConfigManager : ManagerBase<ConfigManager> |
| | | { |
| | | public bool isLoadFinished |
| | | { |
| | | get; |
| | | private set; |
| | | } |
| | | |
| | | private float loadingProgress = 0f; |
| | | |
| | | public override void Init() |
| | | { |
| | | base.Init(); |
| | | InitConfigs(); |
| | | } |
| | | |
| | | public virtual async UniTask InitConfigs() |
| | | { |
| | | // 加载配置文件 |
| | | await LoadConfigs(); |
| | | } |
| | | |
| | | protected async UniTask LoadConfigs() |
| | | { |
| | | loadingProgress = 0f; |
| | | isLoadFinished = false; |
| | | |
| | | // 加载配置文件 |
| | | int totalConfigs = 48; |
| | | Type[] configTypes = new Type[] { |
| | | typeof(AppointItemConfig), |
| | | typeof(AudioConfig), |
| | | typeof(ChestsAwardConfig), |
| | | typeof(ChestsConfig), |
| | | typeof(CTGConfig), |
| | | typeof(CTGSelectItemConfig), |
| | | typeof(DienstgradConfig), |
| | | typeof(DirtyWordConfig), |
| | | typeof(EffectConfig), |
| | | typeof(EmojiPackConfig), |
| | | typeof(FaceConfig), |
| | | typeof(FamilyConfig), |
| | | typeof(FuncConfigConfig), |
| | | typeof(FuncOpenLVConfig), |
| | | typeof(FunctionTeamSetConfig), |
| | | typeof(GetItemWaysConfig), |
| | | typeof(GmCmdConfig), |
| | | typeof(GuideConfig), |
| | | typeof(HeroAwakeConfig), |
| | | typeof(HeroBreakConfig), |
| | | typeof(HeroConfig), |
| | | typeof(HeroFetterConfig), |
| | | typeof(HeroQualityAwakeConfig), |
| | | typeof(HeroQualityBreakConfig), |
| | | typeof(HeroQualityConfig), |
| | | typeof(HeroSkinConfig), |
| | | typeof(HeroTalentConfig), |
| | | typeof(IconConfig), |
| | | typeof(ItemConfig), |
| | | typeof(KickOutReasonConfig), |
| | | typeof(LanguageConfig), |
| | | typeof(MailConfig), |
| | | typeof(NPCConfig), |
| | | typeof(NPCExConfig), |
| | | typeof(OrderInfoConfig), |
| | | typeof(PlayerFaceConfig), |
| | | typeof(PlayerFacePicConfig), |
| | | typeof(PlayerFacePicStarConfig), |
| | | typeof(PlayerFaceStarConfig), |
| | | typeof(PlayerLVConfig), |
| | | typeof(priorbundleConfig), |
| | | typeof(RichTextMsgReplaceConfig), |
| | | typeof(RuleConfig), |
| | | typeof(SkillConfig), |
| | | typeof(StoreConfig), |
| | | typeof(SuccessConfig), |
| | | typeof(SysInfoConfig), |
| | | typeof(TitleStarUpConfig) |
| | | }; |
| | | |
| | | // 逐个加载配置并更新进度 |
| | | for (int i = 0; i < configTypes.Length; i++) |
| | | { |
| | | await LoadConfigByType(configTypes[i]); |
| | | loadingProgress = (float)(i + 1) / totalConfigs; |
| | | } |
| | | |
| | | // 加载完成后设置isLoadFinished为true |
| | | loadingProgress = 1f; |
| | | isLoadFinished = true; |
| | | } |
| | | |
| | | public async UniTask LoadConfigByType(Type configType) |
| | | { |
| | | string configName = configType.Name; |
| | | if (configName.EndsWith("Config")) |
| | | { |
| | | configName = configName.Substring(0, configName.Length - 6); |
| | | } |
| | | TextAsset textAsset = ResManager.Instance.LoadAsset<TextAsset>("Config", configName); |
| | | if (textAsset != null) |
| | | { |
| | | string[] lines = textAsset.text.Split('\n'); |
| | | var methodInfo = configType.GetMethod("Init", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.FlattenHierarchy); |
| | | if (methodInfo != null) |
| | | { |
| | | methodInfo.Invoke(null, new object[] { lines }); |
| | | // 设置初始化标志 |
| | | var isInitField = configType.GetField("isInit", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static); |
| | | if (isInitField != null) |
| | | { |
| | | isInitField.SetValue(null, true); |
| | | } |
| | | Debug.Log($"加载配置: {configType.Name} 成功"); |
| | | } |
| | | else |
| | | { |
| | | Debug.LogError($"配置类 {configType.Name} 没有静态Init方法"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | Debug.LogError($"找不到配置文件: {configName}"); |
| | | } |
| | | } |
| | | |
| | | private async UniTask LoadConfig<T>() where T : class |
| | | { |
| | | string configName = typeof(T).Name; |
| | | |
| | | TextAsset textAsset = ResManager.Instance.LoadAsset<TextAsset>("Config", configName); |
| | | if (textAsset != null) |
| | | { |
| | | string[] lines = textAsset.text.Split('\n'); |
| | | var methodInfo = typeof(T).GetMethod("Init", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static); |
| | | if (methodInfo != null) |
| | | { |
| | | methodInfo.Invoke(null, lines); |
| | | // 设置初始化标志 |
| | | var isInitField = typeof(T).GetField("isInit", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static); |
| | | if (isInitField != null) |
| | | { |
| | | isInitField.SetValue(null, true); |
| | | } |
| | | Debug.Log($"加载配置: {typeof(T).Name} 成功"); |
| | | } |
| | | else |
| | | { |
| | | Debug.LogError($"配置类 {typeof(T).Name} 没有静态Init方法"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | Debug.LogError($"找不到配置文件: {configName}"); |
| | | } |
| | | } |
| | | |
| | | public float GetLoadingProgress() |
| | | { |
| | | return loadingProgress; |
| | | } |
| | | |
| | | private void ClearConfigDictionary<T>() where T : class |
| | | { |
| | | // 重置 T 初始化状态 |
| | | var isInitField = typeof(T).GetField("isInit", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static); |
| | | if (isInitField != null) |
| | | { |
| | | isInitField.SetValue(null, false); |
| | | } |
| | | } |
| | | |
| | | public override void Release() |
| | | { |
| | | // 清空 AppointItemConfig 字典 |
| | | ClearConfigDictionary<AppointItemConfig>(); |
| | | // 清空 AudioConfig 字典 |
| | | ClearConfigDictionary<AudioConfig>(); |
| | | // 清空 ChestsAwardConfig 字典 |
| | | ClearConfigDictionary<ChestsAwardConfig>(); |
| | | // 清空 ChestsConfig 字典 |
| | | ClearConfigDictionary<ChestsConfig>(); |
| | | // 清空 CTGConfig 字典 |
| | | ClearConfigDictionary<CTGConfig>(); |
| | | // 清空 CTGSelectItemConfig 字典 |
| | | ClearConfigDictionary<CTGSelectItemConfig>(); |
| | | // 清空 DienstgradConfig 字典 |
| | | ClearConfigDictionary<DienstgradConfig>(); |
| | | // 清空 DirtyWordConfig 字典 |
| | | ClearConfigDictionary<DirtyWordConfig>(); |
| | | // 清空 EffectConfig 字典 |
| | | ClearConfigDictionary<EffectConfig>(); |
| | | // 清空 EmojiPackConfig 字典 |
| | | ClearConfigDictionary<EmojiPackConfig>(); |
| | | // 清空 FaceConfig 字典 |
| | | ClearConfigDictionary<FaceConfig>(); |
| | | // 清空 FamilyConfig 字典 |
| | | ClearConfigDictionary<FamilyConfig>(); |
| | | // 清空 FuncConfigConfig 字典 |
| | | ClearConfigDictionary<FuncConfigConfig>(); |
| | | // 清空 FuncOpenLVConfig 字典 |
| | | ClearConfigDictionary<FuncOpenLVConfig>(); |
| | | // 清空 FunctionTeamSetConfig 字典 |
| | | ClearConfigDictionary<FunctionTeamSetConfig>(); |
| | | // 清空 GetItemWaysConfig 字典 |
| | | ClearConfigDictionary<GetItemWaysConfig>(); |
| | | // 清空 GmCmdConfig 字典 |
| | | ClearConfigDictionary<GmCmdConfig>(); |
| | | // 清空 GuideConfig 字典 |
| | | ClearConfigDictionary<GuideConfig>(); |
| | | // 清空 HeroAwakeConfig 字典 |
| | | ClearConfigDictionary<HeroAwakeConfig>(); |
| | | // 清空 HeroBreakConfig 字典 |
| | | ClearConfigDictionary<HeroBreakConfig>(); |
| | | // 清空 HeroConfig 字典 |
| | | ClearConfigDictionary<HeroConfig>(); |
| | | // 清空 HeroFetterConfig 字典 |
| | | ClearConfigDictionary<HeroFetterConfig>(); |
| | | // 清空 HeroQualityAwakeConfig 字典 |
| | | ClearConfigDictionary<HeroQualityAwakeConfig>(); |
| | | // 清空 HeroQualityBreakConfig 字典 |
| | | ClearConfigDictionary<HeroQualityBreakConfig>(); |
| | | // 清空 HeroQualityConfig 字典 |
| | | ClearConfigDictionary<HeroQualityConfig>(); |
| | | // 清空 HeroSkinConfig 字典 |
| | | ClearConfigDictionary<HeroSkinConfig>(); |
| | | // 清空 HeroTalentConfig 字典 |
| | | ClearConfigDictionary<HeroTalentConfig>(); |
| | | // 清空 IconConfig 字典 |
| | | ClearConfigDictionary<IconConfig>(); |
| | | // 清空 ItemConfig 字典 |
| | | ClearConfigDictionary<ItemConfig>(); |
| | | // 清空 KickOutReasonConfig 字典 |
| | | ClearConfigDictionary<KickOutReasonConfig>(); |
| | | // 清空 LanguageConfig 字典 |
| | | ClearConfigDictionary<LanguageConfig>(); |
| | | // 清空 MailConfig 字典 |
| | | ClearConfigDictionary<MailConfig>(); |
| | | // 清空 NPCConfig 字典 |
| | | ClearConfigDictionary<NPCConfig>(); |
| | | // 清空 NPCExConfig 字典 |
| | | ClearConfigDictionary<NPCExConfig>(); |
| | | // 清空 OrderInfoConfig 字典 |
| | | ClearConfigDictionary<OrderInfoConfig>(); |
| | | // 清空 PlayerFaceConfig 字典 |
| | | ClearConfigDictionary<PlayerFaceConfig>(); |
| | | // 清空 PlayerFacePicConfig 字典 |
| | | ClearConfigDictionary<PlayerFacePicConfig>(); |
| | | // 清空 PlayerFacePicStarConfig 字典 |
| | | ClearConfigDictionary<PlayerFacePicStarConfig>(); |
| | | // 清空 PlayerFaceStarConfig 字典 |
| | | ClearConfigDictionary<PlayerFaceStarConfig>(); |
| | | // 清空 PlayerLVConfig 字典 |
| | | ClearConfigDictionary<PlayerLVConfig>(); |
| | | // 清空 priorbundleConfig 字典 |
| | | ClearConfigDictionary<priorbundleConfig>(); |
| | | // 清空 RichTextMsgReplaceConfig 字典 |
| | | ClearConfigDictionary<RichTextMsgReplaceConfig>(); |
| | | // 清空 RuleConfig 字典 |
| | | ClearConfigDictionary<RuleConfig>(); |
| | | // 清空 SkillConfig 字典 |
| | | ClearConfigDictionary<SkillConfig>(); |
| | | // 清空 StoreConfig 字典 |
| | | ClearConfigDictionary<StoreConfig>(); |
| | | // 清空 SuccessConfig 字典 |
| | | ClearConfigDictionary<SuccessConfig>(); |
| | | // 清空 SysInfoConfig 字典 |
| | | ClearConfigDictionary<SysInfoConfig>(); |
| | | // 清空 TitleStarUpConfig 字典 |
| | | ClearConfigDictionary<TitleStarUpConfig>(); |
| | | } |
| | | } |
| | | using System;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using Cysharp.Threading.Tasks;
|
| | | using System.Reflection;
|
| | |
|
| | |
|
| | | public class ConfigManager : ManagerBase<ConfigManager>
|
| | | {
|
| | | public bool isLoadFinished
|
| | | {
|
| | | get;
|
| | | private set;
|
| | | }
|
| | |
|
| | | private float loadingProgress = 0f;
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | | base.Init();
|
| | | InitConfigs();
|
| | | }
|
| | |
|
| | | public virtual async UniTask InitConfigs()
|
| | | {
|
| | | // 加载配置文件
|
| | | await LoadConfigs();
|
| | | }
|
| | |
|
| | | protected async UniTask LoadConfigs()
|
| | | {
|
| | | loadingProgress = 0f;
|
| | | isLoadFinished = false;
|
| | |
|
| | | // 加载配置文件
|
| | | int totalConfigs = 49;
|
| | | Type[] configTypes = new Type[] {
|
| | | typeof(AppointItemConfig),
|
| | | typeof(AudioConfig),
|
| | | typeof(ChestsAwardConfig),
|
| | | typeof(ChestsConfig),
|
| | | typeof(CTGConfig),
|
| | | typeof(CTGSelectItemConfig),
|
| | | typeof(DienstgradConfig),
|
| | | typeof(DirtyWordConfig),
|
| | | typeof(EffectConfig),
|
| | | typeof(EmojiPackConfig),
|
| | | typeof(FaceConfig),
|
| | | typeof(FamilyConfig),
|
| | | typeof(FirstGoldConfig),
|
| | | typeof(FuncConfigConfig),
|
| | | typeof(FuncOpenLVConfig),
|
| | | typeof(FunctionTeamSetConfig),
|
| | | typeof(GetItemWaysConfig),
|
| | | typeof(GmCmdConfig),
|
| | | typeof(GuideConfig),
|
| | | typeof(HeroAwakeConfig),
|
| | | typeof(HeroBreakConfig),
|
| | | typeof(HeroConfig),
|
| | | typeof(HeroFetterConfig),
|
| | | typeof(HeroQualityAwakeConfig),
|
| | | typeof(HeroQualityBreakConfig),
|
| | | typeof(HeroQualityConfig),
|
| | | typeof(HeroSkinConfig),
|
| | | typeof(HeroTalentConfig),
|
| | | typeof(IconConfig),
|
| | | typeof(ItemConfig),
|
| | | typeof(KickOutReasonConfig),
|
| | | typeof(LanguageConfig),
|
| | | typeof(MailConfig),
|
| | | typeof(NPCConfig),
|
| | | typeof(NPCExConfig),
|
| | | typeof(OrderInfoConfig),
|
| | | typeof(PlayerFaceConfig),
|
| | | typeof(PlayerFacePicConfig),
|
| | | typeof(PlayerFacePicStarConfig),
|
| | | typeof(PlayerFaceStarConfig),
|
| | | typeof(PlayerLVConfig),
|
| | | typeof(priorbundleConfig),
|
| | | typeof(RichTextMsgReplaceConfig),
|
| | | typeof(RuleConfig),
|
| | | typeof(SkillConfig),
|
| | | typeof(StoreConfig),
|
| | | typeof(SuccessConfig),
|
| | | typeof(SysInfoConfig),
|
| | | typeof(TitleStarUpConfig)
|
| | | };
|
| | |
|
| | | // 逐个加载配置并更新进度
|
| | | for (int i = 0; i < configTypes.Length; i++)
|
| | | {
|
| | | await LoadConfigByType(configTypes[i]);
|
| | | loadingProgress = (float)(i + 1) / totalConfigs;
|
| | | }
|
| | |
|
| | | // 加载完成后设置isLoadFinished为true
|
| | | loadingProgress = 1f;
|
| | | isLoadFinished = true;
|
| | | }
|
| | |
|
| | | public async UniTask LoadConfigByType(Type configType)
|
| | | {
|
| | | string configName = configType.Name;
|
| | | if (configName.EndsWith("Config"))
|
| | | {
|
| | | configName = configName.Substring(0, configName.Length - 6);
|
| | | }
|
| | | TextAsset textAsset = ResManager.Instance.LoadAsset<TextAsset>("Config", configName);
|
| | | if (textAsset != null)
|
| | | {
|
| | | string[] lines = textAsset.text.Split('\n');
|
| | | var methodInfo = configType.GetMethod("Init", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.FlattenHierarchy);
|
| | | if (methodInfo != null)
|
| | | {
|
| | | methodInfo.Invoke(null, new object[] { lines });
|
| | | // 设置初始化标志
|
| | | var isInitField = configType.GetField("isInit", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static);
|
| | | if (isInitField != null)
|
| | | {
|
| | | isInitField.SetValue(null, true);
|
| | | }
|
| | | Debug.Log($"加载配置: {configType.Name} 成功");
|
| | | }
|
| | | else
|
| | | {
|
| | | Debug.LogError($"配置类 {configType.Name} 没有静态Init方法");
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | Debug.LogError($"找不到配置文件: {configName}");
|
| | | }
|
| | | }
|
| | |
|
| | | private async UniTask LoadConfig<T>() where T : class
|
| | | {
|
| | | string configName = typeof(T).Name;
|
| | |
|
| | | TextAsset textAsset = ResManager.Instance.LoadAsset<TextAsset>("Config", configName);
|
| | | if (textAsset != null)
|
| | | {
|
| | | string[] lines = textAsset.text.Split('\n');
|
| | | var methodInfo = typeof(T).GetMethod("Init", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static);
|
| | | if (methodInfo != null)
|
| | | {
|
| | | methodInfo.Invoke(null, lines);
|
| | | // 设置初始化标志
|
| | | var isInitField = typeof(T).GetField("isInit", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static);
|
| | | if (isInitField != null)
|
| | | {
|
| | | isInitField.SetValue(null, true);
|
| | | }
|
| | | Debug.Log($"加载配置: {typeof(T).Name} 成功");
|
| | | }
|
| | | else
|
| | | {
|
| | | Debug.LogError($"配置类 {typeof(T).Name} 没有静态Init方法");
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | Debug.LogError($"找不到配置文件: {configName}");
|
| | | }
|
| | | }
|
| | |
|
| | | public float GetLoadingProgress()
|
| | | {
|
| | | return loadingProgress;
|
| | | }
|
| | |
|
| | | private void ClearConfigDictionary<T>() where T : class
|
| | | {
|
| | | // 重置 T 初始化状态
|
| | | var isInitField = typeof(T).GetField("isInit", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static);
|
| | | if (isInitField != null)
|
| | | {
|
| | | isInitField.SetValue(null, false);
|
| | | }
|
| | | }
|
| | |
|
| | | public override void Release()
|
| | | {
|
| | | // 清空 AppointItemConfig 字典
|
| | | ClearConfigDictionary<AppointItemConfig>();
|
| | | // 清空 AudioConfig 字典
|
| | | ClearConfigDictionary<AudioConfig>();
|
| | | // 清空 ChestsAwardConfig 字典
|
| | | ClearConfigDictionary<ChestsAwardConfig>();
|
| | | // 清空 ChestsConfig 字典
|
| | | ClearConfigDictionary<ChestsConfig>();
|
| | | // 清空 CTGConfig 字典
|
| | | ClearConfigDictionary<CTGConfig>();
|
| | | // 清空 CTGSelectItemConfig 字典
|
| | | ClearConfigDictionary<CTGSelectItemConfig>();
|
| | | // 清空 DienstgradConfig 字典
|
| | | ClearConfigDictionary<DienstgradConfig>();
|
| | | // 清空 DirtyWordConfig 字典
|
| | | ClearConfigDictionary<DirtyWordConfig>();
|
| | | // 清空 EffectConfig 字典
|
| | | ClearConfigDictionary<EffectConfig>();
|
| | | // 清空 EmojiPackConfig 字典
|
| | | ClearConfigDictionary<EmojiPackConfig>();
|
| | | // 清空 FaceConfig 字典
|
| | | ClearConfigDictionary<FaceConfig>();
|
| | | // 清空 FamilyConfig 字典
|
| | | ClearConfigDictionary<FamilyConfig>();
|
| | | // 清空 FirstGoldConfig 字典
|
| | | ClearConfigDictionary<FirstGoldConfig>();
|
| | | // 清空 FuncConfigConfig 字典
|
| | | ClearConfigDictionary<FuncConfigConfig>();
|
| | | // 清空 FuncOpenLVConfig 字典
|
| | | ClearConfigDictionary<FuncOpenLVConfig>();
|
| | | // 清空 FunctionTeamSetConfig 字典
|
| | | ClearConfigDictionary<FunctionTeamSetConfig>();
|
| | | // 清空 GetItemWaysConfig 字典
|
| | | ClearConfigDictionary<GetItemWaysConfig>();
|
| | | // 清空 GmCmdConfig 字典
|
| | | ClearConfigDictionary<GmCmdConfig>();
|
| | | // 清空 GuideConfig 字典
|
| | | ClearConfigDictionary<GuideConfig>();
|
| | | // 清空 HeroAwakeConfig 字典
|
| | | ClearConfigDictionary<HeroAwakeConfig>();
|
| | | // 清空 HeroBreakConfig 字典
|
| | | ClearConfigDictionary<HeroBreakConfig>();
|
| | | // 清空 HeroConfig 字典
|
| | | ClearConfigDictionary<HeroConfig>();
|
| | | // 清空 HeroFetterConfig 字典
|
| | | ClearConfigDictionary<HeroFetterConfig>();
|
| | | // 清空 HeroQualityAwakeConfig 字典
|
| | | ClearConfigDictionary<HeroQualityAwakeConfig>();
|
| | | // 清空 HeroQualityBreakConfig 字典
|
| | | ClearConfigDictionary<HeroQualityBreakConfig>();
|
| | | // 清空 HeroQualityConfig 字典
|
| | | ClearConfigDictionary<HeroQualityConfig>();
|
| | | // 清空 HeroSkinConfig 字典
|
| | | ClearConfigDictionary<HeroSkinConfig>();
|
| | | // 清空 HeroTalentConfig 字典
|
| | | ClearConfigDictionary<HeroTalentConfig>();
|
| | | // 清空 IconConfig 字典
|
| | | ClearConfigDictionary<IconConfig>();
|
| | | // 清空 ItemConfig 字典
|
| | | ClearConfigDictionary<ItemConfig>();
|
| | | // 清空 KickOutReasonConfig 字典
|
| | | ClearConfigDictionary<KickOutReasonConfig>();
|
| | | // 清空 LanguageConfig 字典
|
| | | ClearConfigDictionary<LanguageConfig>();
|
| | | // 清空 MailConfig 字典
|
| | | ClearConfigDictionary<MailConfig>();
|
| | | // 清空 NPCConfig 字典
|
| | | ClearConfigDictionary<NPCConfig>();
|
| | | // 清空 NPCExConfig 字典
|
| | | ClearConfigDictionary<NPCExConfig>();
|
| | | // 清空 OrderInfoConfig 字典
|
| | | ClearConfigDictionary<OrderInfoConfig>();
|
| | | // 清空 PlayerFaceConfig 字典
|
| | | ClearConfigDictionary<PlayerFaceConfig>();
|
| | | // 清空 PlayerFacePicConfig 字典
|
| | | ClearConfigDictionary<PlayerFacePicConfig>();
|
| | | // 清空 PlayerFacePicStarConfig 字典
|
| | | ClearConfigDictionary<PlayerFacePicStarConfig>();
|
| | | // 清空 PlayerFaceStarConfig 字典
|
| | | ClearConfigDictionary<PlayerFaceStarConfig>();
|
| | | // 清空 PlayerLVConfig 字典
|
| | | ClearConfigDictionary<PlayerLVConfig>();
|
| | | // 清空 priorbundleConfig 字典
|
| | | ClearConfigDictionary<priorbundleConfig>();
|
| | | // 清空 RichTextMsgReplaceConfig 字典
|
| | | ClearConfigDictionary<RichTextMsgReplaceConfig>();
|
| | | // 清空 RuleConfig 字典
|
| | | ClearConfigDictionary<RuleConfig>();
|
| | | // 清空 SkillConfig 字典
|
| | | ClearConfigDictionary<SkillConfig>();
|
| | | // 清空 StoreConfig 字典
|
| | | ClearConfigDictionary<StoreConfig>();
|
| | | // 清空 SuccessConfig 字典
|
| | | ClearConfigDictionary<SuccessConfig>();
|
| | | // 清空 SysInfoConfig 字典
|
| | | ClearConfigDictionary<SysInfoConfig>();
|
| | | // 清空 TitleStarUpConfig 字典
|
| | | ClearConfigDictionary<TitleStarUpConfig>();
|
| | | }
|
| | | }
|
New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: YYL
|
| | | // [ Date ]: 2025年6月15日
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | | using System.IO;
|
| | | using System.Threading;
|
| | | using System;
|
| | | using UnityEngine;
|
| | | using LitJson;
|
| | |
|
| | | public partial class FirstGoldConfig : ConfigBase<int, FirstGoldConfig>
|
| | | {
|
| | |
|
| | | public int Day;
|
| | | public string JobItemInfo;
|
| | | public string CommItemList;
|
| | |
|
| | | public override int LoadKey(string _key)
|
| | | {
|
| | | int key = GetKey(_key);
|
| | | return key;
|
| | | }
|
| | |
|
| | | public override void LoadConfig(string input)
|
| | | {
|
| | | try {
|
| | | string[] tables = input.Split('\t');
|
| | | int.TryParse(tables[0],out Day); |
| | |
|
| | | JobItemInfo = tables[1];
|
| | |
|
| | | CommItemList = tables[2];
|
| | | }
|
| | | catch (Exception exception)
|
| | | {
|
| | | Debug.LogError(exception);
|
| | | }
|
| | | }
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 7a18fe9ad1e827a48859432def151470 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | |
| | | |
| | | public partial class OrderInfoConfig : ConfigBase<int, OrderInfoConfig> |
| | | { |
| | | //0.1折 |
| | | public float PayRMBNumOnSale |
| | | { |
| | | get |
| | | { |
| | | return PayRMBNum * 0.01f; |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 90b7da475c140514491b78c0f7c3a5a9 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | } |
| | | } |
| | | |
| | | public void RefreshPlayerData(/*H0418_tagObjInfoRefresh vNetData*/) |
| | | { |
| | | // UpdatePlayerData(vNetData); |
| | | // //StoreModel.RefreshTCBPlayerData(vNetData); |
| | | // if (playerDataUpdateEvent != null) |
| | | // { |
| | | // playerDataUpdateEvent(); |
| | | // } |
| | | public void RefreshPlayerData(H0418_tagObjInfoRefresh vNetData) |
| | | {
|
| | | UpdatePlayerData(vNetData);
|
| | | //StoreModel.RefreshTCBPlayerData(vNetData);
|
| | | if (playerDataUpdateEvent != null)
|
| | | {
|
| | | playerDataUpdateEvent();
|
| | | } |
| | | } |
| | | |
| | | |
| | | private void UpdatePlayerData(int temp/*H0418_tagObjInfoRefresh vNetData*/) |
| | | { |
| | | // if (baseData != null && vNetData.ObjID == baseData.PlayerID) |
| | | // { |
| | | // var deltaValue = -1; //变化值用于处理表现 |
| | | // switch ((PlayerDataType)vNetData.RefreshType) |
| | | // { |
| | | // case PlayerDataType.MaxHP: |
| | | // deltaValue = (int)(vNetData.Value + vNetData.ValueEx * Constants.ExpPointValue - extersion.MaxHP); |
| | | // break; |
| | | // case PlayerDataType.MAXATK: |
| | | // deltaValue = (int)(vNetData.Value - extersion.MAXATK); |
| | | // break; |
| | | // case PlayerDataType.MINATK: |
| | | // deltaValue = (int)(vNetData.Value - extersion.MINATK); |
| | | // break; |
| | | // case PlayerDataType.DEF: |
| | | // deltaValue = (int)(vNetData.Value - extersion.DEF); |
| | | // break; |
| | | // case PlayerDataType.HIT: |
| | | // deltaValue = (int)(vNetData.Value - extersion.HIT); |
| | | // break; |
| | | // case PlayerDataType.Miss: |
| | | // deltaValue = (int)(vNetData.Value - extersion.Miss); |
| | | // break; |
| | | // case PlayerDataType.BattleValEx1: |
| | | // deltaValue = (int)(vNetData.Value - extersion.battleValEx1); |
| | | // break; |
| | | // case PlayerDataType.SpeedValue: |
| | | // deltaValue = (int)(vNetData.Value - extersion.SpeedValue); |
| | | // break; |
| | | // default: |
| | | // deltaValue = -1; |
| | | // break; |
| | | // } |
| | | |
| | | // if (deltaValue > 0 && attributePromoteEvent != null) |
| | | // { |
| | | // attributePromoteEvent((PlayerDataType)vNetData.RefreshType, deltaValue); |
| | | // } |
| | | |
| | | // RefreshProperty(vNetData.socketType == ServerType.Main, (PlayerDataType)vNetData.RefreshType, vNetData.Value, vNetData.ValueEx); |
| | | |
| | | // if (PlayerDataDict.ContainsKey((PlayerDataType)vNetData.RefreshType)) |
| | | // { |
| | | // PlayerDataDict[(PlayerDataType)vNetData.RefreshType] = vNetData.Value + vNetData.ValueEx * Constants.ExpPointValue; |
| | | // } |
| | | // else |
| | | // { |
| | | // PlayerDataDict.Add((PlayerDataType)vNetData.RefreshType, vNetData.Value + vNetData.ValueEx * Constants.ExpPointValue); |
| | | // } |
| | | |
| | | // if (playerDataRefreshEvent != null) |
| | | // { |
| | | // playerDataRefreshEvent((PlayerDataType)vNetData.RefreshType); |
| | | // } |
| | | // } |
| | | private void UpdatePlayerData(H0418_tagObjInfoRefresh vNetData) |
| | | {
|
| | | if (baseData != null && vNetData.ObjID == baseData.PlayerID)
|
| | | {
|
| | | RefreshProperty((PlayerDataType)vNetData.RefreshType, vNetData.Value, vNetData.ValueEx);
|
| | |
|
| | | if (PlayerDataDict.ContainsKey((PlayerDataType)vNetData.RefreshType))
|
| | | {
|
| | | PlayerDataDict[(PlayerDataType)vNetData.RefreshType] = vNetData.Value + vNetData.ValueEx * Constants.ExpPointValue;
|
| | | }
|
| | | else
|
| | | {
|
| | | PlayerDataDict.Add((PlayerDataType)vNetData.RefreshType, vNetData.Value + vNetData.ValueEx * Constants.ExpPointValue);
|
| | | }
|
| | |
|
| | | if (playerDataRefreshEvent != null)
|
| | | {
|
| | | playerDataRefreshEvent((PlayerDataType)vNetData.RefreshType);
|
| | | }
|
| | | } |
| | | } |
| | | |
| | | public void RefreshProperty(PlayerDataType _type, uint value, uint valueEx) |
| | |
| | | case PlayerDataType.PlayerID: |
| | | baseData.PlayerID = value; |
| | | break; |
| | | case PlayerDataType.PlayerName: |
| | | break; |
| | | case PlayerDataType.Sex: |
| | | break; |
| | | case PlayerDataType.Job: |
| | | baseData.Job = (byte)value; |
| | | break; |
| | | case PlayerDataType.LV: |
| | | if (baseData.LV != 0 && value > baseData.LV) |
| | | { |
| | | // TODO YYL 升级特效 |
| | | // if (hero != null) |
| | | // { |
| | | // if (PlayerDatas.Instance.baseData.MapID == 31080) |
| | | // { |
| | | // SFXPlayUtility.Instance.PlayBattleEffect(1156, hero); |
| | | // } |
| | | // else |
| | | // { |
| | | // SFXPlayUtility.Instance.PlayBattleEffect(1039, hero); |
| | | // } |
| | | |
| | | // } |
| | | } |
| | | changeLV = value - baseData.LV; |
| | | baseData.LV = (ushort)value; |
| | | if (changeLV > 0) |
| | |
| | | SDKUtils.Instance.TraceEvent("joinalliance", "", false); |
| | | LocalSave.SetInt("FimilyReport" + PlayerDatas.Instance.baseData.PlayerID, 1); |
| | | } |
| | | // TODO YYL |
| | | // if (hero != null) |
| | | // { |
| | | // hero.ActorInfo.familyID = value; |
| | | // ReCheckAttackTarget(); |
| | | // } |
| | | break; |
| | | case PlayerDataType.TeamHornor: |
| | | break; |
| | | case PlayerDataType.PKValue: |
| | | break; |
| | | case PlayerDataType.FamilyHornor: |
| | | break; |
| | | case PlayerDataType.FamilyActiveValue: |
| | | break; |
| | | case PlayerDataType.CountryHornor: |
| | | break; |
| | | case PlayerDataType.Mate: |
| | | break; |
| | | case PlayerDataType.Gold: |
| | | baseData.diamond = value; |
| | |
| | | case PlayerDataType.Silver: |
| | | baseData.copper = value; |
| | | break; |
| | | case PlayerDataType.SilverPaper: |
| | | break; |
| | | case PlayerDataType.FightPoint: |
| | | break; |
| | | case PlayerDataType.HappyPoint: |
| | | break; |
| | | case PlayerDataType.MapID: |
| | | baseData.MapID = (ushort)value; |
| | | break; |
| | |
| | | break; |
| | | case PlayerDataType.PosY: |
| | | baseData.PosY = (ushort)value;//角色坐标y |
| | | break; |
| | | case PlayerDataType.State: |
| | | break; |
| | | case PlayerDataType.MaxHP: |
| | | extersion.MaxHP = value + valueEx * Constants.ExpPointValue; |
| | | // TODO YYL |
| | | // if (hero != null) |
| | | // { |
| | | // hero.ActorInfo.ResetHp(-1, (long)extersion.MaxHP); |
| | | // } |
| | | break; |
| | | case PlayerDataType.HP: |
| | | baseData.HP = value + valueEx * Constants.ExpPointValue; |
| | | break; |
| | | case PlayerDataType.MaxMP: |
| | | extersion.MaxMP = (int)value; |
| | | break; |
| | | |
| | | case PlayerDataType.HPRestoreSetting: |
| | | break; |
| | | case PlayerDataType.MPRestoreSetting: |
| | | break; |
| | | case PlayerDataType.ExpRate: |
| | | extersion.ExpRate = (int)value; |
| | |
| | | case PlayerDataType.MAXATK: |
| | | extersion.MAXATK = (int)value; |
| | | break; |
| | | case PlayerDataType.MAtkMin: |
| | | break; |
| | | case PlayerDataType.MAtkMax: |
| | | break; |
| | | case PlayerDataType.MDef: |
| | | break; |
| | | case PlayerDataType.HIT: |
| | | extersion.HIT = (int)value; |
| | | break; |
| | | case PlayerDataType.POISIONATK: |
| | | break; |
| | | case PlayerDataType.FIREATK: |
| | | break; |
| | | case PlayerDataType.REALATK: |
| | | extersion.realATK = (int)value; |
| | | break; |
| | | case PlayerDataType.THUNDERATK: |
| | | break; |
| | | case PlayerDataType.WINDATK: |
| | | break; |
| | | case PlayerDataType.POISIONDEF: |
| | | break; |
| | | case PlayerDataType.FIREDEF: |
| | | break; |
| | | case PlayerDataType.REALDEF: |
| | | extersion.realDEF = (int)value; |
| | | break; |
| | | case PlayerDataType.THUNDERDEF: |
| | | break; |
| | | case PlayerDataType.WINDDEF: |
| | | break; |
| | | case PlayerDataType.Miss: |
| | | extersion.Miss = (int)value; |
| | | break; |
| | | case PlayerDataType.SuperHit: |
| | | extersion.SuperHit = (int)value; |
| | | break; |
| | | case PlayerDataType.Buff: |
| | | break; |
| | | case PlayerDataType.Skill: |
| | | break; |
| | | case PlayerDataType.Mark: |
| | | break; |
| | | case PlayerDataType.SettingH: |
| | | break; |
| | | case PlayerDataType.SettingV: |
| | | break; |
| | | case PlayerDataType.FightPK: |
| | | break; |
| | | case PlayerDataType.ActiveValue: |
| | | break; |
| | | case PlayerDataType.NameColor: |
| | | case PlayerDataType.AtkInterval: |
| | |
| | | case PlayerDataType.PickupDist: |
| | | extersion.PickupDist = (int)value; |
| | | break; |
| | | case PlayerDataType.CountryLastWeekHornor: |
| | | break; |
| | | case PlayerDataType.LastWeekOnlineTime: |
| | | break; |
| | | case PlayerDataType.LastWeekFamilyActiveValue: |
| | | break; |
| | | case PlayerDataType.FBID: |
| | | baseData.FBID = (byte)value; |
| | | break; |
| | | case PlayerDataType.FamilyLV: |
| | | break; |
| | | case PlayerDataType.RealMapID: |
| | | extersion.RealMapID = (int)value; |
| | |
| | | baseData.GMLevel = (byte)value; |
| | | break; |
| | | case PlayerDataType.TeamID: |
| | | // TODO YYL |
| | | // if (hero != null) |
| | | // { |
| | | // hero.ActorInfo.teamID = value; |
| | | // ReCheckAttackTarget(); |
| | | // } |
| | | break; |
| | | case PlayerDataType.TeamLV: |
| | | break; |
| | |
| | | baseData.FightPoint = value + valueEx * Constants.ExpPointValue; |
| | | // TODO YYL |
| | | // ModelCenter.Instance.GetModel<PlayerMainDate>().PowerAdd(baseData.FightPoint); |
| | | break; |
| | | case PlayerDataType.RebornMapID: |
| | | break; |
| | | case PlayerDataType.RebornPosX: |
| | | break; |
| | | case PlayerDataType.RebornPosY: |
| | | break; |
| | | case PlayerDataType.Coin: |
| | | break; |
| | | case PlayerDataType.BillboardLV: |
| | | break; |
| | | case PlayerDataType.Tick: |
| | | #if UNITY_EDITOR |
| | |
| | | m_Tick = Environment.TickCount; |
| | | |
| | | break; |
| | | case PlayerDataType.CurrentPlayerType: |
| | | break; |
| | | case PlayerDataType.FriendFavor: |
| | | break; |
| | | case PlayerDataType.BackpackLV: |
| | | break; |
| | | case PlayerDataType.ReincarnationLV: |
| | | break; |
| | | case PlayerDataType.BaseSTR: |
| | | break; |
| | | case PlayerDataType.BasePNE: |
| | | break; |
| | | case PlayerDataType.BasePHY: |
| | | break; |
| | | case PlayerDataType.BaseCON: |
| | | break; |
| | | case PlayerDataType.ReceivedSalary: |
| | | break; |
| | | case PlayerDataType.WarehouseLV: |
| | | break; |
| | | case PlayerDataType.EquipShowSwitch: |
| | | baseData.equipShowSwitch = value; |
| | | // TODO YYL |
| | | // if (hero != null) |
| | | // { |
| | | // hero.SwitchSuit(); |
| | | // hero.ReqLingGenEffect((int)(baseData.equipShowSwitch / 10 % 100), (int)(baseData.equipShowSwitch / 1000 % 1000)); |
| | | // hero.horseAwakeId = (int)(value / 1000000); |
| | | // #if UNITY_EDITOR |
| | | // if (hero.horseAwakeId != 0) |
| | | // { |
| | | // Debug.LogFormat("玩家骑宠觉醒ID改变: {0}", hero.horseAwakeId); |
| | | // } |
| | | // #endif |
| | | // } |
| | | |
| | | break; |
| | | case PlayerDataType.LuckValue: |
| | | extersion.luckValue = (int)value; |
| | | break; |
| | | case PlayerDataType.ExAttr1: |
| | | // TODO YYL |
| | | // if (hero != null && !hero.ActorInfo.serverDie) |
| | | // { |
| | | // if (hero.aiHandler.IsAuto()) |
| | | // { |
| | | // hero.Behaviour.StopHandupAI(true); |
| | | // } |
| | | // } |
| | | baseData.ExAttr1 = value; |
| | | // TODO YYL |
| | | // if (baseData.ExAttr1 == 0) |
| | | // assistModel.assistGUID = string.Empty; |
| | | break; |
| | | case PlayerDataType.ExAttr2: |
| | | baseData.teamAutoOperateFlag = value; |
| | |
| | | case PlayerDataType.ExAttr4: |
| | | baseData.shield = value; |
| | | break; |
| | | case PlayerDataType.ExAttr5: |
| | | var oldExAttr5 = baseData.CrossServerFlag; |
| | | baseData.CrossServerFlag = value; |
| | | |
| | | // TODO YYL |
| | | // if (oldExAttr5 > 2 && value <= 2) |
| | | // { |
| | | // if (GameNetSystem.Instance.crossServerConnected_Loigc) |
| | | // { |
| | | // GameNetSystem.Instance.crossServerConnected_Loigc = false; |
| | | // GameNetSystem.Instance.DisconnectCrossServer(); |
| | | |
| | | // // TODO YYL |
| | | // // if (hero != null) |
| | | // // { |
| | | // // StatusMgr.Instance.ReleaseActor(hero.ServerInstID); |
| | | // // } |
| | | |
| | | // extersion.pkState = 0; |
| | | // baseData.MapID = baseData.mainServerMapIdRecord; |
| | | // baseData.dungeonLineId = 0; |
| | | // baseData.dungeonMapId = 0; |
| | | // ModelCenter.Instance.GetModel<DungeonModel>().ResetBufData(); |
| | | |
| | | // StageLoad.Instance.PushSceneLoadCommand(new StageLoad.StageLoadCommand() |
| | | // { |
| | | // toMapId = baseData.MapID, |
| | | // toLineId = 0, |
| | | // needEmpty = true, |
| | | // needLoadResource = true, |
| | | // isClientLoadMap = true, |
| | | // refreshPlayerDatas = true |
| | | // }); |
| | | // } |
| | | // } |
| | | break; |
| | | |
| | | case PlayerDataType.Faction: |
| | | baseData.faction = value; |
| | | // TODO YYL |
| | | // if (hero != null) |
| | | // { |
| | | // hero.ActorInfo.faction = (int)value; |
| | | // ReCheckAttackTarget(); |
| | | // hero.SetFairyLeagueHeadUp(baseData.MapID == FairyLeagueModel.FAIRY_LEAGUE_DUNGEON); |
| | | // } |
| | | break; |
| | | case PlayerDataType.InfamyValue: |
| | | break; |
| | | case PlayerDataType.RealmLevel: |
| | | baseData.realmLevel = (byte)value; |
| | | break; |
| | | case PlayerDataType.IsFindByLabel: |
| | | break; |
| | | case PlayerDataType.IsCloseFriendLabel: |
| | | break; |
| | | case PlayerDataType.ChangeCoinPointTotal: |
| | | baseData.coinPointTotal = value; |
| | | break; |
| | | case PlayerDataType.VIPLv: |
| | | // TODO YYL |
| | | // if (baseData.VIPLv <= 0 && value > 0) |
| | | // { |
| | | // ModelCenter.Instance.GetModel<SetPrivateModel>().SetVipPushNotify((int)value); |
| | | // } |
| | | // else if (value <= 0) |
| | | // { |
| | | // ModelCenter.Instance.GetModel<SetPrivateModel>().SetVipPushNotify(0); |
| | | // } |
| | | baseData.VIPLv = (byte)value; |
| | | break; |
| | | case PlayerDataType.ExAttr6: |
| | | baseData.copperExtend = value; |
| | | break; |
| | | case PlayerDataType.ExAttr7: |
| | | baseData.sp = value; |
| | | break; |
| | | case PlayerDataType.ExAttr8: |
| | | baseData.spExtend = value; |
| | | break; |
| | | case PlayerDataType.ExAttr9: |
| | | break; |
| | | case PlayerDataType.ExAttr10: |
| | | baseData.bubbleId = value; |
| | | break; |
| | | case PlayerDataType.ModelMark: |
| | | break; |
| | | case PlayerDataType.PrizeCoin: |
| | | break; |
| | | case PlayerDataType.ExAttr11: |
| | | baseData.ExAttr11 = value; |
| | | break; |
| | | case PlayerDataType.ExAttr12: |
| | | break; |
| | | case PlayerDataType.ExAttr13: |
| | | baseData.ServerGroupId = value; |
| | | break; |
| | | case PlayerDataType.ExAttr14: |
| | | break; |
| | | case PlayerDataType.BattleValEx1: |
| | | extersion.battleValEx1 = (int)value; |
| | | // TODO YYL |
| | | // if (hero != null) |
| | | // { |
| | | // hero.CalculateAtkSpeed((ushort)extersion.battleValEx1); |
| | | // } |
| | | break; |
| | | case PlayerDataType.BattleValEx3: |
| | | extersion.battleValEx3 = (int)value; |
| | |
| | | break; |
| | | case PlayerDataType.RuneSplinters: |
| | | extersion.runeEssence = (int)value; |
| | | break; |
| | | case PlayerDataType.FamilyContribution: |
| | | // TODO YYL |
| | | // method.CepaContribution((int)value); |
| | | break; |
| | | case PlayerDataType.FamilyStoreScore: |
| | | break; |
| | | case PlayerDataType.SuperHitReduce: |
| | | extersion.SuperHitReduce = (int)value; |
| | |
| | | break; |
| | | case PlayerDataType.SpeedValue: |
| | | extersion.SpeedValue = (int)value; |
| | | // TODO YYL |
| | | // if (hero != null) |
| | | // { |
| | | // hero.CalculateMoveSpeed((ushort)extersion.SpeedValue); |
| | | // } |
| | | break; |
| | | case PlayerDataType.DamagePVE: |
| | | break; |
| | | case PlayerDataType.PetDamPer: |
| | | extersion.PetDamPer = (int)value; |
| | |
| | | break; |
| | | case PlayerDataType.PlayerPKState: |
| | | extersion.pkState = (int)value; |
| | | // TODO YYL |
| | | |
| | | // if (baseData.MapID != 31220 |
| | | // && baseData.MapID != 32030 |
| | | // && baseData.MapID != 22030) |
| | | // { |
| | | // if (hero != null) |
| | | // { |
| | | // if (value == 1) |
| | | // { |
| | | // if (MapArea.IsOutMapArea(hero.CurMapArea, MapArea.E_Type.Neutral)) |
| | | // { |
| | | // hero.SwitchGrayName(true); |
| | | // } |
| | | // } |
| | | // else if (value == 0) |
| | | // { |
| | | // hero.SwitchGrayName(false); |
| | | // if (StatusMgr.Instance.IsExist(PlayerId, StatusMgr.Instance.redNameBuffID)) |
| | | // { |
| | | // hero.SwitchRedName(true); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | break; |
| | | case PlayerDataType.IsAttackBossState: |
| | | extersion.bossState = (int)value; |
| | | // TODO YYL |
| | | // if (hero != null) |
| | | // { |
| | | // if (extersion.bossState == 0) |
| | | // { |
| | | // hero.atkBossID = 0; |
| | | // } |
| | | // } |
| | | break; |
| | | case PlayerDataType.BasicsMinimum: |
| | | baseData.BasicsMinimum = (int)value; |
| | |
| | | case PlayerDataType.CDBPlayerRefresh_TalentPoint: |
| | | extersion.talentPoint = (int)value; |
| | | break; |
| | | case PlayerDataType.CDBPlayerRefresh_GodWeaponLV_1: |
| | | break; |
| | | case PlayerDataType.CDBPlayerRefresh_GodWeaponLV_2: |
| | | break; |
| | | case PlayerDataType.CDBPlayerRefresh_GodWeaponLV_3: |
| | | break; |
| | | case PlayerDataType.CDBPlayerRefresh_GodWeaponLV_4: |
| | | break; |
| | | |
| | | case PlayerDataType.CDBPlayerRefresh_SoulDust: |
| | | extersion.soulDust = value; |
| | | break; |
| | |
| | | case PlayerDataType.CDBPlayerRefresh_FinalHurtReducePer: |
| | | baseData.reduceFinalHurt = (int)value; |
| | | break; |
| | | case PlayerDataType.CDBPlayerRefresh_YinjiTime: |
| | | baseData.yinjiTime = (int)value; |
| | | break; |
| | | case PlayerDataType.CDBPlayerRefresh_YinjiCount: |
| | | baseData.yinjiCount = (int)value; |
| | | break; |
| | | |
| | | case PlayerDataType.CDBPlayerRefresh_SkillAddPerA: |
| | | baseData.skillAddPerA = (int)value; |
| | | break; |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 3f1fe023f8649e74d80e82731aa1fc06 |
| | | folderAsset: yes |
| | | DefaultImporter: |
| | | externalObjects: {} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //07 0F 背包重整#tagCItemPackReset//对性能有比较大的影响
|
| | |
|
| | | public class C070F_tagCItemPackReset : GameNetPackBasic {
|
| | | public byte Type; //背包类型
|
| | | public ushort ItemBeginIndex; //物品起始索引
|
| | | public ushort ItemEndIndex; //物品结束索引
|
| | |
|
| | | public C070F_tagCItemPackReset () {
|
| | | _cmd = (ushort)0x070F;
|
| | | }
|
| | |
|
| | | public override void WriteToBytes () {
|
| | | WriteBytes (Type, NetDataType.BYTE);
|
| | | WriteBytes (ItemBeginIndex, NetDataType.WORD);
|
| | | WriteBytes (ItemEndIndex, NetDataType.WORD);
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 834e17ffd6028e144b0392a7a6797a4d |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // A1 26 充值自选物品选择 #tagCMSelectCTGItem
|
| | |
|
| | | public class CA126_tagCMSelectCTGItem : GameNetPackBasic {
|
| | | public ushort RecordID; //充值ID
|
| | | public uint SelectItemValue; // 自选物品索引值,每两位存储每个自选索引对应选择的物品索引+1,存储位值为0代表未选择,最多支持选择4种物品
|
| | |
|
| | | public CA126_tagCMSelectCTGItem () {
|
| | | combineCmd = (ushort)0x03FE;
|
| | | _cmd = (ushort)0xA126;
|
| | | }
|
| | |
|
| | | public override void WriteToBytes () {
|
| | | WriteBytes (RecordID, NetDataType.WORD);
|
| | | WriteBytes (SelectItemValue, NetDataType.DWORD);
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 31a8a659914874a4eb17680e441f666f |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 37394482328657c438bd99896822f165 |
| | | folderAsset: yes |
| | | DefaultImporter: |
| | | externalObjects: {} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // C0 02 查看跨服玩家信息 #tagCGViewCrossPlayerInfo
|
| | |
|
| | | public class CC002_tagCGViewCrossPlayerInfo : GameNetPackBasic {
|
| | | public uint PlayerID; // 跨服玩家ID
|
| | | public byte EquipClassLV; //大于0为查看指定境界阶装备信息, 0为查看默认信息
|
| | |
|
| | | public CC002_tagCGViewCrossPlayerInfo () {
|
| | | combineCmd = (ushort)0x03FE;
|
| | | _cmd = (ushort)0xC002;
|
| | | }
|
| | |
|
| | | public override void WriteToBytes () {
|
| | | WriteBytes (PlayerID, NetDataType.DWORD);
|
| | | WriteBytes (EquipClassLV, NetDataType.BYTE);
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 836f0e335de27464f9299c7c3e61c140 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //01 11 在线回应回报#tagOnlineReply
|
| | |
|
| | | public class DTC0111_tagOnlineReply : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | H0111_tagOnlineReply vNetData = vNetPack as H0111_tagOnlineReply;
|
| | | }
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: a92f24a06dfc50949a89412aadcf0162 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //01 13 服务器心跳包#tagServerHeart
|
| | |
|
| | | public class DTC0113_tagServerHeart : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | |
|
| | | var sendInfo = new C0104_tagCOnlineReturn();
|
| | | sendInfo.Type = 0;
|
| | |
|
| | | GameNetSystem.Instance.SendInfo(sendInfo);// 在线回应
|
| | | }
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 234311ac6166110479dc7cd4163bcf9a |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using static UnityEditor.Experimental.GraphView.GraphView; |
| | | |
| | | //04 18 周围对象刷新#tagObjInfoRefresh
|
| | |
|
| | | public class DTC0418_tagObjInfoRefresh : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | H0418_tagObjInfoRefresh vNetData = vNetPack as H0418_tagObjInfoRefresh;
|
| | | Update0418(vNetData);
|
| | | }
|
| | |
|
| | |
|
| | | public static void Update0418(H0418_tagObjInfoRefresh vNetData) |
| | | {
|
| | | if (PlayerDatas.Instance.PlayerId == vNetData.ObjID) |
| | | { |
| | | |
| | | PlayerDatas.Instance.RefreshPlayerData(vNetData); |
| | | } |
| | | else |
| | | { |
| | | //其他玩家数据,如果需要同场景处理 |
| | | //_player.UpdateData(vNetData); |
| | | } |
| | | }
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: d93a49a087b45eb41b342b24c16e78bc |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 6f4d48045afbd124bbeb89c4bc71706d |
| | | folderAsset: yes |
| | | DefaultImporter: |
| | | externalObjects: {} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //06 05 对象增加Buf#tagObjAddBuff
|
| | |
|
| | | public class DTC0605_tagObjAddBuff : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | H0605_tagObjAddBuff vNetData = vNetPack as H0605_tagObjAddBuff;
|
| | | }
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ab22a1e1dbaa6804ba19406c7ad3437c |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //06 06 对象减少Buf#tagObjDelBuff
|
| | |
|
| | | public class DTC0606_tagObjDelBuff : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | H0606_tagObjDelBuff vNetData = vNetPack as H0606_tagObjDelBuff;
|
| | | }
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 15cb5f876af39584590fb067a6f11bc2 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //06 08 NPC死亡#tagNPCDie
|
| | |
|
| | | public class DTC0608_tagNPCDie : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | H0608_tagNPCDie vNetData = vNetPack as H0608_tagNPCDie;
|
| | | }
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ad2de856034e58348812209c01a12b49 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //06 12 根据类型清空对象的buff#tagClearObjBuff
|
| | |
|
| | | public class DTC0612_tagClearObjBuff : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | H0612_tagClearObjBuff vNetData = vNetPack as H0612_tagClearObjBuff;
|
| | | }
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 4013d80ce79674c47962d9eb7de9e33b |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //07 04 ���DZ���ˢ��#tagRolePackRefresh |
| | | |
| | | |
| | | |
| | | public class DTC0704_tagRolePackRefresh : DtcBasic |
| | | { |
| | | public override void Done(GameNetPackBasic vNetPack) |
| | | { |
| | | base.Done(vNetPack); |
| | | H0704_tagRolePackRefresh vNetData = vNetPack as H0704_tagRolePackRefresh; |
| | | PackManager.Instance.UpdateItem(vNetData); |
| | | |
| | | // if (vNetData.PackType == 1) |
| | | // { |
| | | // var _hero = PlayerDatas.Instance.hero; |
| | | // if (_hero != null) |
| | | // { |
| | | // _hero.PutonEquip(vNetData.ItemID); |
| | | |
| | | // if (vNetData.ItemPlace == 5) |
| | | // { |
| | | // if (vNetData.UserDataLen > 0) |
| | | // { |
| | | // var _jsonData = LitJson.JsonMapper.ToObject(vNetData.UserData); |
| | | // if ((_jsonData as IDictionary).Contains("210")) |
| | | // { |
| | | // _hero.horseAwakeId = int.Parse(_jsonData["210"][0].ToString()); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | } |
| | | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | //07 04 主角背包刷新#tagRolePackRefresh
|
| | |
|
| | | public class DTC0704_tagRolePackRefresh : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack)
|
| | | {
|
| | | base.Done(vNetPack);
|
| | | H0704_tagRolePackRefresh vNetData = vNetPack as H0704_tagRolePackRefresh;
|
| | | PackManager.Instance.UpdateItem(vNetData);
|
| | | }
|
| | | }
|
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //07 06 ���ʹ����Ʒ�ɹ�#tagUseItemSuccess |
| | | public class DTC0706_tagUseItemSuccess : DtcBasic |
| | | { |
| | | public override void Done(GameNetPackBasic vNetPack) |
| | | { |
| | | base.Done(vNetPack); |
| | | H0706_tagUseItemSuccess vNetData = vNetPack as H0706_tagUseItemSuccess; |
| | | PackManager.Instance.UseItemSuccess(vNetData); |
| | | } |
| | | } |
| | | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | //07 06 玩家使用物品成功#tagUseItemSuccess
|
| | |
|
| | | public class DTC0706_tagUseItemSuccess : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack)
|
| | | {
|
| | | base.Done(vNetPack);
|
| | | H0706_tagUseItemSuccess vNetData = vNetPack as H0706_tagUseItemSuccess;
|
| | | PackManager.Instance.UseItemSuccess(vNetData);
|
| | | }
|
| | | }
|
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //07 07 ��Ʒ����ˢ��#tagItemCountRefresh |
| | | |
| | | |
| | | public class DTC0707_tagItemCountRefresh : DtcBasic |
| | | { |
| | | public override void Done(GameNetPackBasic vNetPack) |
| | | { |
| | | base.Done(vNetPack); |
| | | H0707_tagItemCountRefresh vNetData = vNetPack as H0707_tagItemCountRefresh; |
| | | Debug.Log(707 + "ˢ������"); |
| | | PackManager.Instance.RefreshItemCount(vNetData); |
| | | } |
| | | |
| | | } |
| | | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | //07 07 物品数量刷新#tagItemCountRefresh
|
| | |
|
| | | public class DTC0707_tagItemCountRefresh : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack)
|
| | | {
|
| | | base.Done(vNetPack);
|
| | | H0707_tagItemCountRefresh vNetData = vNetPack as H0707_tagItemCountRefresh;
|
| | | PackManager.Instance.RefreshItemCount(vNetData);
|
| | | }
|
| | | }
|
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //07 09 �����Ʒ#tagClearItem |
| | | |
| | | |
| | | |
| | | public class DTC0709_tagClearItem : DtcBasic |
| | | { |
| | | /** ɾ����Ʒ�¼����� */ |
| | | public delegate void ItemChangeHandler(int type, int index); |
| | | public static event ItemChangeHandler ItemChangeEvent; |
| | | public override void Done(GameNetPackBasic vNetPack) |
| | | { |
| | | base.Done(vNetPack); |
| | | |
| | | H0709_tagClearItem vNetData = vNetPack as H0709_tagClearItem; |
| | | PackManager.Instance.RemoveItem(vNetData); |
| | | |
| | | // if (vNetData.PackType == 1) |
| | | // { |
| | | // var _hero = PlayerDatas.Instance.hero; |
| | | // if (_hero != null) |
| | | // { |
| | | // _hero.TakeoffEquip(vNetData.ItemIndex); |
| | | // } |
| | | // } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | //07 09 清空物品#tagClearItem
|
| | |
|
| | | public class DTC0709_tagClearItem : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack)
|
| | | {
|
| | | base.Done(vNetPack);
|
| | | H0709_tagClearItem vNetData = vNetPack as H0709_tagClearItem;
|
| | | PackManager.Instance.RemoveItem(vNetData);
|
| | | }
|
| | | }
|
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | //07 11 ��ձ���#tagClearItemPack |
| | | |
| | | |
| | | public class DTC0711_tagClearItemPack : DtcBasic |
| | | { |
| | | public override void Done(GameNetPackBasic vNetPack) |
| | | { |
| | | base.Done(vNetPack); |
| | | H0711_tagClearItemPack vNetData = vNetPack as H0711_tagClearItemPack; |
| | | PackManager.Instance.ClearPack(vNetData); |
| | | } |
| | | |
| | | } |
| | | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | //07 11 清空背包#tagClearItemPack
|
| | |
|
| | | public class DTC0711_tagClearItemPack : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack)
|
| | | {
|
| | | base.Done(vNetPack);
|
| | | H0711_tagClearItemPack vNetData = vNetPack as H0711_tagClearItemPack;
|
| | | PackManager.Instance.ClearPack(vNetData);
|
| | | }
|
| | | }
|
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //07 22 物品死锁#tagItemDeadLockRefresh
|
| | |
|
| | | public class DTC0722_tagItemDeadLockRefresh : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | H0722_tagItemDeadLockRefresh vNetData = vNetPack as H0722_tagItemDeadLockRefresh;
|
| | | }
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: f7951045c8334c6488c40a5ffe71765d |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //07 24 ���DZ����ѿ�������#tagRolePackCanUseCount |
| | | //07 24 主角背包已开启格数#tagRolePackCanUseCount |
| | | |
| | | public class DTC0724_tagRolePackCanUseCount : DtcBasic |
| | | { |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //07 25 ���DZ���ˢ�£�֪ͨ������Ʒ�� #tagRolePackRefreshEx |
| | | |
| | | |
| | | |
| | | public class DTC0725_tagRolePackRefreshEx : DtcBasic |
| | | { |
| | | public override void Done(GameNetPackBasic vNetPack) |
| | | { |
| | | base.Done(vNetPack); |
| | | H0725_tagRolePackRefreshEx vNetData = vNetPack as H0725_tagRolePackRefreshEx; |
| | | PackManager.Instance.UpdatePack(vNetData); |
| | | |
| | | // if (vNetData.PackType == 1) |
| | | // { |
| | | // if (vNetData.ItemCount > 0) |
| | | // { |
| | | // foreach (var _item in vNetData.ItemInfo) |
| | | // { |
| | | // var _hero = PlayerDatas.Instance.hero; |
| | | // if (_hero != null) |
| | | // { |
| | | // _hero.PutonEquip(_item.ItemID); |
| | | |
| | | // if (_item.UserDataLen > 0) |
| | | // { |
| | | // var _jsonData = LitJson.JsonMapper.ToObject(_item.UserData); |
| | | // if ((_jsonData as IDictionary).Contains("210")) |
| | | // { |
| | | // _hero.horseAwakeId = int.Parse(_jsonData["210"][0].ToString()); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | } |
| | | } |
| | | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | //07 25 主角背包刷新(通知所有物品) #tagRolePackRefreshEx
|
| | |
|
| | | public class DTC0725_tagRolePackRefreshEx : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack)
|
| | | {
|
| | | base.Done(vNetPack);
|
| | | H0725_tagRolePackRefreshEx vNetData = vNetPack as H0725_tagRolePackRefreshEx;
|
| | | PackManager.Instance.UpdatePack(vNetData);
|
| | | }
|
| | | }
|
New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // A0 08 玩家记录信息 #tagGCPlayerRecInfo
|
| | |
|
| | | public class DTCA008_tagGCPlayerRecInfo : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack)
|
| | | {
|
| | | base.Done(vNetPack);
|
| | | HA008_tagGCPlayerRecInfo vNetData = vNetPack as HA008_tagGCPlayerRecInfo;
|
| | | RechargeManager.Instance.UpdatePlayerRecInfoVoucher(vNetData);
|
| | | }
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: e292325c9eafc4d41847142a9dc0b2fb |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 6b59c021a2ffe494cb68dcad02eb0942 |
| | | folderAsset: yes |
| | | DefaultImporter: |
| | | externalObjects: {} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // A1 10 充值购买次数信息 #tagMCCoinToGoldCountInfo
|
| | |
|
| | | public class DTCA110_tagMCCoinToGoldCountInfo : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack)
|
| | | {
|
| | | base.Done(vNetPack);
|
| | | HA110_tagMCCoinToGoldCountInfo vNetData = vNetPack as HA110_tagMCCoinToGoldCountInfo;
|
| | | RechargeManager.Instance.UpdateRechargeCount(vNetData);
|
| | | }
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: d2b26239e01df3847b56b1d116cef75d |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //A3 A1 各功能模块战斗力信息 #tagMCModuleFightPowerInfo
|
| | |
|
| | | public class DTCA3A1_tagMCModuleFightPowerInfo : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | HA3A1_tagMCModuleFightPowerInfo vNetData = vNetPack as HA3A1_tagMCModuleFightPowerInfo;
|
| | | }
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 28bea9968bf0d0e4e942a2872db6ae39 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: c8217f0911245984f9db8fcdeb70c7bb |
| | | folderAsset: yes |
| | | DefaultImporter: |
| | | externalObjects: {} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | //A7 05 查询玩家详细信息结果#tagSCQueryPlayerCacheResult
|
| | |
|
| | | public class DTCA705_tagSCQueryPlayerCacheResult : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack)
|
| | | {
|
| | | base.Done(vNetPack);
|
| | | HA705_tagSCQueryPlayerCacheResult vNetData = vNetPack as HA705_tagSCQueryPlayerCacheResult;
|
| | | RoleParticularModel.Instance.OnRevRoleEquip(vNetData);
|
| | | }
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: e87ee89663569794cb9bd1b839e461c5 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //A7 09 周围对象刷新合并包 #tagObjInfoListRefresh
|
| | |
|
| | | public class DTCA709_tagObjInfoListRefresh : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | HA709_tagObjInfoListRefresh vNetData = vNetPack as HA709_tagObjInfoListRefresh;
|
| | |
|
| | | for (int i = 0; i < vNetData.Count; i++) |
| | | { |
| | | var data = new H0418_tagObjInfoRefresh(); |
| | | data.socketType = vNetData.socketType; |
| | | data.ObjID = vNetData.ObjID; |
| | | data.ObjType = vNetData.ObjType; |
| | | data.RefreshType = vNetData.RefreshType[i].RefreshType; |
| | | data.Value = vNetData.RefreshType[i].Value; |
| | | data.ValueEx = vNetData.RefreshType[i].ValueEx; |
| | | DTC0418_tagObjInfoRefresh.Update0418(data); |
| | | }
|
| | | }
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 2abe2d82a9f9e564a9cad936d1314294 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // A7 10 引导状态记录 #tagMCGuideState
|
| | |
|
| | | public class DTCA710_tagMCGuideState : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | HA710_tagMCGuideState vNetData = vNetPack as HA710_tagMCGuideState;
|
| | | //NewBieCenter.Instance.ResetGuideRecords(vNetData.GuideState); |
| | | }
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: bd2d4f2c6ed22394eba955a35b713e4a |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 33eb8c07250563944acb58984ae81c60 |
| | | folderAsset: yes |
| | | DefaultImporter: |
| | | externalObjects: {} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // AA 02 首充信息 #tagMCFirstGoldInfo
|
| | |
|
| | | public class DTCAA02_tagMCFirstGoldInfo : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack)
|
| | | {
|
| | | base.Done(vNetPack);
|
| | | HAA02_tagMCFirstGoldInfo vNetData = vNetPack as HAA02_tagMCFirstGoldInfo;
|
| | | RechargeManager.Instance.UpdateFirstChargeReward(vNetData);
|
| | | }
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 56da7e3109f052e46860b1ed27323ab4 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // AA 74 购买次数礼包活动信息 #tagMCActBuyCountGiftInfo
|
| | |
|
| | | public class DTCAA74_tagMCActBuyCountGiftInfo : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | HAA74_tagMCActBuyCountGiftInfo vNetData = vNetPack as HAA74_tagMCActBuyCountGiftInfo;
|
| | | }
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: d3377004fadeadd49b4d48473ffcf291 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // AA 75 购买次数礼包活动玩家信息 #tagMCActBuyCountGiftPlayerInfo
|
| | |
|
| | | public class DTCAA75_tagMCActBuyCountGiftPlayerInfo : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | HAA75_tagMCActBuyCountGiftPlayerInfo vNetData = vNetPack as HAA75_tagMCActBuyCountGiftPlayerInfo;
|
| | | }
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 74a099c825926fd4ab7edd9c1c40f26f |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | { |
| | | // 登记相应的数据体及对应的数据转逻辑类 |
| | | Register(typeof(H0102_tagCDBPlayer), typeof(DTC0102_tagCDBPlayer)); |
| | | Register(typeof(HA004_tagServerDateTime), typeof(DTCA004_tagServerDateTime));
|
| | | Register(typeof(HA005_tagOpenServerDay), typeof(DTCA005_tagOpenServerDay));
|
| | | Register(typeof(H0403_tagPlayerLoginLoadOK), typeof(DTC0403_tagPlayerLoginLoadOK));
|
| | | Register(typeof(H0101_tagServerPrepared), typeof(DTC0101_tagServerPrepared));
|
| | | Register(typeof(H0104_tagServerDisconnect), typeof(DTC0104_tagServerDisconnect));
|
| | |
|
| | |
|
| | | Register(typeof(HA004_tagServerDateTime), typeof(DTCA004_tagServerDateTime)); |
| | | Register(typeof(HA005_tagOpenServerDay), typeof(DTCA005_tagOpenServerDay)); |
| | | Register(typeof(H0403_tagPlayerLoginLoadOK), typeof(DTC0403_tagPlayerLoginLoadOK)); |
| | | Register(typeof(H0101_tagServerPrepared), typeof(DTC0101_tagServerPrepared)); |
| | | Register(typeof(H0104_tagServerDisconnect), typeof(DTC0104_tagServerDisconnect)); |
| | | Register(typeof(H0724_tagRolePackCanUseCount), typeof(DTC0724_tagRolePackCanUseCount)); |
| | | Register(typeof(H0725_tagRolePackRefreshEx), typeof(DTC0725_tagRolePackRefreshEx)); |
| | | Register(typeof(H0704_tagRolePackRefresh), typeof(DTC0704_tagRolePackRefresh)); |
| | | Register(typeof(H0706_tagUseItemSuccess), typeof(DTC0706_tagUseItemSuccess)); |
| | | Register(typeof(H0707_tagItemCountRefresh), typeof(DTC0707_tagItemCountRefresh)); |
| | | Register(typeof(H0709_tagClearItem), typeof(DTC0709_tagClearItem)); |
| | | Register(typeof(H0711_tagClearItemPack), typeof(DTC0711_tagClearItemPack)); |
| | | Register(typeof(HA204_tagMCVPackRefresh), typeof(DTCA204_tagMCVPackRefresh)); |
| | | Register(typeof(HA205_tagMCVPackClear), typeof(DTCA205_tagMCVPackClear)); |
| | | Register(typeof(HA206_tagMCAutoItemCountRefresh), typeof(DTCA206_tagMCAutoItemCountRefresh)); |
| | | Register(typeof(HA710_tagMCGuideState), typeof(DTCA710_tagMCGuideState)); |
| | | Register(typeof(H0418_tagObjInfoRefresh), typeof(DTC0418_tagObjInfoRefresh)); |
| | | Register(typeof(HA709_tagObjInfoListRefresh), typeof(DTCA709_tagObjInfoListRefresh)); |
| | | Register(typeof(H0113_tagServerHeart), typeof(DTC0113_tagServerHeart)); |
| | | Register(typeof(H0111_tagOnlineReply), typeof(DTC0111_tagOnlineReply)); |
| | | Register(typeof(H0605_tagObjAddBuff), typeof(DTC0605_tagObjAddBuff)); |
| | | Register(typeof(H0606_tagObjDelBuff), typeof(DTC0606_tagObjDelBuff)); |
| | | Register(typeof(H0608_tagNPCDie), typeof(DTC0608_tagNPCDie)); |
| | | Register(typeof(H0612_tagClearObjBuff), typeof(DTC0612_tagClearObjBuff)); |
| | | Register(typeof(HA3A1_tagMCModuleFightPowerInfo), typeof(DTCA3A1_tagMCModuleFightPowerInfo)); |
| | | Register(typeof(HA110_tagMCCoinToGoldCountInfo), typeof(DTCA110_tagMCCoinToGoldCountInfo)); |
| | | Register(typeof(HA008_tagGCPlayerRecInfo), typeof(DTCA008_tagGCPlayerRecInfo)); |
| | | Register(typeof(HAA02_tagMCFirstGoldInfo), typeof(DTCAA02_tagMCFirstGoldInfo)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //主工程注册封包 |
| | | public static void Register(Type _pack, Type _business) |
| | | { |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //01 11 在线回应回报#tagOnlineReply
|
| | |
|
| | | public class H0111_tagOnlineReply : GameNetPackBasic {
|
| | | public byte Type;
|
| | |
|
| | | public H0111_tagOnlineReply () {
|
| | | _cmd = (ushort)0x0111;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out Type, vBytes, NetDataType.BYTE);
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 41e333eb338c59e4d93e35333a55ba19 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //01 13 服务器心跳包#tagServerHeart
|
| | |
|
| | | public class H0113_tagServerHeart : GameNetPackBasic {
|
| | | public byte Type;
|
| | |
|
| | | public H0113_tagServerHeart () {
|
| | | _cmd = (ushort)0x0113;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out Type, vBytes, NetDataType.BYTE);
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 11abd8c3d3508a54eb32ea1697c7f03c |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //04 18 周围对象刷新#tagObjInfoRefresh
|
| | |
|
| | | public class H0418_tagObjInfoRefresh : GameNetPackBasic {
|
| | | public uint ObjID;
|
| | | public byte ObjType;
|
| | | public ushort RefreshType;
|
| | | public uint Value;
|
| | | public uint ValueEx;
|
| | |
|
| | | public H0418_tagObjInfoRefresh () {
|
| | | _cmd = (ushort)0x0418;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out ObjID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out ObjType, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out RefreshType, vBytes, NetDataType.WORD);
|
| | | TransBytes (out Value, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out ValueEx, vBytes, NetDataType.DWORD);
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 71d0294c4a4ae834c9f72b44f8d71cab |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ed2af882bf8f9d24a9e74b720a181ed6 |
| | | folderAsset: yes |
| | | DefaultImporter: |
| | | externalObjects: {} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //06 05 对象增加Buf#tagObjAddBuff
|
| | |
|
| | | public class H0605_tagObjAddBuff : GameNetPackBasic {
|
| | | public byte ObjType; //buff的受效果者
|
| | | public uint ObjID;
|
| | | public byte BuffType; //Buff类型 TBuffType
|
| | | public ushort SkillID;
|
| | | public uint LastTime;
|
| | | public uint Value;
|
| | | public uint Value1;
|
| | | public uint Value2;
|
| | | public byte Layer; //层数,不需要默认0
|
| | | public uint OwnerID; // buff来源者
|
| | | public byte OwnerType;
|
| | |
|
| | | public H0605_tagObjAddBuff () {
|
| | | _cmd = (ushort)0x0605;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out ObjType, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out ObjID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out BuffType, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out SkillID, vBytes, NetDataType.WORD);
|
| | | TransBytes (out LastTime, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out Value, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out Value1, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out Value2, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out Layer, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out OwnerID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out OwnerType, vBytes, NetDataType.BYTE);
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 6f36552c258dcd14fb30a3366bb16cf1 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //06 06 对象减少Buf#tagObjDelBuff
|
| | |
|
| | | public class H0606_tagObjDelBuff : GameNetPackBasic {
|
| | | public byte ObjType;
|
| | | public uint ObjID;
|
| | | public byte BuffType;
|
| | | public ushort SkillID;
|
| | |
|
| | | public H0606_tagObjDelBuff () {
|
| | | _cmd = (ushort)0x0606;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out ObjType, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out ObjID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out BuffType, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out SkillID, vBytes, NetDataType.WORD);
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: b98c2ae3ef253814189edb8d9fe00b5a |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //06 08 NPC死亡#tagNPCDie
|
| | |
|
| | | public class H0608_tagNPCDie : GameNetPackBasic {
|
| | | public uint ObjID;
|
| | | public uint Reason;
|
| | | public byte KillerType;
|
| | | public uint KillerID;
|
| | |
|
| | | public H0608_tagNPCDie () {
|
| | | _cmd = (ushort)0x0608;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out ObjID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out Reason, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out KillerType, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out KillerID, vBytes, NetDataType.DWORD);
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 1799fc498eb2730439e8bcc3d8d8ee57 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //06 12 根据类型清空对象的buff#tagClearObjBuff
|
| | |
|
| | | public class H0612_tagClearObjBuff : GameNetPackBasic {
|
| | | public byte ObjType;
|
| | | public uint ObjID;
|
| | | public byte BuffType; //buff类型
|
| | |
|
| | | public H0612_tagClearObjBuff () {
|
| | | _cmd = (ushort)0x0612;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out ObjType, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out ObjID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out BuffType, vBytes, NetDataType.BYTE);
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: aa4427250f1a828469c5baba3c29682a |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //07 04 主角背包刷新#tagRolePackRefresh
|
| | |
|
| | | //07 04 主角背包刷新#tagRolePackRefresh
|
| | |
|
| | | public class H0704_tagRolePackRefresh : GameNetPackBasic {
|
| | | public byte PackType; //背包类型:rptItem, rptEquip, rptWarehouse
|
| | | public byte ItemPlace;
|
| | | public uint ItemID;
|
| | | public byte IsLocked; //是否锁定
|
| | | public ushort ItemCount; //物品数量
|
| | | public byte IsBind; //是否绑定
|
| | | public uint GearScore; //评分
|
| | | public uint RemainHour; //剩余时间(小时)
|
| | | public byte IsSuite; //是否已经套装化
|
| | | public uint UserDataLen;
|
| | | public string UserData; //size = UserDataLen
|
| | | public string ItemGUID;
|
| | |
|
| | | public H0704_tagRolePackRefresh () {
|
| | | _cmd = (ushort)0x0704;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out PackType, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out ItemPlace, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out ItemID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out IsLocked, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out ItemCount, vBytes, NetDataType.WORD);
|
| | | TransBytes (out IsBind, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out GearScore, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out RemainHour, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out IsSuite, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out UserDataLen, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out UserData, vBytes, NetDataType.Chars, UserDataLen);
|
| | | TransBytes (out ItemGUID, vBytes, NetDataType.Chars, 40);
|
| | | }
|
| | |
|
| | | }
|
| | | public class H0704_tagRolePackRefresh : GameNetPackBasic {
|
| | | public byte PackType; //背包类型:rptItem, rptEquip, rptWarehouse
|
| | | public byte ItemPlace;
|
| | | public uint ItemID;
|
| | | public byte IsLocked; //是否锁定
|
| | | public ushort ItemCount; //物品数量
|
| | | public byte IsBind; //是否绑定
|
| | | public uint GearScore; //评分
|
| | | public uint RemainHour; //剩余时间(小时)
|
| | | public byte IsSuite; //是否已经套装化
|
| | | public uint UserDataLen;
|
| | | public string UserData; //size = UserDataLen
|
| | | public string ItemGUID;
|
| | |
|
| | | public H0704_tagRolePackRefresh () {
|
| | | _cmd = (ushort)0x0704;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out PackType, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out ItemPlace, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out ItemID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out IsLocked, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out ItemCount, vBytes, NetDataType.WORD);
|
| | | TransBytes (out IsBind, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out GearScore, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out RemainHour, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out IsSuite, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out UserDataLen, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out UserData, vBytes, NetDataType.Chars, UserDataLen);
|
| | | TransBytes (out ItemGUID, vBytes, NetDataType.Chars, 40);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //07 06 玩家使用物品成功#tagUseItemSuccess |
| | | |
| | | |
| | | |
| | | public class H0706_tagUseItemSuccess : GameNetPackBasic { |
| | | |
| | | public uint PlayerID; |
| | | |
| | | public uint ItemID; |
| | | |
| | | public byte ItemIndex; |
| | | |
| | | |
| | | |
| | | public H0706_tagUseItemSuccess () { |
| | | |
| | | _cmd = (ushort)0x0706; |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | public override void ReadFromBytes (byte[] vBytes) { |
| | | |
| | | TransBytes (out PlayerID, vBytes, NetDataType.DWORD); |
| | | |
| | | TransBytes (out ItemID, vBytes, NetDataType.DWORD); |
| | | |
| | | TransBytes (out ItemIndex, vBytes, NetDataType.BYTE); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | //07 06 玩家使用物品成功#tagUseItemSuccess
|
| | |
|
| | | public class H0706_tagUseItemSuccess : GameNetPackBasic {
|
| | | public uint PlayerID;
|
| | | public uint ItemID;
|
| | | public byte ItemIndex;
|
| | |
|
| | | public H0706_tagUseItemSuccess () {
|
| | | _cmd = (ushort)0x0706;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out PlayerID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out ItemID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out ItemIndex, vBytes, NetDataType.BYTE);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //07 07 物品数量刷新#tagItemCountRefresh
|
| | |
|
| | | //07 07 物品数量刷新#tagItemCountRefresh
|
| | |
|
| | | public class H0707_tagItemCountRefresh : GameNetPackBasic {
|
| | | public byte PackType;
|
| | | public byte ItemIndex;
|
| | | public ushort ItemCount;
|
| | |
|
| | | public H0707_tagItemCountRefresh () {
|
| | | _cmd = (ushort)0x0707;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out PackType, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out ItemIndex, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out ItemCount, vBytes, NetDataType.WORD);
|
| | | }
|
| | |
|
| | | }
|
| | | public class H0707_tagItemCountRefresh : GameNetPackBasic {
|
| | | public byte PackType;
|
| | | public byte ItemIndex;
|
| | | public ushort ItemCount;
|
| | |
|
| | | public H0707_tagItemCountRefresh () {
|
| | | _cmd = (ushort)0x0707;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out PackType, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out ItemIndex, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out ItemCount, vBytes, NetDataType.WORD);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //07 09 清空物品#tagClearItem |
| | | |
| | | |
| | | |
| | | public class H0709_tagClearItem : GameNetPackBasic { |
| | | |
| | | public byte PackType; |
| | | |
| | | public byte ItemIndex; |
| | | |
| | | public byte ClearType; //Type = TItemNotifyType |
| | | |
| | | |
| | | |
| | | public H0709_tagClearItem () { |
| | | |
| | | _cmd = (ushort)0x0709; |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | public override void ReadFromBytes (byte[] vBytes) { |
| | | |
| | | TransBytes (out PackType, vBytes, NetDataType.BYTE); |
| | | |
| | | TransBytes (out ItemIndex, vBytes, NetDataType.BYTE); |
| | | |
| | | TransBytes (out ClearType, vBytes, NetDataType.BYTE); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | //07 09 清空物品#tagClearItem
|
| | |
|
| | | public class H0709_tagClearItem : GameNetPackBasic {
|
| | | public byte PackType;
|
| | | public byte ItemIndex;
|
| | | public byte ClearType; //Type = TItemNotifyType
|
| | |
|
| | | public H0709_tagClearItem () {
|
| | | _cmd = (ushort)0x0709;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out PackType, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out ItemIndex, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out ClearType, vBytes, NetDataType.BYTE);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //07 11 清空背包#tagClearItemPack
|
| | |
|
| | | //07 11 清空背包#tagClearItemPack
|
| | |
|
| | | public class H0711_tagClearItemPack : GameNetPackBasic {
|
| | | public byte PackIndex; //背包索引
|
| | | public ushort ItemBeginIndex; //背包格子起始索引,从0开始
|
| | | public ushort ItemEndIndex; //背包格子结索引,从0开始
|
| | |
|
| | | public H0711_tagClearItemPack () {
|
| | | _cmd = (ushort)0x0711;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out PackIndex, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out ItemBeginIndex, vBytes, NetDataType.WORD);
|
| | | TransBytes (out ItemEndIndex, vBytes, NetDataType.WORD);
|
| | | }
|
| | |
|
| | | }
|
| | | public class H0711_tagClearItemPack : GameNetPackBasic {
|
| | | public byte PackIndex; //背包索引
|
| | | public ushort ItemBeginIndex; //背包格子起始索引,从0开始
|
| | | public ushort ItemEndIndex; //背包格子结索引,从0开始
|
| | |
|
| | | public H0711_tagClearItemPack () {
|
| | | _cmd = (ushort)0x0711;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out PackIndex, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out ItemBeginIndex, vBytes, NetDataType.WORD);
|
| | | TransBytes (out ItemEndIndex, vBytes, NetDataType.WORD);
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //07 22 物品死锁#tagItemDeadLockRefresh
|
| | |
|
| | | public class H0722_tagItemDeadLockRefresh : GameNetPackBasic {
|
| | | public byte PackType;
|
| | | public byte ItemIndex;
|
| | | public byte IsLock;
|
| | |
|
| | | public H0722_tagItemDeadLockRefresh () {
|
| | | _cmd = (ushort)0x0722;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out PackType, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out ItemIndex, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out IsLock, vBytes, NetDataType.BYTE);
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 482a2445357832a448bf99461964a148 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //07 24 主角背包已开启格数#tagRolePackCanUseCount |
| | | //07 24 主角背包已开启格数#tagRolePackCanUseCount |
| | | |
| | | |
| | | |
| | | public class H0724_tagRolePackCanUseCount : GameNetPackBasic { |
| | | |
| | | public byte PackType; //背包类型:rptItem, rptEquip, rptWarehouse |
| | | public byte PackType; //背包类型:rptItem, rptEquip, rptWarehouse |
| | | |
| | | public ushort CanUseCount; //背包已开启格数 |
| | | public ushort CanUseCount; //背包已开启格数 |
| | | |
| | | |
| | | |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //07 25 主角背包刷新(通知所有物品) #tagRolePackRefreshEx
|
| | |
|
| | | //07 25 主角背包刷新(通知所有物品) #tagRolePackRefreshEx
|
| | |
|
| | | public class H0725_tagRolePackRefreshEx : GameNetPackBasic {
|
| | | public byte PackType; //背包类型:rptItem, rptEquip, rptWarehouse
|
| | | public ushort ItemCount;
|
| | | public tagRoleItemRefresh[] ItemInfo = null; //size = ItemCount
|
| | |
|
| | | public H0725_tagRolePackRefreshEx () {
|
| | | _cmd = (ushort)0x0725;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out PackType, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out ItemCount, vBytes, NetDataType.WORD);
|
| | | ItemInfo = new tagRoleItemRefresh[ItemCount];
|
| | | for (int i = 0; i < ItemCount; i ++) {
|
| | | ItemInfo[i] = new tagRoleItemRefresh();
|
| | | TransBytes (out ItemInfo[i].ItemPlace, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out ItemInfo[i].ItemID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out ItemInfo[i].IsLocked, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out ItemInfo[i].ItemCount, vBytes, NetDataType.WORD);
|
| | | TransBytes (out ItemInfo[i].IsBind, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out ItemInfo[i].GearScore, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out ItemInfo[i].RemainHour, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out ItemInfo[i].IsSuite, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out ItemInfo[i].UserDataLen, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out ItemInfo[i].UserData, vBytes, NetDataType.Chars, ItemInfo[i].UserDataLen);
|
| | | TransBytes (out ItemInfo[i].ItemGUID, vBytes, NetDataType.Chars, 40);
|
| | | }
|
| | | }
|
| | |
|
| | | public struct tagRoleItemRefresh {
|
| | | public byte ItemPlace;
|
| | | public uint ItemID;
|
| | | public byte IsLocked; //是否锁定
|
| | | public ushort ItemCount; //物品数量
|
| | | public byte IsBind; //是否绑定
|
| | | public uint GearScore; //评分
|
| | | public uint RemainHour; //剩余时间(小时)
|
| | | public byte IsSuite; //是否已经套装化
|
| | | public uint UserDataLen;
|
| | | public string UserData; //size = UserDataLen
|
| | | public string ItemGUID;
|
| | | }
|
| | |
|
| | | }
|
| | | public class H0725_tagRolePackRefreshEx : GameNetPackBasic {
|
| | | public byte PackType; //背包类型:rptItem, rptEquip, rptWarehouse
|
| | | public ushort ItemCount;
|
| | | public tagRoleItemRefresh[] ItemInfo; //size = ItemCount
|
| | |
|
| | | public H0725_tagRolePackRefreshEx () {
|
| | | _cmd = (ushort)0x0725;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out PackType, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out ItemCount, vBytes, NetDataType.WORD);
|
| | | ItemInfo = new tagRoleItemRefresh[ItemCount];
|
| | | for (int i = 0; i < ItemCount; i ++) {
|
| | | ItemInfo[i] = new tagRoleItemRefresh();
|
| | | TransBytes (out ItemInfo[i].ItemPlace, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out ItemInfo[i].ItemID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out ItemInfo[i].IsLocked, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out ItemInfo[i].ItemCount, vBytes, NetDataType.WORD);
|
| | | TransBytes (out ItemInfo[i].IsBind, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out ItemInfo[i].GearScore, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out ItemInfo[i].RemainHour, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out ItemInfo[i].IsSuite, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out ItemInfo[i].UserDataLen, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out ItemInfo[i].UserData, vBytes, NetDataType.Chars, ItemInfo[i].UserDataLen);
|
| | | TransBytes (out ItemInfo[i].ItemGUID, vBytes, NetDataType.Chars, 40);
|
| | | }
|
| | | }
|
| | |
|
| | | public struct tagRoleItemRefresh {
|
| | | public byte ItemPlace;
|
| | | public uint ItemID;
|
| | | public byte IsLocked; //是否锁定
|
| | | public ushort ItemCount; //物品数量
|
| | | public byte IsBind; //是否绑定
|
| | | public uint GearScore; //评分
|
| | | public uint RemainHour; //剩余时间(小时)
|
| | | public byte IsSuite; //是否已经套装化
|
| | | public uint UserDataLen;
|
| | | public string UserData; //size = UserDataLen
|
| | | public string ItemGUID;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // A0 08 玩家记录信息 #tagGCPlayerRecInfo
|
| | |
|
| | | public class HA008_tagGCPlayerRecInfo : GameNetPackBasic {
|
| | | public byte Type; //类型
|
| | | public ushort Count; //数量
|
| | | public tagGCPlayerRec[] PlayerRecList;
|
| | |
|
| | | public HA008_tagGCPlayerRecInfo () {
|
| | | _cmd = (ushort)0xA008;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out Type, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out Count, vBytes, NetDataType.WORD);
|
| | | PlayerRecList = new tagGCPlayerRec[Count];
|
| | | for (int i = 0; i < Count; i ++) {
|
| | | PlayerRecList[i] = new tagGCPlayerRec();
|
| | | TransBytes (out PlayerRecList[i].Time, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out PlayerRecList[i].Value1, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out PlayerRecList[i].Value2, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out PlayerRecList[i].Value3, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out PlayerRecList[i].Value4, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out PlayerRecList[i].Value5, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out PlayerRecList[i].Value6, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out PlayerRecList[i].Value7, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out PlayerRecList[i].Value8, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out PlayerRecList[i].UserDataLen, vBytes, NetDataType.WORD);
|
| | | TransBytes (out PlayerRecList[i].UserData, vBytes, NetDataType.Chars, PlayerRecList[i].UserDataLen);
|
| | | }
|
| | | }
|
| | |
|
| | | public struct tagGCPlayerRec {
|
| | | public uint Time; //时间
|
| | | public uint Value1; //值1
|
| | | public uint Value2; //值2
|
| | | public uint Value3; //值3
|
| | | public uint Value4; //值4
|
| | | public uint Value5; //值5
|
| | | public uint Value6; //值6
|
| | | public uint Value7; //值7
|
| | | public uint Value8; //值8
|
| | | public ushort UserDataLen; //扩展数据长度
|
| | | public string UserData; //扩展数据
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: a48c1bcaf98ce744ba6ef8d12221ae76 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 6297fb5ba860acb499c26db8cfe3b58f |
| | | folderAsset: yes |
| | | DefaultImporter: |
| | | externalObjects: {} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // A1 10 充值购买次数信息 #tagMCCoinToGoldCountInfo
|
| | |
|
| | | public class HA110_tagMCCoinToGoldCountInfo : GameNetPackBasic {
|
| | | public uint RealFirstTime; // 首次真实充值时间戳
|
| | | public uint RealToday; // 今日真实充值coin
|
| | | public uint RealTotal; // 累计真实充值coin
|
| | | public ushort RecordCount;
|
| | | public tagMCCoinToGoldCount[] CTGCountInfoList;
|
| | |
|
| | | public HA110_tagMCCoinToGoldCountInfo () {
|
| | | _cmd = (ushort)0xA110;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out RealFirstTime, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out RealToday, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out RealTotal, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out RecordCount, vBytes, NetDataType.WORD);
|
| | | CTGCountInfoList = new tagMCCoinToGoldCount[RecordCount];
|
| | | for (int i = 0; i < RecordCount; i ++) {
|
| | | CTGCountInfoList[i] = new tagMCCoinToGoldCount();
|
| | | TransBytes (out CTGCountInfoList[i].RecordID, vBytes, NetDataType.WORD);
|
| | | TransBytes (out CTGCountInfoList[i].TodayPayCount, vBytes, NetDataType.WORD);
|
| | | TransBytes (out CTGCountInfoList[i].TotalPayCount, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out CTGCountInfoList[i].WeekPayCount, vBytes, NetDataType.WORD);
|
| | | TransBytes (out CTGCountInfoList[i].MonthPayCount, vBytes, NetDataType.WORD);
|
| | | TransBytes (out CTGCountInfoList[i].SelectItemValue, vBytes, NetDataType.DWORD);
|
| | | }
|
| | | }
|
| | |
|
| | | public struct tagMCCoinToGoldCount {
|
| | | public ushort RecordID;
|
| | | public ushort TodayPayCount; // 今日已购买次数
|
| | | public uint TotalPayCount; // 累计总购买次数
|
| | | public ushort WeekPayCount; // 周总购买次数
|
| | | public ushort MonthPayCount; // 月总购买次数
|
| | | public uint SelectItemValue; // 自选物品索引值,每两位存储每个自选索引对应选择的物品索引+1,存储位值为0代表未选择,最多支持选择4种物品
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 825c271b181b2084bbbb204d3d67e9b8 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //A3 A1 各功能模块战斗力信息 #tagMCModuleFightPowerInfo
|
| | |
|
| | | public class HA3A1_tagMCModuleFightPowerInfo : GameNetPackBasic {
|
| | | public uint TotalFightPower; //总战斗力,求余亿部分
|
| | | public uint TotalFightPoweEx; //总战斗力,整除亿部分,1代表1亿
|
| | | public byte MFPCnt; //模块战斗力总数
|
| | | public tagMCModuleFightPower[] MFPList;
|
| | |
|
| | | public HA3A1_tagMCModuleFightPowerInfo () {
|
| | | _cmd = (ushort)0xA3A1;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out TotalFightPower, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out TotalFightPoweEx, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out MFPCnt, vBytes, NetDataType.BYTE);
|
| | | MFPList = new tagMCModuleFightPower[MFPCnt];
|
| | | for (int i = 0; i < MFPCnt; i ++) {
|
| | | MFPList[i] = new tagMCModuleFightPower();
|
| | | TransBytes (out MFPList[i].MfpType, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out MFPList[i].FightPower, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out MFPList[i].FightPowerEx, vBytes, NetDataType.DWORD);
|
| | | }
|
| | | }
|
| | |
|
| | | public struct tagMCModuleFightPower {
|
| | | public byte MfpType; //模块编号类型
|
| | | public uint FightPower; //本模块战斗力,求余亿部分
|
| | | public uint FightPowerEx; //本模块战斗力,整除亿部分,1代表1亿
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 6fb2c77abf75d964d82b4b15659602b9 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //A7 05 查询玩家详细信息结果#tagSCQueryPlayerCacheResult
|
| | |
|
| | | public class HA705_tagSCQueryPlayerCacheResult : GameNetPackBasic {
|
| | | public uint PlayerID;
|
| | | public string PlayerName;
|
| | | public ushort LV;
|
| | | public byte Job;
|
| | | public byte RealmLV;
|
| | | public uint Face;
|
| | | public uint FacePic;
|
| | | public uint TitleID; //佩戴的称号
|
| | | public uint ServerID;
|
| | | public uint FightPower;
|
| | | public uint FightPowerEx;
|
| | | public uint FamilyID;
|
| | | public string FamilyName;
|
| | | public uint FamilyEmblemID; //仙盟徽章ID
|
| | | public uint PlusDataSize;
|
| | | public string PlusData; //扩展记录 |
| | |
|
| | | public HA705_tagSCQueryPlayerCacheResult () {
|
| | | _cmd = (ushort)0xA705;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out PlayerID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out PlayerName, vBytes, NetDataType.Chars, 33);
|
| | | TransBytes (out LV, vBytes, NetDataType.WORD);
|
| | | TransBytes (out Job, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out RealmLV, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out Face, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out FacePic, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out TitleID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out ServerID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out FightPower, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out FightPowerEx, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out FamilyID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out FamilyName, vBytes, NetDataType.Chars, 33);
|
| | | TransBytes (out FamilyEmblemID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out PlusDataSize, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out PlusData, vBytes, NetDataType.Chars, PlusDataSize);
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 3e1df4d0627000245b6d07c34859acd5 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //A7 09 周围对象刷新合并包 #tagObjInfoListRefresh
|
| | |
|
| | | public class HA709_tagObjInfoListRefresh : GameNetPackBasic {
|
| | | public uint ObjID;
|
| | | public byte ObjType;
|
| | | public byte Count;
|
| | | public tagRefreshType[] RefreshType;
|
| | |
|
| | | public HA709_tagObjInfoListRefresh () {
|
| | | _cmd = (ushort)0xA709;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out ObjID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out ObjType, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out Count, vBytes, NetDataType.BYTE);
|
| | | RefreshType = new tagRefreshType[Count];
|
| | | for (int i = 0; i < Count; i ++) {
|
| | | RefreshType[i] = new tagRefreshType();
|
| | | TransBytes (out RefreshType[i].RefreshType, vBytes, NetDataType.WORD);
|
| | | TransBytes (out RefreshType[i].Value, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out RefreshType[i].ValueEx, vBytes, NetDataType.DWORD);
|
| | | }
|
| | | }
|
| | |
|
| | | public struct tagRefreshType {
|
| | | public ushort RefreshType;
|
| | | public uint Value;
|
| | | public uint ValueEx;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: c0ae500874519ab468b615dd7dea93b5 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // A7 10 引导状态记录 #tagMCGuideState
|
| | |
|
| | | public class HA710_tagMCGuideState : GameNetPackBasic {
|
| | | public byte Count;
|
| | | public uint[] GuideState; // 每个数值存储31位(0~30),目前最多存储Count*31位
|
| | |
|
| | | public HA710_tagMCGuideState () {
|
| | | _cmd = (ushort)0xA710;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out Count, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out GuideState, vBytes, NetDataType.DWORD, Count);
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 244c237180326f048a3d24e5d837c6f4 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: c196f23036a29764fb14008db0077457 |
| | | folderAsset: yes |
| | | DefaultImporter: |
| | | externalObjects: {} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // AA 02 首充信息 #tagMCFirstGoldInfo
|
| | |
|
| | | public class HAA02_tagMCFirstGoldInfo : GameNetPackBasic {
|
| | | public byte FirstGoldRewardState; //首充奖励领奖记录,按位记录首充第X天是否已领取,第1天为第0索引位
|
| | | public byte FirstGoldTry; //首充试用状态0-不可试用 1-可试用 2-已试用
|
| | | public ushort FirstGoldServerDay; //首充时是开服第几天,从1开始,0代表未记录充值
|
| | |
|
| | | public HAA02_tagMCFirstGoldInfo () {
|
| | | _cmd = (ushort)0xAA02;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out FirstGoldRewardState, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out FirstGoldTry, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out FirstGoldServerDay, vBytes, NetDataType.WORD);
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 23a1bc83dc491c34e96dccbd6a1e4beb |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // AA 74 购买次数礼包活动信息 #tagMCActBuyCountGiftInfo
|
| | |
|
| | | public class HAA74_tagMCActBuyCountGiftInfo : GameNetPackBasic {
|
| | | public byte ActNum; // 活动编号
|
| | | public string StartDate; // 开始日期 y-m-d
|
| | | public string EndtDate; // 结束日期 y-m-d
|
| | | public byte IsDayReset; // 是否每天重置
|
| | | public byte ResetType; // 重置类型,0-0点重置;1-5点重置
|
| | | public ushort LimitLV; // 限制等级
|
| | | public byte CTGIDCount;
|
| | | public ushort[] CTGIDList; // CTGID列表;总购买次数前端自己统计,直接取CTGID对应的累计购买次数累加
|
| | | public byte GiftCount;
|
| | | public tagMCActBuyCountGift[] BuyCountGiftList; // 购买次数礼包列表
|
| | | public ushort ShopType; // 开放商店类型,可能为0不开放
|
| | |
|
| | | public HAA74_tagMCActBuyCountGiftInfo () {
|
| | | _cmd = (ushort)0xAA74;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out ActNum, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out StartDate, vBytes, NetDataType.Chars, 10);
|
| | | TransBytes (out EndtDate, vBytes, NetDataType.Chars, 10);
|
| | | TransBytes (out IsDayReset, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out ResetType, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out LimitLV, vBytes, NetDataType.WORD);
|
| | | TransBytes (out CTGIDCount, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out CTGIDList, vBytes, NetDataType.WORD, CTGIDCount);
|
| | | TransBytes (out GiftCount, vBytes, NetDataType.BYTE);
|
| | | BuyCountGiftList = new tagMCActBuyCountGift[GiftCount];
|
| | | for (int i = 0; i < GiftCount; i ++) {
|
| | | BuyCountGiftList[i] = new tagMCActBuyCountGift();
|
| | | TransBytes (out BuyCountGiftList[i].NeedBuyCount, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out BuyCountGiftList[i].Count, vBytes, NetDataType.BYTE);
|
| | | BuyCountGiftList[i].AwardItemList = new tagMCActBuyCountGiftItem[BuyCountGiftList[i].Count];
|
| | | for (int j = 0; j < BuyCountGiftList[i].Count; j ++) {
|
| | | BuyCountGiftList[i].AwardItemList[j] = new tagMCActBuyCountGiftItem();
|
| | | TransBytes (out BuyCountGiftList[i].AwardItemList[j].ItemID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out BuyCountGiftList[i].AwardItemList[j].ItemCount, vBytes, NetDataType.WORD);
|
| | | TransBytes (out BuyCountGiftList[i].AwardItemList[j].IsBind, vBytes, NetDataType.BYTE);
|
| | | }
|
| | | }
|
| | | TransBytes (out ShopType, vBytes, NetDataType.WORD);
|
| | | }
|
| | |
|
| | | public struct tagMCActBuyCountGiftItem {
|
| | | public uint ItemID;
|
| | | public ushort ItemCount;
|
| | | public byte IsBind;
|
| | | }
|
| | |
|
| | | public struct tagMCActBuyCountGift {
|
| | | public byte NeedBuyCount; // 所需总购买次数,0为免费领取的档次
|
| | | public byte Count; // 奖励物品数
|
| | | public tagMCActBuyCountGiftItem[] AwardItemList; // 奖励物品列表
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 5c68ca6a422b00f4a8f5985299beb9c9 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // AA 75 购买次数礼包活动玩家信息 #tagMCActBuyCountGiftPlayerInfo
|
| | |
|
| | | public class HAA75_tagMCActBuyCountGiftPlayerInfo : GameNetPackBasic {
|
| | | public byte ActNum; // 活动编号
|
| | | public uint GiftAwardRecord; // 购买次数礼包领奖记录,直接用购买次数做位运算判断是否已领取
|
| | |
|
| | | public HAA75_tagMCActBuyCountGiftPlayerInfo () {
|
| | | _cmd = (ushort)0xAA75;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out ActNum, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out GiftAwardRecord, vBytes, NetDataType.DWORD);
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: dc6e07b3871072b428e384ff1e25b85b |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | Debug.Log("切换到登录场景");
|
| | | ConfigManager.Instance.Init();
|
| | | StageManager.Instance.ToLoginScene();
|
| | |
|
| | | DTC0403_tagPlayerLoginLoadOK.finishedLogin = false;
|
| | | DTC0102_tagCDBPlayer.isAfterPlayerDataInitialize = false;
|
| | | }
|
| | |
|
| | | public static async UniTask InitManagers()
|
| | |
| | |
|
| | | // 初始化游戏系统
|
| | | managers.Add(BattleManager.Instance);
|
| | | managers.Add(VirtualPackManager.Instance);
|
| | | managers.Add(RoleParticularModel.Instance);
|
| | | managers.Add(RechargeManager.Instance);
|
| | | managers.Add(RoleParticularModel.Instance);
|
| | |
|
| | | foreach (var manager in managers)
|
| | | {
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 3bec9fa3bab3d9e43a9d88be500ac926 |
| | | folderAsset: yes |
| | | DefaultImporter: |
| | | externalObjects: {} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Wednesday, September 26, 2018
|
| | | //--------------------------------------------------------
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | | using System.Collections.Generic;
|
| | |
|
| | |
|
| | | public class CustomizedGiftCell : CellView
|
| | | {
|
| | | [SerializeField] Text title;
|
| | | [SerializeField] Text saleValue;
|
| | | [SerializeField] Text limiteBuyCntText;
|
| | | [SerializeField] List<CustomizedItemCell> itemCells;
|
| | | [SerializeField] Button buyBtn;
|
| | | [SerializeField] Text priceText;
|
| | | [SerializeField] Button haveBtn;
|
| | | [SerializeField] Image buyYetImg;
|
| | | [SerializeField] Image haveYetImg;
|
| | | [SerializeField] ImageEx ImgSale;
|
| | | int girdIndex = 0;
|
| | | TextEx orgPrice;
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | public void Display(int index)
|
| | | {
|
| | | OperationRechargeGiftAct act;
|
| | | if (!OperationTimeHepler.Instance.TryGetOperation(CustomizedGiftModel.operaType, out act))
|
| | | {
|
| | | return;
|
| | | }
|
| | | //免费礼包
|
| | | if (CustomizedGiftModel.Instance.IsFree(index))
|
| | | {
|
| | | ImgSale.SetActive(false);
|
| | | buyBtn.SetActive(false);
|
| | | buyYetImg.SetActive(false);
|
| | | limiteBuyCntText.SetActive(false);
|
| | | haveBtn.SetActive(true);
|
| | | title.text = Language.Get("CustomizedGift02");
|
| | | int totalBuyCnt = CustomizedGiftModel.Instance.GetBuyTotalCnt();
|
| | | var awardInfo = act.buyCountGifts[index];
|
| | | for (int i = 0; i < itemCells.Count; i++)
|
| | | {
|
| | | if (i < awardInfo.AwardItemList.Length)
|
| | | {
|
| | | var award = awardInfo.AwardItemList[i];
|
| | | itemCells[i].button.interactable = true;
|
| | | itemCells[i].SetActive(true);
|
| | | var itemData = new ItemCellModel((int)award.ItemID, false, award.ItemCount);
|
| | | itemCells[i].Init(itemData);
|
| | | itemCells[i].button.SetListener(() =>
|
| | | {
|
| | | ItemTipUtility.Show((int)award.ItemID);
|
| | | });
|
| | | }
|
| | | else
|
| | | {
|
| | | itemCells[i].SetActive(false);
|
| | | }
|
| | | }
|
| | | haveBtn.SetColorful(null, totalBuyCnt >= awardInfo.NeedBuyCount);
|
| | | haveBtn.interactable = totalBuyCnt >= awardInfo.NeedBuyCount;
|
| | | haveBtn.SetListener(() =>
|
| | | {
|
| | | CustomizedGiftModel.Instance.SendGetAward(awardInfo.NeedBuyCount);
|
| | | });
|
| | |
|
| | | if (index == act.buyCountGifts.Count - 1 && CustomizedGiftModel.Instance.GetBuyGiftState(awardInfo.NeedBuyCount) == 2)
|
| | | {
|
| | | haveYetImg.SetActive(true);
|
| | | haveBtn.SetActive(false);
|
| | | }
|
| | | else
|
| | | {
|
| | | haveYetImg.SetActive(false);
|
| | | haveBtn.SetActive(true);
|
| | | }
|
| | | }
|
| | | //付费礼包
|
| | | else
|
| | | {
|
| | | haveBtn.SetActive(false);
|
| | | haveYetImg.SetActive(false);
|
| | | limiteBuyCntText.SetActive(true);
|
| | | ImgSale.SetActive(true);
|
| | |
|
| | | int actCtgIndex = index - 1;
|
| | | int ctgID = act.ctgIDs[actCtgIndex];
|
| | |
|
| | | CustomizedRechargeModel.Instance.ShowUIItems(itemCells, ctgID);
|
| | |
|
| | | var ctgConfig = CTGConfig.Get(ctgID);
|
| | | title.text = ctgConfig.Title;
|
| | | saleValue.text = Language.Get("RechargeGiftActWin3", ctgConfig.Percentage);
|
| | | var countInfo = CustomizedGiftModel.Instance.GetBuyCntInfo(ctgID);
|
| | | int buyCnt = countInfo.x;
|
| | | int totalCnt = countInfo.y;
|
| | | limiteBuyCntText.text = Language.Get("RechargeGiftActWin4", UIHelper.AppendColor(buyCnt >= totalCnt ? TextColType.Red : TextColType.Green, buyCnt + "/" + totalCnt, true));
|
| | | buyBtn.SetActive(buyCnt < totalCnt);
|
| | | buyBtn.SetListener(() =>
|
| | | {
|
| | | RechargeManager.Instance.CTG(ctgID);
|
| | | });
|
| | | buyYetImg.SetActive(buyCnt >= totalCnt);
|
| | | OrderInfoConfig orderConfig;
|
| | | RechargeManager.Instance.TryGetOrderInfo(ctgID, out orderConfig);
|
| | | priceText.text = Language.Get("PayMoneyNum", UIHelper.GetMoneyFormat(orderConfig.PayRMBNumOnSale));
|
| | |
|
| | | var obj = buyBtn.FindComponent("Text", "Txt_orgPrice");
|
| | | if (obj != null)
|
| | | orgPrice = obj as TextEx;
|
| | |
|
| | | if (orgPrice != null)
|
| | | {
|
| | | orgPrice.SetActive(PlayerDatas.Instance.baseData.IsActive90Off);
|
| | | orgPrice.text = Language.Get("PayMoneyNum", UIHelper.GetMoneyFormat(orderConfig.PayRMBNum));
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ea483c50174ddc745b563ae438a3b538 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Wednesday, September 26, 2018
|
| | | //--------------------------------------------------------
|
| | | using UnityEngine;
|
| | | using System.Collections.Generic;
|
| | |
|
| | |
|
| | |
|
| | | public class CustomizedGiftChooseCell : CellView
|
| | | {
|
| | | [SerializeField] List<ItemCell> itemCells;
|
| | | [SerializeField] List<ImageEx> images;
|
| | |
|
| | |
|
| | | public void Display(int index)
|
| | | {
|
| | | var selectItemInfo = CTGConfig.Get(CustomizedRechargeModel.Instance.chooseCTGID).SelectItemInfo;
|
| | | int chooseCount = selectItemInfo.Length;
|
| | |
|
| | | for (int i = 0; i < itemCells.Count; i++)
|
| | | {
|
| | | int itemIndex = index * 7 + i;
|
| | | if (itemIndex < selectItemInfo[CustomizedRechargeModel.Instance.chooseWinIndex].Length)
|
| | | {
|
| | | int selectID = selectItemInfo[CustomizedRechargeModel.Instance.chooseWinIndex][itemIndex];
|
| | | int itemId = CTGSelectItemConfig.Get(selectID).ItemID;
|
| | | int count = CTGSelectItemConfig.Get(selectID).ItemCount;
|
| | | var itemData = new ItemCellModel((int)itemId, false, (ulong)count);
|
| | | images[i].SetActive(CustomizedRechargeModel.Instance.GetChooseSubIndex(CustomizedRechargeModel.Instance.chooseWinIndex) - 1 == i);
|
| | | itemCells[i].SetActive(true);
|
| | | itemCells[i].Init(itemData);
|
| | | itemCells[i].button.SetListener(() =>
|
| | | {
|
| | | CustomizedRechargeModel.Instance.chooseIndexDict[CustomizedRechargeModel.Instance.chooseWinIndex] = itemIndex + 1;
|
| | | //选中后跳下一个
|
| | | if (CustomizedRechargeModel.Instance.chooseWinIndex + 1 < chooseCount)
|
| | | {
|
| | | CustomizedRechargeModel.Instance.chooseWinIndex += 1;
|
| | | }
|
| | | else
|
| | | {
|
| | | CustomizedRechargeModel.Instance.chooseWinIndex = 0;
|
| | | }
|
| | |
|
| | | CustomizedRechargeModel.Instance.UpdateWin?.Invoke();
|
| | | });
|
| | | }
|
| | | else
|
| | | {
|
| | | images[i].SetActive(false);
|
| | | itemCells[i].SetActive(false);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 83b64748aceec7741b3e4942be3a462f |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using System;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | |
|
| | | public class CustomizedGiftChooseWin : UIBase
|
| | | {
|
| | | [SerializeField] ScrollerController m_Controller;
|
| | | [SerializeField] Text txtTitle;
|
| | | [SerializeField] RichText txtInfo;
|
| | | [SerializeField] List<CustomizedItemCell> itemCellList;
|
| | | [SerializeField] List<ImageEx> imageList;
|
| | | [SerializeField] Button closeBtn;
|
| | | [SerializeField] Button closeBtn2;
|
| | | [SerializeField] Button okBtn;
|
| | |
|
| | | int index;
|
| | | int actCtgIndex;
|
| | | #region Built-in
|
| | | protected override void InitComponent()
|
| | | {
|
| | | closeBtn.SetListener(CloseWindow);
|
| | |
|
| | | closeBtn2.SetListener(CloseWindow);
|
| | |
|
| | | okBtn.SetListener(ChooseItem);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | CustomizedRechargeModel.Instance.InitChoose();
|
| | | m_Controller.OnRefreshCell += OnRefreshCell;
|
| | | CustomizedRechargeModel.Instance.UpdateWin += OnUpdateWin;
|
| | | RechargeManager.Instance.rechargeCountEvent += VipModel_rechargeCountEvent;
|
| | | Display();
|
| | | }
|
| | | void VipModel_rechargeCountEvent(int obj)
|
| | | {
|
| | | if (CustomizedRechargeModel.Instance.chooseCTGID == obj)
|
| | | {
|
| | | CloseWindow();
|
| | | }
|
| | | }
|
| | |
|
| | | protected override void OnOpen()
|
| | | {
|
| | | DisplayScroll();
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | m_Controller.OnRefreshCell -= OnRefreshCell;
|
| | | CustomizedRechargeModel.Instance.UpdateWin -= OnUpdateWin;
|
| | | RechargeManager.Instance.rechargeCountEvent -= VipModel_rechargeCountEvent;
|
| | | }
|
| | |
|
| | | void OnUpdateWin()
|
| | | {
|
| | | Display();
|
| | | m_Controller.m_Scorller.RefreshActiveCellViews();
|
| | | }
|
| | |
|
| | |
|
| | | #endregion
|
| | |
|
| | | private void OnRefreshCell(ScrollerDataType type, CellView cell)
|
| | | {
|
| | | var _cell = cell as CustomizedGiftChooseCell;
|
| | | _cell.Display(_cell.index);
|
| | | }
|
| | |
|
| | | void DisplayScroll()
|
| | | {
|
| | | m_Controller.Refresh();
|
| | | var ctgConfig = CTGConfig.Get(CustomizedRechargeModel.Instance.chooseCTGID);
|
| | | var selectItemInfo = ctgConfig.SelectItemInfo[CustomizedRechargeModel.Instance.chooseWinIndex];
|
| | | int count = selectItemInfo.Length;
|
| | | int lineCount = (int)Math.Ceiling((double)count / 7);
|
| | | for (int i = 0; i < lineCount; i++)
|
| | | {
|
| | | m_Controller.AddCell(ScrollerDataType.Header, i);
|
| | | }
|
| | | m_Controller.Restart();
|
| | | }
|
| | |
|
| | | void Display()
|
| | | {
|
| | | for (int i = 0; i < imageList.Count; i++)
|
| | | {
|
| | | imageList[i].SetActive(false);
|
| | | }
|
| | |
|
| | | var ctgConfig = CTGConfig.Get(CustomizedRechargeModel.Instance.chooseCTGID);
|
| | | var selectItemInfo = ctgConfig.SelectItemInfo[CustomizedRechargeModel.Instance.chooseWinIndex];
|
| | |
|
| | | int selectItemID = 0;
|
| | | int selectIemCount = 0;
|
| | | for (int i = 0; i < itemCellList.Count; i++)
|
| | | {
|
| | | if (i < ctgConfig.SelectItemInfo.Length)
|
| | | {
|
| | | itemCellList[i].SetActive(true);
|
| | | int chooseIndex = CustomizedRechargeModel.Instance.GetChooseSubIndex(i);
|
| | | if (chooseIndex != 0)
|
| | | {
|
| | | int selectID = ctgConfig.SelectItemInfo[i][chooseIndex - 1];
|
| | | var itemData = new ItemCellModel(CTGSelectItemConfig.Get(selectID).ItemID, false, (ulong)CTGSelectItemConfig.Get(selectID).ItemCount);
|
| | | itemCellList[i].Init(itemData);
|
| | | if (i == CustomizedRechargeModel.Instance.chooseWinIndex)
|
| | | {
|
| | | selectItemID = CTGSelectItemConfig.Get(selectID).ItemID;
|
| | | selectIemCount = CTGSelectItemConfig.Get(selectID).ItemCount;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | itemCellList[i].Init(null);
|
| | | }
|
| | |
|
| | | int index = i;
|
| | | itemCellList[i].button.SetListener(() =>
|
| | | {
|
| | | if (CustomizedRechargeModel.Instance.chooseWinIndex != index)
|
| | | {
|
| | | CustomizedRechargeModel.Instance.chooseWinIndex = index;
|
| | | Display();
|
| | | DisplayScroll();
|
| | | }
|
| | | });
|
| | |
|
| | | imageList[i].SetActive(i == CustomizedRechargeModel.Instance.chooseWinIndex);
|
| | |
|
| | | }
|
| | | else
|
| | | {
|
| | | itemCellList[i].SetActive(false);
|
| | | }
|
| | | }
|
| | |
|
| | | if (selectItemID > 0)
|
| | | {
|
| | | txtTitle.SetActive(true);
|
| | | txtInfo.SetActive(true);
|
| | | txtTitle.text = StringUtility.Contact(ItemConfig.Get(selectItemID).ItemName, " x", selectIemCount);
|
| | | txtInfo.text = ItemConfig.Get(selectItemID).Description;
|
| | | }
|
| | | else
|
| | | {
|
| | | txtTitle.SetActive(false);
|
| | | txtInfo.SetActive(false);
|
| | | }
|
| | | }
|
| | |
|
| | | void ChooseItem()
|
| | | {
|
| | | var ctgConfig = CTGConfig.Get(CustomizedRechargeModel.Instance.chooseCTGID);
|
| | | if (ctgConfig.SelectItemInfo.Length != CustomizedRechargeModel.Instance.chooseIndexDict.Count)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("CustomizedGift01");
|
| | | return;
|
| | | }
|
| | | |
| | | CA126_tagCMSelectCTGItem pack = new CA126_tagCMSelectCTGItem();
|
| | | pack.RecordID = (ushort)CustomizedRechargeModel.Instance.chooseCTGID;
|
| | | pack.SelectItemValue = CustomizedRechargeModel.Instance.GetSelectedItemValue();
|
| | | GameNetSystem.Instance.SendInfo(pack);
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: cca8090830ee61e4783982674ff9c1b9 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | |
| | | |
| | | //自选礼包的活动 |
| | | public class CustomizedGiftModel : GameSystemManager<CustomizedGiftModel>, IOpenServerActivity |
| | | { |
| | | public event Action<int> onStateUpdate; |
| | | public Redpoint enRedPoint = new Redpoint(MainRedDot.CustomizedGiftRedpoint); |
| | | public const int redPointID = MainRedDot.CustomizedGiftRedpoint * 10 + 2; |
| | | public Redpoint redPoint = new Redpoint(MainRedDot.CustomizedGiftRedpoint, redPointID); //可能挂多个父红点 |
| | | |
| | | private int GiftAwardRecord; //领取状态 |
| | | |
| | | public const int activityType = (int)OpenServerActivityCenter.ActivityType.AT_Activity2; |
| | | public const int activityID = (int)NewDayActivityID.CustomizedGiftWin; |
| | | public static Operation operaType = Operation.default35; |
| | | |
| | | public int actNum; //对应界面 |
| | | public event Action UpdateRechargeGiftActEvent; |
| | | |
| | | |
| | | public override void Init() |
| | | { |
| | | OperationTimeHepler.Instance.operationStartEvent += OperationStartEvent; |
| | | OperationTimeHepler.Instance.operationEndEvent += OperationEndEvent; |
| | | OperationTimeHepler.Instance.operationAdvanceEvent += OperationAdvanceEvent; |
| | | OpenServerActivityCenter.Instance.Register(activityID, this, activityType); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | public bool IsOpen |
| | | { |
| | | get |
| | | { |
| | | return OperationTimeHepler.Instance.SatisfyOpenCondition(operaType); |
| | | } |
| | | } |
| | | |
| | | public bool priorityOpen |
| | | { |
| | | get |
| | | { |
| | | return redPoint.state == RedPointState.Simple; |
| | | } |
| | | } |
| | | |
| | | public bool IsAdvance |
| | | { |
| | | get |
| | | { |
| | | return OperationTimeHepler.Instance.SatisfyAdvanceCondition(operaType); |
| | | } |
| | | } |
| | | |
| | | private void OperationEndEvent(Operation type, int state) |
| | | { |
| | | if (type == operaType && state == 0) |
| | | { |
| | | if (onStateUpdate != null) |
| | | { |
| | | onStateUpdate(activityID); |
| | | } |
| | | UpdateRedpoint(); |
| | | } |
| | | } |
| | | |
| | | private void OperationAdvanceEvent(Operation type) |
| | | { |
| | | if (type == operaType) |
| | | { |
| | | if (onStateUpdate != null) |
| | | { |
| | | onStateUpdate(activityID); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void OperationStartEvent(Operation type, int state) |
| | | { |
| | | if (type == operaType && state == 0) |
| | | { |
| | | |
| | | if (onStateUpdate != null) |
| | | { |
| | | onStateUpdate(activityID); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | //是不是免费礼包 |
| | | public bool IsFree(int index) |
| | | { |
| | | return index == 0; |
| | | } |
| | | |
| | | |
| | | //0 不可领取 1 可领取 2 已领取 |
| | | public int GetBuyGiftState(int count) |
| | | { |
| | | OperationRechargeGiftAct act; |
| | | OperationTimeHepler.Instance.TryGetOperation(operaType, out act); |
| | | |
| | | if (act == null) return 0; |
| | | if (GetBuyTotalCnt() < count) return 0; |
| | | if (((int)Math.Pow(2, count) & GiftAwardRecord) == 0) |
| | | { |
| | | return 1; |
| | | } |
| | | return 2; |
| | | } |
| | | |
| | | public int GetBuyTotalCnt() |
| | | { |
| | | OperationRechargeGiftAct act; |
| | | OperationTimeHepler.Instance.TryGetOperation(operaType, out act); |
| | | |
| | | if (act == null) return 0; |
| | | int total = 0; |
| | | for (int i = 0; i < act.ctgIDs.Count; i++) |
| | | { |
| | | int ctgID = act.ctgIDs[i]; |
| | | RechargeManager.RechargeCount rechargeCount; |
| | | if (RechargeManager.Instance.TryGetRechargeCount(ctgID, out rechargeCount)) |
| | | { |
| | | total += rechargeCount.totalCount; |
| | | } |
| | | |
| | | } |
| | | return total; |
| | | } |
| | | |
| | | public Int2 GetBuyCntInfo(int ctgID) |
| | | { |
| | | OperationRechargeGiftAct act; |
| | | OperationTimeHepler.Instance.TryGetOperation(operaType, out act); |
| | | |
| | | RechargeManager.RechargeCount rechargeCount; |
| | | RechargeManager.Instance.TryGetRechargeCount(ctgID, out rechargeCount); |
| | | |
| | | var ctgConfig = CTGConfig.Get(ctgID); |
| | | int buyCnt = 0; |
| | | int totalCnt = 0; |
| | | if (ctgConfig.DailyBuyCount != 0) |
| | | { |
| | | buyCnt = rechargeCount.todayCount; |
| | | totalCnt = ctgConfig.DailyBuyCount; |
| | | } |
| | | else |
| | | { |
| | | buyCnt = rechargeCount.totalCount; |
| | | totalCnt = ctgConfig.TotalBuyCount; |
| | | } |
| | | |
| | | return new Int2(buyCnt, totalCnt); |
| | | } |
| | | |
| | | void UpdateRedpoint() |
| | | { |
| | | redPoint.state = RedPointState.None; |
| | | if (!IsOpen) return; |
| | | OperationRechargeGiftAct act; |
| | | OperationTimeHepler.Instance.TryGetOperation(operaType, out act); |
| | | if (act == null) return; //封包顺序如果有问题 此处为空 |
| | | |
| | | for (int i = 0; i < act.buyCountGifts.Count; i++) |
| | | { |
| | | if (GetBuyGiftState(act.buyCountGifts[i].NeedBuyCount) == 1) |
| | | { |
| | | redPoint.state = RedPointState.Simple; |
| | | return; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | public void UpdateBuyCountGiftPlayerInfo(HAA75_tagMCActBuyCountGiftPlayerInfo netPack) |
| | | { |
| | | if (netPack.ActNum != 10) |
| | | return; |
| | | actNum = netPack.ActNum; |
| | | GiftAwardRecord = (int)netPack.GiftAwardRecord; |
| | | UpdateRechargeGiftActEvent?.Invoke(); |
| | | UpdateRedpoint(); |
| | | } |
| | | |
| | | |
| | | public void SendGetAward(int count) |
| | | { |
| | | CA504_tagCMPlayerGetReward getReward = new CA504_tagCMPlayerGetReward(); |
| | | getReward.RewardType = 72; |
| | | getReward.DataEx = (uint)count; |
| | | getReward.DataExStr = actNum.ToString(); |
| | | getReward.DataExStrLen = (byte)getReward.DataExStr.Length; |
| | | GameNetSystem.Instance.SendInfo(getReward); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: a61783b8a3ca5dc4e8cc5a3e8a2b2071 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Thursday, April 18, 2019 |
| | | //-------------------------------------------------------- |
| | | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | public class CustomizedGiftWin : UIBase |
| | | { |
| | | [SerializeField] ScrollerController m_Controller; |
| | | [SerializeField] Button CloseBtn; |
| | | [SerializeField] TextEx actTime; |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | | CloseBtn.SetListener(CloseWindow); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | m_Controller.OnRefreshCell += OnRefreshCell; |
| | | RechargeManager.Instance.rechargeCountEvent += VipModel_rechargeCountEvent; |
| | | CustomizedGiftModel.Instance.UpdateRechargeGiftActEvent += OnUpdateRechargeGiftActEvent; |
| | | GlobalTimeEvent.Instance.secondEvent += secondEvent; |
| | | secondEvent(); |
| | | DisplayScroll(); |
| | | } |
| | | |
| | | void VipModel_rechargeCountEvent(int obj) |
| | | { |
| | | m_Controller.m_Scorller.RefreshActiveCellViews(); |
| | | } |
| | | |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | m_Controller.OnRefreshCell -= OnRefreshCell; |
| | | RechargeManager.Instance.rechargeCountEvent -= VipModel_rechargeCountEvent; |
| | | CustomizedGiftModel.Instance.UpdateRechargeGiftActEvent -= OnUpdateRechargeGiftActEvent; |
| | | GlobalTimeEvent.Instance.secondEvent -= secondEvent; |
| | | } |
| | | void secondEvent() |
| | | { |
| | | OperationBase holiday; |
| | | if (!OperationTimeHepler.Instance.TryGetOperation(CustomizedGiftModel.operaType, out holiday)) |
| | | { |
| | | return; |
| | | } |
| | | actTime.text = Language.Get("BossFHLanguage2", TimeUtility.SecondsToHMS(holiday.GetResetSurplusTime())); |
| | | } |
| | | |
| | | void OnUpdateRechargeGiftActEvent() |
| | | { |
| | | m_Controller.m_Scorller.RefreshActiveCellViews(); |
| | | } |
| | | |
| | | void DisplayScroll() |
| | | { |
| | | m_Controller.Refresh(); |
| | | OperationRechargeGiftAct act; |
| | | OperationTimeHepler.Instance.TryGetOperation(CustomizedGiftModel.operaType, out act); |
| | | |
| | | for (int i = 0; i <= act.ctgIDs.Count; i++) |
| | | { |
| | | m_Controller.AddCell(ScrollerDataType.Header, i); |
| | | } |
| | | m_Controller.Restart(); |
| | | |
| | | } |
| | | |
| | | private void OnRefreshCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | var _cell = cell as CustomizedGiftCell; |
| | | _cell.Display(_cell.index); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 5aa4d2b8fc7462240babdc13f8111fbb |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | |
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | |
|
| | | //自选商品的UI显示,增加对应的选择图片即可
|
| | | public class CustomizedItemCell : ItemCell
|
| | | {
|
| | |
|
| | | [SerializeField] Image addImage; //图片参考 ItemNormal_a 和 zxlb_+
|
| | |
|
| | |
|
| | | public override void Init(ItemCellModel model)
|
| | | {
|
| | | if (model == null)
|
| | | {
|
| | | for (int i = 0; i < transform.childCount; i++)
|
| | | {
|
| | | transform.GetChild(i).SetActive(false);
|
| | | }
|
| | | button.SetActive(true);
|
| | | addImage?.SetActive(true); //注意图片设置为不可点击
|
| | | }
|
| | | else
|
| | | {
|
| | | for (int i = 0; i < transform.childCount; i++)
|
| | | {
|
| | | transform.GetChild(i).SetActive(true);
|
| | | }
|
| | | base.Init(model);
|
| | | addImage?.SetActive(false);
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 34e1dcbb05ab0a5489087b2de193ed80 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using System;
|
| | | using System.Collections.Generic;
|
| | |
|
| | |
|
| | | //充值自选功能
|
| | | public class CustomizedRechargeModel : GameSystemManager<CustomizedRechargeModel>
|
| | | {
|
| | | public const int MaxGridCount = 4; //最多4个可选格子
|
| | |
|
| | | //用户选择面板
|
| | | public int chooseWinIndex = 0; //用户选择面板 当前选中的格子(自选位索引)
|
| | | public int chooseCTGID = 0; //用户选择面板 当前选中的礼包id
|
| | | public Dictionary<int, int> chooseIndexDict = new Dictionary<int, int>(); //用户在选择面板中已选中物品栏中的索引
|
| | |
|
| | | public Action UpdateWin;
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | | }
|
| | |
|
| | |
|
| | | //自选礼包 物品信息
|
| | | //count为固定的数量,sumCount包含自选格子总数量不管是否已选
|
| | | public bool TryGetRechargeItemEx(int ctgId, out List<Item> items, out int count, out int sumCount)
|
| | | {
|
| | | count = 0;
|
| | | sumCount = 0;
|
| | | items = new List<Item>();
|
| | | List<Item> awards = new List<Item>();
|
| | | if (!RechargeManager.Instance.TryGetRechargeItem(ctgId, out awards))
|
| | | return false;
|
| | |
|
| | | RechargeManager.RechargeCount rechargeCount;
|
| | | if (!RechargeManager.Instance.TryGetRechargeCount(ctgId, out rechargeCount))
|
| | | {
|
| | | return false;
|
| | | }
|
| | |
|
| | | count = awards.Count;
|
| | | for (int i = 0; i < awards.Count; i++)
|
| | | {
|
| | | items.Add(awards[i]);
|
| | | }
|
| | | var selectItemInfo = CTGConfig.Get(ctgId).SelectItemInfo;
|
| | | if (selectItemInfo != null && selectItemInfo.Length != 0)
|
| | | {
|
| | | sumCount = selectItemInfo.Length + items.Count;
|
| | |
|
| | | var selectedItemIndexs = GetSelectedItems(rechargeCount.selectItemValue);
|
| | | //自选
|
| | | for (int j = 0; j < selectedItemIndexs.Count; j++)
|
| | | {
|
| | | int selectID = selectItemInfo[j][selectedItemIndexs[j] - 1];
|
| | |
|
| | | items.Add(new Item(CTGSelectItemConfig.Get(selectID).ItemID, CTGSelectItemConfig.Get(selectID).ItemCount));
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | sumCount = count;
|
| | | }
|
| | |
|
| | | return true;
|
| | | }
|
| | |
|
| | | //约定最多4个可选, 只有全选和未选两种状态
|
| | | public List<int> GetSelectedItems(int SelectItemValue)
|
| | | {
|
| | | if (SelectItemValue <= 0)
|
| | | return new List<int>();
|
| | | var list = new List<int>();
|
| | |
|
| | | for (int i = 0; i < MaxGridCount; i++)
|
| | | {
|
| | | int itemIndex = (int)(SelectItemValue % 100);
|
| | | if (itemIndex == 0)
|
| | | break;
|
| | | SelectItemValue /= 100;
|
| | | list.Add(itemIndex);
|
| | | }
|
| | |
|
| | | return list;
|
| | | }
|
| | |
|
| | | public uint GetSelectedItemValue()
|
| | | {
|
| | | uint SelectItemValue = 0;
|
| | |
|
| | | for (int i = 0; i < MaxGridCount; i++)
|
| | | {
|
| | | if (chooseIndexDict.ContainsKey(i))
|
| | | {
|
| | | SelectItemValue += (uint)(chooseIndexDict[i] * Math.Pow(100, i));
|
| | | }
|
| | | }
|
| | |
|
| | | return SelectItemValue;
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | public void InitChoose()
|
| | | {
|
| | | RechargeManager.RechargeCount rechargeCount;
|
| | | RechargeManager.Instance.TryGetRechargeCount(chooseCTGID, out rechargeCount);
|
| | |
|
| | | var selectedItemIndexs = CustomizedRechargeModel.Instance.GetSelectedItems(rechargeCount.selectItemValue);
|
| | |
|
| | | if (selectedItemIndexs.Count == 0)
|
| | | {
|
| | | chooseIndexDict.Clear();
|
| | | return;
|
| | | }
|
| | |
|
| | | for (int i = 0; i < selectedItemIndexs.Count; i++)
|
| | | {
|
| | | chooseIndexDict[i] = selectedItemIndexs[i];
|
| | | }
|
| | | }
|
| | |
|
| | | //0 未选中,从1开始
|
| | | public int GetChooseSubIndex(int index)
|
| | | {
|
| | | if (chooseIndexDict.ContainsKey(index))
|
| | | return chooseIndexDict[index];
|
| | | return 0;
|
| | | }
|
| | |
|
| | | public void ShowUIItems(List<CustomizedItemCell> itemCells, int ctgID)
|
| | | {
|
| | | int goodsCount; //固定商品种类数量
|
| | | int goodsSumCount; //商品总数量
|
| | | List<Item> awards = new List<Item>();
|
| | | TryGetRechargeItemEx(ctgID, out awards, out goodsCount, out goodsSumCount);
|
| | | RechargeManager.RechargeCount rechargeCount;
|
| | | RechargeManager.Instance.TryGetRechargeCount(ctgID, out rechargeCount);
|
| | | for (int i = 0; i < itemCells.Count; i++)
|
| | | {
|
| | | if (i < goodsSumCount)
|
| | | {
|
| | | itemCells[i].SetActive(true);
|
| | | int index = i;
|
| | | if (i < awards.Count)
|
| | | {
|
| | | var award = awards[i];
|
| | | var itemData = new ItemCellModel(award.id, false, (ulong)award.count);
|
| | | itemCells[i].Init(itemData);
|
| | | itemCells[i].button.SetListener(() =>
|
| | | {
|
| | | if (index < goodsCount)
|
| | | ItemTipUtility.Show(award.id);
|
| | | else
|
| | | {
|
| | | //可自选
|
| | | chooseWinIndex = index - goodsCount;
|
| | | chooseCTGID = ctgID;
|
| | | UIManager.Instance.OpenWindow<CustomizedGiftChooseWin>();
|
| | | }
|
| | |
|
| | | });
|
| | | }
|
| | | else
|
| | | {
|
| | | itemCells[i].Init(null);
|
| | | itemCells[i].button.SetListener(() =>
|
| | | {
|
| | | chooseWinIndex = index - goodsCount;
|
| | | chooseCTGID = ctgID;
|
| | | UIManager.Instance.OpenWindow<CustomizedGiftChooseWin>();
|
| | | });
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | itemCells[i].SetActive(false);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: cb2a950b178a4f04892b127390d7f517 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using System;
|
| | |
|
| | |
|
| | | public class DayRemind
|
| | | {
|
| | |
|
| | | private static DayRemind m_Instance = null;
|
| | |
|
| | | public static DayRemind Instance
|
| | | {
|
| | | get
|
| | | {
|
| | | if (m_Instance == null)
|
| | | {
|
| | | m_Instance = new DayRemind();
|
| | | }
|
| | | return m_Instance;
|
| | | }
|
| | | }
|
| | |
|
| | | protected DayRemind()
|
| | | {
|
| | | GetPlayerDayRemind();
|
| | | DTC0102_tagCDBPlayer.afterPlayerDataInitializeEvent += AfterPlayerDataInitializeEvent;
|
| | | }
|
| | |
|
| | | private void AfterPlayerDataInitializeEvent()
|
| | | {
|
| | | GetPlayerDayRemind();
|
| | | }
|
| | |
|
| | | public const string DJQTip = "DJQTip"; // 代金券提示
|
| | |
|
| | | public Dictionary<string, int[]> dayRemindDic = new Dictionary<string, int[]>();
|
| | |
|
| | | public bool GetDayRemind(string _remindKey)
|
| | | {
|
| | | int[] intarray = null;
|
| | | dayRemindDic.TryGetValue(_remindKey, out intarray);
|
| | | if (intarray == null)
|
| | | {
|
| | | SetDayRemind(_remindKey);
|
| | | }
|
| | | if (intarray != null && intarray.Length == 3)
|
| | | {
|
| | | if (intarray[0] != TimeUtility.ServerNow.Month || intarray[1] != TimeUtility.ServerNow.Day)
|
| | | {
|
| | | SetDayRemind(_remindKey, false);
|
| | | return false;
|
| | | }
|
| | | return intarray[2] == 1;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public void SetDayRemind(string _remindKey, bool _remind)
|
| | | {
|
| | | int[] intarray = null;
|
| | | dayRemindDic.TryGetValue(_remindKey, out intarray);
|
| | | if (intarray == null)
|
| | | {
|
| | | intarray = new int[3];
|
| | | dayRemindDic[_remindKey] = intarray;
|
| | | }
|
| | | intarray[0] = TimeUtility.ServerNow.Month;
|
| | | intarray[1] = TimeUtility.ServerNow.Day;
|
| | | intarray[2] = _remind ? 1 : 0;
|
| | | LocalSave.SetIntArray(StringUtility.Contact(_remindKey, PlayerDatas.Instance.baseData.PlayerID), intarray);
|
| | | }
|
| | |
|
| | | private void GetPlayerDayRemind()
|
| | | {
|
| | | SetDayRemind(DJQTip);
|
| | | }
|
| | |
|
| | | public void SetDayRemind(string _key)
|
| | | {
|
| | | var intarray = LocalSave.GetIntArray(StringUtility.Contact(_key, PlayerDatas.Instance.baseData.PlayerID));
|
| | | if (dayRemindDic.ContainsKey(_key))
|
| | | {
|
| | | dayRemindDic[_key] = intarray;
|
| | | return;
|
| | | }
|
| | | dayRemindDic.Add(_key, intarray);
|
| | | }
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 0fadc227d46f3b9498a26159494f538f |
| | | timeCreated: 1512524149 |
| | | licenseType: Free |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | public bool isPackResetOk { get; set; }
|
| | | public void ResetPack(PackType type)
|
| | | {
|
| | | // if (lookLineIndex > -1)
|
| | | // {
|
| | | // SetLookIndex(null);
|
| | | // }
|
| | | if (lookLineIndex > -1)
|
| | | {
|
| | | SetLookIndex(null);
|
| | | }
|
| | |
|
| | | // if (KnapSackWin.titleType == KnapsackFuncTitle.bag)
|
| | | // {
|
| | | // packModel.isPlayBetterEquipEffect = true;
|
| | | // }
|
| | |
|
| | | // SinglePack singlePack = packModel.GetSinglePack(type);
|
| | | // if (singlePack != null)
|
| | | // {
|
| | | // var packReset = new C070F_tagCItemPackReset();
|
| | | // packReset.Type = (byte)type;
|
| | | // packReset.ItemBeginIndex = 0;
|
| | | // packReset.ItemEndIndex = (ushort)(singlePack.unlockedGridCount - 1);
|
| | | // GameNetSystem.Instance.SendInfo(packReset); //整理物品
|
| | | // if (type == PackType.Item)
|
| | | // {
|
| | | // isPackResetOk = false;
|
| | | // }
|
| | | // }
|
| | | SinglePack singlePack = packModel.GetSinglePack(type);
|
| | | if (singlePack != null)
|
| | | {
|
| | | var packReset = new C070F_tagCItemPackReset();
|
| | | packReset.Type = (byte)type;
|
| | | packReset.ItemBeginIndex = 0;
|
| | | packReset.ItemEndIndex = (ushort)(singlePack.unlockedGridCount - 1);
|
| | | GameNetSystem.Instance.SendInfo(packReset); //整理物品
|
| | | if (type == PackType.Item)
|
| | | {
|
| | | isPackResetOk = false;
|
| | | }
|
| | | }
|
| | | }
|
| | | #endregion
|
| | |
|
| | |
| | | public int auctionSurplusTime {
|
| | |
|
| | | get {
|
| | | return 0;
|
| | | /*
|
| | | var createTime = GetUseDataFirstValue(50);
|
| | | if (createTime > 0)
|
| | | {
|
| | |
| | | {
|
| | | return 0;
|
| | | }
|
| | | */
|
| | | }
|
| | | }
|
| | |
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: d33e244e9be6fe1458ef78c0181b3ac4 |
| | | folderAsset: yes |
| | | DefaultImporter: |
| | | externalObjects: {} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | //修改成控制多个活动模块,如精彩活动模板1,精彩活动模板2
|
| | |
|
| | | public class OpenServerActivityCenter : Singleton<OpenServerActivityCenter>
|
| | | {
|
| | | public event Action openServerActivityStateChange;
|
| | |
|
| | | //{活动模板:{活动ID:活动接口}}
|
| | | Dictionary<int, Dictionary<int, IOpenServerActivity>> GameServerActivitys = new Dictionary<int, Dictionary<int, IOpenServerActivity>>();
|
| | |
|
| | | public int selectFuncOrder = -1;
|
| | |
|
| | | public enum ActivityType
|
| | | {
|
| | | AT_JCHD = 0, //精彩活动
|
| | | AT_JRZF, //节日祝福
|
| | | AT_HFHD, //合服活动
|
| | | AT_Activity1, //预备活动1
|
| | | AT_Activity2, //日期型活动- 按日期开放的排行榜系列活动相关 id从200开始(与其他活动区分,虽然id重复并没有关系), 类同节日活动
|
| | | AT_Activity3, //预备活动3
|
| | | //后续IL开发添加预设
|
| | | default1,
|
| | | default2,
|
| | | default3,
|
| | | default4,
|
| | | default5,
|
| | | default6,
|
| | | default7,
|
| | | default8,
|
| | | default9,
|
| | | default10,
|
| | | }
|
| | |
|
| | | public OpenServerActivityCenter()
|
| | | {
|
| | | TimeUtility.OnServerOpenDayRefresh += OnServerOpenDayRefresh;
|
| | | }
|
| | |
|
| | | public void Register(int funcOrder, IOpenServerActivity activity, int activityType = (int)ActivityType.AT_JCHD)
|
| | | {
|
| | | if (!GameServerActivitys.ContainsKey(activityType))
|
| | | {
|
| | | GameServerActivitys.Add(activityType, new Dictionary<int, IOpenServerActivity>());
|
| | | }
|
| | |
|
| | | var openServerActivitys = GameServerActivitys[activityType];
|
| | | if (!openServerActivitys.ContainsKey(funcOrder))
|
| | | {
|
| | | openServerActivitys.Add(funcOrder, activity);
|
| | | activity.onStateUpdate += OnStateUpdate;
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnStateUpdate(int _order)
|
| | | {
|
| | | if (openServerActivityStateChange != null)
|
| | | {
|
| | | openServerActivityStateChange();
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnServerOpenDayRefresh()
|
| | | {
|
| | | if (openServerActivityStateChange != null)
|
| | | {
|
| | | openServerActivityStateChange();
|
| | | }
|
| | | }
|
| | |
|
| | | public bool IsAnyActivityOpen(out int _functionOrder, int activityType = (int)ActivityType.AT_JCHD)
|
| | | {
|
| | | if (!GameServerActivitys.ContainsKey(activityType))
|
| | | {
|
| | | GameServerActivitys.Add(activityType, new Dictionary<int, IOpenServerActivity>());
|
| | | }
|
| | |
|
| | | var openServerActivitys = GameServerActivitys[activityType];
|
| | | _functionOrder = 0;
|
| | | foreach (var _order in openServerActivitys.Keys)
|
| | | {
|
| | | if (openServerActivitys[_order].IsOpen || openServerActivitys[_order].IsAdvance)
|
| | | {
|
| | | _functionOrder = _order;
|
| | | return true;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public bool IsActivityOpen(int _funcOrder, int activityType = (int)ActivityType.AT_JCHD)
|
| | | {
|
| | | if (!GameServerActivitys.ContainsKey(activityType))
|
| | | {
|
| | | GameServerActivitys.Add(activityType, new Dictionary<int, IOpenServerActivity>());
|
| | | }
|
| | | |
| | | bool isOpen = false;
|
| | | var openServerActivitys = GameServerActivitys[activityType];
|
| | | if (openServerActivitys.ContainsKey(_funcOrder))
|
| | | {
|
| | | isOpen = openServerActivitys[_funcOrder].IsOpen || openServerActivitys[_funcOrder].IsAdvance;
|
| | | }
|
| | |
|
| | | return isOpen;
|
| | | }
|
| | |
|
| | | public bool IsPriorityOpenOpen(int _funcOrder, int activityType = (int)ActivityType.AT_JCHD)
|
| | | {
|
| | | if (!GameServerActivitys.ContainsKey(activityType))
|
| | | {
|
| | | GameServerActivitys.Add(activityType, new Dictionary<int, IOpenServerActivity>());
|
| | | }
|
| | |
|
| | | var openServerActivitys = GameServerActivitys[activityType];
|
| | | if (openServerActivitys.ContainsKey(_funcOrder))
|
| | | {
|
| | | return openServerActivitys[_funcOrder].priorityOpen;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | public void ProcessErrorTip()
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("ActiveOutTime");
|
| | | }
|
| | |
|
| | | //AT_Activity2 日期型活动-默认设计都是同一个入口,根据活动替换图标和名称,打开不同界面
|
| | | public NewDayActivityInfo GetNewDayActionEnterInfo()
|
| | | {
|
| | | if (IsActivityOpen((int)NewDayActivityID.BossTrial, (int)ActivityType.AT_Activity2))
|
| | | {
|
| | | return new NewDayActivityInfo() { activityID = (int)NewDayActivityID.BossTrial, redpointID = MainRedDot.BossTrialRepoint, winName = "BossTrialActWin" };
|
| | | }
|
| | | else if (IsActivityOpen((int)NewDayActivityID.SecretPlaceXB, (int)ActivityType.AT_Activity2))
|
| | | {
|
| | | return new NewDayActivityInfo() { activityID = (int)NewDayActivityID.SecretPlaceXB, redpointID = MainRedDot.MjxbRedpoint, winName = "SecretPlaceActWin" };
|
| | | }
|
| | | else if (IsActivityOpen((int)NewDayActivityID.PetHorseAct, (int)ActivityType.AT_Activity2))
|
| | | {
|
| | | return new NewDayActivityInfo() { activityID = (int)NewDayActivityID.PetHorseAct, redpointID = MainRedDot.QCTrainActRedpoint, winName = "PetHorseActWin" };
|
| | | }
|
| | | else if (IsActivityOpen((int)NewDayActivityID.TreasurePavilionAct, (int)ActivityType.AT_Activity2))
|
| | | {
|
| | | return new NewDayActivityInfo() { activityID = (int)NewDayActivityID.TreasurePavilionAct, redpointID = MainRedDot.TreasurePavilionRankActRepoint, winName = "TreasurePavilionRankActWin" };
|
| | | }
|
| | |
|
| | | return new NewDayActivityInfo() { activityID = 0 };
|
| | | }
|
| | |
|
| | | //AT_Activity2 入口信息
|
| | | public struct NewDayActivityInfo
|
| | | {
|
| | | public int activityID;
|
| | | public int redpointID;
|
| | | public string winName;
|
| | | }
|
| | | }
|
| | |
|
| | | public interface IOpenServerActivity
|
| | | {
|
| | | bool IsOpen { get; }
|
| | | bool IsAdvance { get; }
|
| | | bool priorityOpen { get; }
|
| | |
|
| | | event Action<int> onStateUpdate;
|
| | | }
|
| | |
|
| | | public class ILOpenServerActivityProxy : IOpenServerActivity
|
| | | {
|
| | | public bool IsOpen => funcIsOpen();
|
| | |
|
| | | public bool IsAdvance => funcIsAdvance();
|
| | |
|
| | | public bool priorityOpen => funcPriorityOpen();
|
| | |
|
| | | public event Action<int> onStateUpdate;
|
| | |
|
| | | private Func<bool> funcIsOpen;
|
| | | private Func<bool> funcIsAdvance;
|
| | | private Func<bool> funcPriorityOpen;
|
| | |
|
| | | public ILOpenServerActivityProxy(Func<bool> isOpen, Func<bool> isAdvance, Func<bool> priorityOpen)
|
| | | {
|
| | | funcIsOpen = isOpen;
|
| | | funcIsAdvance = isAdvance;
|
| | | funcPriorityOpen = priorityOpen;
|
| | | }
|
| | |
|
| | |
|
| | | public void StateUpdate(int id)
|
| | | {
|
| | | if (onStateUpdate != null)
|
| | | {
|
| | | onStateUpdate(id);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 8c3fdbb5fddadb4439b0d3a3fc985963 |
| | | timeCreated: 1560857826 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | //活动时间存在两种
|
| | | // 1. 参与时段和领奖时段,每日不重置 如 1月1号 1点 - 1月3号 22点为活动时间,1月3号 22点 - 24点为展示时间
|
| | | // 每日重置 如 1月1号 - 1月3号 中每日 1点- 22点为活动时间, 22点 - 24点为展示时间
|
| | | // 2. 每日的时间段,如每日的双倍经验活动是 18点-20点,活动整个周期为 1月1号-1月3号
|
| | | public class OperationBase
|
| | | {
|
| | | public OperationDate startDate;
|
| | | public OperationDate endDate;
|
| | | public List<OperationTime> times = new List<OperationTime>(); //一定是每日里的活动时间段
|
| | |
|
| | | //当本服和跨服为共同活动时,每日开启时间会配置晚几分钟开放,以便于同步跨服不会造成不同服务器的时间差问题
|
| | | public int joinStartHour; //可参与活动的时间段,当每日重置时为每日的时间段;当不重置时,为活动第一天的开始时分和最后一天的结束时分
|
| | | public int joinStartMinute;
|
| | | public int joinEndHour;
|
| | | public int joinEndMinute;
|
| | |
|
| | |
|
| | | /// <summary>
|
| | | /// 是否每日重置
|
| | | /// </summary>
|
| | | public bool dayReset = false;
|
| | | /// <summary>
|
| | | /// 0-0点重置,1-5点重置
|
| | | /// </summary>
|
| | | public int resetType = 0;
|
| | |
|
| | | public const int DayResetHour = 5;
|
| | |
|
| | | public bool stepTimeNotify = false;
|
| | | public bool stepDateNotify = false;
|
| | |
|
| | | public bool inTimeNotify = false;
|
| | | public bool inDateNotify = false;
|
| | |
|
| | | public int inAdvanceMinute = 0;
|
| | | public bool inAdvanceNotify = false;
|
| | |
|
| | | public int limitLv;
|
| | | public int ActNum; //活动编号 决定了使用哪个活动界面
|
| | |
|
| | | public bool allDay
|
| | | {
|
| | | get { return times.Count <= 0; }
|
| | | }
|
| | |
|
| | | public int totalDays
|
| | | {
|
| | | get { return endDate - startDate; }
|
| | | }
|
| | |
|
| | | public bool IsLastDay
|
| | | {
|
| | | get
|
| | | {
|
| | | return IndexOfDays(TimeUtility.ServerNow) == totalDays;
|
| | | }
|
| | | }
|
| | |
|
| | | public bool InTime(DateTime time)
|
| | | {
|
| | | if (!InDay(time))
|
| | | {
|
| | | return false;
|
| | | }
|
| | | if (allDay)
|
| | | {
|
| | | return InDayResetTime(time);
|
| | | }
|
| | | for (int i = 0; i < times.Count; i++)
|
| | | {
|
| | | if (times[i].InTime(time))
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | bool InDayResetTime(DateTime time)
|
| | | {
|
| | | if (!InDay(time))
|
| | | {
|
| | | return false;
|
| | | }
|
| | | switch (resetType)
|
| | | {
|
| | | case 0:
|
| | | {
|
| | | return true;
|
| | | }
|
| | | case 1:
|
| | | {
|
| | | var indexOfDays = IndexOfDays(time);
|
| | | if (indexOfDays == 0)
|
| | | {
|
| | | return time.Hour >= DayResetHour;
|
| | | }
|
| | | if (indexOfDays == totalDays)
|
| | | {
|
| | | return time.Hour < DayResetHour;
|
| | | }
|
| | | if (indexOfDays < totalDays)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | break;
|
| | | case 2:
|
| | | {
|
| | | var indexOfDays = IndexOfDays(time);
|
| | | if (indexOfDays == 0)
|
| | | {
|
| | | return time.Hour >= DayResetHour;
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public bool InDay(DateTime time)
|
| | | {
|
| | | OperationDate date = new OperationDate()
|
| | | {
|
| | | year = time.Year,
|
| | | month = time.Month,
|
| | | day = time.Day,
|
| | | };
|
| | | return date >= startDate && date <= endDate;
|
| | | }
|
| | |
|
| | | //日期范围InDay - 时段范围 - 重置时间范围
|
| | | public bool InJoinTime(DateTime time)
|
| | | {
|
| | | if (!InDay(time))
|
| | | {
|
| | | return false;
|
| | | }
|
| | |
|
| | | if (!InJoinHourMinute(time))
|
| | | {
|
| | | return false;
|
| | | }
|
| | |
|
| | | if (allDay)
|
| | | {
|
| | | return InDayResetTime(time);
|
| | | }
|
| | | for (int i = 0; i < times.Count; i++)
|
| | | {
|
| | | if (times[i].InTime(time))
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | //日期范围InDay - 时段范围 - 重置时间范围
|
| | | //可参与活动的时间段,当每日重置时为每日的时间段;当不重置时,为活动第一天的开始时分和最后一天的结束时分
|
| | | //属于 时段范围 的判断,在Inday之后
|
| | | public bool InJoinHourMinute(DateTime time)
|
| | | {
|
| | | OperationDate date = new OperationDate()
|
| | | {
|
| | | year = time.Year,
|
| | | month = time.Month,
|
| | | day = time.Day,
|
| | | };
|
| | | if (joinStartHour != 0 || joinStartMinute != 0 || joinEndHour != 0 || joinEndMinute != 0)
|
| | | {
|
| | | if (dayReset)
|
| | | {
|
| | | //每日重置,判断时分
|
| | | if (time.Hour * 60 + time.Minute >= joinStartHour * 60 + joinStartMinute &&
|
| | | time.Hour * 60 + time.Minute < joinEndHour * 60 + joinEndMinute)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | | else
|
| | | {
|
| | | //不重置,判断日期
|
| | | if (date == startDate)
|
| | | {
|
| | | if (time.Hour * 60 + time.Minute >= joinStartHour * 60 + joinStartMinute)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | else if (date == endDate)
|
| | | {
|
| | | if (time.Hour * 60 + time.Minute < joinEndHour * 60 + joinEndMinute)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | else if (date > startDate && date < endDate)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
|
| | | //是否准备时间:活动开始到可参与活动的时间段
|
| | | public bool IsPrepareTime(DateTime time)
|
| | | {
|
| | | OperationDate date = new OperationDate()
|
| | | {
|
| | | year = time.Year,
|
| | | month = time.Month,
|
| | | day = time.Day,
|
| | | };
|
| | |
|
| | | if (date == startDate)
|
| | | {
|
| | | if (time.Hour * 60 + time.Minute < joinStartHour * 60 + joinStartMinute)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | |
|
| | | return false;
|
| | | }
|
| | |
|
| | | public int IndexOfDays(DateTime time)
|
| | | {
|
| | | if (!InDay(time))
|
| | | {
|
| | | return -1;
|
| | | }
|
| | | DateTime s = new DateTime(startDate.year, startDate.month, startDate.day);
|
| | | return (time - s).Days;
|
| | | }
|
| | |
|
| | | protected virtual int IndexOfTime(DateTime time, int compare = 0)
|
| | | {
|
| | | if (allDay)
|
| | | {
|
| | | if (!dayReset)
|
| | | {
|
| | | return 0;
|
| | | }
|
| | | var index = Mathf.Max(0, IndexOfDays(time));
|
| | | switch (resetType)
|
| | | {
|
| | | case 0:
|
| | | return index;
|
| | | case 1:
|
| | | case 2:
|
| | | return time.Hour < DayResetHour ? Mathf.Max(0, index - 1) : index;
|
| | | default:
|
| | | return index;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | var index = 0;
|
| | | bool equalCompare = false;
|
| | | for (int i = 0; i < times.Count; i++)
|
| | | {
|
| | | if (times[i].InTime(time))
|
| | | {
|
| | | index = i;
|
| | | break;
|
| | | }
|
| | | if (!equalCompare && times[i].CompareTime(TimeUtility.ServerNow) == compare)
|
| | | {
|
| | | index = i;
|
| | | equalCompare = true;
|
| | | }
|
| | | }
|
| | | return index;
|
| | | }
|
| | | }
|
| | |
|
| | | public int GetSurplusTime(DateTime time)
|
| | | {
|
| | | var seconds = 0;
|
| | | if (InTime(time))
|
| | | {
|
| | | if (allDay)
|
| | | {
|
| | | seconds += GetSurplusDayResetTime(time);
|
| | | }
|
| | | else
|
| | | {
|
| | | for (int i = 0; i < times.Count; i++)
|
| | | {
|
| | | if (times[i].InTime(time))
|
| | | {
|
| | | seconds += times[i] - time;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | return seconds;
|
| | | }
|
| | |
|
| | | int GetSurplusDayResetTime(DateTime time)
|
| | | {
|
| | | switch (resetType)
|
| | | {
|
| | | case 0:
|
| | | case 2:
|
| | | return (int)(endDate.AddSeconds(24 * 60 * 60) - time).TotalSeconds;
|
| | | case 1:
|
| | | var endTime = new DateTime(endDate.year, endDate.month, endDate.day, DayResetHour, 0, 0);
|
| | | return (int)(endTime - time).TotalSeconds;
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | public bool InAdvanceTime(DateTime time)
|
| | | {
|
| | | if (inAdvanceMinute <= 0)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | var advanceSeconds = inAdvanceMinute * 60;
|
| | | var beforeStartSeconds = GetSecondsBeforeStart(time);
|
| | | return beforeStartSeconds > 0 && beforeStartSeconds <= advanceSeconds;
|
| | | }
|
| | |
|
| | | public int GetSecondsBeforeStart(DateTime time)
|
| | | {
|
| | | var seconds = 0;
|
| | | if (InTime(time))
|
| | | {
|
| | | return 0;
|
| | | }
|
| | | if (allDay)
|
| | | {
|
| | | var startHour = 0;
|
| | | switch (resetType)
|
| | | {
|
| | | case 0:
|
| | | startHour = 0;
|
| | | break;
|
| | | case 1:
|
| | | case 2:
|
| | | startHour = DayResetHour;
|
| | | break;
|
| | | }
|
| | | var startTime = new DateTime(startDate.year, startDate.month, startDate.day, startHour, 0, 0);
|
| | | seconds = Mathf.CeilToInt((float)(startTime - time).TotalSeconds);
|
| | | }
|
| | | else
|
| | | {
|
| | | var index = IndexOfDays(time);
|
| | | var date = startDate.AddDays(index);
|
| | | for (int i = 0; i < times.Count; i++)
|
| | | {
|
| | | var startTime = new DateTime(date.year, date.month, date.day, times[i].startHour, times[i].startMinute, 0);
|
| | | seconds = Mathf.CeilToInt((float)(startTime - time).TotalSeconds);
|
| | | if (seconds > 0)
|
| | | {
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | return seconds;
|
| | | }
|
| | |
|
| | | public int GetResetSurplusTime()
|
| | | {
|
| | | var time = TimeUtility.ServerNow;
|
| | | if (!InTime(time))
|
| | | {
|
| | | return 0;
|
| | | }
|
| | | var seconds = 0;
|
| | | if (allDay)
|
| | | {
|
| | | if (!dayReset)
|
| | | {
|
| | | return GetSurplusTime(time);
|
| | | }
|
| | | switch (resetType)
|
| | | {
|
| | | case 0:
|
| | | {
|
| | | DateTime endOperationTime = new DateTime(TimeUtility.Year, TimeUtility.Month,
|
| | | TimeUtility.Day, 0, 0, 0);
|
| | | endOperationTime = endOperationTime.AddDays(1);
|
| | | seconds = (int)(endOperationTime - TimeUtility.ServerNow).TotalSeconds;
|
| | | }
|
| | | break;
|
| | | case 1:
|
| | | {
|
| | | DateTime endOperationTime = new DateTime(TimeUtility.Year, TimeUtility.Month,
|
| | | TimeUtility.Day, DayResetHour, 0, 0);
|
| | | if (time.Hour >= DayResetHour)
|
| | | {
|
| | | endOperationTime = endOperationTime.AddDays(1);
|
| | | }
|
| | | seconds = (int)(endOperationTime - TimeUtility.ServerNow).TotalSeconds;
|
| | | }
|
| | | break;
|
| | | case 2:
|
| | | {
|
| | | var indexOfDays = IndexOfDays(time);
|
| | | DateTime endOperationTime = DateTime.Now;
|
| | | if (indexOfDays == totalDays)
|
| | | {
|
| | | if (time.Hour >= DayResetHour)
|
| | | {
|
| | | endOperationTime = new DateTime(TimeUtility.Year, TimeUtility.Month,
|
| | | TimeUtility.Day, 0, 0, 0);
|
| | | endOperationTime = endOperationTime.AddDays(1);
|
| | | }
|
| | | else
|
| | | {
|
| | | endOperationTime = new DateTime(TimeUtility.Year, TimeUtility.Month,
|
| | | TimeUtility.Day, DayResetHour, 0, 0);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | endOperationTime = new DateTime(TimeUtility.Year, TimeUtility.Month,
|
| | | TimeUtility.Day, DayResetHour, 0, 0);
|
| | | if (time.Hour >= DayResetHour)
|
| | | {
|
| | | endOperationTime = endOperationTime.AddDays(1);
|
| | | }
|
| | | }
|
| | | seconds = (int)(endOperationTime - TimeUtility.ServerNow).TotalSeconds;
|
| | | }
|
| | | break;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | for (int i = 0; i < times.Count; i++)
|
| | | {
|
| | | if (times[i].InTime(time))
|
| | | {
|
| | | DateTime endOperationTime = new DateTime(TimeUtility.Year, TimeUtility.Month,
|
| | | TimeUtility.Day, times[i].endHour, times[i].endMinute, 0);
|
| | | seconds = (int)(endOperationTime - TimeUtility.ServerNow).TotalSeconds;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | return seconds;
|
| | | }
|
| | |
|
| | | public virtual string ToDisplayTime()
|
| | | {
|
| | | return string.Empty;
|
| | | }
|
| | |
|
| | | public virtual void Reset()
|
| | | {
|
| | | stepTimeNotify = false;
|
| | | stepDateNotify = false;
|
| | | inTimeNotify = false;
|
| | | inDateNotify = false;
|
| | | dayReset = false;
|
| | | resetType = 0;
|
| | | limitLv = 0;
|
| | | inAdvanceNotify = false;
|
| | | inAdvanceMinute = 0;
|
| | | ActNum = 0;
|
| | | times.Clear();
|
| | | }
|
| | |
|
| | | public virtual bool SatisfyOpenCondition()
|
| | | {
|
| | | return PlayerDatas.Instance.baseData.LV >= limitLv;
|
| | | }
|
| | |
|
| | | public void ParseJoinTime(string joinStart, string joinEnd)
|
| | | {
|
| | | joinStart = UIHelper.ServerStringTrim(joinStart);
|
| | | joinEnd = UIHelper.ServerStringTrim(joinEnd);
|
| | |
|
| | | if (string.IsNullOrEmpty(joinStart) || string.IsNullOrEmpty(joinEnd))
|
| | | return;
|
| | | var joinStarts = joinStart.Split(':');
|
| | | var joinEnds = joinEnd.Split(':');
|
| | | joinStartHour = int.Parse(joinStarts[0]);
|
| | | joinStartMinute = int.Parse(joinStarts[1]);
|
| | | joinEndHour = int.Parse(joinEnds[0]);
|
| | | joinEndMinute = int.Parse(joinEnds[1]);
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | //活动排行榜奖励 有积分限制和额外奖励
|
| | | public struct ActBillboardAwards
|
| | | {
|
| | | public int needScore; // 上榜所需积分
|
| | | public List<Item> awardItemList; // 奖励物品列表
|
| | | public int needScoreEx; // 额外奖励所需积分
|
| | | public List<Item> awardItemListEx; // 额外奖励列表
|
| | | }
|
| | |
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: d7a32da08ee54c94aa3e7054a83a2446 |
| | | timeCreated: 1536804239 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | |
| | | |
| | | public class OperationRechargeGiftAct : OperationBase |
| | | { |
| | | public List<int> ctgIDs = new List<int>(); |
| | | public List<HAA74_tagMCActBuyCountGiftInfo.tagMCActBuyCountGift> buyCountGifts = new List<HAA74_tagMCActBuyCountGiftInfo.tagMCActBuyCountGift>(); |
| | | public int shopType; |
| | | |
| | | public override bool SatisfyOpenCondition() |
| | | { |
| | | return PlayerDatas.Instance.baseData.LV >= limitLv; |
| | | } |
| | | |
| | | public override string ToDisplayTime() |
| | | { |
| | | var textBuilder = OperationTimeHepler.textBuilder; |
| | | textBuilder.Length = 0; |
| | | textBuilder.Append(startDate.ToDisplay()); |
| | | if (startDate != endDate) |
| | | { |
| | | textBuilder.Append("—"); |
| | | textBuilder.Append(endDate.ToDisplay()); |
| | | } |
| | | return textBuilder.ToString(); |
| | | } |
| | | public string ToDisplayTimeEx() |
| | | { |
| | | var textBuilder = OperationTimeHepler.textBuilder; |
| | | textBuilder.Length = 0; |
| | | textBuilder.Append(startDate.ToDisplay(false)); |
| | | textBuilder.Append(string.Format(" {0}:{1}", joinStartHour.ToString("D2"), joinStartMinute.ToString("D2"))); |
| | | if (startDate != endDate) |
| | | { |
| | | textBuilder.Append(" - "); |
| | | textBuilder.Append(endDate.ToDisplay(false)); |
| | | textBuilder.Append(string.Format(" {0}:{1}", joinEndHour.ToString("D2"), joinEndMinute.ToString("D2"))); |
| | | } |
| | | return textBuilder.ToString(); |
| | | } |
| | | public override void Reset() |
| | | { |
| | | base.Reset(); |
| | | } |
| | | |
| | | public void ParsePackage(HAA74_tagMCActBuyCountGiftInfo package) |
| | | { |
| | | ctgIDs.Clear(); |
| | | buyCountGifts.Clear(); |
| | | for (int i = 0; i < package.CTGIDCount; i++) |
| | | { |
| | | ctgIDs.Add(package.CTGIDList[i]); |
| | | } |
| | | for (int i = 0; i < package.GiftCount; i++) |
| | | { |
| | | buyCountGifts.Add(package.BuyCountGiftList[i]); |
| | | } |
| | | shopType = package.ShopType; |
| | | |
| | | buyCountGifts.Sort(SortCount); |
| | | } |
| | | |
| | | |
| | | |
| | | int SortCount(HAA74_tagMCActBuyCountGiftInfo.tagMCActBuyCountGift dataA, HAA74_tagMCActBuyCountGiftInfo.tagMCActBuyCountGift dataB) |
| | | { |
| | | return dataA.NeedBuyCount.CompareTo(dataB.NeedBuyCount); |
| | | } |
| | | } |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 706234ffb8039464ea944a81f0f99131 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using System.Text;
|
| | | using UnityEngine;
|
| | |
|
| | | public class OperationTimeHepler : Singleton<OperationTimeHepler>
|
| | | {
|
| | | public Dictionary<Operation, OperationBase> operationDict = new Dictionary<Operation, OperationBase>();
|
| | |
|
| | | public static StringBuilder textBuilder = new StringBuilder();
|
| | |
|
| | | public event Action<Operation> operationTimeUpdateEvent;
|
| | | public event Action<Operation> operationServerCloseEvent;//特殊情况下触发
|
| | | public event Action<Operation, int> operationEndEvent;//活动结束时间触发 第二个参数0--过活动时间触发 1--过活动天触发
|
| | | public event Action<Operation, int> operationStartEvent;//活动开始时间并且满足开启条件触发 第二个参数0--活动时间触发 1--活动天触发
|
| | | public event Action<int> dayResetEvent;//活动重置事件0-0点 1-5点
|
| | | public event Action<Operation> operationAdvanceEvent;//活动在提前开启的时间内
|
| | |
|
| | | public OperationTimeHepler()
|
| | | {
|
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += BeforePlayerDataInitializeEvent;
|
| | | GlobalTimeEvent.Instance.secondEvent += SecondEvent;
|
| | | TimeMgr.Instance.OnHourEvent += HourEvent;
|
| | | }
|
| | |
|
| | | private void BeforePlayerDataInitializeEvent()
|
| | | {
|
| | | operationDict.Clear();
|
| | | }
|
| | |
|
| | | private void SecondEvent()
|
| | | {
|
| | | if (!ConfigManager.Instance.isLoadFinished)
|
| | | return;
|
| | |
|
| | | if (!DTC0403_tagPlayerLoginLoadOK.finishedLogin)
|
| | | {
|
| | | return;
|
| | | }
|
| | | for (int i = 0; i < (int)Operation.max; i++)
|
| | | {
|
| | | if (operationDict.ContainsKey((Operation)i))
|
| | | {
|
| | | var operation = operationDict[(Operation)i];
|
| | | if (!operation.inDateNotify && operation.SatisfyOpenCondition()
|
| | | && operation.InDay(TimeUtility.ServerNow))
|
| | | {
|
| | | operation.inDateNotify = true;
|
| | | operation.stepDateNotify = false;
|
| | | Debug.LogFormat("{0} 活动天开始", (Operation)i);
|
| | | if (operationStartEvent != null)
|
| | | {
|
| | | operationStartEvent((Operation)i, 1);
|
| | | }
|
| | | }
|
| | | else if (!operation.stepDateNotify && !operation.InDay(TimeUtility.ServerNow))
|
| | | {
|
| | | operation.inDateNotify = false;
|
| | | operation.stepDateNotify = true;
|
| | | Debug.LogFormat("{0} 活动天结束", (Operation)i);
|
| | | if (operationEndEvent != null)
|
| | | {
|
| | | operationEndEvent((Operation)i, 1);
|
| | | }
|
| | | }
|
| | | if (!operation.inTimeNotify && operation.SatisfyOpenCondition()
|
| | | && operation.InTime(TimeUtility.ServerNow))
|
| | | {
|
| | | operation.inTimeNotify = true;
|
| | | operation.stepTimeNotify = false;
|
| | | Debug.LogFormat("{0} 活动时间开始", (Operation)i);
|
| | | if (operationStartEvent != null)
|
| | | {
|
| | | operationStartEvent((Operation)i, 0);
|
| | | }
|
| | | }
|
| | | else if (!operation.stepTimeNotify && !operation.InTime(TimeUtility.ServerNow))
|
| | | {
|
| | | operation.inTimeNotify = false;
|
| | | operation.stepTimeNotify = true;
|
| | | operation.inAdvanceNotify = false;
|
| | | Debug.LogFormat("{0} 活动时间结束", (Operation)i);
|
| | | if (operationEndEvent != null)
|
| | | {
|
| | | operationEndEvent((Operation)i, 0);
|
| | | }
|
| | | }
|
| | |
|
| | | if (!operation.inAdvanceNotify && operation.SatisfyOpenCondition()
|
| | | && operation.InAdvanceTime(TimeUtility.ServerNow))
|
| | | {
|
| | | operation.inAdvanceNotify = true;
|
| | | Debug.LogFormat("{0} 活动提前开启", (Operation)i);
|
| | | if (operationAdvanceEvent != null)
|
| | | {
|
| | | operationAdvanceEvent((Operation)i);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void HourEvent()
|
| | | {
|
| | | if (!DTC0403_tagPlayerLoginLoadOK.finishedLogin)
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (TimeUtility.Hour == 0 && dayResetEvent != null)
|
| | | {
|
| | | dayResetEvent(0);
|
| | | }
|
| | | if (TimeUtility.Hour == 5 && dayResetEvent != null)
|
| | | {
|
| | | dayResetEvent(1);
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | // /// <summary>
|
| | | // /// 累计充值
|
| | | // /// </summary>
|
| | | // /// <param name="package"></param>
|
| | |
|
| | | // public void UpdateAccumulateRecharge(HAA1D_tagMCActTotalRechargeInfo package)
|
| | | // {
|
| | | // OperationBase operationBase = null;
|
| | |
|
| | | // Operation opreationType = Operation.AccumulateRecharge;
|
| | | // if (package.ActNum == 10)
|
| | | // {
|
| | | // //精彩活动-单日累充
|
| | | // opreationType = Operation.AccumulateRecharge;
|
| | | // }
|
| | | // else if (package.ActNum == 11)
|
| | | // {
|
| | | // //精彩活动-多日累充
|
| | | // opreationType = Operation.DaysAccumulateRecharge;
|
| | | // }
|
| | | // else if (package.ActNum == 20)
|
| | | // {
|
| | | // //合服-福利(多日累充1档)
|
| | | // opreationType = Operation.default8;
|
| | | // }
|
| | | // else if (package.ActNum == 30)
|
| | | // {
|
| | | // //节日-单日累充
|
| | | // opreationType = Operation.HolidayAccumulateRecharge;
|
| | | // }
|
| | | // else if (package.ActNum == 31)
|
| | | // {
|
| | | // //节日-多日累充
|
| | | // opreationType = Operation.HolidayMultiRecharge;
|
| | | // }
|
| | | // else if (package.ActNum == 34)
|
| | | // {
|
| | | // // 节日-指定1档充值
|
| | | // opreationType = Operation.default20;
|
| | | // }
|
| | | // else if (package.ActNum == 35)
|
| | | // {
|
| | | // // 福缘- 长久累充(几个月或更长)
|
| | | // opreationType = Operation.default32;
|
| | | // }
|
| | |
|
| | | // operationDict.TryGetValue(opreationType, out operationBase);
|
| | | // if (string.IsNullOrEmpty(package.StartDate) || string.IsNullOrEmpty(package.EndtDate))
|
| | | // {
|
| | | // ForceStopOperation(opreationType);
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // if (operationBase == null)
|
| | | // {
|
| | | // operationBase = new OperationAccumulateRecharge();
|
| | | // operationDict.Add(opreationType, operationBase);
|
| | | // }
|
| | | // OperationAccumulateRecharge operation = operationBase as OperationAccumulateRecharge;
|
| | | // operation.Reset();
|
| | | // operation.limitLv = package.LimitLV;
|
| | | // operation.startDate = ParseOperationDate(package.StartDate);
|
| | | // operation.endDate = ParseOperationDate(package.EndtDate);
|
| | | // operation.dayReset = package.IsDayReset == 1;
|
| | | // operation.ParseAccumulateRecharge(package);
|
| | | // operation.ActNum = package.ActNum;
|
| | | // if (operationTimeUpdateEvent != null)
|
| | | // {
|
| | | // operationTimeUpdateEvent(opreationType);
|
| | | // }
|
| | | // }
|
| | | // }
|
| | |
|
| | | |
| | |
|
| | | // public void UpdateCollectWordsPackage(HAA40_tagMCActCollectWordsInfo package)
|
| | | // {
|
| | | // OperationBase operationBase = null;
|
| | |
|
| | | // var opreationType = Operation.CollectWords;
|
| | |
|
| | | // switch (package.ActNum)
|
| | | // {
|
| | | // case 10:
|
| | | // opreationType = Operation.CollectWords;
|
| | | // break;
|
| | | // case 20:
|
| | | // opreationType = Operation.default10;
|
| | | // break;
|
| | | // case 30:
|
| | | // opreationType = Operation.HolidayCollectWords;
|
| | | // break;
|
| | | // }
|
| | |
|
| | | // operationDict.TryGetValue(opreationType, out operationBase);
|
| | | // if (string.IsNullOrEmpty(package.StartDate) || string.IsNullOrEmpty(package.EndtDate))
|
| | | // {
|
| | | // ForceStopOperation(opreationType);
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // if (operationBase == null)
|
| | | // {
|
| | | // operationBase = new OperationCollectWords();
|
| | | // operationDict.Add(opreationType, operationBase);
|
| | | // }
|
| | | // OperationCollectWords operation = operationBase as OperationCollectWords;
|
| | | // operation.Reset();
|
| | | // operation.limitLv = package.LimitLV;
|
| | | // operation.startDate = ParseOperationDate(package.StartDate);
|
| | | // operation.endDate = ParseOperationDate(package.EndtDate);
|
| | | // operation.ActNum = package.ActNum;
|
| | | // operation.LastDayOnlyExchange = package.LastDayOnlyExchange;
|
| | | // operation.ParseCollectWords(package);
|
| | | // if (operationTimeUpdateEvent != null)
|
| | | // {
|
| | | // operationTimeUpdateEvent(opreationType);
|
| | | // }
|
| | | // }
|
| | | // }
|
| | |
|
| | | // public void UpdateSingleRechargeInfo(HAA50_tagMCActSingleRechargeInfo package)
|
| | | // {
|
| | | // OperationBase operationBase = null;
|
| | |
|
| | | // var opreationType = Operation.default28;
|
| | |
|
| | | // operationDict.TryGetValue(opreationType, out operationBase);
|
| | | // if (string.IsNullOrEmpty(package.StartDate) || string.IsNullOrEmpty(package.EndtDate))
|
| | | // {
|
| | | // ForceStopOperation(opreationType);
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // if (operationBase == null)
|
| | | // {
|
| | | // operationBase = new OperationSingleRecharge();
|
| | | // operationDict.Add(opreationType, operationBase);
|
| | | // }
|
| | | // OperationSingleRecharge operation = operationBase as OperationSingleRecharge;
|
| | | // operation.Reset();
|
| | | // operation.limitLv = package.LimitLV;
|
| | | // operation.startDate = ParseOperationDate(package.StartDate);
|
| | | // operation.endDate = ParseOperationDate(package.EndtDate);
|
| | | // operation.ActNum = package.ActNum;
|
| | | // operation.dayReset = package.IsDayReset == 1;
|
| | | // operation.ParseSingleRecharge(package);
|
| | | // if (operationTimeUpdateEvent != null)
|
| | | // {
|
| | | // operationTimeUpdateEvent(opreationType);
|
| | | // }
|
| | | // }
|
| | | // }
|
| | |
|
| | | // public void UpdateHolidayLogin(HAA42_tagMCFeastLoginInfo package)
|
| | | // {
|
| | | // OperationBase operationBase = null;
|
| | | // operationDict.TryGetValue(Operation.HolidayLogin, out operationBase);
|
| | | // if (string.IsNullOrEmpty(package.StartDate) || string.IsNullOrEmpty(package.EndtDate))
|
| | | // {
|
| | | // ForceStopOperation(Operation.HolidayLogin);
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // if (operationBase == null)
|
| | | // {
|
| | | // operationBase = new OperationHolidayLogin();
|
| | | // operationDict.Add(Operation.HolidayLogin, operationBase);
|
| | | // }
|
| | | // var operation = operationBase as OperationHolidayLogin;
|
| | | // operation.Reset();
|
| | | // operation.startDate = ParseOperationDate(package.StartDate);
|
| | | // operation.endDate = ParseOperationDate(package.EndtDate);
|
| | | // operation.limitLv = package.LimitLV;
|
| | | // operation.ParsePackage(package);
|
| | | // if (operationTimeUpdateEvent != null)
|
| | | // {
|
| | | // operationTimeUpdateEvent(Operation.HolidayLogin);
|
| | | // }
|
| | | // }
|
| | | // }
|
| | |
|
| | | |
| | |
|
| | | // public void UpdateMultiRechargePackage(HAA27_tagMCActRechargePrizeInfo package)
|
| | | // {
|
| | | // OperationBase operationBase = null;
|
| | | // operationDict.TryGetValue(Operation.MultiRecharge, out operationBase);
|
| | | // if (string.IsNullOrEmpty(package.StartDate) || string.IsNullOrEmpty(package.EndtDate))
|
| | | // {
|
| | | // ForceStopOperation(Operation.MultiRecharge);
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // if (operationBase == null)
|
| | | // {
|
| | | // operationBase = new OperationMultiRecharge();
|
| | | // operationDict.Add(Operation.MultiRecharge, operationBase);
|
| | | // }
|
| | | // OperationMultiRecharge operation = operationBase as OperationMultiRecharge;
|
| | | // operation.Reset();
|
| | | // operation.limitLv = package.LimitLV;
|
| | | // operation.startDate = ParseOperationDate(package.StartDate);
|
| | | // operation.endDate = ParseOperationDate(package.EndtDate);
|
| | | // operation.dayReset = package.IsDayReset == 1;
|
| | | // operation.ParseMultiRecharge(package);
|
| | | // if (operationTimeUpdateEvent != null)
|
| | | // {
|
| | | // operationTimeUpdateEvent(Operation.MultiRecharge);
|
| | | // }
|
| | | // }
|
| | | // }
|
| | |
|
| | | // /// <summary>
|
| | | // /// 限时礼包
|
| | | // /// </summary>
|
| | | // /// <param name="package"></param>
|
| | |
|
| | | // public void UpdateGiftPackage(HAA12_tagMCFlashGiftbagInfo package)
|
| | | // {
|
| | | // OperationBase operationBase = null;
|
| | | // Operation operationType = Operation.GiftPackage;
|
| | |
|
| | | // switch (package.ActNum)
|
| | | // {
|
| | | // case 10:
|
| | | // operationType = Operation.GiftPackage;
|
| | | // break;
|
| | | // case 20:
|
| | | // operationType = Operation.default13;
|
| | | // break;
|
| | | // case 30:
|
| | | // operationType = Operation.HolidayGiftPackage;
|
| | | // break;
|
| | | // }
|
| | |
|
| | | // operationDict.TryGetValue(operationType, out operationBase);
|
| | | // if (string.IsNullOrEmpty(package.StartDate) || string.IsNullOrEmpty(package.EndtDate))
|
| | | // {
|
| | | // ForceStopOperation(operationType);
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // if (operationBase == null)
|
| | | // {
|
| | | // operationBase = new GiftPackageClass();
|
| | | // operationDict.Add(operationType, operationBase);
|
| | | // }
|
| | | // GiftPackageClass operation = operationBase as GiftPackageClass;
|
| | | // operation.Reset();
|
| | | // operation.limitLv = package.LimitLV;
|
| | | // operation.startDate = ParseOperationDate(package.StartDate);
|
| | | // operation.endDate = ParseOperationDate(package.EndtDate);
|
| | | // operation.dayReset = package.IsDayReset == 1;
|
| | | // operation.inAdvanceMinute = package.AdvanceMinutes;
|
| | | // operation.ActNum = package.ActNum;
|
| | | // for (int i = 0; i < package.ActivityTimeCount; i++)
|
| | | // {
|
| | | // operation.times.Add(ParseOperationTime(package.ActivityTime[i].StartTime,
|
| | | // package.ActivityTime[i].EndtTime));
|
| | | // }
|
| | | // operation.ParsePackage(package);
|
| | | // if (operationTimeUpdateEvent != null)
|
| | | // {
|
| | | // operationTimeUpdateEvent(operationType);
|
| | | // }
|
| | | // }
|
| | | // }
|
| | |
|
| | | |
| | | |
| | | |
| | |
|
| | | // public void UpdateCrossActLianQiInfo(HAA90_tagMCCrossActLianqiInfo package)
|
| | | // {
|
| | | // OperationBase operationBase = null;
|
| | | // operationDict.TryGetValue(Operation.default51, out operationBase);
|
| | | // if (string.IsNullOrEmpty(package.StartDate) || string.IsNullOrEmpty(package.EndtDate))
|
| | | // {
|
| | | // ForceStopOperation(Operation.default51);
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // if (operationBase == null)
|
| | | // {
|
| | | // operationBase = new OperationLianQiCross();
|
| | | // operationDict.Add(Operation.default51, operationBase);
|
| | | // }
|
| | | // OperationLianQiCross operation = operationBase as OperationLianQiCross;
|
| | | // operation.Reset();
|
| | | // operation.m_ServerListStr = UIHelper.GetServers(package.ServerIDRangeInfo);
|
| | | // operation.m_GroupValue1 = package.GroupValue1;
|
| | | // operation.startDate = ParseOperationDate(package.StartDate);
|
| | | // operation.endDate = ParseOperationDate(package.EndtDate);
|
| | | // operation.dayReset = true;
|
| | | // operation.limitLv = package.LimitLV;
|
| | | // operation.ParseJoinTime(package.JoinStartTime, package.JoinEndTime);
|
| | | // operation.ParseCrossActHorsePetTrainInfo(package);
|
| | | // //for (int i = 0; i < package.ActivityTimeCount; i++)
|
| | | // //{
|
| | | // // operation.times.Add(ParseOperationTime(package.ActivityTime[i].StartTime,
|
| | | // // package.ActivityTime[i].EndtTime));
|
| | | // //}
|
| | | // if (operationTimeUpdateEvent != null)
|
| | | // {
|
| | | // operationTimeUpdateEvent(Operation.default51);
|
| | | // }
|
| | | // }
|
| | | // }
|
| | |
|
| | | // public void UpdateActLunhuidianInfo(HAA88_tagMCActLunhuidianInfo package)
|
| | | // {
|
| | | // OperationBase operationBase = null;
|
| | | // operationDict.TryGetValue(Operation.default47, out operationBase);
|
| | | // if (string.IsNullOrEmpty(package.StartDate) || string.IsNullOrEmpty(package.EndtDate))
|
| | | // {
|
| | | // ForceStopOperation(Operation.default47);
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // if (operationBase == null)
|
| | | // {
|
| | | // operationBase = new OperationCycleHall();
|
| | | // operationDict.Add(Operation.default47, operationBase);
|
| | | // }
|
| | | // OperationCycleHall operation = operationBase as OperationCycleHall;
|
| | | // operation.Reset();
|
| | | // operation.startDate = ParseOperationDate(package.StartDate);
|
| | | // operation.endDate = ParseOperationDate(package.EndtDate);
|
| | | // operation.resetType = package.ResetType;
|
| | | // operation.limitLv = package.LimitLV;
|
| | | // operation.ParseCycleHallInfo(package);
|
| | | // if (operationTimeUpdateEvent != null)
|
| | | // {
|
| | | // operationTimeUpdateEvent(Operation.default47);
|
| | | // }
|
| | | // }
|
| | | // }
|
| | |
|
| | | // public void UpdateActYunShiInfo(HAA87_tagMCActYunshiInfo package)
|
| | | // {
|
| | | // Operation operationType = Operation.default48;
|
| | |
|
| | | // switch (package.ActNum)
|
| | | // {
|
| | | // case 10:
|
| | | // operationType = Operation.default48;
|
| | | // break;
|
| | | // }
|
| | | // OperationBase operationBase = null;
|
| | | // operationDict.TryGetValue(operationType, out operationBase);
|
| | | // if (string.IsNullOrEmpty(package.StartDate) || string.IsNullOrEmpty(package.EndtDate))
|
| | | // {
|
| | | // ForceStopOperation(operationType);
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // if (operationBase == null)
|
| | | // {
|
| | | // operationBase = new OperationYunShi();
|
| | | // operationDict.Add(operationType, operationBase);
|
| | | // }
|
| | | // OperationYunShi operation = operationBase as OperationYunShi;
|
| | | // operation.Reset();
|
| | | // operation.startDate = ParseOperationDate(package.StartDate);
|
| | | // operation.endDate = ParseOperationDate(package.EndtDate);
|
| | | // operation.resetType = package.ResetType;
|
| | | // operation.limitLv = package.LimitLV;
|
| | | // operation.treasureType = package.TreasureType;
|
| | | // if (operationTimeUpdateEvent != null)
|
| | | // {
|
| | | // operationTimeUpdateEvent(operationType);
|
| | | // }
|
| | | // }
|
| | | // }
|
| | |
|
| | | |
| | | // public void UpdateLoginAct(HAA69_tagMCActLoginNew package)
|
| | | // {
|
| | | // OperationBase operationBase = null;
|
| | | // Operation operationType = Operation.default29;
|
| | |
|
| | | // switch (package.ActNum)
|
| | | // {
|
| | | // case 11:
|
| | | // operationType = Operation.default44;
|
| | | // break;
|
| | | // case 30:
|
| | | // operationType = Operation.default29;
|
| | | // break;
|
| | | // }
|
| | |
|
| | | // operationDict.TryGetValue(operationType, out operationBase);
|
| | | // if (string.IsNullOrEmpty(package.StartDate) || string.IsNullOrEmpty(package.EndtDate))
|
| | | // {
|
| | | // ForceStopOperation(operationType);
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // if (operationBase == null)
|
| | | // {
|
| | | // operationBase = new OperationLoginAct();
|
| | | // operationDict.Add(operationType, operationBase);
|
| | | // }
|
| | | // var operation = operationBase as OperationLoginAct;
|
| | | // operation.Reset();
|
| | | // operation.startDate = ParseOperationDate(package.StartDate);
|
| | | // operation.endDate = ParseOperationDate(package.EndtDate);
|
| | | // operation.limitLv = package.LimitLV;
|
| | | // operation.ActNum = package.ActNum;
|
| | | // operation.ParsePackage(package);
|
| | | // if (operationTimeUpdateEvent != null)
|
| | | // {
|
| | | // operationTimeUpdateEvent(operationType);
|
| | | // }
|
| | | // }
|
| | | // }
|
| | |
|
| | | // public void UpdateMissionAct(HAA71_tagMCActTaskInfo package)
|
| | | // {
|
| | | // OperationBase operationBase = null;
|
| | |
|
| | | // var opreationType = Operation.default30;
|
| | | // switch (package.ActNum)
|
| | | // {
|
| | | // case 11:
|
| | | // opreationType = Operation.default45;
|
| | | // break;
|
| | | // case 12:
|
| | | // opreationType = Operation.default49;
|
| | | // break;
|
| | | // case 30:
|
| | | // opreationType = Operation.default30;
|
| | | // break;
|
| | | // }
|
| | | // operationDict.TryGetValue(opreationType, out operationBase);
|
| | |
|
| | | // if (string.IsNullOrEmpty(package.StartDate) || string.IsNullOrEmpty(package.EndtDate))
|
| | | // {
|
| | | // ForceStopOperation(opreationType);
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // if (operationBase == null)
|
| | | // {
|
| | | // operationBase = new OperationMissionAct();
|
| | | // operationDict.Add(opreationType, operationBase);
|
| | | // }
|
| | | // var operation = operationBase as OperationMissionAct;
|
| | | // operation.Reset();
|
| | | // operation.startDate = ParseOperationDate(package.StartDate);
|
| | | // operation.endDate = ParseOperationDate(package.EndtDate);
|
| | | // operation.limitLv = package.LimitLV;
|
| | | // operation.dayReset = package.IsDayReset == 1;
|
| | | // operation.resetType = package.ResetType;
|
| | | // operation.ActNum = package.ActNum;
|
| | | // operation.ParsePackage(package);
|
| | | // if (operationTimeUpdateEvent != null)
|
| | | // {
|
| | | // operationTimeUpdateEvent(Operation.default30);
|
| | | // }
|
| | | // }
|
| | | // }
|
| | |
|
| | | // public void UpdateRechargeGiftAct(HAA74_tagMCActBuyCountGiftInfo package)
|
| | | // {
|
| | | // OperationBase operationBase = null;
|
| | |
|
| | | // Operation operationType = Operation.default31;
|
| | |
|
| | | // switch (package.ActNum)
|
| | | // {
|
| | | // case 30:
|
| | | // operationType = Operation.default31;
|
| | | // break;
|
| | | // case 10:
|
| | | // operationType = Operation.default35;
|
| | | // break;
|
| | | // case 31:
|
| | | // operationType = Operation.default38;
|
| | | // break;
|
| | | // case 11:
|
| | | // operationType = Operation.default46;
|
| | | // break;
|
| | | // case 12:
|
| | | // operationType = Operation.default50;
|
| | | // break;
|
| | | // case 13:
|
| | | // operationType = Operation.default52;
|
| | | // break;
|
| | | // default:
|
| | | // return;
|
| | | // }
|
| | | // operationDict.TryGetValue(operationType, out operationBase);
|
| | | // if (string.IsNullOrEmpty(package.StartDate) || string.IsNullOrEmpty(package.EndtDate))
|
| | | // {
|
| | | // ForceStopOperation(operationType);
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // if (operationBase == null)
|
| | | // {
|
| | | // operationBase = new OperationRechargeGiftAct();
|
| | | // operationDict.Add(operationType, operationBase);
|
| | | // }
|
| | | // var operation = operationBase as OperationRechargeGiftAct;
|
| | | // operation.Reset();
|
| | | // operation.startDate = ParseOperationDate(package.StartDate);
|
| | | // operation.endDate = ParseOperationDate(package.EndtDate);
|
| | | // operation.limitLv = package.LimitLV;
|
| | | // operation.dayReset = package.IsDayReset == 1;
|
| | | // operation.resetType = package.ResetType;
|
| | | // operation.ActNum = package.ActNum;
|
| | | // operation.ParsePackage(package);
|
| | | // if (operationTimeUpdateEvent != null)
|
| | | // {
|
| | | // operationTimeUpdateEvent(operationType);
|
| | | // }
|
| | | // }
|
| | | // }
|
| | |
|
| | | // public void UpdateActFamilyCTGAssistInfo(HAA77_tagMCActFamilyCTGAssistInfo package)
|
| | | // {
|
| | | // OperationBase operationBase = null;
|
| | |
|
| | | // Operation operationType = Operation.default34;
|
| | |
|
| | | // switch (package.ActNum)
|
| | | // {
|
| | | // case 30:
|
| | | // operationType = Operation.default34;
|
| | | // break;
|
| | | // case 32:
|
| | | // operationType = Operation.default54;
|
| | | // break;
|
| | | // default:
|
| | | // return;
|
| | | // }
|
| | | // operationDict.TryGetValue(operationType, out operationBase);
|
| | | // if (string.IsNullOrEmpty(package.StartDate) || string.IsNullOrEmpty(package.EndtDate))
|
| | | // {
|
| | | // ForceStopOperation(operationType);
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // if (operationBase == null)
|
| | | // {
|
| | | // operationBase = new OperationFamilyRechargeConn();
|
| | | // operationDict.Add(operationType, operationBase);
|
| | | // }
|
| | | // var operation = operationBase as OperationFamilyRechargeConn;
|
| | | // operation.Reset();
|
| | | // operation.startDate = ParseOperationDate(package.StartDate);
|
| | | // operation.endDate = ParseOperationDate(package.EndtDate);
|
| | | // operation.limitLv = package.LimitLV;
|
| | | // operation.dayReset = package.IsDayReset == 1;
|
| | | // operation.ActNum = package.ActNum;
|
| | | // operation.ParseActFamilyCTGAssistInfo(package);
|
| | | // if (operationTimeUpdateEvent != null)
|
| | | // {
|
| | | // operationTimeUpdateEvent(operationType);
|
| | | // }
|
| | | // }
|
| | | // }
|
| | |
|
| | | public void ForceStopOperation(Operation operationType)
|
| | | {
|
| | | if (operationDict.ContainsKey(operationType))
|
| | | {
|
| | | operationDict.Remove(operationType);
|
| | | }
|
| | | if (operationServerCloseEvent != null)
|
| | | {
|
| | | operationServerCloseEvent(operationType);
|
| | | }
|
| | | if (operationEndEvent != null)
|
| | | {
|
| | | operationEndEvent(operationType, 0);
|
| | | operationEndEvent(operationType, 1);
|
| | | }
|
| | | }
|
| | |
|
| | | public bool TryGetOperationTime(Operation type, out OperationBase operation)
|
| | | {
|
| | | return operationDict.TryGetValue(type, out operation);
|
| | | }
|
| | |
|
| | | public bool TryGetOperation<T>(Operation type, out T operation) where T : OperationBase
|
| | | {
|
| | | operation = null;
|
| | | if (operationDict.ContainsKey(type))
|
| | | {
|
| | | operation = operationDict[type] as T;
|
| | | return operation is T;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public bool InOperationTime(Operation type)
|
| | | {
|
| | | OperationBase operation;
|
| | | if (TryGetOperationTime(type, out operation))
|
| | | {
|
| | | return operation.InTime(TimeUtility.ServerNow);
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public bool InOperationTime(Operation type, DateTime time)
|
| | | {
|
| | | OperationBase operation;
|
| | | if (TryGetOperationTime(type, out operation))
|
| | | {
|
| | | return operation.InTime(time);
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public bool InOperationJoinTime(Operation type, DateTime time)
|
| | | {
|
| | | OperationBase operation;
|
| | | if (TryGetOperationTime(type, out operation))
|
| | | {
|
| | | return operation.InJoinTime(time);
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public bool InOperationDay(Operation type)
|
| | | {
|
| | | OperationBase operation;
|
| | | if (TryGetOperationTime(type, out operation))
|
| | | {
|
| | | return operation.InDay(TimeUtility.ServerNow);
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public int GetOperationSurplusTime(Operation type)
|
| | | {
|
| | | OperationBase operation;
|
| | | if (TryGetOperationTime(type, out operation))
|
| | | {
|
| | | return operation.GetSurplusTime(TimeUtility.ServerNow);
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | public bool InOperationAdvance(Operation type)
|
| | | {
|
| | | OperationBase operation;
|
| | | if (TryGetOperationTime(type, out operation))
|
| | | {
|
| | | return operation.InAdvanceTime(TimeUtility.ServerNow);
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public int GetOperationSecondsBeforeStart(Operation type)
|
| | | {
|
| | | OperationBase operation;
|
| | | if (TryGetOperationTime(type, out operation))
|
| | | {
|
| | | return operation.GetSecondsBeforeStart(TimeUtility.ServerNow);
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | public bool SatisfyOpenCondition(Operation type)
|
| | | {
|
| | | OperationBase operation;
|
| | | if (TryGetOperationTime(type, out operation))
|
| | | {
|
| | | return operation.SatisfyOpenCondition() && InOperationTime(type);
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public bool SatisfyOpenCondition(Operation type, DateTime time)
|
| | | {
|
| | | OperationBase operation;
|
| | | if (TryGetOperationTime(type, out operation))
|
| | | {
|
| | | return operation.SatisfyOpenCondition() && InOperationTime(type, time);
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | //活动开启中,有参与进行时间段
|
| | | public bool SatisfyJoinCondition(Operation type, DateTime time)
|
| | | {
|
| | | OperationBase operation;
|
| | | if (TryGetOperationTime(type, out operation))
|
| | | {
|
| | | return InOperationJoinTime(type, time);
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public bool IsPrepareTime(Operation type, DateTime time)
|
| | | {
|
| | | OperationBase operation;
|
| | | if (TryGetOperationTime(type, out operation))
|
| | | {
|
| | | return operation.IsPrepareTime(time);
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public bool SatisfyAdvanceCondition(Operation type)
|
| | | {
|
| | | OperationBase operation;
|
| | | if (TryGetOperationTime(type, out operation))
|
| | | {
|
| | | return operation.SatisfyOpenCondition() && InOperationAdvance(type);
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public void ProcessConditionError(Operation type)
|
| | | {
|
| | | if (SatisfyOpenCondition(type))
|
| | | {
|
| | | return;
|
| | | }
|
| | | OperationBase operation;
|
| | | if (TryGetOperationTime(type, out operation))
|
| | | {
|
| | | if (!InOperationTime(type))
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("InOperationTimeError");
|
| | | }
|
| | | else if (!operation.SatisfyOpenCondition())
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip(StringUtility.Contact("OperationLevelLimit_", type), operation.limitLv);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("InOperationTimeError");
|
| | | }
|
| | | }
|
| | |
|
| | | public OperationDate ParseOperationDate(string date)
|
| | | {
|
| | | string[] dateArray = date.Split('-');
|
| | | if (dateArray != null && dateArray.Length == 3)
|
| | | {
|
| | | return new OperationDate()
|
| | | {
|
| | | year = int.Parse(dateArray[0].Trim()),
|
| | | month = int.Parse(dateArray[1].Trim()),
|
| | | day = int.Parse(dateArray[2].Trim())
|
| | | };
|
| | | }
|
| | | //else if (dateArray != null && dateArray.Length == 1)
|
| | | //{
|
| | | // var time = TimeUtility.openServerTime;
|
| | | // if (time.Equals(default(DateTime)))
|
| | | // {
|
| | | // Debug.Log("服务期开服时间下发顺序有问题");
|
| | | // }
|
| | | // var days = 0;
|
| | | // int.TryParse(date, out days);
|
| | | // days = Mathf.Max(1, days);
|
| | | // time = time.AddDays(days - 1);
|
| | | // return new OperationDate()
|
| | | // {
|
| | | // year = time.Year,
|
| | | // month = time.Month,
|
| | | // day = time.Day,
|
| | | // };
|
| | | //}
|
| | | return default(OperationDate);
|
| | | }
|
| | |
|
| | | private OperationTime ParseOperationTime(string startTime, string endTime)
|
| | | {
|
| | | var startTimeArray = startTime.Split(':');
|
| | | var endTimeArray = endTime.Split(':');
|
| | | if (startTimeArray != null && startTimeArray.Length == 2
|
| | | && endTimeArray != null && endTimeArray.Length == 2)
|
| | | {
|
| | | return new OperationTime()
|
| | | {
|
| | | startHour = int.Parse(startTimeArray[0].Trim()),
|
| | | startMinute = int.Parse(startTimeArray[1].Trim()),
|
| | | endHour = int.Parse(endTimeArray[0].Trim()),
|
| | | endMinute = int.Parse(endTimeArray[1].Trim()),
|
| | | };
|
| | | }
|
| | | return default(OperationTime);
|
| | | }
|
| | | }
|
| | |
|
| | | public struct OperationDate
|
| | | {
|
| | | public int year;
|
| | | public int month;
|
| | | public int day;
|
| | |
|
| | | public static bool operator ==(OperationDate x, OperationDate y)
|
| | | {
|
| | | return x.year == y.year && x.month == y.month && x.day == y.day;
|
| | | }
|
| | |
|
| | | public static bool operator !=(OperationDate x, OperationDate y)
|
| | | {
|
| | | return !(x == y);
|
| | | }
|
| | |
|
| | | public static bool operator >(OperationDate x, OperationDate y)
|
| | | {
|
| | | if (x.year > y.year)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | if (x.year == y.year)
|
| | | {
|
| | | if (x.month > y.month)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | if (x.month == y.month)
|
| | | {
|
| | | return x.day > y.day;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public static bool operator <(OperationDate x, OperationDate y)
|
| | | {
|
| | | return !(x > y) && x != y;
|
| | | }
|
| | |
|
| | | public static bool operator >=(OperationDate x, OperationDate y)
|
| | | {
|
| | | return x > y || x == y;
|
| | | }
|
| | |
|
| | | public static bool operator <=(OperationDate x, OperationDate y)
|
| | | {
|
| | | return x < y || x == y;
|
| | | }
|
| | |
|
| | | public DateTime AddSeconds(int _seconds)
|
| | | {
|
| | | DateTime d = new DateTime(year, month, day);
|
| | | return d.AddTicks(_seconds * TimeSpan.TicksPerSecond);
|
| | | }
|
| | |
|
| | | public OperationDate AddDays(int _days)
|
| | | {
|
| | | DateTime d = new DateTime(year, month, day);
|
| | | d = d.AddTicks(_days * TimeSpan.TicksPerDay);
|
| | | return new OperationDate()
|
| | | {
|
| | | year = d.Year,
|
| | | month = d.Month,
|
| | | day = d.Day,
|
| | | };
|
| | | }
|
| | |
|
| | | public string ToDisplay(bool showYear = true)
|
| | | {
|
| | | if (showYear)
|
| | | {
|
| | | return StringUtility.Contact(year, "/", month, "/", day);
|
| | | }
|
| | |
|
| | | return StringUtility.Contact(month, "/", day);
|
| | |
|
| | | //var yearString = StringUtility.Contact(year, Language.Get("Year"));
|
| | | //return StringUtility.Contact(showYear ? yearString : string.Empty, month, Language.Get("Month"), day, Language.Get("Day"));
|
| | | }
|
| | |
|
| | | public static int operator -(OperationDate x, OperationDate y)
|
| | | {
|
| | | DateTime _x = new DateTime(x.year, x.month, x.day);
|
| | | DateTime _y = new DateTime(y.year, y.month, y.day);
|
| | | return (int)(_x - _y).TotalDays;
|
| | | }
|
| | | }
|
| | |
|
| | | public struct OperationTime
|
| | | {
|
| | | public int startHour;
|
| | | public int startMinute;
|
| | |
|
| | | public int endHour;
|
| | | public int endMinute;
|
| | |
|
| | | public bool InTime(DateTime time)
|
| | | {
|
| | | return CompareTime(time) == 0;
|
| | | }
|
| | |
|
| | | public int CompareTime(DateTime time)
|
| | | {
|
| | | if (time.Hour < startHour || (time.Hour == startHour && time.Minute < startMinute))
|
| | | {
|
| | | return -1;
|
| | | }
|
| | | if (time.Hour > endHour || (time.Hour == endHour && time.Minute >= endMinute))
|
| | | {
|
| | | return 1;
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | public override string ToString()
|
| | | {
|
| | | return StringUtility.Contact(startHour.ToString("D2"), ":", startMinute.ToString("D2"),
|
| | | "-", endHour.ToString("D2"), ":", endMinute.ToString("D2"));
|
| | | }
|
| | |
|
| | | public static int operator -(OperationTime x, DateTime y)
|
| | | {
|
| | | DateTime d = new DateTime(y.Year, y.Month, y.Day, x.endHour, x.endMinute, 0);
|
| | | return Mathf.Max(0, (int)(d - y).TotalSeconds);
|
| | | }
|
| | | }
|
| | |
|
| | | public enum Operation
|
| | | {
|
| | | MultipleExp,
|
| | | ConsumeRebate,
|
| | | FlashSale,//限时特惠
|
| | | BossReborn,
|
| | | GiftPackage,
|
| | | FairyCeremony, //仙界盛典
|
| | | MultipRealmPoint, //N倍修行点
|
| | | FlashRushToBuy, //限时抢购
|
| | | WishingWellInfo, //许愿池
|
| | | AccumulateRecharge,//累计充值,单日
|
| | | LoginReward,//登录奖励
|
| | | FestivalRedpack,//节日红包
|
| | | NewYearFairyCeremony, //春节仙界盛典
|
| | | SpringFestival,//春节巡礼
|
| | | OpenServiceAchievement,//七日巡礼
|
| | | LuckyTreasure,//幸运鉴宝
|
| | | MultiRecharge, //仙玉充值返利 (首充双倍)
|
| | | CZBMGift, // 成长必买礼包
|
| | | DaysAccumulateRecharge, //累计充值,多日
|
| | | CollectWords, //收集文字
|
| | | HolidayLogin, //节日登录
|
| | | HolidayWish, //节日祝福灯笼
|
| | | HolidayMultiRecharge,//节日祝福的多日累计充值 包含任意充值界面和多日累充界面
|
| | | HolidayTravel, //节日游历
|
| | | HolidayAccumulateRecharge, //节日-单日的累积充值
|
| | | HolidayCollectWords, //节日-集字
|
| | | HolidayGiftPackage, //节日祝福-限时礼包
|
| | | HolidayFlashRushToBuy, //节日-限时抢购
|
| | | HolidayFlashSale, //节日祝福-限时特惠
|
| | | HolidayConsumeRebate, //节日祝福-消费返利
|
| | |
|
| | | //后续IL开发添加预设
|
| | | default1, // 连续多日累充
|
| | | default2,
|
| | | default3, // 节日-垃圾分类
|
| | | default4, // 节日-翻牌
|
| | | default5,
|
| | | default6,
|
| | | default7, // 精彩活动-跨服充值
|
| | | default8, // 合服-福利(多日累充1档)
|
| | | default9, // 合服-转盘
|
| | | default10, // 合服-集字狂欢
|
| | | default11, // 合服-坐骑盛宴
|
| | | default12, // 合服-超值限购
|
| | | default13, // 合服-限时礼包
|
| | | default14,
|
| | | default15,
|
| | | default16,
|
| | | default17,
|
| | | default18, // 幸运云购
|
| | | default19,
|
| | | default20, //节日指定累计充值额度,和节日任意充值独立两个界面
|
| | | default21,
|
| | | default22, //天帝礼包
|
| | | default23,
|
| | | default24,
|
| | | default25, //买1送5
|
| | | default26,
|
| | | default27, //日期型活动- boss历练活动
|
| | | default28, //精彩活动-单笔充值
|
| | | default29, //日期型活动- 登录,可补签
|
| | | default30, //日期型活动- 任务
|
| | | default31, //日期型活动- 礼包,可累计购买次数领取
|
| | | default32, //福缘- 长久累充(几个月或更长) 独立界面
|
| | | default33, //日期型活动- boss 历练活动(跨服) 必须和活动default27一起使用
|
| | | default34, //日期型活动- 仙盟充值互助,特殊:允许多个活动同时开启
|
| | | default35, //自选礼包
|
| | | default36, //日期型活动- 秘境寻宝(类仙匣) 主活动
|
| | | default37, //日期型活动- 秘境寻宝(类仙匣) 跨服
|
| | | default38, //日期型活动- 自选礼包 + 商店
|
| | | default39, //日期型活动- 骑宠培养本服
|
| | | default40, //日期型活动- 骑宠培养跨服
|
| | | default41, //日期型活动- 古宝养成本服
|
| | | default42, //日期型活动- 古宝养成跨服
|
| | | default43, ////日期型活动- 任务环
|
| | | default44, //日期型活动 - 仙缘登陆,可补签
|
| | | default45, //日期型活动 - 仙缘任务
|
| | | default46, //日期型活动 - 仙缘礼包
|
| | | default47, //日期型活动 - 轮回殿
|
| | | default48, //日期型活动 - 运势寻宝
|
| | | default49, //日期型活动 - 运势任务
|
| | | default50, //日期型活动 - 运势礼包
|
| | | default51, //日期型活动 - 仙匠大会炼器
|
| | | default52, //日期型活动 - 仙匠大会礼包
|
| | | default53, //日期型活动 - 仙盟攻城战 跨服
|
| | | default54, //日期型活动 - 仙盟攻城战仙盟协助和礼包
|
| | | max,
|
| | | } |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: d2095de53afc244429c13d31ffcc6db9 |
| | | timeCreated: 1531287451 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 4a97e38ab5f3549439e76af195da7c18 |
| | | folderAsset: yes |
| | | DefaultImporter: |
| | | externalObjects: {} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | |
|
| | | using UnityEngine;
|
| | | using LitJson;
|
| | | using System.Linq;
|
| | |
|
| | |
|
| | | public class RechargeManager : GameSystemManager<RechargeManager>
|
| | | {
|
| | | private Dictionary<string, List<int>> m_CTGConfigDict = new Dictionary<string, List<int>>();
|
| | | public List<int> voucherCTGList = new List<int>();
|
| | |
|
| | | public event Action OnVipOpenPayWinEvent;
|
| | |
|
| | | public event Action firstChargeRewardEvent;
|
| | | public event Action<int> rechargeCountEvent;
|
| | |
|
| | | private bool serverInited = false;
|
| | |
|
| | | private bool waitingJump = false;
|
| | |
|
| | | public int realRecharge = 0; //真实充值金额
|
| | | public event Action rechargeChangeEvent;
|
| | |
|
| | | //代金券记录
|
| | | public List<HA008_tagGCPlayerRecInfo.tagGCPlayerRec> m_PlayerRecsVoucher = new List<HA008_tagGCPlayerRecInfo.tagGCPlayerRec>();
|
| | |
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | | ParseConfig();
|
| | | ParseCTGConfig();
|
| | | ParseFirstCharge();
|
| | | PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefreshInfoEvent;
|
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitialize;
|
| | | SDKUtils.Instance.onFreePlatformPayCancel += OnChargeFail;
|
| | | SDKUtils.Instance.onFreePlatformPayFail += OnChargeFail;
|
| | | SDKUtils.Instance.onFreePlatformPayOk += OnChargeComplete;
|
| | | TimeUtility.OnServerOpenDayRefresh += OnServerOpenDayRefresh;
|
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOk;
|
| | | }
|
| | |
|
| | |
|
| | | public override void Release()
|
| | | {
|
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= OnBeforePlayerDataInitialize;
|
| | | PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefreshInfoEvent;
|
| | | SDKUtils.Instance.onFreePlatformPayCancel -= OnChargeFail;
|
| | | SDKUtils.Instance.onFreePlatformPayFail -= OnChargeFail;
|
| | | SDKUtils.Instance.onFreePlatformPayOk -= OnChargeComplete;
|
| | | TimeUtility.OnServerOpenDayRefresh -= OnServerOpenDayRefresh;
|
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent -= OnPlayerLoginOk;
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | TimeMgr.Instance.UnRegister(TimeMgr.SyntonyType.VipExperirnceOverdue);
|
| | | // if (UIManager.Instance.IsOpened<GotoChargeWin>())
|
| | | // {
|
| | | // UIManager.Instance.CloseWindow<GotoChargeWin>();
|
| | | // }
|
| | | m_RechargeCountDict.Clear();
|
| | | m_ChargeReset = true;
|
| | | serverInited = false;
|
| | | firstRechargeOpen = false;
|
| | | waitingJump = false;
|
| | | RechargeTimeLismit.Clear();
|
| | | m_PlayerRecsVoucher.Clear();
|
| | | realRecharge = 0;
|
| | | }
|
| | |
|
| | | private void PlayerDataRefreshInfoEvent(PlayerDataType _type)
|
| | | {
|
| | | if (_type == PlayerDataType.ChangeCoinPointTotal)
|
| | | {
|
| | | if (serverInited && FirstGoldServerDay > 0
|
| | | && !beforeRecharge)
|
| | | {
|
| | | firstRechargeOpen = true;
|
| | | }
|
| | | m_ChargeReset = true;
|
| | | UpdateRedpoint();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | | private void OnChargeComplete()
|
| | | {
|
| | | m_ChargeReset = true;
|
| | | // if (UIManager.Instance.IsOpened<RechargeBoxWin>())
|
| | | // {
|
| | | // UIManager.Instance.CloseWindow<RechargeBoxWin>();
|
| | | // }
|
| | |
|
| | | }
|
| | |
|
| | | private void OnChargeFail()
|
| | | {
|
| | | m_ChargeReset = true;
|
| | | }
|
| | |
|
| | |
|
| | | private bool m_ChargeReset = true;
|
| | |
|
| | | #region 配置
|
| | | private static string[] lineSplit = new string[] { "</r>" };
|
| | | private int m_CTGDelayTime = 1; // 充值的公共间隔,见配置ChargeDelayTime
|
| | | private int m_CTGLimitDelayTime = 1; // 限购商品的充值间隔,见配置ChargeDelayTime
|
| | |
|
| | | //多倍图片
|
| | | public Dictionary<int, string> MultiRechageImageDict = new Dictionary<int, string>();
|
| | | //港台多倍充值要对应不同的充值编号
|
| | | public Dictionary<int, List<string>> MultiOrderInfoDict = new Dictionary<int, List<string>>();
|
| | | private void ParseConfig()
|
| | | {
|
| | |
|
| | | var textConfig = FuncConfigConfig.Get("MultiRechageImage");
|
| | | var json = JsonMapper.ToObject(textConfig.Numerical1);
|
| | | foreach (var key in json.Keys)
|
| | | {
|
| | | var multi = int.Parse(key);
|
| | | MultiRechageImageDict[multi] = json[key].ToString();
|
| | | }
|
| | |
|
| | | //多倍充值对应不同编号
|
| | | var _json = JsonMapper.ToObject(textConfig.Numerical2);
|
| | | foreach (var _key in _json.Keys)
|
| | | {
|
| | | var _type = int.Parse(_key);
|
| | |
|
| | | MultiOrderInfoDict.Add(_type, new List<string>(JsonMapper.ToObject<string[]>(_json[_key].ToJson()))); ;
|
| | | }
|
| | |
|
| | | var cfg = FuncConfigConfig.Get("DaiJQCTG");
|
| | | voucherCTGList = JsonMapper.ToObject<List<int>>(cfg.Numerical1);
|
| | | }
|
| | |
|
| | | |
| | | Dictionary<int, int> fightPowerDict = new Dictionary<int, int>();
|
| | | // public int GetTitlePower(int vipLv)
|
| | | // {
|
| | | // int[] propertys = DienstgradConfig.GetTitleAttrType(vipTitleDic[vipLv]);
|
| | | // int[] values = DienstgradConfig.GetTitleAttrValue(vipTitleDic[vipLv]);
|
| | | // fightPowerDict.Clear();
|
| | | // for (int i = 0; i < propertys.Length; i++)
|
| | | // {
|
| | | // fightPowerDict.Add(propertys[i], values[i]);
|
| | | // }
|
| | | // return (int)UIHelper.GetFightPower(fightPowerDict);
|
| | | // }
|
| | |
|
| | |
|
| | | private void ParseCTGConfig()
|
| | | {
|
| | | var configs = OrderInfoConfig.GetValues();
|
| | | m_RechargeGainItemDict = new Dictionary<int, List<Item>>();
|
| | | for (int i = 0; i < configs.Count; i++)
|
| | | {
|
| | | List<OrderInfoConfig> list;
|
| | | if (!m_OrderInfoDict.TryGetValue(configs[i].AppId, out list))
|
| | | {
|
| | | list = new List<OrderInfoConfig>();
|
| | | m_OrderInfoDict.Add(configs[i].AppId, list);
|
| | | }
|
| | | list.Add(configs[i]);
|
| | |
|
| | | #if UNITY_EDITOR
|
| | | orderInfoToCTGID[configs[i].OrderInfo] = configs[i].CTGID;
|
| | | #else
|
| | | if (configs[i].AppId == VersionConfig.Get().appId)
|
| | | { |
| | | orderInfoToCTGID[configs[i].OrderInfo] = configs[i].CTGID;
|
| | | }
|
| | | #endif
|
| | | if (configs[i].CTGID == 0)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | List<int> _list = null;
|
| | | if (!m_CTGConfigDict.TryGetValue(configs[i].AppId, out _list))
|
| | | {
|
| | | _list = new List<int>();
|
| | | m_CTGConfigDict.Add(configs[i].AppId, _list);
|
| | | }
|
| | | //港台存在多个orderinfo对应同一个ctgid的情况
|
| | | if (!_list.Contains(configs[i].CTGID))
|
| | | {
|
| | | _list.Add(configs[i].CTGID);
|
| | | }
|
| | | if (!m_RechargeGainItemDict.ContainsKey(configs[i].CTGID))
|
| | | {
|
| | | #if UNITY_EDITOR
|
| | | try
|
| | | {
|
| | | #endif
|
| | | var ctg = CTGConfig.Get(configs[i].CTGID);
|
| | | var _itemArray = LitJson.JsonMapper.ToObject<int[][]>(ctg.GainItemList);
|
| | | if (_itemArray != null && _itemArray.Length > 0)
|
| | | {
|
| | | var _itemList = new List<Item>();
|
| | | m_RechargeGainItemDict.Add(configs[i].CTGID, _itemList);
|
| | | for (int k = 0; k < _itemArray.Length; k++)
|
| | | {
|
| | | Item _item = new Item(_itemArray[k][0], _itemArray[k][1]);
|
| | | _itemList.Add(_item);
|
| | | }
|
| | | }
|
| | | #if UNITY_EDITOR
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | Debug.LogError("错误的 充值商品ctgid = " + configs[i].CTGID + e);
|
| | | }
|
| | | #endif
|
| | | }
|
| | | }
|
| | | var _funcConfig = FuncConfigConfig.Get("ChargeDelayTime");
|
| | | m_CTGDelayTime = int.Parse(_funcConfig.Numerical1);
|
| | | m_CTGLimitDelayTime = int.Parse(_funcConfig.Numerical2);
|
| | | _funcConfig = FuncConfigConfig.Get("FirstGoldMobs");
|
| | | firstRechargeWeapon = ConfigParse.GetDic<int, int>(_funcConfig.Numerical1);
|
| | | }
|
| | |
|
| | | public List<int> GetCTGConfigs(string _appid)
|
| | | {
|
| | | if (m_CTGConfigDict.ContainsKey(_appid))
|
| | | {
|
| | | return m_CTGConfigDict[_appid];
|
| | | }
|
| | | return m_CTGConfigDict.Values.Last();
|
| | | }
|
| | |
|
| | | //外部调用不可以修改list
|
| | | public bool TryGetRechargeItem(int id, out List<Item> list)
|
| | | {
|
| | | return m_RechargeGainItemDict.TryGetValue(id, out list);
|
| | | }
|
| | |
|
| | | |
| | |
|
| | |
|
| | | private Dictionary<int, Dictionary<int, List<Item>>> m_FirstChargeItemDict = new Dictionary<int, Dictionary<int, List<Item>>>();
|
| | | public Dictionary<int, List<Item>> m_FirstChargeCommonItemDict = new Dictionary<int, List<Item>>();
|
| | | private void ParseFirstCharge()
|
| | | {
|
| | | foreach (var day in FirstGoldConfig.GetKeys())
|
| | | {
|
| | | if (!m_FirstChargeItemDict.ContainsKey(day))
|
| | | {
|
| | | Dictionary<int, List<Item>> JobItems = new Dictionary<int, List<Item>>();
|
| | | m_FirstChargeItemDict[day] = JobItems;
|
| | | }
|
| | | var config = FirstGoldConfig.Get(day);
|
| | | var _itemJson = JsonMapper.ToObject(config.JobItemInfo);
|
| | | foreach (var jobstr in _itemJson.Keys)
|
| | | {
|
| | | var job = int.Parse(jobstr);
|
| | | if (!m_FirstChargeItemDict[day].ContainsKey(job))
|
| | | {
|
| | | List<Item> JobItems = new List<Item>();
|
| | | m_FirstChargeItemDict[day][job] = JobItems;
|
| | | }
|
| | |
|
| | | for (int i = 0; i < _itemJson[jobstr].Count; i++)
|
| | | {
|
| | | m_FirstChargeItemDict[day][job].Add(new Item(int.Parse(_itemJson[jobstr][i][0].ToString()),
|
| | | int.Parse(_itemJson[jobstr][i][1].ToString())));
|
| | | }
|
| | | }
|
| | |
|
| | | if (!m_FirstChargeCommonItemDict.ContainsKey(day))
|
| | | {
|
| | | List<Item> ItemsComm = new List<Item>();
|
| | | m_FirstChargeCommonItemDict[day] = ItemsComm;
|
| | | }
|
| | | var _itemCommon = JsonMapper.ToObject<int[][]>(config.CommItemList);
|
| | | for (int i = 0; i < _itemCommon.Length; i++)
|
| | | {
|
| | | m_FirstChargeCommonItemDict[day].Add(new Item(_itemCommon[i][0], _itemCommon[i][1]));
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | | public bool TryGetFirstReward(int day, int _job, out List<Item> _list)
|
| | | {
|
| | | List<Item> newItems = new List<Item>();
|
| | | newItems.Clear();
|
| | | if (m_FirstChargeItemDict.ContainsKey(day) && m_FirstChargeItemDict[day].ContainsKey(_job))
|
| | | {
|
| | | newItems.AddRange(m_FirstChargeItemDict[day][_job]);
|
| | | }
|
| | | newItems.AddRange(m_FirstChargeCommonItemDict[day]);
|
| | | _list = newItems;
|
| | | return true;
|
| | | }
|
| | |
|
| | |
|
| | | #endregion
|
| | |
|
| | | |
| | |
|
| | | #region 充值
|
| | | public Dictionary<int, int> firstRechargeWeapon { get; private set; }
|
| | | public Dictionary<int, List<Item>> m_RechargeGainItemDict { get; private set; }
|
| | | private Dictionary<int, RechargeCount> m_RechargeCountDict = new Dictionary<int, RechargeCount>();
|
| | | Dictionary<string, List<OrderInfoConfig>> m_OrderInfoDict = new Dictionary<string, List<OrderInfoConfig>>();
|
| | | public Dictionary<string, int> orderInfoToCTGID = new Dictionary<string, int>();
|
| | |
|
| | | public int presentSelectRechargeId { get; private set; }
|
| | | public bool beforeRecharge { get; private set; }
|
| | | private DateTime beforeCTGTime = DateTime.Now;
|
| | | private Redpoint rechargeRedpoint = new Redpoint(21);
|
| | | public Redpoint firstRechargeRedpoint = new Redpoint(210000);//首充领取红点
|
| | | public Redpoint rechargeFuncRedpoint = new Redpoint(21, 2101);
|
| | | public Redpoint rechargeGiftRedpoint = new Redpoint(2101, 210101);//18元礼包
|
| | |
|
| | | public bool TryGetOrderInfo(int _id, out OrderInfoConfig config)
|
| | | {
|
| | | config = null;
|
| | | if (_id == 0)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | List<OrderInfoConfig> list;
|
| | | if (m_OrderInfoDict.TryGetValue(VersionConfig.Get().appId, out list))
|
| | | {
|
| | | for (int i = 0; i < list.Count; i++)
|
| | | {
|
| | | if (list[i].CTGID == _id)
|
| | | {
|
| | | config = list[i];
|
| | | return true;
|
| | | }
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | //港台版本比较特殊同一个CTGID 有多个OrderInfo
|
| | | //暂且只用到首充多倍的区分
|
| | | public bool TryGetOrderInfoList(int _id, out List<OrderInfoConfig> configs)
|
| | | {
|
| | | configs = new List<OrderInfoConfig>();
|
| | | bool result = false;
|
| | | if (_id == 0)
|
| | | {
|
| | | return result;
|
| | | }
|
| | | List<OrderInfoConfig> list;
|
| | | if (m_OrderInfoDict.TryGetValue(VersionConfig.Get().appId, out list))
|
| | | {
|
| | | for (int i = 0; i < list.Count; i++)
|
| | | {
|
| | | if (list[i].CTGID == _id)
|
| | | {
|
| | | configs.Add(list[i]);
|
| | | result = true;
|
| | | }
|
| | | }
|
| | | }
|
| | | return result;
|
| | | }
|
| | |
|
| | | public bool TryGetOrderInfoByOrderInfo(string orderInfo, out OrderInfoConfig config)
|
| | | {
|
| | | config = null;
|
| | | List<OrderInfoConfig> list;
|
| | | if (m_OrderInfoDict.TryGetValue(VersionConfig.Get().appId, out list))
|
| | | {
|
| | | for (int i = 0; i < list.Count; i++)
|
| | | {
|
| | | if (list[i].OrderInfo == orderInfo)
|
| | | {
|
| | | config = list[i];
|
| | | return true;
|
| | | }
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | |
|
| | | public float GetOnSalePayRmb(int _id)
|
| | | {
|
| | | var appid = VersionConfig.Get().appId;
|
| | | appid = m_CTGConfigDict.ContainsKey(appid) ? appid : m_CTGConfigDict.Keys.Last();
|
| | | var configs = OrderInfoConfig.GetValues();
|
| | | for (int i = 0; i < configs.Count; i++)
|
| | | {
|
| | | if (configs[i].AppId.Equals(appid)
|
| | | && configs[i].CTGID == _id)
|
| | | {
|
| | | return configs[i].PayRMBNumOnSale;
|
| | | }
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | public float GetOrgPayRmb(int _id)
|
| | | {
|
| | | var appid = VersionConfig.Get().appId;
|
| | | appid = m_CTGConfigDict.ContainsKey(appid) ? appid : m_CTGConfigDict.Keys.Last();
|
| | | var configs = OrderInfoConfig.GetValues();
|
| | | for (int i = 0; i < configs.Count; i++)
|
| | | {
|
| | | if (configs[i].AppId.Equals(appid)
|
| | | && configs[i].CTGID == _id)
|
| | | {
|
| | | return configs[i].PayRMBNum;
|
| | | }
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | public void CTG(int _id)
|
| | | {
|
| | | OrderInfoConfig orderInfo = null;
|
| | | if (TryGetOrderInfo(_id, out orderInfo))
|
| | | {
|
| | | CTG(orderInfo);
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | public void CTG(OrderInfoConfig config)
|
| | | {
|
| | | if (config == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | | var rechargeConfig = CTGConfig.Get(config.CTGID);
|
| | | if (!VersionConfig.Get().appId.Equals(config.AppId))
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Recharge))
|
| | | {
|
| | | FuncOpen.Instance.ProcessorFuncErrorTip((int)FuncOpenEnum.Recharge);
|
| | | return;
|
| | | }
|
| | |
|
| | | if (rechargeConfig.SelectItemInfo != null && rechargeConfig.SelectItemInfo.Length != 0)
|
| | | { |
| | | int goodsCount; //固定商品种类数量
|
| | | int goodsSumCount; //商品总数量
|
| | | List<Item> awards = new List<Item>();
|
| | | CustomizedRechargeModel.Instance.TryGetRechargeItemEx(config.CTGID, out awards, out goodsCount, out goodsSumCount);
|
| | |
|
| | | //自选礼包没有选全 不能购买
|
| | | if (awards.Count != goodsSumCount)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("CustomizedGift02");
|
| | | return;
|
| | | }
|
| | | }
|
| | |
|
| | | if ((DateTime.Now - beforeCTGTime).TotalSeconds < m_CTGDelayTime && !m_ChargeReset)
|
| | | {
|
| | | ScrollTip.ShowTip(Language.Get("RechargeTimesLimit"));
|
| | | return;
|
| | | }
|
| | | if (m_RechargeCountDict.ContainsKey(config.CTGID))
|
| | | {
|
| | | if (rechargeConfig != null)
|
| | | {
|
| | | if (rechargeConfig.DailyBuyCount > 0 &&
|
| | | rechargeConfig.DailyBuyCount <= m_RechargeCountDict[config.CTGID].todayCount)
|
| | | {
|
| | | ScrollTip.ShowTip(Language.Get("RechargeCountsLimit"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (rechargeConfig.TotalBuyCount > 0 &&
|
| | | rechargeConfig.TotalBuyCount <= m_RechargeCountDict[config.CTGID].totalCount)
|
| | | {
|
| | | return;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | // 对有限购次数的物品 特别提醒,避免玩家短时间内重复购买限购物品
|
| | | if (rechargeConfig.TotalBuyCount > 0 || rechargeConfig.DailyBuyCount > 0)
|
| | | {
|
| | | if (RechargeTimeLismit.ContainsKey(config.OrderInfo))
|
| | | {
|
| | | if ((DateTime.Now - RechargeTimeLismit[config.OrderInfo]).TotalSeconds < m_CTGLimitDelayTime)
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("RechargeLimit", rechargeConfig.Title),
|
| | | (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | m_ChargeReset = false;
|
| | | beforeCTGTime = DateTime.Now;
|
| | | // if (!WindowCenter.Instance.IsOpen<GotoChargeWin>())
|
| | | // {
|
| | | // WindowCenter.Instance.Open<GotoChargeWin>(true);
|
| | | // }
|
| | | SDKUtils.Instance.FreePlatformPay(rechargeConfig.Title, config.PayRMBNum, config.OrderInfo);
|
| | |
|
| | | RechargeTimeLismit[config.OrderInfo] = DateTime.Now;
|
| | | }
|
| | | return;
|
| | | });
|
| | | return;
|
| | | }
|
| | | }
|
| | | RechargeTimeLismit[config.OrderInfo] = DateTime.Now;
|
| | | }
|
| | |
|
| | |
|
| | | m_ChargeReset = false;
|
| | | beforeCTGTime = DateTime.Now;
|
| | | // if (!WindowCenter.Instance.IsOpen<GotoChargeWin>())
|
| | | // {
|
| | | // WindowCenter.Instance.Open<GotoChargeWin>(true);
|
| | | // }
|
| | | SDKUtils.Instance.FreePlatformPay(rechargeConfig == null ? string.Empty : rechargeConfig.Title, config.PayRMBNum, config.OrderInfo);
|
| | | }
|
| | |
|
| | | Dictionary<string, DateTime> RechargeTimeLismit = new Dictionary<string, DateTime>();
|
| | |
|
| | |
|
| | |
|
| | | // 用于服务端通知的商品,充值表里没有配置的,正常都是活动的限购
|
| | | public void OpenFreePlat(string Title, float RMBNum, string OrderInfo)
|
| | | {
|
| | | // 对有限购次数的物品 特别提醒,避免玩家短时间内重复购买限购物品
|
| | | if (RechargeTimeLismit.ContainsKey(OrderInfo))
|
| | | {
|
| | | if ((DateTime.Now - RechargeTimeLismit[OrderInfo]).TotalSeconds < m_CTGLimitDelayTime)
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("RechargeLimit", Title),
|
| | | (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | // if (!WindowCenter.Instance.IsOpen<GotoChargeWin>())
|
| | | // {
|
| | | // WindowCenter.Instance.Open<GotoChargeWin>(true);
|
| | | // }
|
| | | SDKUtils.Instance.FreePlatformPay(Title, RMBNum, OrderInfo);
|
| | | RechargeTimeLismit[OrderInfo] = DateTime.Now;
|
| | | }
|
| | | return;
|
| | | });
|
| | | return;
|
| | | }
|
| | | }
|
| | | RechargeTimeLismit[OrderInfo] = DateTime.Now;
|
| | |
|
| | |
|
| | | // if (!WindowCenter.Instance.IsOpen<GotoChargeWin>())
|
| | | // {
|
| | | // WindowCenter.Instance.Open<GotoChargeWin>(true);
|
| | | // }
|
| | |
|
| | | SDKUtils.Instance.FreePlatformPay(Title, RMBNum, OrderInfo);
|
| | |
|
| | | }
|
| | |
|
| | | public event Action<string> OnCTGStageChange;
|
| | | public void SetCTGDisplay(string _display)
|
| | | {
|
| | | if (OnCTGStageChange != null)
|
| | | {
|
| | | OnCTGStageChange(_display);
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | public void UpdateRechargeCount(HA110_tagMCCoinToGoldCountInfo package)
|
| | | {
|
| | | realRecharge = (int)package.RealTotal;
|
| | | for (int i = 0; i < package.RecordCount; i++)
|
| | | {
|
| | | var _data = package.CTGCountInfoList[i];
|
| | |
|
| | | m_RechargeCountDict[_data.RecordID] = new RechargeCount()
|
| | | {
|
| | | todayCount = _data.TodayPayCount,
|
| | | totalCount = (int)_data.TotalPayCount,
|
| | | weekPayCount = _data.WeekPayCount,
|
| | | monthPayCount = _data.MonthPayCount,
|
| | | selectItemValue = (int)_data.SelectItemValue,
|
| | | };
|
| | | if (rechargeCountEvent != null)
|
| | | {
|
| | | rechargeCountEvent(_data.RecordID);
|
| | | }
|
| | | }
|
| | |
|
| | | rechargeChangeEvent?.Invoke();
|
| | | UpdateRedpoint();
|
| | | }
|
| | |
|
| | | public bool TryGetRechargeCount(int _rechargeId, out RechargeCount _rechargeCount)
|
| | | {
|
| | | return m_RechargeCountDict.TryGetValue(_rechargeId, out _rechargeCount);
|
| | | }
|
| | |
|
| | | private bool firstRechargeOpen
|
| | | {
|
| | | get;
|
| | | set;
|
| | | }
|
| | |
|
| | | public void AreadyGetFirstRecharge()
|
| | | {
|
| | | if (IsFirstChargeRewardGetByDay())
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("FirstPayAlreadyGet");
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | public struct RechargeCount
|
| | | {
|
| | | public int todayCount;
|
| | | public int totalCount;
|
| | | public int weekPayCount;
|
| | | public int monthPayCount;
|
| | | public int selectItemValue;
|
| | |
|
| | | }
|
| | |
|
| | | public int FirstGoldServerDay = 0; //0表示未充值,首充时为开服第几天(openday+1) |
| | |
|
| | | int m_FirstChargeRewardGet = 0;
|
| | | public int firstChargeRewardGet
|
| | | {
|
| | | get { return m_FirstChargeRewardGet; }
|
| | | set
|
| | | {
|
| | | m_FirstChargeRewardGet = value;
|
| | | UpdateFirstRechargeRedpoint();
|
| | | if (firstChargeRewardEvent != null)
|
| | | {
|
| | | firstChargeRewardEvent();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | //是否已领取
|
| | | public bool IsFirstChargeRewardGetByDay(int day = 0)
|
| | | {
|
| | | if (day == 0)
|
| | | {
|
| | | if (m_FirstChargeRewardGet == 7)
|
| | | {
|
| | | //三天全领取
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | if (((int)Math.Pow(2, day - 1) & m_FirstChargeRewardGet) != 0)
|
| | | return true;
|
| | | return false;
|
| | | }
|
| | |
|
| | | // 是否可领取,判断实际天
|
| | | public bool CanGetFirstChargeRewardByDay(int day)
|
| | | {
|
| | | if (FirstGoldServerDay == 0)
|
| | | return false;
|
| | |
|
| | | if (FirstGoldServerDay + day - 2 <= TimeUtility.OpenDay)
|
| | | {
|
| | | if (!IsFirstChargeRewardGetByDay(day))
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | // 获取首充可领取的第一个奖励
|
| | | public int GetFirstChargeRewardIndex()
|
| | | {
|
| | | for (int i = 1; i <= 3; i++)
|
| | | {
|
| | | if (CanGetFirstChargeRewardByDay(i))
|
| | | return i;
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | public void UpdateFirstChargeReward(HAA02_tagMCFirstGoldInfo package)
|
| | | {
|
| | | FirstGoldServerDay = package.FirstGoldServerDay;
|
| | | firstChargeRewardGet = package.FirstGoldRewardState;
|
| | | UpdateFirstRechargeRedpoint();
|
| | | UpdateRedpoint();
|
| | | }
|
| | |
|
| | | private void UpdateFirstRechargeRedpoint()
|
| | | {
|
| | | firstRechargeRedpoint.state = RedPointState.None;
|
| | | if (FirstGoldServerDay == 0)
|
| | | {
|
| | | if (PlayerDatas.Instance.baseData.LV <= GeneralDefine.rechargeRedpointLv
|
| | | && PlayerDatas.Instance.baseData.LV >= GeneralDefine.rechargeRedpointMinLv)
|
| | | {
|
| | | firstRechargeRedpoint.state = RedPointState.Quantity;
|
| | | }
|
| | | return;
|
| | | }
|
| | | firstRechargeRedpoint.state = GetFirstChargeRewardIndex() == 0 ? RedPointState.None : RedPointState.Simple;
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | private void UpdateRedpoint()
|
| | | {
|
| | | if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Recharge))
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (FirstGoldServerDay <= 0 || !IsFirstChargeRewardGetByDay(1))
|
| | | {
|
| | | return;
|
| | | }
|
| | | var list = GetCTGConfigs(VersionConfig.Get().appId);
|
| | | var config = CTGConfig.Get(list[0]);
|
| | | if (m_RechargeCountDict.ContainsKey(config.RecordID))
|
| | | {
|
| | | if (config.DailyBuyCount > 0 &&
|
| | | config.DailyBuyCount <= m_RechargeCountDict[config.RecordID].todayCount)
|
| | | {
|
| | | return;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | private void OnServerOpenDayRefresh()
|
| | | {
|
| | | UpdateRedpoint();
|
| | | UpdateFirstRechargeRedpoint();
|
| | | }
|
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | UpdateFirstRechargeRedpoint();
|
| | | UpdateRedpoint();
|
| | | serverInited = true;
|
| | | beforeRecharge = FirstGoldServerDay > 0;
|
| | | }
|
| | | #endregion
|
| | |
|
| | | public void UpdatePlayerRecInfoVoucher(HA008_tagGCPlayerRecInfo pack)
|
| | | {
|
| | | //只处理代金券
|
| | | if (pack.Type != 3) return;
|
| | |
|
| | | for (int i = 0; i < pack.Count; i++)
|
| | | {
|
| | | m_PlayerRecsVoucher.Add(pack.PlayerRecList[i]);
|
| | | }
|
| | |
|
| | | m_PlayerRecsVoucher.Sort(SortByTime);
|
| | | }
|
| | |
|
| | | int SortByTime(HA008_tagGCPlayerRecInfo.tagGCPlayerRec a, HA008_tagGCPlayerRecInfo.tagGCPlayerRec b)
|
| | | {
|
| | | return b.Time.CompareTo(a.Time);
|
| | | }
|
| | | }
|
| | |
|
| | |
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 4a58156340a177147ad04fab2f28b9e2 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 7f4be2a6d73bb8c40b77b85620ca4026 |
| | | folderAsset: yes |
| | | DefaultImporter: |
| | | externalObjects: {} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using LitJson;
|
| | | using System.Linq;
|
| | |
|
| | |
|
| | | //查看其他玩家的简短信息, 该模块处理数据,其他由各自功能模块处理 通过OnRevPackage
|
| | | public class RoleParticularModel : GameSystemManager<RoleParticularModel>
|
| | | {
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitialize;
|
| | | }
|
| | |
|
| | | public override void Release()
|
| | | {
|
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= OnBeforePlayerDataInitialize;
|
| | | }
|
| | |
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | viewPlayerType = -1;
|
| | | }
|
| | |
|
| | | public int viewPlayer { get; private set; }
|
| | |
|
| | | // 查询本服:0-查看其他玩家的简洁信息界面 1-查看战力界面 2(以上小于100)-返回数据不做处理,由调用者自行处理逻辑
|
| | | // 查询跨服:100-查看其他玩家的简洁信息界面 101-查看战力界面 102以上-返回数据不做处理,由调用者自行处理逻辑
|
| | | // 调用者需要的话自定义枚举值 EnumHelper的ViewPlayerType
|
| | | public int viewPlayerType { get; private set; } |
| | |
|
| | | private Dictionary<int, ViewPlayerData> viewPlayerDataDic = new Dictionary<int, ViewPlayerData>();
|
| | | private Dictionary<int, ulong> funcFightPowerDict = new Dictionary<int, ulong>();
|
| | | public event Action PowerUpdate;
|
| | | public static Action<int, int, ViewPlayerData> OnRevPackage; //尽量不要用第一个参数viewtype做判断,容易出错
|
| | |
|
| | | public ViewPlayerData GetViewPlayerData(int player)
|
| | | {
|
| | | ViewPlayerData viewPlayerData = null;
|
| | | viewPlayerDataDic.TryGetValue(player, out viewPlayerData);
|
| | | return viewPlayerData;
|
| | | }
|
| | |
|
| | | // 查看玩家模型展示,查玩家装备详情需另外处理
|
| | | // 本服查询:返回时打开查看其他玩家的简洁信息界面(可查看装备,宠物,坐骑等具体信息)RoleParticularsWin
|
| | | public void ViewRoleEquip(int playerID)
|
| | | {
|
| | | if (playerID == PlayerDatas.Instance.baseData.PlayerID)
|
| | | {
|
| | | return;
|
| | | }
|
| | | viewPlayerType = (int)ViewPlayerType.viewPlayerEquip;
|
| | | ViewRoleParticulars(playerID);
|
| | | }
|
| | |
|
| | | // 本服查询:返回时打开查看其他玩家战力界面(战力分布)ViewFuncPowerWin
|
| | | public void ViewRoleFightPower(int playerID)
|
| | | {
|
| | | if (playerID == PlayerDatas.Instance.baseData.PlayerID)
|
| | | {
|
| | | return;
|
| | | }
|
| | | viewPlayerType = (int)ViewPlayerType.viewPlayerFightPower;
|
| | | ViewRoleParticulars(playerID);
|
| | | }
|
| | |
|
| | | // 返回时不做任何操作,由调用者自行处理逻辑
|
| | | public void ViewPlayerCacheData(int _playerId, int viewType = (int)ViewPlayerType.viewPlayerData)
|
| | | {
|
| | | viewPlayerType = viewType;
|
| | | ViewRoleParticulars(_playerId);
|
| | | }
|
| | |
|
| | | // 查看玩家模型展示,查玩家装备详情需另外处理
|
| | | // 跨服查询:返回时打开查看其他玩家的简洁信息界面(可查看装备,宠物,坐骑等具体信息)RoleParticularsWin
|
| | | public void ViewCrossServerPlayerEquip(int _playerId)
|
| | | {
|
| | | if (_playerId == PlayerDatas.Instance.baseData.PlayerID)
|
| | | {
|
| | | return;
|
| | | }
|
| | | viewPlayerType = (int)ViewPlayerType.viewCrossPlayerEquip;
|
| | | ViewRoleParticulars(_playerId);
|
| | | }
|
| | |
|
| | | public void ViewCrossPlayerFightPower(int _playerId)
|
| | | {
|
| | | if (_playerId == PlayerDatas.Instance.baseData.PlayerID)
|
| | | {
|
| | | return;
|
| | | }
|
| | | viewPlayerType = (int)ViewPlayerType.viewCrossPlayerFightPower;
|
| | | ViewRoleParticulars(_playerId);
|
| | | }
|
| | |
|
| | | // 返回时不做任何操作,由调用者自行处理逻辑
|
| | | public void ViewCrossPlayerCacheData(int _playerId, int viewType = (int)ViewPlayerType.viewCrossPlayerData)
|
| | | {
|
| | | viewPlayerType = viewType;
|
| | | ViewRoleParticulars(_playerId);
|
| | | }
|
| | |
|
| | | public void ViewRoleParticulars(int playerID)
|
| | | {
|
| | | if (playerID == 0)
|
| | | {
|
| | | return;
|
| | | }
|
| | | viewPlayer = playerID;
|
| | | if (viewPlayerDataDic.ContainsKey(playerID))
|
| | | {
|
| | | ViewPlayerData viewPlayerData = viewPlayerDataDic[playerID];
|
| | | if ((DateTime.Now - viewPlayerData.getTime).TotalSeconds < 30)
|
| | | {
|
| | | ShowRoleParticulars(viewPlayerData, playerID);
|
| | | return;
|
| | | }
|
| | | }
|
| | | if (viewPlayerType >= (int)ViewPlayerType.viewCrossPlayerEquip)
|
| | | {
|
| | | //由子服服务器向跨服服务器查询; 会优先查本服数据(gameserver)
|
| | | CC002_tagCGViewCrossPlayerInfo c002 = new CC002_tagCGViewCrossPlayerInfo();
|
| | | c002.PlayerID = (uint)playerID;
|
| | | GameNetSystem.Instance.SendInfo(c002);
|
| | | }
|
| | | else
|
| | | {
|
| | | //只查本服数据,有可能本地图有数据,就不查gameserver
|
| | | CA212_tagCMViewPlayerInfo pak = new CA212_tagCMViewPlayerInfo();
|
| | | pak.PlayerID = (uint)playerID;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | //本服竞技场假查询模拟封包,返回查看机器人数据 打开RoleParticularsWin界面,专用接口其他地方不要调用
|
| | | public void ViewFairyArenaRobot(int playerID, ViewPlayerData _viewPlayerData)
|
| | | {
|
| | | ViewPlayerData viewPlayerData = null;
|
| | | viewPlayer = playerID;
|
| | | if (!viewPlayerDataDic.TryGetValue(playerID, out viewPlayerData))
|
| | | {
|
| | | viewPlayerDataDic.Add(playerID, _viewPlayerData);
|
| | | }
|
| | | else
|
| | | {
|
| | | viewPlayerDataDic[playerID] = _viewPlayerData;
|
| | | }
|
| | |
|
| | | viewPlayerType = (int)ViewPlayerType.viewCrossPlayerEquip;
|
| | | ShowRoleParticulars(_viewPlayerData, playerID);
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | public void OnRevRoleEquip(HA705_tagSCQueryPlayerCacheResult package)
|
| | | {
|
| | |
|
| | | ViewPlayerData viewPlayerData = null;
|
| | | if (!viewPlayerDataDic.TryGetValue((int)package.PlayerID, out viewPlayerData))
|
| | | {
|
| | | viewPlayerData = new ViewPlayerData();
|
| | | viewPlayerData.getTime = DateTime.Now;
|
| | | viewPlayerDataDic.Add((int)package.PlayerID, viewPlayerData);
|
| | | }
|
| | |
|
| | | viewPlayerData.getTime = DateTime.Now;
|
| | | viewPlayerData.rolePropData.PlayerID = (int)package.PlayerID;
|
| | | viewPlayerData.rolePropData.Name = package.PlayerName;
|
| | | viewPlayerData.rolePropData.LV = package.LV;
|
| | | viewPlayerData.rolePropData.Job = package.Job;
|
| | | viewPlayerData.rolePropData.RealmLV = package.RealmLV;
|
| | | viewPlayerData.rolePropData.Face = (int)package.Face;
|
| | | viewPlayerData.rolePropData.FacePic = (int)package.FacePic;
|
| | | viewPlayerData.rolePropData.TitleID = (int)package.TitleID;
|
| | | viewPlayerData.rolePropData.ServerID = (int)package.ServerID;
|
| | | viewPlayerData.rolePropData.FightPower = package.FightPower + package.FightPowerEx * (long)Constants.ExpPointValue;
|
| | | viewPlayerData.rolePropData.FamilyID = (int)package.FamilyID;
|
| | | viewPlayerData.rolePropData.FamilyName = package.FamilyName;
|
| | | viewPlayerData.rolePropData.FamilyEmblemID = (int)package.FamilyEmblemID;
|
| | |
|
| | |
|
| | | if (viewPlayerData.rolePlusData == null)
|
| | | {
|
| | | //第一次初始化
|
| | | viewPlayerData.rolePlusData = new RolePlusData();
|
| | | }
|
| | | if (package.PlusDataSize != 0)
|
| | | {
|
| | | viewPlayerData.rolePlusData.AnalysisRolePlusData(package.PlusData);
|
| | | }
|
| | |
|
| | |
|
| | | ShowRoleParticulars(viewPlayerData, (int)package.PlayerID);
|
| | | }
|
| | |
|
| | | public void OnRevRoleFuncPower(HA3A1_tagMCModuleFightPowerInfo package)
|
| | | {
|
| | | if (package.MFPCnt == 0)
|
| | | return;
|
| | | for (int i = 0; i < package.MFPList.Length; i++)
|
| | | {
|
| | | funcFightPowerDict[package.MFPList[i].MfpType] = package.MFPList[i].FightPowerEx * Constants.ExpPointValue + package.MFPList[i].FightPower;
|
| | | }
|
| | | if (PowerUpdate != null)
|
| | | {
|
| | | PowerUpdate();
|
| | | }
|
| | | }
|
| | |
|
| | | public ulong GetFuncFightPower(int type)
|
| | | {
|
| | | if (funcFightPowerDict.ContainsKey(type))
|
| | | {
|
| | | return funcFightPowerDict[type];
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | #region 查看玩家坐骑灵宠属性
|
| | | |
| | |
|
| | | // int[] qualitys;
|
| | | // string[] qualityTitles;
|
| | | // public string GetQualityDisplay(int quality)
|
| | | // {
|
| | | // if (qualitys == null)
|
| | | // {
|
| | | // var config = FuncConfigConfig.Get("PetQuality");
|
| | | // qualitys = ConfigParse.GetMultipleStr<int>(config.Numerical1);
|
| | | // qualityTitles = ConfigParse.GetMultipleStr(config.Numerical2);
|
| | | // }
|
| | | // for (int i = 0; i < qualitys.Length; i++)
|
| | | // {
|
| | | // if (quality == qualitys[i])
|
| | | // {
|
| | | // return qualityTitles[i];
|
| | | // }
|
| | | // }
|
| | | // return string.Empty;
|
| | | // }
|
| | |
|
| | |
|
| | | // public int GetPetFightPower(List<PetInfo> pets)
|
| | | // {
|
| | | // var fightPower = 0;
|
| | | // for (int i = 0; i < pets.Count; i++)
|
| | | // {
|
| | | // fightPower += GetPetFightPower(pets[i].id, pets[i].lv);
|
| | | // }
|
| | | // return fightPower;
|
| | | // }
|
| | |
|
| | | // public int GetPetFightPower(int id, int lv)
|
| | | // {
|
| | | // var fightPower = 0;
|
| | | // var config = PetInfoConfig.Get(id);
|
| | | // var _init_fightpower = 0;
|
| | | // int.TryParse(config.InitFightPower, out _init_fightpower);
|
| | | // fightPower += _init_fightpower;
|
| | | // PetInfoConfig.GetPetSkills(id, lv, true, ref skills);
|
| | | // var petUpConfig = PetClassCostConfig.GetPetIdAndRank(id, lv);
|
| | | // if (petUpConfig != null)
|
| | | // {
|
| | | // Dictionary<int, int> propertyDict = new Dictionary<int, int>();
|
| | | // propertyDict.Add(77, petUpConfig.AtkAdd);
|
| | | // propertyDict.Add(78, petUpConfig.AtkAdd);
|
| | | // fightPower += UIHelper.GetFightPower(propertyDict);// Mathf.FloorToInt(petUpConfig.AtkAdd * 2.5f);
|
| | | // }
|
| | | // for (int i = 0; i < skills.Count; i++)
|
| | | // {
|
| | | // var skillConfig = SkillConfig.Get(skills[i]);
|
| | | // if (skillConfig != null)
|
| | | // {
|
| | | // fightPower += skillConfig.FightPower;
|
| | | // }
|
| | | // }
|
| | | // return fightPower;
|
| | | // }
|
| | |
|
| | | // public int GetPetAtkProperty(List<PetInfo> pets)
|
| | | // {
|
| | | // var atk = 0;
|
| | | // for (int i = 0; i < pets.Count; i++)
|
| | | // {
|
| | | // atk += GetPetAtkProperty(pets[i].id, pets[i].lv, pets);
|
| | | // }
|
| | | // return atk;
|
| | | // }
|
| | |
|
| | | // public int GetPetAtkProperty(int id, int lv, List<PetInfo> pets)
|
| | | // {
|
| | | // var atk = 0;
|
| | | // var petUpConfig = PetClassCostConfig.GetPetIdAndRank(id, lv);
|
| | | // if (petUpConfig != null)
|
| | | // {
|
| | | // atk += petUpConfig.AtkAdd;
|
| | | // }
|
| | | // PetInfoConfig.GetPetSkills(id, lv, true, ref skills);
|
| | | // for (int i = 0; i < skills.Count; i++)
|
| | | // {
|
| | | // atk += GetPetAtkSkillProperty(skills[i], pets);
|
| | | // }
|
| | | // return atk;
|
| | | // }
|
| | |
|
| | | // public int GetPetAtkSkillProperty(int skillId, List<PetInfo> pets)
|
| | | // {
|
| | | // SkillConfig skillconfig = SkillConfig.Get(skillId);
|
| | | // if (skillconfig == null)
|
| | | // {
|
| | | // return 0;
|
| | | // }
|
| | | // if (skillconfig.Effect1 == (int)RidingAndPetActivationModel.RidingAndPetProperty.PetAttack)
|
| | | // {
|
| | | // return GetPetAttack(skillconfig.EffectValue11, skillconfig.EffectValue12, pets);
|
| | | // }
|
| | | // else if (skillconfig.Effect2 == (int)RidingAndPetActivationModel.RidingAndPetProperty.PetAttack)
|
| | | // {
|
| | | // return GetPetAttack(skillconfig.EffectValue21, skillconfig.EffectValue22, pets);
|
| | | // }
|
| | | // else if (skillconfig.Effect3 == (int)RidingAndPetActivationModel.RidingAndPetProperty.PetAttack)
|
| | | // {
|
| | | // return GetPetAttack(skillconfig.EffectValue31, skillconfig.EffectValue32, pets);
|
| | | // }
|
| | | // else if (skillconfig.Effect4 == (int)RidingAndPetActivationModel.RidingAndPetProperty.PetAttack)
|
| | | // {
|
| | | // return GetPetAttack(skillconfig.EffectValue41, skillconfig.EffectValue42, pets);
|
| | | // }
|
| | | // else if (skillconfig.Effect5 == (int)RidingAndPetActivationModel.RidingAndPetProperty.PetAttack)
|
| | | // {
|
| | | // return GetPetAttack(skillconfig.EffectValue51, skillconfig.EffectValue52, pets);
|
| | | // }
|
| | | // else if (skillconfig.Effect6 == (int)RidingAndPetActivationModel.RidingAndPetProperty.PetAttack)
|
| | | // {
|
| | | // return GetPetAttack(skillconfig.EffectValue61, skillconfig.EffectValue62, pets);
|
| | | // }
|
| | | // return 0;
|
| | | // }
|
| | |
|
| | | // int GetPetAttack(int quality, int value, List<PetInfo> pets)
|
| | | // {
|
| | | // var atk = 0;
|
| | | // for (int i = 0; i < pets.Count; i++)
|
| | | // {
|
| | | // var config = PetInfoConfig.Get(pets[i].id);
|
| | | // if (config != null && config.Quality == quality)
|
| | | // {
|
| | | // var petUpConfig = PetClassCostConfig.GetPetIdAndRank(pets[i].id, pets[i].lv);
|
| | | // atk += petUpConfig == null ? 0 : petUpConfig.AtkAdd;
|
| | | // }
|
| | | // }
|
| | | // return (int)(atk * ((float)value / 10000));
|
| | | // }
|
| | |
|
| | | public bool viewPetStone { get; set; }
|
| | | #endregion
|
| | |
|
| | | //尽量不要用第一个参数viewtype做判断,容易出错,比如同时发送两个不同的viewPlayerType请求的时候
|
| | | private void ShowRoleParticulars(ViewPlayerData _viewPlayerData, int playerID)
|
| | | {
|
| | | // if (viewPlayerType == (int)ViewPlayerType.viewPlayerEquip || viewPlayerType == (int)ViewPlayerType.viewCrossPlayerEquip)
|
| | | // {
|
| | | // if (!WindowCenter.Instance.IsOpen<RoleParticularsWin>())
|
| | | // {
|
| | | // RoleParticularsWin.viewType = viewPlayerType;
|
| | | // WindowCenter.Instance.Open<RoleParticularsWin>();
|
| | | // }
|
| | | // }
|
| | | // else if (viewPlayerType == (int)ViewPlayerType.viewPlayerFightPower || viewPlayerType == (int)ViewPlayerType.viewCrossPlayerFightPower)
|
| | | // {
|
| | | // if (!WindowCenter.Instance.IsOpen<ViewFuncPowerWin>())
|
| | | // {
|
| | | // WindowCenter.Instance.Open<ViewFuncPowerWin>();
|
| | | // }
|
| | | // }
|
| | |
|
| | | |
| | | OnRevPackage?.Invoke(viewPlayerType, playerID, _viewPlayerData);
|
| | | viewPlayerType = -1;
|
| | | }
|
| | |
|
| | | public class ViewPlayerData
|
| | | {
|
| | | public RolePropData rolePropData;
|
| | | public RolePlusData rolePlusData;
|
| | |
|
| | | public DateTime getTime;
|
| | |
|
| | | public int GetEquipSuitLevel()
|
| | | {
|
| | | return 0;
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | | [Serializable]
|
| | | public struct RolePropData
|
| | | {
|
| | | public int PlayerID;
|
| | | public int LV;
|
| | | public int RealmLV;
|
| | | public string Name;
|
| | | public string FamilyName;
|
| | | public int Job;
|
| | | public int FamilyID;
|
| | | public long FightPower;
|
| | | public int TitleID;
|
| | | public int ServerID;
|
| | | public int FamilyEmblemID;
|
| | | public int Face; //脸型
|
| | | public int FacePic; //脸型外框
|
| | | }
|
| | |
|
| | |
|
| | | public class RolePlusData
|
| | | {
|
| | | Dictionary<int, ulong> fightPowerDict = new Dictionary<int, ulong>();
|
| | | Dictionary<int, int> godWeaponDict = new Dictionary<int, int>();
|
| | | Dictionary<int, int> treasureDict = new Dictionary<int, int>();
|
| | | public List<HorseInfo> horses = new List<HorseInfo>();
|
| | | public List<PetInfo> pets = new List<PetInfo>();
|
| | | public List<AlchemyDrug> alchemyDrugs = new List<AlchemyDrug>();
|
| | | public int Horse { get; private set; } //改为等级
|
| | | public int Pet { get; private set; }
|
| | |
|
| | | public int AtkSpeed { get; private set; }
|
| | | public int Rune { get; private set; }
|
| | | public int orangeEquipsCount { get; private set; }
|
| | | public int totalGemsLevel { get; private set; }
|
| | | public int totalEquipWashLevel { get; private set; }
|
| | | public int totalEquipStarLevel { get; private set; }
|
| | | public int totalEquipStrengthLevel { get; private set; }
|
| | | public int totalEquipEvolveLevel { get; private set; }
|
| | | public int totalSkillLevel { get; private set; }
|
| | |
|
| | | public ulong GetFightPower(int type)
|
| | | {
|
| | | if (fightPowerDict != null && fightPowerDict.ContainsKey(type))
|
| | | {
|
| | | return fightPowerDict[type];
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | public void AnalysisRolePlusData(string jsonStr)
|
| | | {
|
| | | try
|
| | | {
|
| | | var jsonData = JsonMapper.ToObject(jsonStr);
|
| | | if (jsonData.Keys.Contains("FightPowerDict"))
|
| | | {
|
| | | var jsonPlusData = jsonData["FightPowerDict"];
|
| | | if (jsonPlusData.IsObject)
|
| | | {
|
| | | foreach (var key in jsonPlusData.Keys)
|
| | | {
|
| | | int type = int.Parse(key);
|
| | | fightPowerDict.Add(type, ulong.Parse(jsonPlusData[key].ToString()));
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | // if (jsonData.Keys.Contains("Pet"))
|
| | | // {
|
| | | // var jsonPlusData = jsonData["Pet"];
|
| | | // if (jsonPlusData.IsObject)
|
| | | // {
|
| | | // foreach (var _key in jsonPlusData.Keys)
|
| | | // {
|
| | | // if (_key.Equals("AtkSpeed"))
|
| | | // {
|
| | | // AtkSpeed = int.Parse(jsonPlusData[_key].ToString());
|
| | | // }
|
| | | // else if (_key.Equals("PetLV"))
|
| | | // {
|
| | | // var petInfos = JsonMapper.ToObject<PetInfo[]>(jsonPlusData[_key].ToJson());
|
| | | // if (petInfos != null && petInfos.Length > 0)
|
| | | // {
|
| | | // for (int i = 0; i < petInfos.Length; i++)
|
| | | // {
|
| | | // var petInfo = petInfos[i];
|
| | | // pets.Add(new PetInfo()
|
| | | // {
|
| | | // id = petInfo.id,
|
| | | // lv = petInfo.lv + 1,
|
| | | // });
|
| | | // }
|
| | | // }
|
| | | // }
|
| | | // }
|
| | | // pets.Sort(Compare);
|
| | | // }
|
| | | // Pet = pets.Count;
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // Pet = 0;
|
| | | // }
|
| | | |
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | Debug.Log(e.StackTrace);
|
| | | }
|
| | | }
|
| | |
|
| | | // int Compare(PetInfo x, PetInfo y)
|
| | | // {
|
| | | // var config_x = PetInfoConfig.Get(x.id);
|
| | | // var config_y = PetInfoConfig.Get(y.id);
|
| | | // if (config_x == null || config_y == null)
|
| | | // {
|
| | | // return 0;
|
| | | // }
|
| | | // return -config_x.Sort.CompareTo(config_y.Sort);
|
| | | // }
|
| | |
|
| | | // int Compare(HorseInfo x, HorseInfo y)
|
| | | // {
|
| | | // var config_x = HorseConfig.Get(x.id);
|
| | | // var config_y = HorseConfig.Get(y.id);
|
| | | // if (config_x == null || config_y == null)
|
| | | // {
|
| | | // return 0;
|
| | | // }
|
| | | // return -config_x.Sort.CompareTo(config_y.Sort);
|
| | | // }
|
| | | }
|
| | |
|
| | | public struct HorseInfo
|
| | | {
|
| | | public int id;
|
| | | public int lv;
|
| | | }
|
| | |
|
| | | public struct PetInfo
|
| | | {
|
| | | public int id;
|
| | | public int lv;
|
| | | }
|
| | |
|
| | | public struct AlchemyDrug
|
| | | {
|
| | | public int item;
|
| | | public int count;
|
| | | }
|
| | | }
|
| | |
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 10f0fd9d4033d03459f8b176ace9daa3 |
| | | timeCreated: 1511769062 |
| | | licenseType: Free |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |