Improve StartGameWindow and apply 'dontListen' option

This commit is contained in:
in0finite 2019-04-23 23:21:41 +02:00
parent b465ba0d67
commit 580335b576
2 changed files with 6 additions and 3 deletions

View file

@ -11,6 +11,8 @@ namespace SanAndreasUnity.Net
public static int listenPortNumber { get { return telepathyTransport.port; } }
public static bool dontListen { get { return NetworkServer.dontListen; } set { NetworkServer.dontListen = value; } }
public static TelepathyTransport telepathyTransport { get { return ((TelepathyTransport)Transport.activeTransport); } }
public static string onlineScene {

View file

@ -36,11 +36,11 @@ namespace SanAndreasUnity.UI
{
GUILayout.Label ("Port:");
m_port = GUILayout.TextField(m_port);
m_port = GUILayout.TextField(m_port, GUILayout.Width(100));
m_dontListen = GUILayout.Toggle(m_dontListen, "Don't listen:");
m_dontListen = GUILayout.Toggle(m_dontListen, "Don't listen");
m_dedicatedServer = GUILayout.Toggle(m_dedicatedServer, "Dedicated server:");
m_dedicatedServer = GUILayout.Toggle(m_dedicatedServer, "Dedicated server");
GUILayout.Label("Map:");
m_selectedSceneIndex = GUILayout.SelectionGrid(m_selectedSceneIndex, m_availableScenes, 4);
@ -61,6 +61,7 @@ namespace SanAndreasUnity.UI
// first start a server, and then change scene
NetManager.dontListen = m_dontListen;
if (m_dedicatedServer)
NetManager.StartServer(port);
else