MapConfig.cs 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. using System;
  2. using System.Collections.Generic;
  3. using MongoDB.Bson.Serialization.Attributes;
  4. using ProtoBuf;
  5. namespace ET
  6. {
  7. [ProtoContract]
  8. [Config]
  9. public partial class MapConfigCategory : ConfigSingleton<MapConfigCategory>, IMerge
  10. {
  11. [ProtoIgnore]
  12. [BsonIgnore]
  13. private Dictionary<int, MapConfig> dict = new Dictionary<int, MapConfig>();
  14. [BsonElement]
  15. [ProtoMember(1)]
  16. private List<MapConfig> list = new List<MapConfig>();
  17. public void Merge(object o)
  18. {
  19. MapConfigCategory s = o as MapConfigCategory;
  20. this.list.AddRange(s.list);
  21. }
  22. [ProtoAfterDeserialization]
  23. public void ProtoEndInit()
  24. {
  25. foreach (MapConfig config in list)
  26. {
  27. config.AfterEndInit();
  28. this.dict.Add(config.Id, config);
  29. }
  30. this.list.Clear();
  31. this.AfterEndInit();
  32. }
  33. public MapConfig Get(int id)
  34. {
  35. this.dict.TryGetValue(id, out MapConfig item);
  36. if (item == null)
  37. {
  38. throw new Exception($"配置找不到,配置表名: {nameof (MapConfig)},配置id: {id}");
  39. }
  40. return item;
  41. }
  42. public bool Contain(int id)
  43. {
  44. return this.dict.ContainsKey(id);
  45. }
  46. public Dictionary<int, MapConfig> GetAll()
  47. {
  48. return this.dict;
  49. }
  50. public MapConfig GetOne()
  51. {
  52. if (this.dict == null || this.dict.Count <= 0)
  53. {
  54. return null;
  55. }
  56. return this.dict.Values.GetEnumerator().Current;
  57. }
  58. }
  59. [ProtoContract]
  60. public partial class MapConfig: ProtoObject, IConfig
  61. {
  62. /// <summary>Id</summary>
  63. [ProtoMember(1)]
  64. public int Id { get; set; }
  65. /// <summary>名字</summary>
  66. [ProtoMember(2)]
  67. public string Name { get; set; }
  68. /// <summary>成色</summary>
  69. [ProtoMember(3)]
  70. public int Qcolor { get; set; }
  71. /// <summary>玩法类型</summary>
  72. [ProtoMember(4)]
  73. public int Type { get; set; }
  74. /// <summary>场景类型</summary>
  75. [ProtoMember(5)]
  76. public int AreaType { get; set; }
  77. /// <summary>地图模版id</summary>
  78. [ProtoMember(6)]
  79. public int TemplateID { get; set; }
  80. /// <summary>怪物强度</summary>
  81. [ProtoMember(7)]
  82. public string MonsterHard { get; set; }
  83. /// <summary>所属阵营</summary>
  84. [ProtoMember(8)]
  85. public int Race { get; set; }
  86. /// <summary>默认PK模式</summary>
  87. [ProtoMember(9)]
  88. public int Pktype { get; set; }
  89. /// <summary>是否允许改变PK模式</summary>
  90. [ProtoMember(10)]
  91. public int changePKtype { get; set; }
  92. /// <summary>是否无视PK红名规则</summary>
  93. [ProtoMember(11)]
  94. public int ignorePkRule { get; set; }
  95. /// <summary>是否可使用回城功能</summary>
  96. [ProtoMember(12)]
  97. public int canBeTrans { get; set; }
  98. /// <summary>地图等级</summary>
  99. [ProtoMember(13)]
  100. public int MapLevel { get; set; }
  101. /// <summary>掉线后返回地图ID</summary>
  102. [ProtoMember(14)]
  103. public int DisConnToMapID { get; set; }
  104. /// <summary>复活地图ID</summary>
  105. [ProtoMember(15)]
  106. public int RevivedMapID { get; set; }
  107. /// <summary>生命周期</summary>
  108. [ProtoMember(16)]
  109. public int LifeTime { get; set; }
  110. /// <summary>人数软上限</summary>
  111. [ProtoMember(17)]
  112. public int FullPlayers { get; set; }
  113. /// <summary>人数硬上限</summary>
  114. [ProtoMember(18)]
  115. public int MaxPlayers { get; set; }
  116. /// <summary>状态分界值</summary>
  117. [ProtoMember(19)]
  118. public int Boundary { get; set; }
  119. /// <summary>需要等级</summary>
  120. [ProtoMember(20)]
  121. public int ReqLevel { get; set; }
  122. /// <summary>限制等级</summary>
  123. [ProtoMember(21)]
  124. public int Levellimit { get; set; }
  125. /// <summary>需要VIP等级</summary>
  126. [ProtoMember(22)]
  127. public string ReqVip { get; set; }
  128. /// <summary>需要任务ID</summary>
  129. [ProtoMember(23)]
  130. public int ReqQuestId { get; set; }
  131. /// <summary>可进入阵营</summary>
  132. [ProtoMember(24)]
  133. public int AllowedRace { get; set; }
  134. /// <summary>状态条件</summary>
  135. [ProtoMember(25)]
  136. public string ReqState { get; set; }
  137. /// <summary>状态值</summary>
  138. [ProtoMember(26)]
  139. public int StateValue { get; set; }
  140. /// <summary>开放策略</summary>
  141. [ProtoMember(27)]
  142. public int OpenRule { get; set; }
  143. /// <summary>开放日</summary>
  144. [ProtoMember(28)]
  145. public string OpenDate { get; set; }
  146. /// <summary>开始时间</summary>
  147. [ProtoMember(29)]
  148. public string BeginTime { get; set; }
  149. /// <summary>结束时间</summary>
  150. [ProtoMember(30)]
  151. public string EndTime { get; set; }
  152. /// <summary>关闭时强制传送到地图ID</summary>
  153. [ProtoMember(31)]
  154. public int ClosedToMapID { get; set; }
  155. /// <summary>进入是否扣除队员物品</summary>
  156. [ProtoMember(32)]
  157. public int ReqNotOnlyLeader { get; set; }
  158. /// <summary>进入需要物品Code</summary>
  159. [ProtoMember(33)]
  160. public string ReqItemCode { get; set; }
  161. /// <summary>进入需要物品数量</summary>
  162. [ProtoMember(34)]
  163. public int ReqItemCount { get; set; }
  164. /// <summary>进入后扣除物品数量</summary>
  165. [ProtoMember(35)]
  166. public int ReduceItemCount { get; set; }
  167. /// <summary>是否可以传送</summary>
  168. [ProtoMember(36)]
  169. public int AllowedTransfer { get; set; }
  170. /// <summary>传送消耗道具</summary>
  171. [ProtoMember(37)]
  172. public string CostItem { get; set; }
  173. /// <summary>传送消耗道具数量</summary>
  174. [ProtoMember(38)]
  175. public int CostItemNum { get; set; }
  176. /// <summary>扣除金币</summary>
  177. [ProtoMember(39)]
  178. public int CostGold { get; set; }
  179. /// <summary>随机宝箱出现概率</summary>
  180. [ProtoMember(40)]
  181. public int RandChestChance { get; set; }
  182. /// <summary>随机宝箱最大数量</summary>
  183. [ProtoMember(41)]
  184. public int MaxRandChest { get; set; }
  185. /// <summary>随机宝箱TC</summary>
  186. [ProtoMember(42)]
  187. public string RandChestTC { get; set; }
  188. /// <summary>场景小地图</summary>
  189. [ProtoMember(43)]
  190. public string MapName { get; set; }
  191. /// <summary>地图描述</summary>
  192. [ProtoMember(45)]
  193. public string MapDesc { get; set; }
  194. /// <summary>场景传送</summary>
  195. [ProtoMember(46)]
  196. public string Connect { get; set; }
  197. /// <summary>是否允许改变分配方式</summary>
  198. [ProtoMember(47)]
  199. public int IsChange { get; set; }
  200. /// <summary>默认分配模式</summary>
  201. [ProtoMember(48)]
  202. public int Distribution { get; set; }
  203. /// <summary>能否自动战斗</summary>
  204. [ProtoMember(49)]
  205. public int AutoFight { get; set; }
  206. /// <summary>能否吃药剂</summary>
  207. [ProtoMember(50)]
  208. public int UseAgent { get; set; }
  209. /// <summary>能否使用坐骑</summary>
  210. [ProtoMember(51)]
  211. public int RideMount { get; set; }
  212. /// <summary>能否携带宠物</summary>
  213. [ProtoMember(52)]
  214. public int TakePet { get; set; }
  215. /// <summary>是否重置状态</summary>
  216. [ProtoMember(53)]
  217. public int Recovery { get; set; }
  218. /// <summary>BOSS列表显示</summary>
  219. [ProtoMember(54)]
  220. public int BossInfoShow { get; set; }
  221. /// <summary>连杀时间间隔-毫秒</summary>
  222. [ProtoMember(55)]
  223. public int killInterval { get; set; }
  224. /// <summary>连杀满值重置</summary>
  225. [ProtoMember(56)]
  226. public int killFullNum { get; set; }
  227. /// <summary>连杀满值冷却-秒</summary>
  228. [ProtoMember(57)]
  229. public int killFullCollSec { get; set; }
  230. /// <summary>灵气点采集修为值</summary>
  231. [ProtoMember(58)]
  232. public int Cultivation { get; set; }
  233. /// <summary>地图是否有迷雾</summary>
  234. [ProtoMember(59)]
  235. public int IsFog { get; set; }
  236. /// <summary>副本通关时长</summary>
  237. [ProtoMember(60)]
  238. public int GameTime { get; set; }
  239. /// <summary>能否进行召唤</summary>
  240. [ProtoMember(61)]
  241. public int IsCall { get; set; }
  242. /// <summary>能否响应召唤</summary>
  243. [ProtoMember(62)]
  244. public int IsCanBeCall { get; set; }
  245. }
  246. }