private void OnGUIClient()
{
int offsetY = this.m_OffsetY;
GUI.Label(new Rect((float) this.m_OffsetX, (float) offsetY, 200f, 40f), "Lost Connection To Host ID(" + this.m_OldServerConnectionId + ")");
offsetY += 0x19;
if (Application.platform == RuntimePlatform.WebGLPlayer)
{
GUI.Label(new Rect((float) this.m_OffsetX, (float) offsetY, 200f, 40f), "Host Migration not supported for WebGL");
}
else
{
if (this.m_WaitingToBecomeNewHost)
{
GUI.Label(new Rect((float) this.m_OffsetX, (float) offsetY, 200f, 40f), "You are the new host");
offsetY += 0x19;
if (GUI.Button(new Rect((float) this.m_OffsetX, (float) offsetY, 200f, 20f), "Start As Host"))
{
if (NetworkManager.singleton != null)
{
this.BecomeNewHost(NetworkManager.singleton.networkPort);
}
else
{
Debug.LogWarning("MigrationManager Client BecomeNewHost - No NetworkManager.");
}
}
offsetY += 0x19;
}
else if (this.m_WaitingReconnectToNewHost)
{
GUI.Label(new Rect((float) this.m_OffsetX, (float) offsetY, 200f, 40f), "New host is " + this.m_NewHostAddress);
offsetY += 0x19;
if (GUI.Button(new Rect((float) this.m_OffsetX, (float) offsetY, 200f, 20f), "Reconnect To New Host"))
{
this.Reset(this.m_OldServerConnectionId);
if (NetworkManager.singleton != null)
{
NetworkManager.singleton.networkAddress = this.m_NewHostAddress;
NetworkManager.singleton.client.ReconnectToNewHost(this.m_NewHostAddress, NetworkManager.singleton.networkPort);
}
else
{
Debug.LogWarning("MigrationManager Client reconnect - No NetworkManager.");
}
}
offsetY += 0x19;
}
else
{
bool flag;
if (GUI.Button(new Rect((float) this.m_OffsetX, (float) offsetY, 200f, 20f), "Pick New Host") && this.FindNewHost(out this.m_NewHostInfo, out flag))
{
this.m_NewHostAddress = this.m_NewHostInfo.address;
if (flag)
{
this.m_WaitingToBecomeNewHost = true;
}
else
{
this.m_WaitingReconnectToNewHost = true;
}
}
offsetY += 0x19;
}
if (GUI.Button(new Rect((float) this.m_OffsetX, (float) offsetY, 200f, 20f), "Leave Game"))
{
if (NetworkManager.singleton != null)
{
NetworkManager.singleton.SetupMigrationManager(null);
NetworkManager.singleton.StopHost();
}
else
{
Debug.LogWarning("MigrationManager Client LeaveGame - No NetworkManager.");
}
this.Reset(-1);
}
offsetY += 0x19;
}
}