2020-02-14 21:14:24 +00:00
|
|
|
|
using UnityEngine;
|
2020-02-13 19:23:26 +00:00
|
|
|
|
using UnityEngine.Networking;
|
|
|
|
|
|
2020-02-15 19:48:02 +00:00
|
|
|
|
namespace QSB
|
|
|
|
|
{
|
|
|
|
|
public class QSBNetworkManager : NetworkManager
|
|
|
|
|
{
|
|
|
|
|
private void Awake()
|
|
|
|
|
{
|
2020-02-13 19:34:51 +00:00
|
|
|
|
var assetBundle = QSB.Helper.Assets.LoadBundle("assets/network");
|
|
|
|
|
playerPrefab = assetBundle.LoadAsset<GameObject>("assets/networkplayer.prefab");
|
|
|
|
|
playerPrefab.AddComponent<NetworkPlayer>();
|
2020-02-13 19:23:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-02-15 19:48:02 +00:00
|
|
|
|
public override void OnStartServer()
|
|
|
|
|
{
|
|
|
|
|
WakeUpSync.IsServer = true;
|
2020-02-14 21:14:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-02-15 19:48:02 +00:00
|
|
|
|
public override void OnClientConnect(NetworkConnection conn)
|
|
|
|
|
{
|
2020-02-14 21:14:24 +00:00
|
|
|
|
base.OnClientConnect(conn);
|
2020-02-13 19:23:26 +00:00
|
|
|
|
|
2020-02-14 21:14:24 +00:00
|
|
|
|
DebugLog.Screen("OnClientConnect");
|
|
|
|
|
gameObject.AddComponent<WakeUpSync>();
|
2020-02-13 20:23:12 +00:00
|
|
|
|
gameObject.AddComponent<SectorSync>();
|
2020-02-13 19:23:26 +00:00
|
|
|
|
}
|
2020-02-15 19:48:02 +00:00
|
|
|
|
|
2020-02-13 19:23:26 +00:00
|
|
|
|
}
|
|
|
|
|
}
|