(d5505ed3d) Show the name of the server in the "connecting to..." popup instead of the IP address
This commit is contained in:
@@ -727,7 +727,7 @@ namespace Barotrauma
|
||||
GameMain.ServerChildProcess = Process.Start(processInfo);
|
||||
Thread.Sleep(1000); //wait until the server is ready before connecting
|
||||
|
||||
GameMain.Client = new GameClient(name, "127.0.0.1:" + port.ToString(),ownerKey);
|
||||
GameMain.Client = new GameClient(name, "127.0.0.1:" + port.ToString(), name, ownerKey);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
@@ -598,9 +598,11 @@ namespace Barotrauma
|
||||
GameMain.Config.SaveNewPlayerConfig();
|
||||
|
||||
string ip = null;
|
||||
string serverName = null;
|
||||
if (ipBox.UserData is ServerInfo serverInfo)
|
||||
{
|
||||
ip = serverInfo.IP + ":" + serverInfo.Port;
|
||||
serverName = serverInfo.ServerName;
|
||||
}
|
||||
else if (!string.IsNullOrWhiteSpace(ipBox.Text))
|
||||
{
|
||||
@@ -614,18 +616,18 @@ namespace Barotrauma
|
||||
return false;
|
||||
}
|
||||
|
||||
CoroutineManager.StartCoroutine(ConnectToServer(ip));
|
||||
CoroutineManager.StartCoroutine(ConnectToServer(ip, serverName));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private IEnumerable<object> ConnectToServer(string ip)
|
||||
private IEnumerable<object> ConnectToServer(string ip, string serverName)
|
||||
{
|
||||
#if !DEBUG
|
||||
try
|
||||
{
|
||||
#endif
|
||||
GameMain.Client = new GameClient(clientNameBox.Text, ip);
|
||||
GameMain.Client = new GameClient(clientNameBox.Text, ip, serverName);
|
||||
#if !DEBUG
|
||||
}
|
||||
catch (Exception e)
|
||||
|
||||
Reference in New Issue
Block a user