123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341 |
- using Client.MirSounds;
- using Newtonsoft.Json;
- using Newtonsoft.Json.Linq;
- using Newtonsoft.Json.Serialization;
- using System;
- using System.Collections.Generic;
- using System.Diagnostics;
- using System.IO;
- using System.Linq;
- using System.Net;
- using System.Text;
- using System.Windows.Forms;
- namespace Client
- {
- class Settings
- {
- public const long CleanDelay = 10000; //600000
- public static int ScreenWidth = 1024, ScreenHeight = 768;
- // public static int ScreenWidth = 640, ScreenHeight = 480;
- private static string selfname = Process.GetCurrentProcess().ProcessName;
- private static InIReader Reader = new InIReader(selfname == "Mir3" ? @".\Mir3Config.ini" : @".\Mir3ConfigKF.ini");
- public static JObject update, shield;
- public static JArray games, updates, shields;
- public static bool isMustUpdate=false;
- public static string ServerID;
- public static List<ItemSetInfo> ItemSetInfos;
- private static bool _useTestConfig;
- internal static string ServerName;
- protected static byte[] GetFileData(string fileUrl, int pos = 0)
- {
- FileStream fs = new FileStream(fileUrl, FileMode.Open, FileAccess.Read);
- try
- {
- byte[] buff = new byte[fs.Length - pos];
- fs.Seek(pos, SeekOrigin.Begin);
- fs.Read(buff, 0, (int)fs.Length - pos);
- return buff;
- }
- catch (Exception ex)
- {
- return null;
- }
- finally
- {
- if (fs != null)
- {
- //关闭资源
- fs.Close();
- }
- }
- }
- public static void initConfig()
- {
- try
- {
- var str = HttpGet("http://106.54.24.45:5000/Servers", "");
- JObject servers = JObject.Parse(str);
- if (servers != null)
- {
- updates = JArray.Parse(servers["updates"].ToString());
- games = JArray.Parse(servers["games"].ToString());
- shields = JArray.Parse(games[0]["shields"].ToString());
- isMustUpdate= servers["isMustUpdate"].Value<bool>();
- }
- }
- catch (Exception)
- {
- try
- {
- var str = HttpGet("http://39.98.38.46:5000/Servers", "");
- JObject servers = JObject.Parse(str);
- if (servers != null)
- {
- updates = JArray.Parse(servers["updates"].ToString());
- games = JArray.Parse(servers["games"].ToString());
- shields = JArray.Parse(games[0]["shields"].ToString());
- isMustUpdate = servers["isMustUpdate"].Value<bool>();
- }
- }
- catch (Exception)
- {
- try
- {
- 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]");
- 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 ]");
- shields = JArray.Parse(games[0]["shields"].ToString());
- isMustUpdate = true;
- }
- catch (Exception)
- {
- MessageBox.Show("服务器数据读取失败!");
- throw;
- }
- }
- }
- //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";
- //else
- //{
- // 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]");
- // games = JArray.Parse("[{\"ServerID\": \"GAME009\",\"ServerName\": \"龙吟九霄\"},{\"ServerID\": \"GAME008\",\"ServerName\": \"诸神争锋\"},{\"ServerID\": \"TEST001\",\"ServerName\": \"测试服\"},{\"ServerID\": \"GAME007\",\"ServerName\": \"老区567合\"}]");
- // shields = JArray.Parse("[{\"ServerID\":\"Shield_301\",\"ServerName\":\"盾机301\",\"ServerType\":\"盾机\",\"ServerPort\":9991,\"IP\":\"127.0.0.1\",\"HideMode\":false,\"BackupPorts\":[9991]}]");
- // if (Debugger.IsAttached)
- // {
- // shields = JArray.Parse("[{\"ServerID\":\"Shield_301\",\"ServerName\":\"盾机301\",\"ServerType\":\"盾机\",\"ServerPort\":9991,\"IP\":\"127.0.0.1\",\"HideMode\":false,\"BackupPorts\":[9991]}]");
- // }
- // else
- // {
- // //shields = JArray.Parse("[{\"ServerID\":\"Shield_301\",\"ServerName\":\"盾机301\",\"ServerType\":\"盾机\",\"ServerPort\":9991,\"IP\":\"101.34.72.9\",\"HideMode\":false,\"BackupPorts\":[9991]}]");
- // shields = JArray.Parse("[{\"ServerID\":\"Shield_301\",\"ServerName\":\"盾机301\",\"ServerType\":\"盾机\",\"ServerPort\":9991,\"IP\":\"101.34.74.225\",\"HideMode\":false,\"BackupPorts\":[9991]}]");
- // //shields = JArray.Parse("[{\"ServerID\":\"Shield_301\",\"ServerName\":\"盾机301\",\"ServerType\":\"盾机\",\"ServerPort\":9991,\"IP\":\"127.0.0.1\",\"HideMode\":false,\"BackupPorts\":[9991]}]");
- // }
- //}
- }
- /// <summary>
- /// 后台发送GET请求
- /// </summary>
- /// <param name="url">服务器地址</param>
- /// <param name="data">发送的数据</param>
- /// <returns></returns>
- public static string HttpGet(string url, string data)
- {
- try
- {
- //创建Get请求
- url = url + (data == "" ? "" : "?") + data;
- HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
- request.Method = "GET";
- request.ContentType = "text/html;charset=UTF-8";
- //接受返回来的数据
- HttpWebResponse response = (HttpWebResponse)request.GetResponse();
- Stream stream = response.GetResponseStream();
- StreamReader streamReader = new StreamReader(stream, Encoding.GetEncoding("utf-8"));
- string retString = streamReader.ReadToEnd();
- streamReader.Close();
- stream.Close();
- response.Close();
- return retString;
- }
- catch (Exception)
- {
- return "";
- }
- }
- public static bool UseTestConfig
- {
- get
- {
- return _useTestConfig;
- }
- set
- {
- //if (value == true)
- //{
- // Reader = new InIReader(@".\Mir2Test.ini");
- //}
- _useTestConfig = value;
- }
- }
- public const string DataPath = @".\Data\",
- MapPath = @".\Map\",
- SoundPath = @".\Sound\",
- ExtraDataPath = @".\Data\Extra\",
- ShadersPath = @".\Data\Shaders\",
- //MonsterPath = @".\Data\Monster\",
- Mir3MonsterPath = @".\Data\Mir3monster\",
- GatePath = @".\Data\Gate\",
- NPCPath = @".\Data\NPC\",
- //CArmourPath = @".\Data\CArmour\",
- //CWeaponPath = @".\Data\CWeapon\",
- //CHairPath = @".\Data\CHair\",
- // AArmourPath = @".\Data\AArmour\",
- //AWeaponPath = @".\Data\AWeapon\",
- // AHairPath = @".\Data\AHair\",
- // ARArmourPath = @".\Data\ARArmour\",
- // ARWeaponPath = @".\Data\ARWeapon\",
- // ARHairPath = @".\Data\ARHair\",
- // CHumEffectPath = @".\Data\CHumEffect\",
- // AHumEffectPath = @".\Data\AHumEffect\",
- // ARHumEffectPath = @".\Data\ARHumEffect\",
- MountPath = @".\Data\Mount\",
- FishingPath = @".\Data\Fishing\",
- PetsPath = @".\Data\Pet\",
- TransformPath = @".\Data\Transform\",
- TransformMountsPath = @".\Data\TransformRide2\",
- TransformEffectPath = @".\Data\TransformEffect\",
- TransformWeaponEffectPath = @".\Data\TransformWeaponEffect\";
- //Logs
- public static bool LogErrors = true;
- public static bool LogChat = true;
- public static int RemainingErrorLogs = 100;
- public static List<string> RememberAccount = new List<string>();
- public static void SaveRememberAccount()
- {
- Reader.Write("RememberAccount", "RememberAccount1", RememberAccount[0]);
- Reader.Write("RememberAccount", "RememberAccount2", RememberAccount[1]);
- Reader.Write("RememberAccount", "RememberAccount3", RememberAccount[2]);
- Reader.Write("RememberAccount", "RememberAccount4", RememberAccount[3]);
- Reader.Write("RememberAccount", "RememberAccount5", RememberAccount[4]);
- }
- //Graphics
- private static bool _FullScreen = false;
- public static bool FullScreen
- {
- get { return _FullScreen; }
- set
- {
- _FullScreen = value;
- Reader.Write("Graphics", "FullScreen", FullScreen);
- }
- }
- private static bool _AlwaysOnTop = false;
- public static bool AlwaysOnTop
- {
- get { return _AlwaysOnTop; }
- set
- {
- _AlwaysOnTop = value;
- Reader.Write("Graphics", "AlwaysOnTop", AlwaysOnTop);
- }
- }
- private static string _FontName = "Tahoma"; //"字体"
- public static string FontName
- {
- get { return _FontName; }
- set
- {
- _FontName = value;
- Reader.Write("Game", "FontName", FontName);
- }
- }
- private static bool _FPSCap = true;
- public static bool FPSCap
- {
- get { return _FPSCap; }
- set
- {
- _FPSCap = value;
- Reader.Write("Graphics", "FPSCap", FPSCap);
- }
- }
-
- public static string Resolution { get { return (ResolutionId < Resolutions.Length) ? Resolutions[ResolutionId] : "1280x1024"; } }
- public static int ResolutionWidth { get { return int.Parse(Resolution.Split('x')[0]); } }
- public static int ResolutionHeight { get { return int.Parse(Resolution.Split('x')[1]); } }
- public static string[] Resolutions = new string[] {
- "800x600",
- "1024x768",
- "1152x864",
- "1176x664",
- "1280x720",
- "1280x768",
- "1280x800",
- "1280x960",
- "1280x1024",
- "1360x768",
- "1440x900",
- "1600x900",
- "1600x1024",
- "1920x1080",
- "1920x1200",
- };
- private static int _ResolutionId = 1;
- public static int ResolutionId
- {
- get { return _ResolutionId; }
- set
- {
- _ResolutionId = value;
- Reader.Write("Graphics", "ResolutionId", ResolutionId);
- }
- }
- private static bool _DebugMode = true;
- public static bool DebugMode
- {
- get { return _DebugMode; }
- set
- {
- _DebugMode = value;
- Reader.Write("Graphics", "DebugMode", DebugMode);
- }
- }
- private static bool _ShowHealthBar = true;
- public static bool ShowHealthBar
- {
- get { return _ShowHealthBar; }
- set
- {
- _ShowHealthBar = value;
- Reader.Write("Graphics", "ShowHealthBar", ShowHealthBar);
- }
- }
- private static bool _ShowPlayerHP = true;
- public static bool ShowPlayerHP
- {
- get { return _ShowPlayerHP; }
- set
- {
- _ShowPlayerHP = value;
- Reader.Write("Graphics", "ShowPlayerHP", ShowPlayerHP);
- }
- }
- private static bool _ShowMonsterHP = true;
- public static bool ShowMonsterHP
- {
- get { return _ShowMonsterHP; }
- set
- {
- _ShowMonsterHP = value;
- Reader.Write("Graphics", "ShowMonsterHP", ShowMonsterHP);
- }
- }
- //Network
- public static bool UseConfig = true;
- public static string IPAddress = "127.0.0.1";//默认读取IP
- public static string IPAddress1;
- public static string IPAddress2;
- public static string IPAddress3;
- public static string IPAddress4;
- public static string IPAddress5;
- public static int partnum = 0; //记录登陆器选择的区服
- // public static string IPAddress = "221.226.58.2";//默认读取IP
- //五区IP列表
- public static string[] pt5iplist = new string[] { "139.196.37.152", "47.102.46.119" }; // ,"139.196.186.213","101.133.156.32"
- // public static string[] pt5iplist = new string[] { "106.15.89.40" };
- //三区IP列表
- public static string[] pt3iplist = new string[] { "47.116.112.48", "106.14.123.206" };
- // public static string[] pt3iplist = new string[] { "106.15.89.40" };
- //测试IP列表
- //public static string[] pt9iplist = new string[] { "172.19.11.3" };
- public static int Port = 7000;
- public const int TimeOut = 5000;
- //Sound
- public static int SoundOverLap = 3;
- private static byte _volume = 50;
- public static byte Volume
- {
- get { return _volume; }
- set
- {
- if (_volume == value) return;
- _volume = (byte)(value > 100 ? 100 : value);
- if (_volume == 0)
- SoundManager.Vol = -10000;
- else
- SoundManager.Vol = (int)(-3000 + (3000 * (_volume / 100M)));
- Reader.Write("Sound", "Volume", Volume);
- }
- }
- private static byte _musicVolume = 50;
- public static byte MusicVolume
- {
- get { return _musicVolume; }
- set
- {
- if (_musicVolume == value) return;
- _musicVolume = (byte)(value > 100 ? 100 : value);
- if (_musicVolume <= 0)
- SoundManager.MusicVol = -10000;
- else
- SoundManager.MusicVol = (int)(-3000 + (3000 * (_musicVolume / 100M)));
- Reader.Write("Sound", "Music", MusicVolume);
- }
- }
- //Game
- private static string _AccountID = "";
- public static string AccountID
- {
- get { return _AccountID; }
- set
- {
- _AccountID = value;
- Reader.Write("Game", "AccountID", AccountID);
- }
- }
- private static string _Password = "";
- public static string Password
- {
- get { return _Password; }
- set
- {
- _Password = value;
- Reader.Write("Game", "Password", Password);
- }
- }
- private static bool _SkillMode = false;
- public static bool SkillMode
- {
- get { return _SkillMode; }
- set
- {
- _SkillMode = value;
- Reader.Write("Game", "SkillMode", SkillMode);
- }
- }
- private static bool _SkillBar = false;
- public static bool SkillBar
- {
- get { return _SkillBar; }
- set
- {
- _SkillBar = value;
- Reader.Write("Game", "SkillBar", SkillBar);
- }
- }
- private static bool _ParticleShow = true;
- public static bool ParticleShow
- {
- get { return _ParticleShow; }
- set
- {
- _ParticleShow = value;
- Reader.Write("Game", "ParticleShow", ParticleShow);
- }
- }
- private static bool _Effect = true;
- public static bool Effect
- {
- get { return _Effect; }
- set
- {
- _Effect = value;
- Reader.Write("Game", "Effect", Effect);
- }
- }
- private static bool _LightEffect = false;
- public static bool LightEffect
- {
- get { return _LightEffect; }
- set
- {
- _LightEffect = value;
- Reader.Write("Game", "LightEffect", LightEffect);
- }
- }
- private static bool _LevelEffect = true;
- public static bool LevelEffect
- {
- get { return _LevelEffect; }
- set
- {
- _LevelEffect = value;
- Reader.Write("Game", "LevelEffect", LevelEffect);
- }
- }
- private static bool _DropView = true;
- public static bool DropView
- {
- get { return _DropView; }
- set
- {
- _DropView = value;
- Reader.Write("Game", "DropView", DropView);
- }
- }
- private static bool _NameView = true;
- public static bool NameView
- {
- get { return _NameView; }
- set
- {
- _NameView = value;
- Reader.Write("Game", "NameView", NameView);
- }
- }
- private static bool _MyNameView = true;
- public static bool MyNameView
- {
- get { return _MyNameView; }
- set
- {
- _MyNameView = value;
- Reader.Write("Game", "MyNameView", MyNameView);
- }
- }
- private static bool _PlayerNameView = true;
- public static bool PlayerNameView
- {
- get { return _PlayerNameView; }
- set
- {
- _PlayerNameView = value;
- Reader.Write("Game", "PlayerNameView", PlayerNameView);
- }
- }
- private static bool _MonsterNameView = true;
- public static bool MonsterNameView
- {
- get { return _MonsterNameView; }
- set
- {
- _MonsterNameView = value;
- Reader.Write("Game", "MonsterNameView", MonsterNameView);
- }
- }
- private static bool _NPCNameView = true;
- public static bool NPCNameView
- {
- get { return _NPCNameView; }
- set
- {
- _NPCNameView = value;
- Reader.Write("Game", "NPCNameView", NPCNameView);
- }
- }
- private static bool _HPView = true;
- public static bool HPView
- {
- get { return _HPView; }
- set
- {
- _HPView = value;
- Reader.Write("Game", "HPMPView", HPView);
- }
- }
- private static bool _TransparentChat = false;
- public static bool TransparentChat
- {
- get { return _TransparentChat; }
- set
- {
- _TransparentChat = value;
- Reader.Write("Game", "TransparentChat", TransparentChat);
- }
- }
- private static bool _DuraView = false;
- public static bool DuraView
- {
- get { return _DuraView; }
- set
- {
- _DuraView = value;
- Reader.Write("Game", "DuraWindow", DuraView);
- }
- }
- private static bool _DisplayDamage = true;
- public static bool DisplayDamage
- {
- get { return _DisplayDamage; }
- set
- {
- _DisplayDamage = value;
- Reader.Write("Game", "DisplayDamage", DisplayDamage);
- }
- }
- private static bool _TargetDead = true;
- public static bool TargetDead
- {
- get { return _TargetDead; }
- set
- {
- _TargetDead = value;
- Reader.Write("Game", "TargetDead", TargetDead);
- }
- }
-
-
-
- public static int[,] SkillbarLocation = new int[2, 2] { { 0, 0 }, { 216, 0 } };
- public void SaveSkillbarLocation()
- {
- for (int i = 0; i < SkillbarLocation.Length / 2; i++)
- {
- Reader.Write("Game", "Skillbar" + i.ToString() + "X", SkillbarLocation[i, 0]);
- Reader.Write("Game", "Skillbar" + i.ToString() + "Y", SkillbarLocation[i, 1]);
- }
- }
- //Quests
- public static int[] TrackedQuests = new int[5];
- //Chat
- private static bool _ShowNormalChat = true;
- public static bool ShowNormalChat
- {
- get { return _ShowNormalChat; }
- set
- {
- _ShowNormalChat = value;
- Reader.Write("Chat", "ShowNormalChat", ShowNormalChat);
- }
- }
- private static bool _ShowYellChat = true;
- public static bool ShowYellChat
- {
- get { return _ShowYellChat; }
- set
- {
- _ShowYellChat = value;
- Reader.Write("Chat", "ShowYellChat", ShowYellChat);
- }
- }
- private static bool _ShowWhisperChat = true;
- public static bool ShowWhisperChat
- {
- get { return _ShowWhisperChat; }
- set
- {
- _ShowWhisperChat = value;
- Reader.Write("Chat", "ShowWhisperChat", ShowWhisperChat);
- }
- }
- private static bool _ShowLoverChat = true;
- public static bool ShowLoverChat
- {
- get { return _ShowLoverChat; }
- set
- {
- _ShowLoverChat = value;
- Reader.Write("Chat", "ShowLoverChat", ShowLoverChat);
- }
- }
- private static bool _ShowMentorChat = true;
- public static bool ShowMentorChat
- {
- get { return _ShowMentorChat; }
- set
- {
- _ShowMentorChat = value;
- Reader.Write("Chat", "ShowMentorChat", ShowMentorChat);
- }
- }
- private static bool _ShowGroupChat = true;
- public static bool ShowGroupChat
- {
- get { return _ShowGroupChat; }
- set
- {
- _ShowGroupChat = value;
- Reader.Write("Chat", "ShowGroupChat", ShowGroupChat);
- }
- }
- private static bool _ShowGuildChat = true;
- public static bool ShowGuildChat
- {
- get { return _ShowGuildChat; }
- set
- {
- _ShowGuildChat = value;
- Reader.Write("Chat", "ShowGuildChat", ShowGuildChat);
- }
- }
- //Filters
- private static bool _FilterNormalChat = false;
- public static bool FilterNormalChat
- {
- get { return _FilterNormalChat; }
- set
- {
- _FilterNormalChat = value;
- Reader.Write("Filter", "FilterNormalChat", FilterNormalChat);
- }
- }
- private static bool _FilterWhisperChat = false;
- public static bool FilterWhisperChat
- {
- get { return _FilterWhisperChat; }
- set
- {
- _FilterWhisperChat = value;
- Reader.Write("Filter", "FilterWhisperChat", FilterWhisperChat);
- }
- }
- private static bool _FilterShoutChat = false;
- public static bool FilterShoutChat
- {
- get { return _FilterShoutChat; }
- set
- {
- _FilterShoutChat = value;
- Reader.Write("Filter", "FilterShoutChat", FilterShoutChat);
- }
- }
- private static bool _FilterSystemChat = false;
- public static bool FilterSystemChat
- {
- get { return _FilterSystemChat; }
- set
- {
- _FilterSystemChat = value;
- Reader.Write("Filter", "FilterSystemChat", FilterSystemChat);
- }
- }
- private static bool _FilterLoverChat = false;
- public static bool FilterLoverChat
- {
- get { return _FilterLoverChat; }
- set
- {
- _FilterLoverChat = value;
- Reader.Write("Filter", "FilterLoverChat", FilterLoverChat);
- }
- }
- private static bool _FilterMentorChat = false;
- public static bool FilterMentorChat
- {
- get { return _FilterMentorChat; }
- set
- {
- _FilterMentorChat = value;
- Reader.Write("Filter", "FilterMentorChat", FilterMentorChat);
- }
- }
- private static bool _FilterGroupChat = false;
- public static bool FilterGroupChat
- {
- get { return _FilterGroupChat; }
- set
- {
- _FilterGroupChat = value;
- Reader.Write("Filter", "FilterGroupChat", FilterGroupChat);
- }
- }
- private static bool _FilterGuildChat = false;
- public static bool FilterGuildChat
- {
- get { return _FilterGuildChat; }
- set
- {
- _FilterGuildChat = value;
- Reader.Write("Filter", "FilterGuildChat", FilterGuildChat);
- }
- }
- public static bool FilterShout3Chat = false; //世界喊话
- //AutoPatcher
- public static bool P_Patcher = true;
- public static string P_Host = @""; //ftp://127.0.0.1
- public static string P_PatchFileName = @"PList.gz";
- public static bool P_NeedLogin = false;
- public static string P_Login = string.Empty;
- public static string P_Password = string.Empty;
- public static string P_ServerName = string.Empty;
- public static string P_BrowserAddress = "";
- public static string P_Client = Application.StartupPath + "\\";
- public static bool P_AutoStart = false;
- //Reader.Write("Launcher", "Enabled", P_Patcher);
- // Reader.Write("Launcher", "Host", P_Host);
- // Reader.Write("Launcher", "PatchFile", P_PatchFileName);
- // Reader.Write("Launcher", "NeedLogin", P_NeedLogin);
- // Reader.Write("Launcher", "Login", P_Login);
- // Reader.Write("Launcher", "Password", P_Password);
- // Reader.Write("Launcher", "ServerName", P_ServerName);
- // Reader.Write("Launcher", "Browser", P_BrowserAddress);
- // Reader.Write("Launcher", "AutoStart", P_AutoStart);
- public static void Load()
- {
- if (!Directory.Exists(DataPath)) Directory.CreateDirectory(DataPath);
- if (!Directory.Exists(MapPath)) Directory.CreateDirectory(MapPath);
- if (!Directory.Exists(SoundPath)) Directory.CreateDirectory(SoundPath);
- if (File.Exists(@".\Data\ItemSetInfoConfig.json"))
- {
- ItemSetInfos = JsonConvert.DeserializeObject<List<ItemSetInfo>>(File.ReadAllText(@".\Data\ItemSetInfoConfig.json"));
- }
- //Graphics
- _FullScreen = Reader.ReadBoolean("Graphics", "FullScreen", FullScreen);
- _AlwaysOnTop = Reader.ReadBoolean("Graphics", "AlwaysOnTop", AlwaysOnTop);
- _ResolutionId = Reader.ReadInt32("Graphics", "ResolutionId", ResolutionId);
- _FPSCap = Reader.ReadBoolean("Graphics", "FPSCap", FPSCap);
- _DebugMode = Reader.ReadBoolean("Graphics", "DebugMode", DebugMode);
- _ShowHealthBar = Reader.ReadBoolean("Graphics", "ShowHealthBar", ShowHealthBar);
- _ShowPlayerHP = Reader.ReadBoolean("Graphics", "ShowPlayerHP", ShowPlayerHP);
- _ShowMonsterHP = Reader.ReadBoolean("Graphics", "ShowMonsterHP", ShowMonsterHP);
- //Network
- UseConfig = Reader.ReadBoolean("Network", "UseConfig", UseConfig);
- if (UseConfig)
- {
- IPAddress = Reader.ReadString("Network", "IPAddress", IPAddress);//读取客户配置文件中IP
- IPAddress1 = Reader.ReadString("Network", "IPAddress1", IPAddress1);
- IPAddress2 = Reader.ReadString("Network", "IPAddress2", IPAddress2);
- IPAddress3 = Reader.ReadString("Network", "IPAddress3", IPAddress3);
- IPAddress4 = Reader.ReadString("Network", "IPAddress4", IPAddress4);
- IPAddress5 = Reader.ReadString("Network", "IPAddress5", IPAddress5);
- Port = Reader.ReadInt32("Network", "Port", Port);
- }
- //Logs
- LogErrors = Reader.ReadBoolean("Logs", "LogErrors", LogErrors);
- LogChat = Reader.ReadBoolean("Logs", "LogChat", LogChat);
- //Sound
- Volume = Reader.ReadByte("Sound", "Volume", Volume);
- SoundOverLap = Reader.ReadInt32("Sound", "SoundOverLap", SoundOverLap);
- MusicVolume = Reader.ReadByte("Sound", "Music", MusicVolume);
- //Game
- _AccountID = Reader.ReadString("Game", "AccountID", AccountID);
- _Password = Reader.ReadString("Game", "Password", Password);
- _SkillMode = Reader.ReadBoolean("Game", "SkillMode", SkillMode);
- _SkillBar = Reader.ReadBoolean("Game", "SkillBar", SkillBar);
- _ParticleShow = Reader.ReadBoolean("Game", "_ParticleShow", _ParticleShow);
- //SkillSet = Reader.ReadBoolean("Game", "SkillSet", SkillSet);
- _Effect = Reader.ReadBoolean("Game", "Effect", Effect);
- _LightEffect = Reader.ReadBoolean("Game", "LightEffect", LightEffect);
- _LevelEffect = Reader.ReadBoolean("Game", "LevelEffect", Effect);
- _DropView = Reader.ReadBoolean("Game", "DropView", DropView);
- _NameView = Reader.ReadBoolean("Game", "NameView", NameView);
- _MyNameView = Reader.ReadBoolean("Game", "MyNameView", MyNameView);
- _PlayerNameView = Reader.ReadBoolean("Game", "PlayerNameView", PlayerNameView);
- _NPCNameView = Reader.ReadBoolean("Game", "NPCNameView", NPCNameView);
- _MonsterNameView = Reader.ReadBoolean("Game", "MonsterNameView", MonsterNameView);
- _HPView = Reader.ReadBoolean("Game", "HPMPView", HPView);
- _FontName = Reader.ReadString("Game", "FontName", FontName);
- _TransparentChat = Reader.ReadBoolean("Game", "TransparentChat", TransparentChat);
- _TargetDead = Reader.ReadBoolean("Game", "TargetDead", TargetDead);
- _DuraView = Reader.ReadBoolean("Game", "DuraWindow", DuraView);
- for (int i = 0; i < SkillbarLocation.Length / 2; i++)
- {
- SkillbarLocation[i, 0] = Reader.ReadInt32("Game", "Skillbar" + i.ToString() + "X", SkillbarLocation[i, 0]);
- SkillbarLocation[i, 1] = Reader.ReadInt32("Game", "Skillbar" + i.ToString() + "Y", SkillbarLocation[i, 1]);
- }
- //Chat
- _ShowNormalChat = Reader.ReadBoolean("Chat", "ShowNormalChat", ShowNormalChat);
- _ShowYellChat = Reader.ReadBoolean("Chat", "ShowYellChat", ShowYellChat);
- _ShowWhisperChat = Reader.ReadBoolean("Chat", "ShowWhisperChat", ShowWhisperChat);
- _ShowLoverChat = Reader.ReadBoolean("Chat", "ShowLoverChat", ShowLoverChat);
- _ShowMentorChat = Reader.ReadBoolean("Chat", "ShowMentorChat", ShowMentorChat);
- _ShowGroupChat = Reader.ReadBoolean("Chat", "ShowGroupChat", ShowGroupChat);
- _ShowGuildChat = Reader.ReadBoolean("Chat", "ShowGuildChat", ShowGuildChat);
- //Filters
- _FilterNormalChat = Reader.ReadBoolean("Filter", "FilterNormalChat", FilterNormalChat);
- _FilterWhisperChat = Reader.ReadBoolean("Filter", "FilterWhisperChat", FilterWhisperChat);
- _FilterShoutChat = Reader.ReadBoolean("Filter", "FilterShoutChat", FilterShoutChat);
- _FilterSystemChat = Reader.ReadBoolean("Filter", "FilterSystemChat", FilterSystemChat);
- _FilterLoverChat = Reader.ReadBoolean("Filter", "FilterLoverChat", FilterLoverChat);
- _FilterMentorChat = Reader.ReadBoolean("Filter", "FilterMentorChat", FilterMentorChat);
- _FilterGroupChat = Reader.ReadBoolean("Filter", "FilterGroupChat", FilterGroupChat);
- _FilterGuildChat = Reader.ReadBoolean("Filter", "FilterGuildChat", FilterGuildChat);
- RememberAccount.Add(Reader.ReadString("RememberAccount", "RememberAccount1", ""));
- RememberAccount.Add(Reader.ReadString("RememberAccount", "RememberAccount2", ""));
- RememberAccount.Add(Reader.ReadString("RememberAccount", "RememberAccount3", ""));
- RememberAccount.Add(Reader.ReadString("RememberAccount", "RememberAccount4", ""));
- RememberAccount.Add(Reader.ReadString("RememberAccount", "RememberAccount5", ""));
- //AutoPatcher
- //P_Patcher = Reader.ReadBoolean("Launcher", "Enabled", P_Patcher);
- //P_Host = Reader.ReadString("Launcher", "Host", P_Host);
- //P_PatchFileName = Reader.ReadString("Launcher", "PatchFile", P_PatchFileName);
- //P_NeedLogin = Reader.ReadBoolean("Launcher", "NeedLogin", P_NeedLogin);
- //P_Login = Reader.ReadString("Launcher", "Login", P_Login);
- //P_Password = Reader.ReadString("Launcher", "Password", P_Password);
- //P_AutoStart = Reader.ReadBoolean("Launcher", "AutoStart", P_AutoStart);
- //P_ServerName = Reader.ReadString("Launcher", "ServerName", P_ServerName);
- // P_BrowserAddress = Reader.ReadString("Launcher", "Browser", P_BrowserAddress);读取配置文件中网站
- if (!P_Host.EndsWith("/")) P_Host += "/";
- if (P_Host.StartsWith("www.", StringComparison.OrdinalIgnoreCase)) P_Host = P_Host.Insert(0, "http://");
- //if (P_BrowserAddress.StartsWith("www.", StringComparison.OrdinalIgnoreCase)) P_BrowserAddress = P_BrowserAddress.Insert(0, "http://");
- //Auxsetup
- // HPItemIndexed= Reader.ReadInt32("Auxsetup", "HPItemIndexed" ,HPItemIndexed);
- // MPItemIndexed = Reader.ReadInt32("Auxsetup", "MPItemIndexed", MPItemIndexed);
- }
- public static void LoadTrackedQuests(string Charname)
- {
- //Quests
- for (int i = 0; i < TrackedQuests.Length; i++)
- {
- TrackedQuests[i] = Reader.ReadInt32("Q-" + Charname, "Quest-" + i.ToString(), -1);
- }
- }
- public static void SaveTrackedQuests(string Charname)
- {
- //Quests
- for (int i = 0; i < TrackedQuests.Length; i++)
- {
- Reader.Write("Q-" + Charname, "Quest-" + i.ToString(), TrackedQuests[i]);
- }
- }
- #region AuxSetup
- public static string Charname;
- //Auxsetup
- private static bool _EnableAutoHpRecover = false;
- public static bool EnableAutoHpRecover
- {
- get { return _EnableAutoHpRecover; }
- set
- {
- _EnableAutoHpRecover = value;
- Reader.Write("A-" + Charname, "EnableAutoHpRecover", EnableAutoHpRecover);
- }
- }
- private static int _AutoHpRecoverRate = 5;
- public static int AutoHpRecoverRate
- {
- get { return _AutoHpRecoverRate; }
- set
- {
- _AutoHpRecoverRate = value;
- Reader.Write("A-" + Charname, "AutoHpRecoverRate", AutoHpRecoverRate);
- }
- }
- private static bool _EnableAutoMpRecover = false;
- public static bool EnableAutoMpRecover
- {
- get { return _EnableAutoMpRecover; }
- set
- {
- _EnableAutoMpRecover = value;
- Reader.Write("A-" + Charname, "EnableAutoMpRecover", EnableAutoMpRecover);
- }
- }
- private static int _AutoMpRecoverRate = 5;
- public static int AutoMpRecoverRate
- {
- get { return _AutoMpRecoverRate; }
- set
- {
- _AutoMpRecoverRate = value;
- Reader.Write("A-" + Charname, "AutoMpRecoverRate", AutoMpRecoverRate);
- }
- }
- public static List<int> UnAutoUseItemIds = new List<int>();
- public static List<bool> LockTargetSpells = new List<bool>();
- public static void SaveUnAutoUseItemIds()
- {
- Reader.Write("A-" + Charname, "UnAutoUseItemIds", string.Join(",", UnAutoUseItemIds));
- }
- public static void SaveLockTargetSpells()
- {
- Reader.Write("A-" + Charname, "LockTargetSpells", string.Join(",", LockTargetSpells));
- }
- private static bool _EnableAutoShield = false;
- public static bool EnableAutoShield
- {
- get { return _EnableAutoShield; }
- set
- {
- _EnableAutoShield = value;
- Reader.Write("A-" + Charname, "EnableAutoShield", EnableAutoShield);
- }
- }
- private static bool _EnableAutoFaHuan = false;
- public static bool EnableAutoFaHuan
- {
- get { return _EnableAutoFaHuan; }
- set
- {
- _EnableAutoFaHuan = value;
- Reader.Write("A-" + Charname, "EnableAutoFaHuan", EnableAutoFaHuan);
- }
- }
- private static bool _EnableAutoKuangSha = false;
- public static bool EnableAutoKuangSha
- {
- get { return _EnableAutoKuangSha; }
- set
- {
- _EnableAutoKuangSha = value;
- Reader.Write("A-" + Charname, "EnableAutoKuangSha", EnableAutoKuangSha);
- }
- }
- private static bool _EnableAutoTieBuShan = false;
- public static bool EnableAutoTieBuShan
- {
- get { return _EnableAutoTieBuShan; }
- set
- {
- _EnableAutoTieBuShan = value;
- Reader.Write("A-" + Charname, "EnableAutoTieBuShan", EnableAutoTieBuShan);
- }
- }
- private static bool _EnableAutoSkillExecise = false;
- public static bool EnableAutoSkillExecise
- {
- get { return _EnableAutoSkillExecise; }
- set
- {
- _EnableAutoSkillExecise = value;
- Reader.Write("A-" + Charname, "EnableAutoSkillExecise", EnableAutoSkillExecise);
- }
- }
- //默认使用剑法
- private static bool _EnableAutoSwordSkill = false;
- public static bool EnableAutoSwordSkill
- {
- get { return _EnableAutoSwordSkill; }
- set
- {
- _EnableAutoSwordSkill = value;
- Reader.Write("A-" + Charname, "EnableAutoSwordSkill", EnableAutoSwordSkill);
- }
- }
- private static int _AutoSwordSkillIndex = 0;
- public static int AutoSwordSkillIndex
- {
- get { return _AutoSwordSkillIndex; }
- set
- {
- _AutoSwordSkillIndex = value;
- Reader.Write("A-" + Charname, "AutoSwordSkillIndex", AutoSwordSkillIndex);
- }
- }
- private static int _AutoSkillExeciseKey = 0;
- public static int AutoSkillExeciseKey
- {
- get { return _AutoSkillExeciseKey; }
- set
- {
- _AutoSkillExeciseKey = value;
- Reader.Write("A-" + Charname, "AutoSkillExeciseKey", AutoSkillExeciseKey);
- }
- }
- private static bool _EnableAutoRepeatSkill = false;
- public static bool EnableAutoRepeatSkill
- {
- get { return _EnableAutoRepeatSkill; }
- set
- {
- _EnableAutoRepeatSkill = value;
- Reader.Write("A-" + Charname, "EnableAutoRepeatSkill", EnableAutoRepeatSkill);
- }
- }
- //中键快捷施法
- private static bool _EnableMiddleKeySkill = false;
- public static bool EnableMiddleKeySkill
- {
- get { return _EnableMiddleKeySkill; }
- set
- {
- _EnableMiddleKeySkill = value;
- Reader.Write("A-" + Charname, "EnableMiddleKeySkill", EnableMiddleKeySkill);
- }
- }
- private static int _MiddleKeySkill = 0;
- public static int MiddleKeySkill
- {
- get { return _MiddleKeySkill; }
- set
- {
- _MiddleKeySkill = value;
- Reader.Write("A-" + Charname, "MiddleKeySkill", MiddleKeySkill);
- }
- }
- private static bool _EnableMarriageTeleport = false;
- public static bool EnableMarriageTeleport
- {
- get { return _EnableMarriageTeleport; }
- set
- {
- _EnableMarriageTeleport = value;
- Reader.Write("A-" + Charname, "EnableMarriageTeleport", EnableMarriageTeleport);
- }
- }
- private static bool _EnableSkillOnMount = false;
- public static bool EnableSkillOnMount
- {
- get { return _EnableSkillOnMount; }
- set
- {
- _EnableSkillOnMount = value;
- Reader.Write("A-" + Charname, "EnableSkillOnMount", EnableSkillOnMount);
- }
- }
- //替换火墙外观
- private static bool _EnableFireWallReplace = false;
- public static bool EnableFireWallReplace
- {
- get { return _EnableFireWallReplace; }
- set
- {
- _EnableFireWallReplace = value;
- Reader.Write("A-" + Charname, "EnableFireWallReplace", EnableFireWallReplace);
- }
- }
- private static int _FireWallReplaceKey = 0;
- public static int FireWallReplaceKey
- {
- get { return _FireWallReplaceKey; }
- set
- {
- _FireWallReplaceKey = value;
- Reader.Write("A-" + Charname, "FireWallReplaceKey", FireWallReplaceKey);
- }
- }
- private static int _Shenshengzjfu = -1; //具体绑定那个符
- public static int Shenshengzjfu
- {
- get { return _Shenshengzjfu; }
- set
- {
- _Shenshengzjfu = value;
- Reader.Write("A-" + Charname, "AUX-Shenshengzjfu", Shenshengzjfu);
- }
- }
- private static int _youlindunfu = -1;
- public static int youlindunfu
- {
- get { return _youlindunfu; }
- set
- {
- _youlindunfu = value;
- Reader.Write("A-" + Charname, "AUX-youlindunfu", youlindunfu);
- }
- }
- private static int _qiangmozhenfafu = -1; //具体绑定那个符
- public static int qiangmozhenfafu
- {
- get { return _qiangmozhenfafu; }
- set
- {
- _qiangmozhenfafu = value;
- Reader.Write("A-" + Charname, "AUX-qiangmozhenfafu", qiangmozhenfafu);
- }
- }
- private static int _menghuqiansshifu = -1; //具体绑定那个符
- public static int menghuqiansshifu
- {
- get { return _menghuqiansshifu; }
- set
- {
- _menghuqiansshifu = value;
- Reader.Write("A-" + Charname, "AUX-menghuqiansshifu", menghuqiansshifu);
- }
- }
- private static int _zhaohuankuloufu = -1; //具体绑定那个符
- public static int zhaohuankuloufu
- {
- get { return _zhaohuankuloufu; }
- set
- {
- _zhaohuankuloufu = value;
- Reader.Write("A-" + Charname, "AUX-zhaohuankuloufu", zhaohuankuloufu);
- }
- }
- private static int _chaojizhaohuankuloufu = -1; //具体绑定那个符
- public static int chaojizhaohuankuloufu
- {
- get { return _chaojizhaohuankuloufu; }
- set
- {
- _chaojizhaohuankuloufu = value;
- Reader.Write("A-" + Charname, "AUX-chaojizhaohuankuloufu", chaojizhaohuankuloufu);
- }
- }
- private static int _zhaohuashenshoufu = -1; //具体绑定那个符
- public static int zhaohuashenshoufu
- {
- get { return _zhaohuashenshoufu; }
- set
- {
- _zhaohuashenshoufu = value;
- Reader.Write("A-" + Charname, "AUX-zhaohuashenshoufu", zhaohuashenshoufu);
- }
- }
- private static int _shidushufu = -2; //具体绑定那个粉末
- public static int shidushufu
- {
- get { return _shidushufu; }
- set
- {
- _shidushufu = value;
- Reader.Write("A-" + Charname, "AUX-shidushufu", shidushufu);
- }
- }
- //自动发言
- private static bool _EnableAutoMessage = false;
- public static bool EnableAutoMessage
- {
- get { return _EnableAutoMessage; }
- set
- {
- _EnableAutoMessage = value;
- Reader.Write("A-" + Charname, "AUX-EnableAutoMessage", EnableAutoMessage);
- }
- }
- private static string _AutoMessageStr = "";
- public static string AutoMessageStr
- {
- get { return _AutoMessageStr; }
- set
- {
- _AutoMessageStr = value;
- Reader.Write("A-" + Charname, "AUX-AutoMessageStr", AutoMessageStr);
- }
- }
- private static int _AutoMessageChannel = 0;
- public static int AutoMessageChannel
- {
- get { return _AutoMessageChannel; }
- set
- {
- _AutoMessageChannel = value;
- Reader.Write("A-" + Charname, "AUX-AutoMessageChannel", AutoMessageChannel);
- }
- }
- private static int _AutoMessageGap = 120;
- public static int AutoMessageGap
- {
- get { return _AutoMessageGap; }
- set
- {
- _AutoMessageGap = value;
- Reader.Write("A-" + Charname, "AUX-AutoMessageGap", AutoMessageGap);
- }
- }
- public static int MarriageTeleportGap = 6;
- public static void LoadAuxsetup(string charname)
- {
- Charname = charname;
- _Shenshengzjfu = Reader.ReadInt32("A-" + charname, "AUX-Shenshengzjfu", -1);
- _youlindunfu = Reader.ReadInt32("A-" + charname, "AUX-youlindunfu", -1);
- _menghuqiansshifu = Reader.ReadInt32("A-" + charname, "AUX-menghuqiansshifu", -1);
- _qiangmozhenfafu = Reader.ReadInt32("A-" + charname, "AUX-qiangmozhenfafu", -1);
- _chaojizhaohuankuloufu = Reader.ReadInt32("A-" + charname, "AUX-chaojizhaohuankuloufu", -1);
- _zhaohuankuloufu = Reader.ReadInt32("A-" + charname, "AUX-zhaohuankuloufu", -1);
- _zhaohuashenshoufu = Reader.ReadInt32("A-" + charname, "AUX-zhaohuashenshoufu", -1);
- _shidushufu = Reader.ReadInt32("A-" + charname, "AUX-shidushufu", -2);
- _EnableAutoMessage = Reader.ReadBoolean("A-" + charname, "AUX-EnableAutoMessage", false);
- _AutoMessageStr = Reader.ReadString("A-" + charname, "AUX-AutoMessageStr", "");
- _AutoMessageChannel = Reader.ReadInt32("A-" + charname, "AUX-AutoMessageChannel", 0);
- _AutoMessageGap = Reader.ReadInt32("A-" + charname, "AUX-AutoMessageGap", 120);
- _EnableAutoHpRecover = Reader.ReadBoolean("A-" + charname, "EnableAutoHpRecover", false);
- _AutoHpRecoverRate = Reader.ReadInt32("A-" + charname, "AutoHpRecoverRate", 5);
- _EnableAutoMpRecover = Reader.ReadBoolean("A-" + charname, "EnableAutoMpRecover", false);
- _AutoMpRecoverRate = Reader.ReadInt32("A-" + charname, "AutoMpRecoverRate", 5);
- var strUnAutoUseItemIds = Reader.ReadString("A-" + charname, "UnAutoUseItemIds", "");
- UnAutoUseItemIds.Clear();
- foreach (var str in strUnAutoUseItemIds.Split(','))
- {
- if (!string.IsNullOrEmpty(str))
- {
- UnAutoUseItemIds.Add(int.Parse(str));
- }
- }
- var strLockTargetSpells = Reader.ReadString("A-" + charname, "LockTargetSpells", "False,False");
- LockTargetSpells.Clear();
- foreach (var str in strLockTargetSpells.Split(','))
- {
- if (!string.IsNullOrEmpty(str))
- {
- try
- {
- LockTargetSpells.Add(bool.Parse(str));
- }
- catch (Exception)
- {
- LockTargetSpells.Add(true);
- }
- }
- }
- while (LockTargetSpells.Count < 10)
- {
- LockTargetSpells.Add(true);
- }
- _EnableAutoShield = Reader.ReadBoolean("A-" + charname, "EnableAutoShield", false);
- _EnableAutoFaHuan = Reader.ReadBoolean("A-" + charname, "EnableAutoFaHuan", false);
- _EnableAutoKuangSha = Reader.ReadBoolean("A-" + charname, "EnableAutoKuangSha", false);
- _EnableAutoTieBuShan = Reader.ReadBoolean("A-" + charname, "EnableAutoTieBuShan", false);
- _EnableAutoSwordSkill = Reader.ReadBoolean("A-" + charname, "EnableAutoSwordSkill", false);
- _EnableMiddleKeySkill = Reader.ReadBoolean("A-" + charname, "EnableMiddleKeySkill", false);
- _EnableMarriageTeleport = Reader.ReadBoolean("A-" + charname, "EnableMarriageTeleport", false);
- _EnableSkillOnMount = Reader.ReadBoolean("A-" + charname, "EnableSkillOnMount", false);
- _EnableFireWallReplace = Reader.ReadBoolean("A-" + charname, "EnableFireWallReplace", false);
- _EnableAutoSkillExecise = Reader.ReadBoolean("A-" + charname, "EnableAutoSkillExecise", false);
- _AutoSwordSkillIndex = Reader.ReadInt32("A-" + charname, "AutoSwordSkillIndex", 0);
- _AutoSkillExeciseKey = Reader.ReadInt32("A-" + charname, "AutoSkillExeciseKey", 0);
- _FireWallReplaceKey = Reader.ReadInt32("A-" + charname, "FireWallReplaceKey", 0);
- _MiddleKeySkill = Reader.ReadInt32("A-" + charname, "MiddleKeySkill", 0);
- _EnableAutoRepeatSkill = Reader.ReadBoolean("A-" + charname, "EnableAutoRepeatSkill", false);
- }
- #endregion
- }
- }
|