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