Commit 04ad3005 authored by mercury233's avatar mercury233

don't save recent host when joining from command line

parent 80bf187a
Pipeline #41790 passed with stages
in 15 minutes and 31 seconds
...@@ -445,7 +445,7 @@ public class Program : MonoBehaviour ...@@ -445,7 +445,7 @@ public class Program : MonoBehaviour
if (join) if (join)
{ {
shiftToServant(selectServer); shiftToServant(selectServer);
selectServer.KF_onlineGame(nick, host, port, "0x233", password); selectServer.KF_onlineGame(nick, host, port, "0x233", password, false);
exitOnReturn = true; exitOnReturn = true;
} }
else if (deck != null) else if (deck != null)
......
...@@ -116,7 +116,7 @@ public class SelectServer : WindowServantSP ...@@ -116,7 +116,7 @@ public class SelectServer : WindowServantSP
} }
public void KF_onlineGame(string Name, string ipString, string portString, string versionString, public void KF_onlineGame(string Name, string ipString, string portString, string versionString,
string pswString = "") string pswString = "", bool savetoList = true)
{ {
name = Name; name = Name;
Config.Set("name", name); Config.Set("name", name);
...@@ -127,6 +127,8 @@ public class SelectServer : WindowServantSP ...@@ -127,6 +127,8 @@ public class SelectServer : WindowServantSP
else else
{ {
if (name != "") if (name != "")
{
if (savetoList)
{ {
var fantasty = ipString + ":" + portString + " " + pswString; var fantasty = ipString + ":" + portString + " " + pswString;
list.items.Remove(fantasty); list.items.Remove(fantasty);
...@@ -137,6 +139,7 @@ public class SelectServer : WindowServantSP ...@@ -137,6 +139,7 @@ public class SelectServer : WindowServantSP
for (var i = 0; i < list.items.Count; i++) all += list.items[i] + "\r\n"; for (var i = 0; i < list.items.Count; i++) all += list.items[i] + "\r\n";
File.WriteAllText("config/hosts.conf", all); File.WriteAllText("config/hosts.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