diff --git a/QuantumUNET/QSBNetworkClient.cs b/QuantumUNET/QSBNetworkClient.cs index e6e4cc2b..bce38ca2 100644 --- a/QuantumUNET/QSBNetworkClient.cs +++ b/QuantumUNET/QSBNetworkClient.cs @@ -5,7 +5,6 @@ using System.Net; using System.Net.Sockets; using UnityEngine; using UnityEngine.Networking; -using UnityEngine.Networking.Match; using UnityEngine.Networking.NetworkSystem; namespace QuantumUNET @@ -574,21 +573,6 @@ namespace QuantumUNET m_Connection.Initialize(m_ServerIp, m_ClientId, m_ClientConnectionId, m_HostTopology); } - private void ConnectWithRelay(MatchInfo info) - { - m_AsyncConnect = ConnectState.Connecting; - Update(); - byte b; - m_ClientConnectionId = NetworkTransport.ConnectToNetworkPeer(m_ClientId, info.address, info.port, 0, 0, info.networkId, QSBUtility.GetSourceID(), info.nodeId, out b); - m_Connection = (QSBNetworkConnection)Activator.CreateInstance(m_NetworkConnectionClass); - m_Connection.SetHandlers(m_MessageHandlers); - m_Connection.Initialize(info.address, m_ClientId, m_ClientConnectionId, m_HostTopology); - if (b != 0) - { - Debug.LogError("ConnectToNetworkPeer Error: " + b); - } - } - public virtual void Disconnect() { m_AsyncConnect = ConnectState.Disconnected; diff --git a/QuantumUNET/QSBNetworkManagerUNET.cs b/QuantumUNET/QSBNetworkManagerUNET.cs index 515cee78..c44e5855 100644 --- a/QuantumUNET/QSBNetworkManagerUNET.cs +++ b/QuantumUNET/QSBNetworkManagerUNET.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; using UnityEngine; using UnityEngine.Networking; -using UnityEngine.Networking.Match; using UnityEngine.SceneManagement; namespace QuantumUNET @@ -33,8 +32,6 @@ namespace QuantumUNET public GameObject playerPrefab { get; set; } public PlayerSpawnMethod playerSpawnMethod { get; set; } public List spawnPrefabs { get; } = new List(); - public string matchName = "default"; - public uint matchSize = 4U; public QSBNetworkClient client; public int maxConnections { get; set; } = 4; public List channels { get; } = new List(); @@ -159,22 +156,12 @@ namespace QuantumUNET QSBNetworkServer.RegisterHandler(34, new QSBNetworkMessageDelegate(OnServerErrorInternal)); } - public bool StartServer(ConnectionConfig config, int maxConnections) - { - return StartServer(null, config, maxConnections); - } - public bool StartServer() { - return StartServer(null); + return StartServer(null, -1); } - public bool StartServer(MatchInfo info) - { - return StartServer(info, null, -1); - } - - private bool StartServer(MatchInfo info, ConnectionConfig config, int maxConnections) + private bool StartServer(ConnectionConfig config, int maxConnections) { InitializeSingleton(); OnStartServer(); @@ -201,18 +188,7 @@ namespace QuantumUNET { QSBNetworkServer.Configure(config, maxConnections); } - if (info != null) - { - if (!QSBNetworkServer.Listen(info, networkPort)) - { - if (LogFilter.logError) - { - Debug.LogError("StartServer listen failed."); - } - return false; - } - } - else if (serverBindToIP && !string.IsNullOrEmpty(serverBindAddress)) + if (serverBindToIP && !string.IsNullOrEmpty(serverBindAddress)) { if (!QSBNetworkServer.Listen(serverBindAddress, networkPort)) { @@ -390,23 +366,6 @@ namespace QuantumUNET return result; } - public virtual QSBNetworkClient StartHost(MatchInfo info) - { - OnStartHost(); - QSBNetworkClient result; - if (StartServer(info)) - { - var networkClient = ConnectLocalClient(); - OnStartClient(networkClient); - result = networkClient; - } - else - { - result = null; - } - return result; - } - public virtual QSBNetworkClient StartHost() { OnStartHost();