remove more

This commit is contained in:
Mister_Nebula 2020-12-07 20:52:10 +00:00
parent 83b5daf205
commit 24806ebb98
2 changed files with 3 additions and 60 deletions

View File

@ -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;

View File

@ -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<GameObject> spawnPrefabs { get; } = new List<GameObject>();
public string matchName = "default";
public uint matchSize = 4U;
public QSBNetworkClient client;
public int maxConnections { get; set; } = 4;
public List<QosType> channels { get; } = new List<QosType>();
@ -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();