Commit 7f02a0c3 authored by Szefo09's avatar Szefo09

change psw

parent 85854d51
...@@ -51,80 +51,80 @@ public class SelectServer : WindowServantSP ...@@ -51,80 +51,80 @@ public class SelectServer : WindowServantSP
switch (server) switch (server)
{ {
case "[OCG]Koishi": case "[OCG]Koishi":
{ {
UIHelper.getByName<UIInput>(gameObject, "ip_").value = "koishi.moecube.com"; UIHelper.getByName<UIInput>(gameObject, "ip_").value = "koishi.moecube.com";
UIHelper.getByName<UIInput>(gameObject, "port_").value = "7210"; UIHelper.getByName<UIInput>(gameObject, "port_").value = "7210";
Config.Set("serversPicker", "[OCG]Koishi"); Config.Set("serversPicker", "[OCG]Koishi");
list.enabled = false; //list.enabled = false;
inputIP_.enabled = false; inputIP_.enabled = false;
inputPort_.enabled = false; inputPort_.enabled = false;
break; break;
} }
case "[OCG]Mercury233": case "[OCG]Mercury233":
{ {
UIHelper.getByName<UIInput>(gameObject, "ip_").value = "s1.ygo233.com"; UIHelper.getByName<UIInput>(gameObject, "ip_").value = "s1.ygo233.com";
UIHelper.getByName<UIInput>(gameObject, "port_").value = "233"; UIHelper.getByName<UIInput>(gameObject, "port_").value = "233";
Config.Set("serversPicker", "[OCG]Mercury233"); Config.Set("serversPicker", "[OCG]Mercury233");
list.enabled = false; //list.enabled = false;
inputIP_.enabled = false; inputIP_.enabled = false;
inputPort_.enabled = false; inputPort_.enabled = false;
break; break;
} }
case "[TCG]Koishi": case "[TCG]Koishi":
{ {
UIHelper.getByName<UIInput>(gameObject, "ip_").value = "koishi.moecube.com"; UIHelper.getByName<UIInput>(gameObject, "ip_").value = "koishi.moecube.com";
UIHelper.getByName<UIInput>(gameObject, "port_").value = "1311"; UIHelper.getByName<UIInput>(gameObject, "port_").value = "1311";
Config.Set("serversPicker", "[TCG]Koishi"); Config.Set("serversPicker", "[TCG]Koishi");
list.enabled = false; //list.enabled = false;
inputIP_.enabled = false; inputIP_.enabled = false;
inputPort_.enabled = false; inputPort_.enabled = false;
break; break;
} }
case "[Custom]YGOPro 222DIY": case "[Custom]YGOPro 222DIY":
{ {
UIHelper.getByName<UIInput>(gameObject, "ip_").value = "koishi.moecube.com"; UIHelper.getByName<UIInput>(gameObject, "ip_").value = "koishi.moecube.com";
UIHelper.getByName<UIInput>(gameObject, "port_").value = "222"; UIHelper.getByName<UIInput>(gameObject, "port_").value = "222";
Config.Set("serversPicker", "[Custom]YGOPro 222DIY"); Config.Set("serversPicker", "[Custom]YGOPro 222DIY");
list.enabled = false; //list.enabled = false;
inputIP_.enabled = false; inputIP_.enabled = false;
inputPort_.enabled = false; inputPort_.enabled = false;
break; break;
} }
case "[轮抽服]2Pick": case "[轮抽服]2Pick":
{ {
UIHelper.getByName<UIInput>(gameObject, "ip_").value = "2pick.mycard.moe"; UIHelper.getByName<UIInput>(gameObject, "ip_").value = "2pick.mycard.moe";
UIHelper.getByName<UIInput>(gameObject, "port_").value = "765"; UIHelper.getByName<UIInput>(gameObject, "port_").value = "765";
Config.Set("serversPicker", "[轮抽服]2Pick"); Config.Set("serversPicker", "[轮抽服]2Pick");
list.enabled = false; //list.enabled = false;
inputIP_.enabled = false; inputIP_.enabled = false;
inputPort_.enabled = false; inputPort_.enabled = false;
break; break;
} }
case "[OCG&TCG]한국서버": case "[OCG&TCG]한국서버":
{ {
UIHelper.getByName<UIInput>(gameObject, "ip_").value = "cygopro.fun25.co.kr"; UIHelper.getByName<UIInput>(gameObject, "ip_").value = "cygopro.fun25.co.kr";
UIHelper.getByName<UIInput>(gameObject, "port_").value = "17225"; UIHelper.getByName<UIInput>(gameObject, "port_").value = "17225";
Config.Set("serversPicker", "[OCG&TCG]한국서버"); Config.Set("serversPicker", "[OCG&TCG]한국서버");
list.enabled = false; //list.enabled = false;
inputIP_.enabled = false; inputIP_.enabled = false;
inputPort_.enabled = false; inputPort_.enabled = false;
break; break;
} }
default: default:
{ {
Config.Set("serversPicker", "[Custom]"); Config.Set("serversPicker", "[Custom]");
list.enabled = true; list.enabled = true;
inputIP_.enabled = true; inputIP_.enabled = true;
inputPort_.enabled = true; inputPort_.enabled = true;
break; break;
} }
} }
} }
...@@ -139,41 +139,42 @@ public class SelectServer : WindowServantSP ...@@ -139,41 +139,42 @@ public class SelectServer : WindowServantSP
private void readString(string str) private void readString(string str)
{ {
str = str.Substring(1, str.Length - 1); //str = str.Substring(1, str.Length - 1);
string version = "", remain = ""; //string version = "", remain = "";
string[] splited; //string[] splited;
splited = str.Split(")"); //splited = str.Split(")");
try //try
{ //{
version = splited[0]; // version = splited[0];
remain = splited[1]; // remain = splited[1];
} //}
catch (Exception) //catch (Exception)
{ //{
} //}
splited = remain.Split(":"); //splited = remain.Split(":");
string ip = ""; //string ip = "";
try //try
{ //{
ip = splited[0]; // ip = splited[0];
remain = splited[1]; // remain = splited[1];
} //}
catch (Exception) //catch (Exception)
{ //{
} //}
splited = remain.Split(" "); //splited = remain.Split(" ");
string psw = "", port = ""; //string psw = "", port = "";
try //try
{ //{
port = splited[0]; // port = splited[0];
psw = splited[1]; // psw = splited[1];
} //}
catch (Exception) //catch (Exception)
{ //{
} //}
inputIP.value = ip; //inputIP.value = ip;
inputPort.value = port; //inputPort.value = port;
inputPsw.value = psw; //inputPsw.value = psw;
inputPsw.value = str;
//inputVersion.value = version; //inputVersion.value = version;
} }
...@@ -194,11 +195,11 @@ public class SelectServer : WindowServantSP ...@@ -194,11 +195,11 @@ public class SelectServer : WindowServantSP
void printFile(bool first) void printFile(bool first)
{ {
list.Clear(); list.Clear();
if (File.Exists("config/hosts.conf") == false) if (File.Exists("config/passwords.conf") == false)
{ {
File.Create("config/hosts.conf").Close(); File.Create("config/passwords.conf").Close();
} }
string txtString = File.ReadAllText("config/hosts.conf"); string txtString = File.ReadAllText("config/passwords.conf");
string[] lines = txtString.Replace("\r", "").Split("\n"); string[] lines = txtString.Replace("\r", "").Split("\n");
for (int i = 0; i < lines.Length; i++) for (int i = 0; i < lines.Length; i++)
{ {
...@@ -270,11 +271,11 @@ public class SelectServer : WindowServantSP ...@@ -270,11 +271,11 @@ public class SelectServer : WindowServantSP
{ {
if (name != "") if (name != "")
{ {
string fantasty = "(" + versionString + ")" + ipString + ":" + portString + " " + pswString; string fantasty = pswString;
list.items.Remove(fantasty); list.items.Remove(fantasty);
list.items.Insert(0, fantasty); list.items.Insert(0, fantasty);
list.value = fantasty; list.value = fantasty;
if (list.items.Count>5) if (list.items.Count > 5)
{ {
list.items.RemoveAt(list.items.Count - 1); list.items.RemoveAt(list.items.Count - 1);
} }
...@@ -283,9 +284,9 @@ public class SelectServer : WindowServantSP ...@@ -283,9 +284,9 @@ public class SelectServer : WindowServantSP
{ {
all += list.items[i] + "\r\n"; all += list.items[i] + "\r\n";
} }
File.WriteAllText("config/hosts.conf", all); File.WriteAllText("config/passwords.conf", all);
printFile(false); printFile(false);
(new Thread(() => { TcpHelper.join(ipString, name, portString, pswString,versionString); })).Start(); (new Thread(() => { TcpHelper.join(ipString, name, portString, pswString, versionString); })).Start();
} }
else else
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment