mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-26 14:00:17 +00:00
Improve StartGameWindow and apply 'dontListen' option
This commit is contained in:
parent
b465ba0d67
commit
580335b576
2 changed files with 6 additions and 3 deletions
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue