From f93c57bfd57f97e78c3a00a29f302f5e8c83cdee Mon Sep 17 00:00:00 2001
From: client_linchunjie <461730578@qq.com>
Date: 星期四, 18 十月 2018 21:43:03 +0800
Subject: [PATCH] 2158【1.2.0】猫耳聊天屏蔽逻辑优化
---
System/SystemSetting/HangUpSetModel.cs | 338 ++++++++++++++++++++++++++++----------------------------
1 files changed, 169 insertions(+), 169 deletions(-)
diff --git a/System/SystemSetting/HangUpSetModel.cs b/System/SystemSetting/HangUpSetModel.cs
index 62adf81..7dbb66c 100644
--- a/System/SystemSetting/HangUpSetModel.cs
+++ b/System/SystemSetting/HangUpSetModel.cs
@@ -1,169 +1,169 @@
-锘縰sing System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using TableConfig;
-using Snxxz.UI;
-
-public enum HangUpAutoBoolType
-{
- curFixedScreen = 0, //鍥哄畾灞�
- curFollowScreen, //璺熼殢灞�
- whiteEquip, //鐧借壊瑁呭
- purpleEquip,
- gem, //瀹濈煶
- drug, //鑽搧
- necklaces, //椤归摼銆佷粰鍣�
- coins, //閲戝竵
- other,
- isAutoDrop, //鏄惁鑷姩鎷惧彇
- isAutoHangUp, //鏄惁鎸傛満
- isAutoBuyDrug, //鏄惁鑷姩涔拌嵂
- isAutoSell, //鏄惁鑷姩鍑哄敭
- isAutoDevour,//鏄惁鑷姩鍚炲櫖
- isAutoReborn,//鏄惁鑷姩涔版椿
-}
-
-public class HangUpSetModel : Singleton<HangUpSetModel>
-{
- const string HpSet_Key = "HpSet";
- const string HangUpBoolSet_Key = "HangUpBoolSet";
- public int maxOfflinePluginTime { get; private set; }
-
- public HangUpSetModel()
- {
- maxOfflinePluginTime = int.Parse(ConfigManager.Instance.GetTemplate<FuncConfigConfig>("TJG").Numerical3);
- }
-
- #region 缂撳瓨鏁版嵁
- public float hpSet { get; private set; }
- public void GetLoginHpSet()
- {
- hpSet = SettingMgr.Instance.GetAccountSetFloatInfo(HpSet_Key, 90);
- }
-
- public Dictionary<HangUpAutoBoolType, bool> hangUpSetDict { get; private set; }
- public void GetLoginBoolSet()
- {
- hangUpSetDict = new Dictionary<HangUpAutoBoolType, bool>();
- for(int i = 0; i < 15; i++)
- {
- if(!hangUpSetDict.ContainsKey((HangUpAutoBoolType)i))
- {
- bool isOpen = SettingMgr.Instance.GetAccountSetBoolInfo(((HangUpAutoBoolType)i).ToString());
- hangUpSetDict.Add((HangUpAutoBoolType)i, isOpen);
- }
-
- }
- }
- #endregion
-
- #region 璁剧疆鍙傛暟
-
- public void SetHpSet(float value)
- {
- hpSet = value;
- SettingMgr.Instance.SetAccountSetStr(HpSet_Key, value.ToString());
- }
-
- public float GetHpSet()
- {
- return hpSet;
- }
-
- #endregion
-
- public void SetBoolSetStr(HangUpAutoBoolType dropType, bool isOpen)
- {
- SettingMgr.Instance.SetAccountSetStr(dropType.ToString(), isOpen.ToString());
-
- if (hangUpSetDict != null)
- {
- if (hangUpSetDict.ContainsKey(dropType))
- {
- hangUpSetDict[dropType] = isOpen;
- }
- }
-
- if (dropType == HangUpAutoBoolType.isAutoDevour || dropType == HangUpAutoBoolType.isAutoReborn)
- {
- SendSystemQuest();
- }
-
- if (isOpen)
- {
- switch (dropType)
- {
- case HangUpAutoBoolType.isAutoSell:
- SettingEffectMgr.Instance.RefreshBagItem();
- break;
- case HangUpAutoBoolType.isAutoDevour:
- SettingEffectMgr.Instance.RefreshBagItem();
- break;
- }
- }
- }
-
- public bool GetBool(HangUpAutoBoolType type)
- {
- if(hangUpSetDict != null)
- {
- bool isOpen = false;
- hangUpSetDict.TryGetValue(type, out isOpen);
- return isOpen;
- }
- else
- {
- return SettingMgr.Instance.GetAccountSetBoolInfo(type.ToString());
- }
-
- }
-
- private void SendSystemQuest()
- {
- CB204_tagCMSystem cB204_TagCMSystem = new CB204_tagCMSystem();
- byte autoEat = 0;
- byte autoReborn = 0;
- if (GetBool(HangUpAutoBoolType.isAutoDevour))
- {
- autoEat = 1;
- }
-
- if (GetBool(HangUpAutoBoolType.isAutoReborn))
- {
- autoReborn = 1;
- }
-
- cB204_TagCMSystem.AutoEat = autoEat;
- cB204_TagCMSystem.AutoReborn = autoReborn;
- GameNetSystem.Instance.SendInfo(cB204_TagCMSystem);
- }
-
-
- public int offlinePluginTime { get; private set; }
- public void SetOfflinePluginTime(int time)
- {
- offlinePluginTime = time;
- }
-
- public string GetOfflinePluginTimeStr()
- {
- TimeSpan timeSpan = TimeSpan.FromSeconds(offlinePluginTime);
- string s = "";
- if (timeSpan.Hours > 0)
- {
- s = Language.Get("ItemOverdue103", timeSpan.Hours);
- }
- if (timeSpan.Minutes > 0)
- {
- s = StringUtility.Contact(s, Language.Get("ItemOverdue104", timeSpan.Minutes));
- }
-
- if (s == "")
- {
- s = Language.Get("ItemOverdue104", 0);
- }
-
- return s;
- }
-}
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using TableConfig;
+using Snxxz.UI;
+
+public enum HangUpAutoBoolType
+{
+ curFixedScreen = 0, //鍥哄畾灞�
+ curFollowScreen, //璺熼殢灞�
+ whiteEquip, //鐧借壊瑁呭
+ purpleEquip,
+ gem, //瀹濈煶
+ drug, //鑽搧
+ necklaces, //椤归摼銆佷粰鍣�
+ coins, //閲戝竵
+ other,
+ isAutoDrop, //鏄惁鑷姩鎷惧彇
+ isAutoHangUp, //鏄惁鎸傛満
+ isAutoBuyDrug, //鏄惁鑷姩涔拌嵂
+ isAutoSell, //鏄惁鑷姩鍑哄敭
+ isAutoDevour,//鏄惁鑷姩鍚炲櫖
+ isAutoReborn,//鏄惁鑷姩涔版椿
+}
+
+public class HangUpSetModel : Singleton<HangUpSetModel>
+{
+ const string HpSet_Key = "HpSet";
+ const string HangUpBoolSet_Key = "HangUpBoolSet";
+ public int maxOfflinePluginTime { get; private set; }
+
+ public HangUpSetModel()
+ {
+ maxOfflinePluginTime = int.Parse(Config.Instance.Get<FuncConfigConfig>("TJG").Numerical3);
+ }
+
+ #region 缂撳瓨鏁版嵁
+ public float hpSet { get; private set; }
+ public void GetLoginHpSet()
+ {
+ hpSet = SettingMgr.Instance.GetAccountSetFloatInfo(HpSet_Key, 90);
+ }
+
+ public Dictionary<HangUpAutoBoolType, bool> hangUpSetDict { get; private set; }
+ public void GetLoginBoolSet()
+ {
+ hangUpSetDict = new Dictionary<HangUpAutoBoolType, bool>();
+ for(int i = 0; i < 15; i++)
+ {
+ if(!hangUpSetDict.ContainsKey((HangUpAutoBoolType)i))
+ {
+ bool isOpen = SettingMgr.Instance.GetAccountSetBoolInfo(((HangUpAutoBoolType)i).ToString());
+ hangUpSetDict.Add((HangUpAutoBoolType)i, isOpen);
+ }
+
+ }
+ }
+ #endregion
+
+ #region 璁剧疆鍙傛暟
+
+ public void SetHpSet(float value)
+ {
+ hpSet = value;
+ SettingMgr.Instance.SetAccountSetStr(HpSet_Key, value.ToString());
+ }
+
+ public float GetHpSet()
+ {
+ return hpSet;
+ }
+
+ #endregion
+
+ public void SetBoolSetStr(HangUpAutoBoolType dropType, bool isOpen)
+ {
+ SettingMgr.Instance.SetAccountSetStr(dropType.ToString(), isOpen.ToString());
+
+ if (hangUpSetDict != null)
+ {
+ if (hangUpSetDict.ContainsKey(dropType))
+ {
+ hangUpSetDict[dropType] = isOpen;
+ }
+ }
+
+ if (dropType == HangUpAutoBoolType.isAutoDevour || dropType == HangUpAutoBoolType.isAutoReborn)
+ {
+ SendSystemQuest();
+ }
+
+ if (isOpen)
+ {
+ switch (dropType)
+ {
+ case HangUpAutoBoolType.isAutoSell:
+ SettingEffectMgr.Instance.RefreshBagItem();
+ break;
+ case HangUpAutoBoolType.isAutoDevour:
+ SettingEffectMgr.Instance.RefreshBagItem();
+ break;
+ }
+ }
+ }
+
+ public bool GetBool(HangUpAutoBoolType type)
+ {
+ if(hangUpSetDict != null)
+ {
+ bool isOpen = false;
+ hangUpSetDict.TryGetValue(type, out isOpen);
+ return isOpen;
+ }
+ else
+ {
+ return SettingMgr.Instance.GetAccountSetBoolInfo(type.ToString());
+ }
+
+ }
+
+ private void SendSystemQuest()
+ {
+ CB204_tagCMSystem cB204_TagCMSystem = new CB204_tagCMSystem();
+ byte autoEat = 0;
+ byte autoReborn = 0;
+ if (GetBool(HangUpAutoBoolType.isAutoDevour))
+ {
+ autoEat = 1;
+ }
+
+ if (GetBool(HangUpAutoBoolType.isAutoReborn))
+ {
+ autoReborn = 1;
+ }
+
+ cB204_TagCMSystem.AutoEat = autoEat;
+ cB204_TagCMSystem.AutoReborn = autoReborn;
+ GameNetSystem.Instance.SendInfo(cB204_TagCMSystem);
+ }
+
+
+ public int offlinePluginTime { get; private set; }
+ public void SetOfflinePluginTime(int time)
+ {
+ offlinePluginTime = time;
+ }
+
+ public string GetOfflinePluginTimeStr()
+ {
+ TimeSpan timeSpan = TimeSpan.FromSeconds(offlinePluginTime);
+ string s = "";
+ if (timeSpan.Hours > 0)
+ {
+ s = Language.Get("ItemOverdue103", timeSpan.Hours);
+ }
+ if (timeSpan.Minutes > 0)
+ {
+ s = StringUtility.Contact(s, Language.Get("ItemOverdue104", timeSpan.Minutes));
+ }
+
+ if (s == "")
+ {
+ s = Language.Get("ItemOverdue104", 0);
+ }
+
+ return s;
+ }
+}
--
Gitblit v1.8.0