Commit 7f02a0c3 authored by Szefo09's avatar Szefo09

change psw

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