updated server to start on localhost
parent
20aa6839fe
commit
a3493a49d9
|
|
@ -51,7 +51,7 @@ public class MCPConfigServer
|
||||||
public class ServerConfig
|
public class ServerConfig
|
||||||
{
|
{
|
||||||
[JsonProperty("unity_host")]
|
[JsonProperty("unity_host")]
|
||||||
public string unityHost;
|
public string unityHost = "localhost";
|
||||||
|
|
||||||
[JsonProperty("unity_port")]
|
[JsonProperty("unity_port")]
|
||||||
public int unityPort;
|
public int unityPort;
|
||||||
|
|
@ -147,6 +147,13 @@ public class MCPEditorWindow : EditorWindow
|
||||||
LoadServerConfig(); // Reload config if not loaded
|
LoadServerConfig(); // Reload config if not loaded
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Validate host is not null
|
||||||
|
if (string.IsNullOrEmpty(serverConfig.unityHost))
|
||||||
|
{
|
||||||
|
serverConfig.unityHost = "localhost"; // Fallback to localhost if null
|
||||||
|
UnityEngine.Debug.LogWarning("Unity host was null, defaulting to localhost");
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (var client = new TcpClient())
|
using (var client = new TcpClient())
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue