fix(bridge): prefer persisted project port at start to avoid initial 6400 blip after UPM import
parent
5c632f0ab3
commit
57592017ae
|
|
@ -141,12 +141,11 @@ namespace UnityMcpBridge.Editor
|
||||||
|
|
||||||
Stop();
|
Stop();
|
||||||
|
|
||||||
// Attempt fast bind with same-port preference
|
// Attempt fast bind with stored-port preference (sticky per-project)
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
currentUnityPort = currentUnityPort > 0 && PortManager.IsPortAvailable(currentUnityPort)
|
// Always consult PortManager first so we prefer the persisted project port
|
||||||
? currentUnityPort
|
currentUnityPort = PortManager.GetPortWithFallback();
|
||||||
: PortManager.GetPortWithFallback();
|
|
||||||
|
|
||||||
const int maxImmediateRetries = 3;
|
const int maxImmediateRetries = 3;
|
||||||
const int retrySleepMs = 75;
|
const int retrySleepMs = 75;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue