Settings.cs 54 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341
  1. using Client.MirSounds;
  2. using Newtonsoft.Json;
  3. using Newtonsoft.Json.Linq;
  4. using Newtonsoft.Json.Serialization;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Diagnostics;
  8. using System.IO;
  9. using System.Linq;
  10. using System.Net;
  11. using System.Text;
  12. using System.Windows.Forms;
  13. namespace Client
  14. {
  15. class Settings
  16. {
  17. public const long CleanDelay = 10000; //600000
  18. public static int ScreenWidth = 1024, ScreenHeight = 768;
  19. // public static int ScreenWidth = 640, ScreenHeight = 480;
  20. private static string selfname = Process.GetCurrentProcess().ProcessName;
  21. private static InIReader Reader = new InIReader(selfname == "Mir3" ? @".\Mir3Config.ini" : @".\Mir3ConfigKF.ini");
  22. public static JObject update, shield;
  23. public static JArray games, updates, shields;
  24. public static bool isMustUpdate=false;
  25. public static string ServerID;
  26. public static List<ItemSetInfo> ItemSetInfos;
  27. private static bool _useTestConfig;
  28. internal static string ServerName;
  29. protected static byte[] GetFileData(string fileUrl, int pos = 0)
  30. {
  31. FileStream fs = new FileStream(fileUrl, FileMode.Open, FileAccess.Read);
  32. try
  33. {
  34. byte[] buff = new byte[fs.Length - pos];
  35. fs.Seek(pos, SeekOrigin.Begin);
  36. fs.Read(buff, 0, (int)fs.Length - pos);
  37. return buff;
  38. }
  39. catch (Exception ex)
  40. {
  41. return null;
  42. }
  43. finally
  44. {
  45. if (fs != null)
  46. {
  47. //关闭资源
  48. fs.Close();
  49. }
  50. }
  51. }
  52. public static void initConfig()
  53. {
  54. try
  55. {
  56. var str = HttpGet("http://106.54.24.45:5000/Servers", "");
  57. JObject servers = JObject.Parse(str);
  58. if (servers != null)
  59. {
  60. updates = JArray.Parse(servers["updates"].ToString());
  61. games = JArray.Parse(servers["games"].ToString());
  62. shields = JArray.Parse(games[0]["shields"].ToString());
  63. isMustUpdate= servers["isMustUpdate"].Value<bool>();
  64. }
  65. }
  66. catch (Exception)
  67. {
  68. try
  69. {
  70. var str = HttpGet("http://39.98.38.46:5000/Servers", "");
  71. JObject servers = JObject.Parse(str);
  72. if (servers != null)
  73. {
  74. updates = JArray.Parse(servers["updates"].ToString());
  75. games = JArray.Parse(servers["games"].ToString());
  76. shields = JArray.Parse(games[0]["shields"].ToString());
  77. isMustUpdate = servers["isMustUpdate"].Value<bool>();
  78. }
  79. }
  80. catch (Exception)
  81. {
  82. try
  83. {
  84. updates = JArray.Parse("[ \r\n {\r\n \"ServerID\": \"NU_Update_001\",\r\n \"ServerName\": \"更新001\",\r\n \"ServerType\": \"更新服务器\",\r\n \"ServerPort\": 80,\r\n \"IP\": \"http://39.98.38.46:80/path\",\r\n \"PatchFile\": \"PList.gz\",\r\n \"NeedLogin\": false,\r\n \"HideMode\": false,\r\n \"BackupPorts\": []\r\n }\r\n]");
  85. games = JArray.Parse("[\r\n {\r\n \"ServerID\": \"long1\",\r\n \"ServerName\": \"龙行大运\",\r\n \"shields\": [\r\n {\r\n \"ServerID\": \"Shield_393\",\r\n \"ServerName\": \"盾机303\",\r\n \"ServerType\": \"盾机\",\r\n \"ServerPort\": 17683,\r\n \"IP\": \"106.54.24.45\",\r\n \"HideMode\": false,\r\n \"BackupPorts\": [\r\n 17683\r\n ]\r\n }\r\n ]\r\n },\r\n {\r\n \"ServerID\": \"GAME009\",\r\n \"ServerName\": \"龙吟九霄\",\r\n \"shields\": [\r\n {\r\n \"ServerID\": \"Shield_304\",\r\n \"ServerName\": \"盾机301\",\r\n \"ServerType\": \"盾机\",\r\n \"ServerPort\": 19191,\r\n \"IP\": \"150.158.83.40\",\r\n \"HideMode\": false,\r\n \"BackupPorts\": [\r\n 19191\r\n ]\r\n }\r\n ]\r\n },\r\n {\r\n \"ServerID\": \"TEST001\",\r\n \"ServerName\": \"调试\",\r\n \"shields\": [\r\n {\r\n \"ServerID\": \"Shield_301\",\r\n \"ServerName\": \"盾机301\",\r\n \"ServerType\": \"盾机\",\r\n \"ServerPort\": 1121,\r\n \"IP\": \"127.0.0.1\",\r\n \"HideMode\": false,\r\n \"BackupPorts\": [\r\n 1121\r\n ]\r\n }\r\n ]\r\n }\r\n ]");
  86. shields = JArray.Parse(games[0]["shields"].ToString());
  87. isMustUpdate = true;
  88. }
  89. catch (Exception)
  90. {
  91. MessageBox.Show("服务器数据读取失败!");
  92. throw;
  93. }
  94. }
  95. }
  96. //var str = "{\r\n \"updates\": [\r\n {\r\n \"ServerID\": \"NU_Update_001\",\r\n \"ServerName\": \"更新001\",\r\n \"ServerType\": \"更新服务器\",\r\n \"ServerPort\": 80,\r\n \"IP\": \"http://101.34.74.225:80/\",\r\n \"PatchFile\": \"PList.gz\",\r\n \"NeedLogin\": false,\r\n \"HideMode\": false,\r\n \"BackupPorts\": []\r\n },\r\n {\r\n \"ServerID\": \"NU_Update_999\",\r\n \"ServerName\": \"首包更新服务器\",\r\n \"ServerType\": \"更新服务器\",\r\n \"ServerPort\": 80,\r\n \"IP\": \"http://101.34.74.225:80/\",\r\n \"PatchFile\": \"PList.gz\",\r\n \"NeedLogin\": false,\r\n \"HideMode\": false,\r\n \"BackupPorts\": []\r\n }\r\n ],\r\n \"games\": [\r\n {\r\n \"ServerID\": \"GAME009\",\r\n \"ServerName\": \"龙吟九霄\",\r\n \"shields\": [\r\n {\r\n \"ServerID\": \"Shield_301\",\r\n \"ServerName\": \"盾机301\",\r\n \"ServerType\": \"盾机\",\r\n \"ServerPort\": 1121,\r\n \"IP\": \"127.0.0.1\",\r\n \"HideMode\": false,\r\n \"BackupPorts\": [ 9991 ]\r\n }\r\n ]\r\n },\r\n {\r\n \"ServerID\": \"TEST001\",\r\n \"ServerName\": \"测试服\",\r\n \"shields\": [\r\n {\r\n \"ServerID\": \"Shield_301\",\r\n \"ServerName\": \"盾机301\",\r\n \"ServerType\": \"盾机\",\r\n \"ServerPort\": 9991,\r\n \"IP\": \"192.168.3.44\",\r\n \"HideMode\": false,\r\n \"BackupPorts\": [ 1121 ]\r\n }\r\n ]\r\n }\r\n ]\r\n}\r\n";
  97. //else
  98. //{
  99. // updates = JArray.Parse("[ \r\n {\r\n \"ServerID\": \"NU_Update_001\",\r\n \"ServerName\": \"更新001\",\r\n \"ServerType\": \"更新服务器\",\r\n \"ServerPort\": 80,\r\n \"IP\": \"http://101.34.74.225:80/\",\r\n \"PatchFile\": \"PList.gz\",\r\n \"NeedLogin\": false,\r\n \"HideMode\": false,\r\n \"BackupPorts\": []\r\n }\r\n]");
  100. // games = JArray.Parse("[{\"ServerID\": \"GAME009\",\"ServerName\": \"龙吟九霄\"},{\"ServerID\": \"GAME008\",\"ServerName\": \"诸神争锋\"},{\"ServerID\": \"TEST001\",\"ServerName\": \"测试服\"},{\"ServerID\": \"GAME007\",\"ServerName\": \"老区567合\"}]");
  101. // shields = JArray.Parse("[{\"ServerID\":\"Shield_301\",\"ServerName\":\"盾机301\",\"ServerType\":\"盾机\",\"ServerPort\":9991,\"IP\":\"127.0.0.1\",\"HideMode\":false,\"BackupPorts\":[9991]}]");
  102. // if (Debugger.IsAttached)
  103. // {
  104. // shields = JArray.Parse("[{\"ServerID\":\"Shield_301\",\"ServerName\":\"盾机301\",\"ServerType\":\"盾机\",\"ServerPort\":9991,\"IP\":\"127.0.0.1\",\"HideMode\":false,\"BackupPorts\":[9991]}]");
  105. // }
  106. // else
  107. // {
  108. // //shields = JArray.Parse("[{\"ServerID\":\"Shield_301\",\"ServerName\":\"盾机301\",\"ServerType\":\"盾机\",\"ServerPort\":9991,\"IP\":\"101.34.72.9\",\"HideMode\":false,\"BackupPorts\":[9991]}]");
  109. // shields = JArray.Parse("[{\"ServerID\":\"Shield_301\",\"ServerName\":\"盾机301\",\"ServerType\":\"盾机\",\"ServerPort\":9991,\"IP\":\"101.34.74.225\",\"HideMode\":false,\"BackupPorts\":[9991]}]");
  110. // //shields = JArray.Parse("[{\"ServerID\":\"Shield_301\",\"ServerName\":\"盾机301\",\"ServerType\":\"盾机\",\"ServerPort\":9991,\"IP\":\"127.0.0.1\",\"HideMode\":false,\"BackupPorts\":[9991]}]");
  111. // }
  112. //}
  113. }
  114. /// &lt;summary>
  115. /// 后台发送GET请求
  116. /// &lt;/summary>
  117. /// &lt;param name="url">服务器地址&lt;/param>
  118. /// &lt;param name="data">发送的数据&lt;/param>
  119. /// &lt;returns>&lt;/returns>
  120. public static string HttpGet(string url, string data)
  121. {
  122. try
  123. {
  124. //创建Get请求
  125. url = url + (data == "" ? "" : "?") + data;
  126. HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
  127. request.Method = "GET";
  128. request.ContentType = "text/html;charset=UTF-8";
  129. //接受返回来的数据
  130. HttpWebResponse response = (HttpWebResponse)request.GetResponse();
  131. Stream stream = response.GetResponseStream();
  132. StreamReader streamReader = new StreamReader(stream, Encoding.GetEncoding("utf-8"));
  133. string retString = streamReader.ReadToEnd();
  134. streamReader.Close();
  135. stream.Close();
  136. response.Close();
  137. return retString;
  138. }
  139. catch (Exception)
  140. {
  141. return "";
  142. }
  143. }
  144. public static bool UseTestConfig
  145. {
  146. get
  147. {
  148. return _useTestConfig;
  149. }
  150. set
  151. {
  152. //if (value == true)
  153. //{
  154. // Reader = new InIReader(@".\Mir2Test.ini");
  155. //}
  156. _useTestConfig = value;
  157. }
  158. }
  159. public const string DataPath = @".\Data\",
  160. MapPath = @".\Map\",
  161. SoundPath = @".\Sound\",
  162. ExtraDataPath = @".\Data\Extra\",
  163. ShadersPath = @".\Data\Shaders\",
  164. //MonsterPath = @".\Data\Monster\",
  165. Mir3MonsterPath = @".\Data\Mir3monster\",
  166. GatePath = @".\Data\Gate\",
  167. NPCPath = @".\Data\NPC\",
  168. //CArmourPath = @".\Data\CArmour\",
  169. //CWeaponPath = @".\Data\CWeapon\",
  170. //CHairPath = @".\Data\CHair\",
  171. // AArmourPath = @".\Data\AArmour\",
  172. //AWeaponPath = @".\Data\AWeapon\",
  173. // AHairPath = @".\Data\AHair\",
  174. // ARArmourPath = @".\Data\ARArmour\",
  175. // ARWeaponPath = @".\Data\ARWeapon\",
  176. // ARHairPath = @".\Data\ARHair\",
  177. // CHumEffectPath = @".\Data\CHumEffect\",
  178. // AHumEffectPath = @".\Data\AHumEffect\",
  179. // ARHumEffectPath = @".\Data\ARHumEffect\",
  180. MountPath = @".\Data\Mount\",
  181. FishingPath = @".\Data\Fishing\",
  182. PetsPath = @".\Data\Pet\",
  183. TransformPath = @".\Data\Transform\",
  184. TransformMountsPath = @".\Data\TransformRide2\",
  185. TransformEffectPath = @".\Data\TransformEffect\",
  186. TransformWeaponEffectPath = @".\Data\TransformWeaponEffect\";
  187. //Logs
  188. public static bool LogErrors = true;
  189. public static bool LogChat = true;
  190. public static int RemainingErrorLogs = 100;
  191. public static List<string> RememberAccount = new List<string>();
  192. public static void SaveRememberAccount()
  193. {
  194. Reader.Write("RememberAccount", "RememberAccount1", RememberAccount[0]);
  195. Reader.Write("RememberAccount", "RememberAccount2", RememberAccount[1]);
  196. Reader.Write("RememberAccount", "RememberAccount3", RememberAccount[2]);
  197. Reader.Write("RememberAccount", "RememberAccount4", RememberAccount[3]);
  198. Reader.Write("RememberAccount", "RememberAccount5", RememberAccount[4]);
  199. }
  200. //Graphics
  201. private static bool _FullScreen = false;
  202. public static bool FullScreen
  203. {
  204. get { return _FullScreen; }
  205. set
  206. {
  207. _FullScreen = value;
  208. Reader.Write("Graphics", "FullScreen", FullScreen);
  209. }
  210. }
  211. private static bool _AlwaysOnTop = false;
  212. public static bool AlwaysOnTop
  213. {
  214. get { return _AlwaysOnTop; }
  215. set
  216. {
  217. _AlwaysOnTop = value;
  218. Reader.Write("Graphics", "AlwaysOnTop", AlwaysOnTop);
  219. }
  220. }
  221. private static string _FontName = "Tahoma"; //"字体"
  222. public static string FontName
  223. {
  224. get { return _FontName; }
  225. set
  226. {
  227. _FontName = value;
  228. Reader.Write("Game", "FontName", FontName);
  229. }
  230. }
  231. private static bool _FPSCap = true;
  232. public static bool FPSCap
  233. {
  234. get { return _FPSCap; }
  235. set
  236. {
  237. _FPSCap = value;
  238. Reader.Write("Graphics", "FPSCap", FPSCap);
  239. }
  240. }
  241. public static string Resolution { get { return (ResolutionId < Resolutions.Length) ? Resolutions[ResolutionId] : "1280x1024"; } }
  242. public static int ResolutionWidth { get { return int.Parse(Resolution.Split('x')[0]); } }
  243. public static int ResolutionHeight { get { return int.Parse(Resolution.Split('x')[1]); } }
  244. public static string[] Resolutions = new string[] {
  245. "800x600",
  246. "1024x768",
  247. "1152x864",
  248. "1176x664",
  249. "1280x720",
  250. "1280x768",
  251. "1280x800",
  252. "1280x960",
  253. "1280x1024",
  254. "1360x768",
  255. "1440x900",
  256. "1600x900",
  257. "1600x1024",
  258. "1920x1080",
  259. "1920x1200",
  260. };
  261. private static int _ResolutionId = 1;
  262. public static int ResolutionId
  263. {
  264. get { return _ResolutionId; }
  265. set
  266. {
  267. _ResolutionId = value;
  268. Reader.Write("Graphics", "ResolutionId", ResolutionId);
  269. }
  270. }
  271. private static bool _DebugMode = true;
  272. public static bool DebugMode
  273. {
  274. get { return _DebugMode; }
  275. set
  276. {
  277. _DebugMode = value;
  278. Reader.Write("Graphics", "DebugMode", DebugMode);
  279. }
  280. }
  281. private static bool _ShowHealthBar = true;
  282. public static bool ShowHealthBar
  283. {
  284. get { return _ShowHealthBar; }
  285. set
  286. {
  287. _ShowHealthBar = value;
  288. Reader.Write("Graphics", "ShowHealthBar", ShowHealthBar);
  289. }
  290. }
  291. private static bool _ShowPlayerHP = true;
  292. public static bool ShowPlayerHP
  293. {
  294. get { return _ShowPlayerHP; }
  295. set
  296. {
  297. _ShowPlayerHP = value;
  298. Reader.Write("Graphics", "ShowPlayerHP", ShowPlayerHP);
  299. }
  300. }
  301. private static bool _ShowMonsterHP = true;
  302. public static bool ShowMonsterHP
  303. {
  304. get { return _ShowMonsterHP; }
  305. set
  306. {
  307. _ShowMonsterHP = value;
  308. Reader.Write("Graphics", "ShowMonsterHP", ShowMonsterHP);
  309. }
  310. }
  311. //Network
  312. public static bool UseConfig = true;
  313. public static string IPAddress = "127.0.0.1";//默认读取IP
  314. public static string IPAddress1;
  315. public static string IPAddress2;
  316. public static string IPAddress3;
  317. public static string IPAddress4;
  318. public static string IPAddress5;
  319. public static int partnum = 0; //记录登陆器选择的区服
  320. // public static string IPAddress = "221.226.58.2";//默认读取IP
  321. //五区IP列表
  322. public static string[] pt5iplist = new string[] { "139.196.37.152", "47.102.46.119" }; // ,"139.196.186.213","101.133.156.32"
  323. // public static string[] pt5iplist = new string[] { "106.15.89.40" };
  324. //三区IP列表
  325. public static string[] pt3iplist = new string[] { "47.116.112.48", "106.14.123.206" };
  326. // public static string[] pt3iplist = new string[] { "106.15.89.40" };
  327. //测试IP列表
  328. //public static string[] pt9iplist = new string[] { "172.19.11.3" };
  329. public static int Port = 7000;
  330. public const int TimeOut = 5000;
  331. //Sound
  332. public static int SoundOverLap = 3;
  333. private static byte _volume = 50;
  334. public static byte Volume
  335. {
  336. get { return _volume; }
  337. set
  338. {
  339. if (_volume == value) return;
  340. _volume = (byte)(value > 100 ? 100 : value);
  341. if (_volume == 0)
  342. SoundManager.Vol = -10000;
  343. else
  344. SoundManager.Vol = (int)(-3000 + (3000 * (_volume / 100M)));
  345. Reader.Write("Sound", "Volume", Volume);
  346. }
  347. }
  348. private static byte _musicVolume = 50;
  349. public static byte MusicVolume
  350. {
  351. get { return _musicVolume; }
  352. set
  353. {
  354. if (_musicVolume == value) return;
  355. _musicVolume = (byte)(value > 100 ? 100 : value);
  356. if (_musicVolume <= 0)
  357. SoundManager.MusicVol = -10000;
  358. else
  359. SoundManager.MusicVol = (int)(-3000 + (3000 * (_musicVolume / 100M)));
  360. Reader.Write("Sound", "Music", MusicVolume);
  361. }
  362. }
  363. //Game
  364. private static string _AccountID = "";
  365. public static string AccountID
  366. {
  367. get { return _AccountID; }
  368. set
  369. {
  370. _AccountID = value;
  371. Reader.Write("Game", "AccountID", AccountID);
  372. }
  373. }
  374. private static string _Password = "";
  375. public static string Password
  376. {
  377. get { return _Password; }
  378. set
  379. {
  380. _Password = value;
  381. Reader.Write("Game", "Password", Password);
  382. }
  383. }
  384. private static bool _SkillMode = false;
  385. public static bool SkillMode
  386. {
  387. get { return _SkillMode; }
  388. set
  389. {
  390. _SkillMode = value;
  391. Reader.Write("Game", "SkillMode", SkillMode);
  392. }
  393. }
  394. private static bool _SkillBar = false;
  395. public static bool SkillBar
  396. {
  397. get { return _SkillBar; }
  398. set
  399. {
  400. _SkillBar = value;
  401. Reader.Write("Game", "SkillBar", SkillBar);
  402. }
  403. }
  404. private static bool _ParticleShow = true;
  405. public static bool ParticleShow
  406. {
  407. get { return _ParticleShow; }
  408. set
  409. {
  410. _ParticleShow = value;
  411. Reader.Write("Game", "ParticleShow", ParticleShow);
  412. }
  413. }
  414. private static bool _Effect = true;
  415. public static bool Effect
  416. {
  417. get { return _Effect; }
  418. set
  419. {
  420. _Effect = value;
  421. Reader.Write("Game", "Effect", Effect);
  422. }
  423. }
  424. private static bool _LightEffect = false;
  425. public static bool LightEffect
  426. {
  427. get { return _LightEffect; }
  428. set
  429. {
  430. _LightEffect = value;
  431. Reader.Write("Game", "LightEffect", LightEffect);
  432. }
  433. }
  434. private static bool _LevelEffect = true;
  435. public static bool LevelEffect
  436. {
  437. get { return _LevelEffect; }
  438. set
  439. {
  440. _LevelEffect = value;
  441. Reader.Write("Game", "LevelEffect", LevelEffect);
  442. }
  443. }
  444. private static bool _DropView = true;
  445. public static bool DropView
  446. {
  447. get { return _DropView; }
  448. set
  449. {
  450. _DropView = value;
  451. Reader.Write("Game", "DropView", DropView);
  452. }
  453. }
  454. private static bool _NameView = true;
  455. public static bool NameView
  456. {
  457. get { return _NameView; }
  458. set
  459. {
  460. _NameView = value;
  461. Reader.Write("Game", "NameView", NameView);
  462. }
  463. }
  464. private static bool _MyNameView = true;
  465. public static bool MyNameView
  466. {
  467. get { return _MyNameView; }
  468. set
  469. {
  470. _MyNameView = value;
  471. Reader.Write("Game", "MyNameView", MyNameView);
  472. }
  473. }
  474. private static bool _PlayerNameView = true;
  475. public static bool PlayerNameView
  476. {
  477. get { return _PlayerNameView; }
  478. set
  479. {
  480. _PlayerNameView = value;
  481. Reader.Write("Game", "PlayerNameView", PlayerNameView);
  482. }
  483. }
  484. private static bool _MonsterNameView = true;
  485. public static bool MonsterNameView
  486. {
  487. get { return _MonsterNameView; }
  488. set
  489. {
  490. _MonsterNameView = value;
  491. Reader.Write("Game", "MonsterNameView", MonsterNameView);
  492. }
  493. }
  494. private static bool _NPCNameView = true;
  495. public static bool NPCNameView
  496. {
  497. get { return _NPCNameView; }
  498. set
  499. {
  500. _NPCNameView = value;
  501. Reader.Write("Game", "NPCNameView", NPCNameView);
  502. }
  503. }
  504. private static bool _HPView = true;
  505. public static bool HPView
  506. {
  507. get { return _HPView; }
  508. set
  509. {
  510. _HPView = value;
  511. Reader.Write("Game", "HPMPView", HPView);
  512. }
  513. }
  514. private static bool _TransparentChat = false;
  515. public static bool TransparentChat
  516. {
  517. get { return _TransparentChat; }
  518. set
  519. {
  520. _TransparentChat = value;
  521. Reader.Write("Game", "TransparentChat", TransparentChat);
  522. }
  523. }
  524. private static bool _DuraView = false;
  525. public static bool DuraView
  526. {
  527. get { return _DuraView; }
  528. set
  529. {
  530. _DuraView = value;
  531. Reader.Write("Game", "DuraWindow", DuraView);
  532. }
  533. }
  534. private static bool _DisplayDamage = true;
  535. public static bool DisplayDamage
  536. {
  537. get { return _DisplayDamage; }
  538. set
  539. {
  540. _DisplayDamage = value;
  541. Reader.Write("Game", "DisplayDamage", DisplayDamage);
  542. }
  543. }
  544. private static bool _TargetDead = true;
  545. public static bool TargetDead
  546. {
  547. get { return _TargetDead; }
  548. set
  549. {
  550. _TargetDead = value;
  551. Reader.Write("Game", "TargetDead", TargetDead);
  552. }
  553. }
  554. public static int[,] SkillbarLocation = new int[2, 2] { { 0, 0 }, { 216, 0 } };
  555. public void SaveSkillbarLocation()
  556. {
  557. for (int i = 0; i < SkillbarLocation.Length / 2; i++)
  558. {
  559. Reader.Write("Game", "Skillbar" + i.ToString() + "X", SkillbarLocation[i, 0]);
  560. Reader.Write("Game", "Skillbar" + i.ToString() + "Y", SkillbarLocation[i, 1]);
  561. }
  562. }
  563. //Quests
  564. public static int[] TrackedQuests = new int[5];
  565. //Chat
  566. private static bool _ShowNormalChat = true;
  567. public static bool ShowNormalChat
  568. {
  569. get { return _ShowNormalChat; }
  570. set
  571. {
  572. _ShowNormalChat = value;
  573. Reader.Write("Chat", "ShowNormalChat", ShowNormalChat);
  574. }
  575. }
  576. private static bool _ShowYellChat = true;
  577. public static bool ShowYellChat
  578. {
  579. get { return _ShowYellChat; }
  580. set
  581. {
  582. _ShowYellChat = value;
  583. Reader.Write("Chat", "ShowYellChat", ShowYellChat);
  584. }
  585. }
  586. private static bool _ShowWhisperChat = true;
  587. public static bool ShowWhisperChat
  588. {
  589. get { return _ShowWhisperChat; }
  590. set
  591. {
  592. _ShowWhisperChat = value;
  593. Reader.Write("Chat", "ShowWhisperChat", ShowWhisperChat);
  594. }
  595. }
  596. private static bool _ShowLoverChat = true;
  597. public static bool ShowLoverChat
  598. {
  599. get { return _ShowLoverChat; }
  600. set
  601. {
  602. _ShowLoverChat = value;
  603. Reader.Write("Chat", "ShowLoverChat", ShowLoverChat);
  604. }
  605. }
  606. private static bool _ShowMentorChat = true;
  607. public static bool ShowMentorChat
  608. {
  609. get { return _ShowMentorChat; }
  610. set
  611. {
  612. _ShowMentorChat = value;
  613. Reader.Write("Chat", "ShowMentorChat", ShowMentorChat);
  614. }
  615. }
  616. private static bool _ShowGroupChat = true;
  617. public static bool ShowGroupChat
  618. {
  619. get { return _ShowGroupChat; }
  620. set
  621. {
  622. _ShowGroupChat = value;
  623. Reader.Write("Chat", "ShowGroupChat", ShowGroupChat);
  624. }
  625. }
  626. private static bool _ShowGuildChat = true;
  627. public static bool ShowGuildChat
  628. {
  629. get { return _ShowGuildChat; }
  630. set
  631. {
  632. _ShowGuildChat = value;
  633. Reader.Write("Chat", "ShowGuildChat", ShowGuildChat);
  634. }
  635. }
  636. //Filters
  637. private static bool _FilterNormalChat = false;
  638. public static bool FilterNormalChat
  639. {
  640. get { return _FilterNormalChat; }
  641. set
  642. {
  643. _FilterNormalChat = value;
  644. Reader.Write("Filter", "FilterNormalChat", FilterNormalChat);
  645. }
  646. }
  647. private static bool _FilterWhisperChat = false;
  648. public static bool FilterWhisperChat
  649. {
  650. get { return _FilterWhisperChat; }
  651. set
  652. {
  653. _FilterWhisperChat = value;
  654. Reader.Write("Filter", "FilterWhisperChat", FilterWhisperChat);
  655. }
  656. }
  657. private static bool _FilterShoutChat = false;
  658. public static bool FilterShoutChat
  659. {
  660. get { return _FilterShoutChat; }
  661. set
  662. {
  663. _FilterShoutChat = value;
  664. Reader.Write("Filter", "FilterShoutChat", FilterShoutChat);
  665. }
  666. }
  667. private static bool _FilterSystemChat = false;
  668. public static bool FilterSystemChat
  669. {
  670. get { return _FilterSystemChat; }
  671. set
  672. {
  673. _FilterSystemChat = value;
  674. Reader.Write("Filter", "FilterSystemChat", FilterSystemChat);
  675. }
  676. }
  677. private static bool _FilterLoverChat = false;
  678. public static bool FilterLoverChat
  679. {
  680. get { return _FilterLoverChat; }
  681. set
  682. {
  683. _FilterLoverChat = value;
  684. Reader.Write("Filter", "FilterLoverChat", FilterLoverChat);
  685. }
  686. }
  687. private static bool _FilterMentorChat = false;
  688. public static bool FilterMentorChat
  689. {
  690. get { return _FilterMentorChat; }
  691. set
  692. {
  693. _FilterMentorChat = value;
  694. Reader.Write("Filter", "FilterMentorChat", FilterMentorChat);
  695. }
  696. }
  697. private static bool _FilterGroupChat = false;
  698. public static bool FilterGroupChat
  699. {
  700. get { return _FilterGroupChat; }
  701. set
  702. {
  703. _FilterGroupChat = value;
  704. Reader.Write("Filter", "FilterGroupChat", FilterGroupChat);
  705. }
  706. }
  707. private static bool _FilterGuildChat = false;
  708. public static bool FilterGuildChat
  709. {
  710. get { return _FilterGuildChat; }
  711. set
  712. {
  713. _FilterGuildChat = value;
  714. Reader.Write("Filter", "FilterGuildChat", FilterGuildChat);
  715. }
  716. }
  717. public static bool FilterShout3Chat = false; //世界喊话
  718. //AutoPatcher
  719. public static bool P_Patcher = true;
  720. public static string P_Host = @""; //ftp://127.0.0.1
  721. public static string P_PatchFileName = @"PList.gz";
  722. public static bool P_NeedLogin = false;
  723. public static string P_Login = string.Empty;
  724. public static string P_Password = string.Empty;
  725. public static string P_ServerName = string.Empty;
  726. public static string P_BrowserAddress = "";
  727. public static string P_Client = Application.StartupPath + "\\";
  728. public static bool P_AutoStart = false;
  729. //Reader.Write("Launcher", "Enabled", P_Patcher);
  730. // Reader.Write("Launcher", "Host", P_Host);
  731. // Reader.Write("Launcher", "PatchFile", P_PatchFileName);
  732. // Reader.Write("Launcher", "NeedLogin", P_NeedLogin);
  733. // Reader.Write("Launcher", "Login", P_Login);
  734. // Reader.Write("Launcher", "Password", P_Password);
  735. // Reader.Write("Launcher", "ServerName", P_ServerName);
  736. // Reader.Write("Launcher", "Browser", P_BrowserAddress);
  737. // Reader.Write("Launcher", "AutoStart", P_AutoStart);
  738. public static void Load()
  739. {
  740. if (!Directory.Exists(DataPath)) Directory.CreateDirectory(DataPath);
  741. if (!Directory.Exists(MapPath)) Directory.CreateDirectory(MapPath);
  742. if (!Directory.Exists(SoundPath)) Directory.CreateDirectory(SoundPath);
  743. if (File.Exists(@".\Data\ItemSetInfoConfig.json"))
  744. {
  745. ItemSetInfos = JsonConvert.DeserializeObject<List<ItemSetInfo>>(File.ReadAllText(@".\Data\ItemSetInfoConfig.json"));
  746. }
  747. //Graphics
  748. _FullScreen = Reader.ReadBoolean("Graphics", "FullScreen", FullScreen);
  749. _AlwaysOnTop = Reader.ReadBoolean("Graphics", "AlwaysOnTop", AlwaysOnTop);
  750. _ResolutionId = Reader.ReadInt32("Graphics", "ResolutionId", ResolutionId);
  751. _FPSCap = Reader.ReadBoolean("Graphics", "FPSCap", FPSCap);
  752. _DebugMode = Reader.ReadBoolean("Graphics", "DebugMode", DebugMode);
  753. _ShowHealthBar = Reader.ReadBoolean("Graphics", "ShowHealthBar", ShowHealthBar);
  754. _ShowPlayerHP = Reader.ReadBoolean("Graphics", "ShowPlayerHP", ShowPlayerHP);
  755. _ShowMonsterHP = Reader.ReadBoolean("Graphics", "ShowMonsterHP", ShowMonsterHP);
  756. //Network
  757. UseConfig = Reader.ReadBoolean("Network", "UseConfig", UseConfig);
  758. if (UseConfig)
  759. {
  760. IPAddress = Reader.ReadString("Network", "IPAddress", IPAddress);//读取客户配置文件中IP
  761. IPAddress1 = Reader.ReadString("Network", "IPAddress1", IPAddress1);
  762. IPAddress2 = Reader.ReadString("Network", "IPAddress2", IPAddress2);
  763. IPAddress3 = Reader.ReadString("Network", "IPAddress3", IPAddress3);
  764. IPAddress4 = Reader.ReadString("Network", "IPAddress4", IPAddress4);
  765. IPAddress5 = Reader.ReadString("Network", "IPAddress5", IPAddress5);
  766. Port = Reader.ReadInt32("Network", "Port", Port);
  767. }
  768. //Logs
  769. LogErrors = Reader.ReadBoolean("Logs", "LogErrors", LogErrors);
  770. LogChat = Reader.ReadBoolean("Logs", "LogChat", LogChat);
  771. //Sound
  772. Volume = Reader.ReadByte("Sound", "Volume", Volume);
  773. SoundOverLap = Reader.ReadInt32("Sound", "SoundOverLap", SoundOverLap);
  774. MusicVolume = Reader.ReadByte("Sound", "Music", MusicVolume);
  775. //Game
  776. _AccountID = Reader.ReadString("Game", "AccountID", AccountID);
  777. _Password = Reader.ReadString("Game", "Password", Password);
  778. _SkillMode = Reader.ReadBoolean("Game", "SkillMode", SkillMode);
  779. _SkillBar = Reader.ReadBoolean("Game", "SkillBar", SkillBar);
  780. _ParticleShow = Reader.ReadBoolean("Game", "_ParticleShow", _ParticleShow);
  781. //SkillSet = Reader.ReadBoolean("Game", "SkillSet", SkillSet);
  782. _Effect = Reader.ReadBoolean("Game", "Effect", Effect);
  783. _LightEffect = Reader.ReadBoolean("Game", "LightEffect", LightEffect);
  784. _LevelEffect = Reader.ReadBoolean("Game", "LevelEffect", Effect);
  785. _DropView = Reader.ReadBoolean("Game", "DropView", DropView);
  786. _NameView = Reader.ReadBoolean("Game", "NameView", NameView);
  787. _MyNameView = Reader.ReadBoolean("Game", "MyNameView", MyNameView);
  788. _PlayerNameView = Reader.ReadBoolean("Game", "PlayerNameView", PlayerNameView);
  789. _NPCNameView = Reader.ReadBoolean("Game", "NPCNameView", NPCNameView);
  790. _MonsterNameView = Reader.ReadBoolean("Game", "MonsterNameView", MonsterNameView);
  791. _HPView = Reader.ReadBoolean("Game", "HPMPView", HPView);
  792. _FontName = Reader.ReadString("Game", "FontName", FontName);
  793. _TransparentChat = Reader.ReadBoolean("Game", "TransparentChat", TransparentChat);
  794. _TargetDead = Reader.ReadBoolean("Game", "TargetDead", TargetDead);
  795. _DuraView = Reader.ReadBoolean("Game", "DuraWindow", DuraView);
  796. for (int i = 0; i < SkillbarLocation.Length / 2; i++)
  797. {
  798. SkillbarLocation[i, 0] = Reader.ReadInt32("Game", "Skillbar" + i.ToString() + "X", SkillbarLocation[i, 0]);
  799. SkillbarLocation[i, 1] = Reader.ReadInt32("Game", "Skillbar" + i.ToString() + "Y", SkillbarLocation[i, 1]);
  800. }
  801. //Chat
  802. _ShowNormalChat = Reader.ReadBoolean("Chat", "ShowNormalChat", ShowNormalChat);
  803. _ShowYellChat = Reader.ReadBoolean("Chat", "ShowYellChat", ShowYellChat);
  804. _ShowWhisperChat = Reader.ReadBoolean("Chat", "ShowWhisperChat", ShowWhisperChat);
  805. _ShowLoverChat = Reader.ReadBoolean("Chat", "ShowLoverChat", ShowLoverChat);
  806. _ShowMentorChat = Reader.ReadBoolean("Chat", "ShowMentorChat", ShowMentorChat);
  807. _ShowGroupChat = Reader.ReadBoolean("Chat", "ShowGroupChat", ShowGroupChat);
  808. _ShowGuildChat = Reader.ReadBoolean("Chat", "ShowGuildChat", ShowGuildChat);
  809. //Filters
  810. _FilterNormalChat = Reader.ReadBoolean("Filter", "FilterNormalChat", FilterNormalChat);
  811. _FilterWhisperChat = Reader.ReadBoolean("Filter", "FilterWhisperChat", FilterWhisperChat);
  812. _FilterShoutChat = Reader.ReadBoolean("Filter", "FilterShoutChat", FilterShoutChat);
  813. _FilterSystemChat = Reader.ReadBoolean("Filter", "FilterSystemChat", FilterSystemChat);
  814. _FilterLoverChat = Reader.ReadBoolean("Filter", "FilterLoverChat", FilterLoverChat);
  815. _FilterMentorChat = Reader.ReadBoolean("Filter", "FilterMentorChat", FilterMentorChat);
  816. _FilterGroupChat = Reader.ReadBoolean("Filter", "FilterGroupChat", FilterGroupChat);
  817. _FilterGuildChat = Reader.ReadBoolean("Filter", "FilterGuildChat", FilterGuildChat);
  818. RememberAccount.Add(Reader.ReadString("RememberAccount", "RememberAccount1", ""));
  819. RememberAccount.Add(Reader.ReadString("RememberAccount", "RememberAccount2", ""));
  820. RememberAccount.Add(Reader.ReadString("RememberAccount", "RememberAccount3", ""));
  821. RememberAccount.Add(Reader.ReadString("RememberAccount", "RememberAccount4", ""));
  822. RememberAccount.Add(Reader.ReadString("RememberAccount", "RememberAccount5", ""));
  823. //AutoPatcher
  824. //P_Patcher = Reader.ReadBoolean("Launcher", "Enabled", P_Patcher);
  825. //P_Host = Reader.ReadString("Launcher", "Host", P_Host);
  826. //P_PatchFileName = Reader.ReadString("Launcher", "PatchFile", P_PatchFileName);
  827. //P_NeedLogin = Reader.ReadBoolean("Launcher", "NeedLogin", P_NeedLogin);
  828. //P_Login = Reader.ReadString("Launcher", "Login", P_Login);
  829. //P_Password = Reader.ReadString("Launcher", "Password", P_Password);
  830. //P_AutoStart = Reader.ReadBoolean("Launcher", "AutoStart", P_AutoStart);
  831. //P_ServerName = Reader.ReadString("Launcher", "ServerName", P_ServerName);
  832. // P_BrowserAddress = Reader.ReadString("Launcher", "Browser", P_BrowserAddress);读取配置文件中网站
  833. if (!P_Host.EndsWith("/")) P_Host += "/";
  834. if (P_Host.StartsWith("www.", StringComparison.OrdinalIgnoreCase)) P_Host = P_Host.Insert(0, "http://");
  835. //if (P_BrowserAddress.StartsWith("www.", StringComparison.OrdinalIgnoreCase)) P_BrowserAddress = P_BrowserAddress.Insert(0, "http://");
  836. //Auxsetup
  837. // HPItemIndexed= Reader.ReadInt32("Auxsetup", "HPItemIndexed" ,HPItemIndexed);
  838. // MPItemIndexed = Reader.ReadInt32("Auxsetup", "MPItemIndexed", MPItemIndexed);
  839. }
  840. public static void LoadTrackedQuests(string Charname)
  841. {
  842. //Quests
  843. for (int i = 0; i < TrackedQuests.Length; i++)
  844. {
  845. TrackedQuests[i] = Reader.ReadInt32("Q-" + Charname, "Quest-" + i.ToString(), -1);
  846. }
  847. }
  848. public static void SaveTrackedQuests(string Charname)
  849. {
  850. //Quests
  851. for (int i = 0; i < TrackedQuests.Length; i++)
  852. {
  853. Reader.Write("Q-" + Charname, "Quest-" + i.ToString(), TrackedQuests[i]);
  854. }
  855. }
  856. #region AuxSetup
  857. public static string Charname;
  858. //Auxsetup
  859. private static bool _EnableAutoHpRecover = false;
  860. public static bool EnableAutoHpRecover
  861. {
  862. get { return _EnableAutoHpRecover; }
  863. set
  864. {
  865. _EnableAutoHpRecover = value;
  866. Reader.Write("A-" + Charname, "EnableAutoHpRecover", EnableAutoHpRecover);
  867. }
  868. }
  869. private static int _AutoHpRecoverRate = 5;
  870. public static int AutoHpRecoverRate
  871. {
  872. get { return _AutoHpRecoverRate; }
  873. set
  874. {
  875. _AutoHpRecoverRate = value;
  876. Reader.Write("A-" + Charname, "AutoHpRecoverRate", AutoHpRecoverRate);
  877. }
  878. }
  879. private static bool _EnableAutoMpRecover = false;
  880. public static bool EnableAutoMpRecover
  881. {
  882. get { return _EnableAutoMpRecover; }
  883. set
  884. {
  885. _EnableAutoMpRecover = value;
  886. Reader.Write("A-" + Charname, "EnableAutoMpRecover", EnableAutoMpRecover);
  887. }
  888. }
  889. private static int _AutoMpRecoverRate = 5;
  890. public static int AutoMpRecoverRate
  891. {
  892. get { return _AutoMpRecoverRate; }
  893. set
  894. {
  895. _AutoMpRecoverRate = value;
  896. Reader.Write("A-" + Charname, "AutoMpRecoverRate", AutoMpRecoverRate);
  897. }
  898. }
  899. public static List<int> UnAutoUseItemIds = new List<int>();
  900. public static List<bool> LockTargetSpells = new List<bool>();
  901. public static void SaveUnAutoUseItemIds()
  902. {
  903. Reader.Write("A-" + Charname, "UnAutoUseItemIds", string.Join(",", UnAutoUseItemIds));
  904. }
  905. public static void SaveLockTargetSpells()
  906. {
  907. Reader.Write("A-" + Charname, "LockTargetSpells", string.Join(",", LockTargetSpells));
  908. }
  909. private static bool _EnableAutoShield = false;
  910. public static bool EnableAutoShield
  911. {
  912. get { return _EnableAutoShield; }
  913. set
  914. {
  915. _EnableAutoShield = value;
  916. Reader.Write("A-" + Charname, "EnableAutoShield", EnableAutoShield);
  917. }
  918. }
  919. private static bool _EnableAutoFaHuan = false;
  920. public static bool EnableAutoFaHuan
  921. {
  922. get { return _EnableAutoFaHuan; }
  923. set
  924. {
  925. _EnableAutoFaHuan = value;
  926. Reader.Write("A-" + Charname, "EnableAutoFaHuan", EnableAutoFaHuan);
  927. }
  928. }
  929. private static bool _EnableAutoKuangSha = false;
  930. public static bool EnableAutoKuangSha
  931. {
  932. get { return _EnableAutoKuangSha; }
  933. set
  934. {
  935. _EnableAutoKuangSha = value;
  936. Reader.Write("A-" + Charname, "EnableAutoKuangSha", EnableAutoKuangSha);
  937. }
  938. }
  939. private static bool _EnableAutoTieBuShan = false;
  940. public static bool EnableAutoTieBuShan
  941. {
  942. get { return _EnableAutoTieBuShan; }
  943. set
  944. {
  945. _EnableAutoTieBuShan = value;
  946. Reader.Write("A-" + Charname, "EnableAutoTieBuShan", EnableAutoTieBuShan);
  947. }
  948. }
  949. private static bool _EnableAutoSkillExecise = false;
  950. public static bool EnableAutoSkillExecise
  951. {
  952. get { return _EnableAutoSkillExecise; }
  953. set
  954. {
  955. _EnableAutoSkillExecise = value;
  956. Reader.Write("A-" + Charname, "EnableAutoSkillExecise", EnableAutoSkillExecise);
  957. }
  958. }
  959. //默认使用剑法
  960. private static bool _EnableAutoSwordSkill = false;
  961. public static bool EnableAutoSwordSkill
  962. {
  963. get { return _EnableAutoSwordSkill; }
  964. set
  965. {
  966. _EnableAutoSwordSkill = value;
  967. Reader.Write("A-" + Charname, "EnableAutoSwordSkill", EnableAutoSwordSkill);
  968. }
  969. }
  970. private static int _AutoSwordSkillIndex = 0;
  971. public static int AutoSwordSkillIndex
  972. {
  973. get { return _AutoSwordSkillIndex; }
  974. set
  975. {
  976. _AutoSwordSkillIndex = value;
  977. Reader.Write("A-" + Charname, "AutoSwordSkillIndex", AutoSwordSkillIndex);
  978. }
  979. }
  980. private static int _AutoSkillExeciseKey = 0;
  981. public static int AutoSkillExeciseKey
  982. {
  983. get { return _AutoSkillExeciseKey; }
  984. set
  985. {
  986. _AutoSkillExeciseKey = value;
  987. Reader.Write("A-" + Charname, "AutoSkillExeciseKey", AutoSkillExeciseKey);
  988. }
  989. }
  990. private static bool _EnableAutoRepeatSkill = false;
  991. public static bool EnableAutoRepeatSkill
  992. {
  993. get { return _EnableAutoRepeatSkill; }
  994. set
  995. {
  996. _EnableAutoRepeatSkill = value;
  997. Reader.Write("A-" + Charname, "EnableAutoRepeatSkill", EnableAutoRepeatSkill);
  998. }
  999. }
  1000. //中键快捷施法
  1001. private static bool _EnableMiddleKeySkill = false;
  1002. public static bool EnableMiddleKeySkill
  1003. {
  1004. get { return _EnableMiddleKeySkill; }
  1005. set
  1006. {
  1007. _EnableMiddleKeySkill = value;
  1008. Reader.Write("A-" + Charname, "EnableMiddleKeySkill", EnableMiddleKeySkill);
  1009. }
  1010. }
  1011. private static int _MiddleKeySkill = 0;
  1012. public static int MiddleKeySkill
  1013. {
  1014. get { return _MiddleKeySkill; }
  1015. set
  1016. {
  1017. _MiddleKeySkill = value;
  1018. Reader.Write("A-" + Charname, "MiddleKeySkill", MiddleKeySkill);
  1019. }
  1020. }
  1021. private static bool _EnableMarriageTeleport = false;
  1022. public static bool EnableMarriageTeleport
  1023. {
  1024. get { return _EnableMarriageTeleport; }
  1025. set
  1026. {
  1027. _EnableMarriageTeleport = value;
  1028. Reader.Write("A-" + Charname, "EnableMarriageTeleport", EnableMarriageTeleport);
  1029. }
  1030. }
  1031. private static bool _EnableSkillOnMount = false;
  1032. public static bool EnableSkillOnMount
  1033. {
  1034. get { return _EnableSkillOnMount; }
  1035. set
  1036. {
  1037. _EnableSkillOnMount = value;
  1038. Reader.Write("A-" + Charname, "EnableSkillOnMount", EnableSkillOnMount);
  1039. }
  1040. }
  1041. //替换火墙外观
  1042. private static bool _EnableFireWallReplace = false;
  1043. public static bool EnableFireWallReplace
  1044. {
  1045. get { return _EnableFireWallReplace; }
  1046. set
  1047. {
  1048. _EnableFireWallReplace = value;
  1049. Reader.Write("A-" + Charname, "EnableFireWallReplace", EnableFireWallReplace);
  1050. }
  1051. }
  1052. private static int _FireWallReplaceKey = 0;
  1053. public static int FireWallReplaceKey
  1054. {
  1055. get { return _FireWallReplaceKey; }
  1056. set
  1057. {
  1058. _FireWallReplaceKey = value;
  1059. Reader.Write("A-" + Charname, "FireWallReplaceKey", FireWallReplaceKey);
  1060. }
  1061. }
  1062. private static int _Shenshengzjfu = -1; //具体绑定那个符
  1063. public static int Shenshengzjfu
  1064. {
  1065. get { return _Shenshengzjfu; }
  1066. set
  1067. {
  1068. _Shenshengzjfu = value;
  1069. Reader.Write("A-" + Charname, "AUX-Shenshengzjfu", Shenshengzjfu);
  1070. }
  1071. }
  1072. private static int _youlindunfu = -1;
  1073. public static int youlindunfu
  1074. {
  1075. get { return _youlindunfu; }
  1076. set
  1077. {
  1078. _youlindunfu = value;
  1079. Reader.Write("A-" + Charname, "AUX-youlindunfu", youlindunfu);
  1080. }
  1081. }
  1082. private static int _qiangmozhenfafu = -1; //具体绑定那个符
  1083. public static int qiangmozhenfafu
  1084. {
  1085. get { return _qiangmozhenfafu; }
  1086. set
  1087. {
  1088. _qiangmozhenfafu = value;
  1089. Reader.Write("A-" + Charname, "AUX-qiangmozhenfafu", qiangmozhenfafu);
  1090. }
  1091. }
  1092. private static int _menghuqiansshifu = -1; //具体绑定那个符
  1093. public static int menghuqiansshifu
  1094. {
  1095. get { return _menghuqiansshifu; }
  1096. set
  1097. {
  1098. _menghuqiansshifu = value;
  1099. Reader.Write("A-" + Charname, "AUX-menghuqiansshifu", menghuqiansshifu);
  1100. }
  1101. }
  1102. private static int _zhaohuankuloufu = -1; //具体绑定那个符
  1103. public static int zhaohuankuloufu
  1104. {
  1105. get { return _zhaohuankuloufu; }
  1106. set
  1107. {
  1108. _zhaohuankuloufu = value;
  1109. Reader.Write("A-" + Charname, "AUX-zhaohuankuloufu", zhaohuankuloufu);
  1110. }
  1111. }
  1112. private static int _chaojizhaohuankuloufu = -1; //具体绑定那个符
  1113. public static int chaojizhaohuankuloufu
  1114. {
  1115. get { return _chaojizhaohuankuloufu; }
  1116. set
  1117. {
  1118. _chaojizhaohuankuloufu = value;
  1119. Reader.Write("A-" + Charname, "AUX-chaojizhaohuankuloufu", chaojizhaohuankuloufu);
  1120. }
  1121. }
  1122. private static int _zhaohuashenshoufu = -1; //具体绑定那个符
  1123. public static int zhaohuashenshoufu
  1124. {
  1125. get { return _zhaohuashenshoufu; }
  1126. set
  1127. {
  1128. _zhaohuashenshoufu = value;
  1129. Reader.Write("A-" + Charname, "AUX-zhaohuashenshoufu", zhaohuashenshoufu);
  1130. }
  1131. }
  1132. private static int _shidushufu = -2; //具体绑定那个粉末
  1133. public static int shidushufu
  1134. {
  1135. get { return _shidushufu; }
  1136. set
  1137. {
  1138. _shidushufu = value;
  1139. Reader.Write("A-" + Charname, "AUX-shidushufu", shidushufu);
  1140. }
  1141. }
  1142. //自动发言
  1143. private static bool _EnableAutoMessage = false;
  1144. public static bool EnableAutoMessage
  1145. {
  1146. get { return _EnableAutoMessage; }
  1147. set
  1148. {
  1149. _EnableAutoMessage = value;
  1150. Reader.Write("A-" + Charname, "AUX-EnableAutoMessage", EnableAutoMessage);
  1151. }
  1152. }
  1153. private static string _AutoMessageStr = "";
  1154. public static string AutoMessageStr
  1155. {
  1156. get { return _AutoMessageStr; }
  1157. set
  1158. {
  1159. _AutoMessageStr = value;
  1160. Reader.Write("A-" + Charname, "AUX-AutoMessageStr", AutoMessageStr);
  1161. }
  1162. }
  1163. private static int _AutoMessageChannel = 0;
  1164. public static int AutoMessageChannel
  1165. {
  1166. get { return _AutoMessageChannel; }
  1167. set
  1168. {
  1169. _AutoMessageChannel = value;
  1170. Reader.Write("A-" + Charname, "AUX-AutoMessageChannel", AutoMessageChannel);
  1171. }
  1172. }
  1173. private static int _AutoMessageGap = 120;
  1174. public static int AutoMessageGap
  1175. {
  1176. get { return _AutoMessageGap; }
  1177. set
  1178. {
  1179. _AutoMessageGap = value;
  1180. Reader.Write("A-" + Charname, "AUX-AutoMessageGap", AutoMessageGap);
  1181. }
  1182. }
  1183. public static int MarriageTeleportGap = 6;
  1184. public static void LoadAuxsetup(string charname)
  1185. {
  1186. Charname = charname;
  1187. _Shenshengzjfu = Reader.ReadInt32("A-" + charname, "AUX-Shenshengzjfu", -1);
  1188. _youlindunfu = Reader.ReadInt32("A-" + charname, "AUX-youlindunfu", -1);
  1189. _menghuqiansshifu = Reader.ReadInt32("A-" + charname, "AUX-menghuqiansshifu", -1);
  1190. _qiangmozhenfafu = Reader.ReadInt32("A-" + charname, "AUX-qiangmozhenfafu", -1);
  1191. _chaojizhaohuankuloufu = Reader.ReadInt32("A-" + charname, "AUX-chaojizhaohuankuloufu", -1);
  1192. _zhaohuankuloufu = Reader.ReadInt32("A-" + charname, "AUX-zhaohuankuloufu", -1);
  1193. _zhaohuashenshoufu = Reader.ReadInt32("A-" + charname, "AUX-zhaohuashenshoufu", -1);
  1194. _shidushufu = Reader.ReadInt32("A-" + charname, "AUX-shidushufu", -2);
  1195. _EnableAutoMessage = Reader.ReadBoolean("A-" + charname, "AUX-EnableAutoMessage", false);
  1196. _AutoMessageStr = Reader.ReadString("A-" + charname, "AUX-AutoMessageStr", "");
  1197. _AutoMessageChannel = Reader.ReadInt32("A-" + charname, "AUX-AutoMessageChannel", 0);
  1198. _AutoMessageGap = Reader.ReadInt32("A-" + charname, "AUX-AutoMessageGap", 120);
  1199. _EnableAutoHpRecover = Reader.ReadBoolean("A-" + charname, "EnableAutoHpRecover", false);
  1200. _AutoHpRecoverRate = Reader.ReadInt32("A-" + charname, "AutoHpRecoverRate", 5);
  1201. _EnableAutoMpRecover = Reader.ReadBoolean("A-" + charname, "EnableAutoMpRecover", false);
  1202. _AutoMpRecoverRate = Reader.ReadInt32("A-" + charname, "AutoMpRecoverRate", 5);
  1203. var strUnAutoUseItemIds = Reader.ReadString("A-" + charname, "UnAutoUseItemIds", "");
  1204. UnAutoUseItemIds.Clear();
  1205. foreach (var str in strUnAutoUseItemIds.Split(','))
  1206. {
  1207. if (!string.IsNullOrEmpty(str))
  1208. {
  1209. UnAutoUseItemIds.Add(int.Parse(str));
  1210. }
  1211. }
  1212. var strLockTargetSpells = Reader.ReadString("A-" + charname, "LockTargetSpells", "False,False");
  1213. LockTargetSpells.Clear();
  1214. foreach (var str in strLockTargetSpells.Split(','))
  1215. {
  1216. if (!string.IsNullOrEmpty(str))
  1217. {
  1218. try
  1219. {
  1220. LockTargetSpells.Add(bool.Parse(str));
  1221. }
  1222. catch (Exception)
  1223. {
  1224. LockTargetSpells.Add(true);
  1225. }
  1226. }
  1227. }
  1228. while (LockTargetSpells.Count < 10)
  1229. {
  1230. LockTargetSpells.Add(true);
  1231. }
  1232. _EnableAutoShield = Reader.ReadBoolean("A-" + charname, "EnableAutoShield", false);
  1233. _EnableAutoFaHuan = Reader.ReadBoolean("A-" + charname, "EnableAutoFaHuan", false);
  1234. _EnableAutoKuangSha = Reader.ReadBoolean("A-" + charname, "EnableAutoKuangSha", false);
  1235. _EnableAutoTieBuShan = Reader.ReadBoolean("A-" + charname, "EnableAutoTieBuShan", false);
  1236. _EnableAutoSwordSkill = Reader.ReadBoolean("A-" + charname, "EnableAutoSwordSkill", false);
  1237. _EnableMiddleKeySkill = Reader.ReadBoolean("A-" + charname, "EnableMiddleKeySkill", false);
  1238. _EnableMarriageTeleport = Reader.ReadBoolean("A-" + charname, "EnableMarriageTeleport", false);
  1239. _EnableSkillOnMount = Reader.ReadBoolean("A-" + charname, "EnableSkillOnMount", false);
  1240. _EnableFireWallReplace = Reader.ReadBoolean("A-" + charname, "EnableFireWallReplace", false);
  1241. _EnableAutoSkillExecise = Reader.ReadBoolean("A-" + charname, "EnableAutoSkillExecise", false);
  1242. _AutoSwordSkillIndex = Reader.ReadInt32("A-" + charname, "AutoSwordSkillIndex", 0);
  1243. _AutoSkillExeciseKey = Reader.ReadInt32("A-" + charname, "AutoSkillExeciseKey", 0);
  1244. _FireWallReplaceKey = Reader.ReadInt32("A-" + charname, "FireWallReplaceKey", 0);
  1245. _MiddleKeySkill = Reader.ReadInt32("A-" + charname, "MiddleKeySkill", 0);
  1246. _EnableAutoRepeatSkill = Reader.ReadBoolean("A-" + charname, "EnableAutoRepeatSkill", false);
  1247. }
  1248. #endregion
  1249. }
  1250. }