SanAndreasUnity/Assets/Scripts/Networking/CustomNetworkManager.cs

80 lines
2.2 KiB
C#
Raw Normal View History

Feature/mirror upgrade (#127) * Updated SyncDictionary usage in SyncedBag.cs - Removed the extra class that is no longer needed for SyncDictionary's - Removed OP codes (OP_DIRTY) switch case that no longer exists (superseded by OP_SET) Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated method names Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated more string sync dictionaries Ped_Networking.cs VehicleController.cs Player.cs SyncedServerData.cs Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated NetworkTime fields in NetStats.cs Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated syncData types Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Implemented conditional compilation to replace old isHeadless Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated hooks * A few more syncDictionary upgrades * Moved away from obsolete NetworkIdentity.spawned * Updated SetDirtyBit to SetSyncVarDirtyBit in DeadBody.cs * Updated ScriptingDefineSymbols for Mirror * Updated JoinGameWindow.cs * Use latest MirrorLite commit for submodule * Use latest MirrorLite commit for submodule * Reverted EditorSettings.asset to commit b1c9d38e3ac5113e899ac34ad07bcb8a2890d18b * Reverted JoinGameWindow.cs to commit b1c9d38e3ac5113e899ac34ad07bcb8a2890d18b * Changed method for headless mode in NetCmdLineHandler.cs Changed from compiler defs to SanAndreasUnity helpers for determining headless mode in NetCmdLineHandler.cs * Re-Added ConfigureHeadlessFrameRate override on CustomNetworkManager.cs * Started updating JoinGameWindow.cs - Commented out GUI errors - Updated type 'DiscoveryInfo' to 'ServerResponse' in method ConnectFromDiscovery() params. - Updated Connect() 'port' parameter to use type 'int' rather than 'ushort' as per Mirror conventions. Co-authored-by: Lukas Olson <lukasolson@greyblockgames.com>
2022-04-02 18:15:08 +00:00
using System;
using System.Collections.Generic;
using UnityEngine;
using Mirror;
2022-09-30 12:39:50 +00:00
using UGameCore.Utilities;
using SanAndreasUnity.Behaviours;
namespace SanAndreasUnity.Net
{
public class CustomNetworkManager : NetworkManager
{
Feature/mirror upgrade (#127) * Updated SyncDictionary usage in SyncedBag.cs - Removed the extra class that is no longer needed for SyncDictionary's - Removed OP codes (OP_DIRTY) switch case that no longer exists (superseded by OP_SET) Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated method names Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated more string sync dictionaries Ped_Networking.cs VehicleController.cs Player.cs SyncedServerData.cs Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated NetworkTime fields in NetStats.cs Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated syncData types Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Implemented conditional compilation to replace old isHeadless Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated hooks * A few more syncDictionary upgrades * Moved away from obsolete NetworkIdentity.spawned * Updated SetDirtyBit to SetSyncVarDirtyBit in DeadBody.cs * Updated ScriptingDefineSymbols for Mirror * Updated JoinGameWindow.cs * Use latest MirrorLite commit for submodule * Use latest MirrorLite commit for submodule * Reverted EditorSettings.asset to commit b1c9d38e3ac5113e899ac34ad07bcb8a2890d18b * Reverted JoinGameWindow.cs to commit b1c9d38e3ac5113e899ac34ad07bcb8a2890d18b * Changed method for headless mode in NetCmdLineHandler.cs Changed from compiler defs to SanAndreasUnity helpers for determining headless mode in NetCmdLineHandler.cs * Re-Added ConfigureHeadlessFrameRate override on CustomNetworkManager.cs * Started updating JoinGameWindow.cs - Commented out GUI errors - Updated type 'DiscoveryInfo' to 'ServerResponse' in method ConnectFromDiscovery() params. - Updated Connect() 'port' parameter to use type 'int' rather than 'ushort' as per Mirror conventions. Co-authored-by: Lukas Olson <lukasolson@greyblockgames.com>
2022-04-02 18:15:08 +00:00
public override void OnClientConnect()
{
if (NetStatus.IsServer)
{
// just do default action
Feature/mirror upgrade (#127) * Updated SyncDictionary usage in SyncedBag.cs - Removed the extra class that is no longer needed for SyncDictionary's - Removed OP codes (OP_DIRTY) switch case that no longer exists (superseded by OP_SET) Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated method names Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated more string sync dictionaries Ped_Networking.cs VehicleController.cs Player.cs SyncedServerData.cs Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated NetworkTime fields in NetStats.cs Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated syncData types Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Implemented conditional compilation to replace old isHeadless Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated hooks * A few more syncDictionary upgrades * Moved away from obsolete NetworkIdentity.spawned * Updated SetDirtyBit to SetSyncVarDirtyBit in DeadBody.cs * Updated ScriptingDefineSymbols for Mirror * Updated JoinGameWindow.cs * Use latest MirrorLite commit for submodule * Use latest MirrorLite commit for submodule * Reverted EditorSettings.asset to commit b1c9d38e3ac5113e899ac34ad07bcb8a2890d18b * Reverted JoinGameWindow.cs to commit b1c9d38e3ac5113e899ac34ad07bcb8a2890d18b * Changed method for headless mode in NetCmdLineHandler.cs Changed from compiler defs to SanAndreasUnity helpers for determining headless mode in NetCmdLineHandler.cs * Re-Added ConfigureHeadlessFrameRate override on CustomNetworkManager.cs * Started updating JoinGameWindow.cs - Commented out GUI errors - Updated type 'DiscoveryInfo' to 'ServerResponse' in method ConnectFromDiscovery() params. - Updated Connect() 'port' parameter to use type 'int' rather than 'ushort' as per Mirror conventions. Co-authored-by: Lukas Olson <lukasolson@greyblockgames.com>
2022-04-02 18:15:08 +00:00
base.OnClientConnect();
return;
}
// default method: if no scene was loaded, do Ready/AddPlayer
// we won't do this until loading process finishes
if (Loader.HasLoaded)
Feature/mirror upgrade (#127) * Updated SyncDictionary usage in SyncedBag.cs - Removed the extra class that is no longer needed for SyncDictionary's - Removed OP codes (OP_DIRTY) switch case that no longer exists (superseded by OP_SET) Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated method names Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated more string sync dictionaries Ped_Networking.cs VehicleController.cs Player.cs SyncedServerData.cs Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated NetworkTime fields in NetStats.cs Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated syncData types Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Implemented conditional compilation to replace old isHeadless Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated hooks * A few more syncDictionary upgrades * Moved away from obsolete NetworkIdentity.spawned * Updated SetDirtyBit to SetSyncVarDirtyBit in DeadBody.cs * Updated ScriptingDefineSymbols for Mirror * Updated JoinGameWindow.cs * Use latest MirrorLite commit for submodule * Use latest MirrorLite commit for submodule * Reverted EditorSettings.asset to commit b1c9d38e3ac5113e899ac34ad07bcb8a2890d18b * Reverted JoinGameWindow.cs to commit b1c9d38e3ac5113e899ac34ad07bcb8a2890d18b * Changed method for headless mode in NetCmdLineHandler.cs Changed from compiler defs to SanAndreasUnity helpers for determining headless mode in NetCmdLineHandler.cs * Re-Added ConfigureHeadlessFrameRate override on CustomNetworkManager.cs * Started updating JoinGameWindow.cs - Commented out GUI errors - Updated type 'DiscoveryInfo' to 'ServerResponse' in method ConnectFromDiscovery() params. - Updated Connect() 'port' parameter to use type 'int' rather than 'ushort' as per Mirror conventions. Co-authored-by: Lukas Olson <lukasolson@greyblockgames.com>
2022-04-02 18:15:08 +00:00
base.OnClientConnect();
}
Feature/mirror upgrade (#127) * Updated SyncDictionary usage in SyncedBag.cs - Removed the extra class that is no longer needed for SyncDictionary's - Removed OP codes (OP_DIRTY) switch case that no longer exists (superseded by OP_SET) Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated method names Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated more string sync dictionaries Ped_Networking.cs VehicleController.cs Player.cs SyncedServerData.cs Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated NetworkTime fields in NetStats.cs Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated syncData types Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Implemented conditional compilation to replace old isHeadless Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated hooks * A few more syncDictionary upgrades * Moved away from obsolete NetworkIdentity.spawned * Updated SetDirtyBit to SetSyncVarDirtyBit in DeadBody.cs * Updated ScriptingDefineSymbols for Mirror * Updated JoinGameWindow.cs * Use latest MirrorLite commit for submodule * Use latest MirrorLite commit for submodule * Reverted EditorSettings.asset to commit b1c9d38e3ac5113e899ac34ad07bcb8a2890d18b * Reverted JoinGameWindow.cs to commit b1c9d38e3ac5113e899ac34ad07bcb8a2890d18b * Changed method for headless mode in NetCmdLineHandler.cs Changed from compiler defs to SanAndreasUnity helpers for determining headless mode in NetCmdLineHandler.cs * Re-Added ConfigureHeadlessFrameRate override on CustomNetworkManager.cs * Started updating JoinGameWindow.cs - Commented out GUI errors - Updated type 'DiscoveryInfo' to 'ServerResponse' in method ConnectFromDiscovery() params. - Updated Connect() 'port' parameter to use type 'int' rather than 'ushort' as per Mirror conventions. Co-authored-by: Lukas Olson <lukasolson@greyblockgames.com>
2022-04-02 18:15:08 +00:00
public override void OnClientSceneChanged()
{
if (NetStatus.IsServer)
{
// just do default action
Feature/mirror upgrade (#127) * Updated SyncDictionary usage in SyncedBag.cs - Removed the extra class that is no longer needed for SyncDictionary's - Removed OP codes (OP_DIRTY) switch case that no longer exists (superseded by OP_SET) Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated method names Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated more string sync dictionaries Ped_Networking.cs VehicleController.cs Player.cs SyncedServerData.cs Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated NetworkTime fields in NetStats.cs Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated syncData types Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Implemented conditional compilation to replace old isHeadless Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated hooks * A few more syncDictionary upgrades * Moved away from obsolete NetworkIdentity.spawned * Updated SetDirtyBit to SetSyncVarDirtyBit in DeadBody.cs * Updated ScriptingDefineSymbols for Mirror * Updated JoinGameWindow.cs * Use latest MirrorLite commit for submodule * Use latest MirrorLite commit for submodule * Reverted EditorSettings.asset to commit b1c9d38e3ac5113e899ac34ad07bcb8a2890d18b * Reverted JoinGameWindow.cs to commit b1c9d38e3ac5113e899ac34ad07bcb8a2890d18b * Changed method for headless mode in NetCmdLineHandler.cs Changed from compiler defs to SanAndreasUnity helpers for determining headless mode in NetCmdLineHandler.cs * Re-Added ConfigureHeadlessFrameRate override on CustomNetworkManager.cs * Started updating JoinGameWindow.cs - Commented out GUI errors - Updated type 'DiscoveryInfo' to 'ServerResponse' in method ConnectFromDiscovery() params. - Updated Connect() 'port' parameter to use type 'int' rather than 'ushort' as per Mirror conventions. Co-authored-by: Lukas Olson <lukasolson@greyblockgames.com>
2022-04-02 18:15:08 +00:00
base.OnClientSceneChanged();
return;
}
// default method: do Ready/AddPlayer
// we won't do this until loading process finishes
if (Loader.HasLoaded)
Feature/mirror upgrade (#127) * Updated SyncDictionary usage in SyncedBag.cs - Removed the extra class that is no longer needed for SyncDictionary's - Removed OP codes (OP_DIRTY) switch case that no longer exists (superseded by OP_SET) Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated method names Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated more string sync dictionaries Ped_Networking.cs VehicleController.cs Player.cs SyncedServerData.cs Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated NetworkTime fields in NetStats.cs Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated syncData types Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Implemented conditional compilation to replace old isHeadless Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated hooks * A few more syncDictionary upgrades * Moved away from obsolete NetworkIdentity.spawned * Updated SetDirtyBit to SetSyncVarDirtyBit in DeadBody.cs * Updated ScriptingDefineSymbols for Mirror * Updated JoinGameWindow.cs * Use latest MirrorLite commit for submodule * Use latest MirrorLite commit for submodule * Reverted EditorSettings.asset to commit b1c9d38e3ac5113e899ac34ad07bcb8a2890d18b * Reverted JoinGameWindow.cs to commit b1c9d38e3ac5113e899ac34ad07bcb8a2890d18b * Changed method for headless mode in NetCmdLineHandler.cs Changed from compiler defs to SanAndreasUnity helpers for determining headless mode in NetCmdLineHandler.cs * Re-Added ConfigureHeadlessFrameRate override on CustomNetworkManager.cs * Started updating JoinGameWindow.cs - Commented out GUI errors - Updated type 'DiscoveryInfo' to 'ServerResponse' in method ConnectFromDiscovery() params. - Updated Connect() 'port' parameter to use type 'int' rather than 'ushort' as per Mirror conventions. Co-authored-by: Lukas Olson <lukasolson@greyblockgames.com>
2022-04-02 18:15:08 +00:00
base.OnClientSceneChanged();
}
void OnLoaderFinished()
{
2022-01-30 00:06:45 +00:00
if (F.IsAppInEditMode)
2022-01-22 01:07:08 +00:00
return;
if (NetStatus.IsServer) // don't do anything on server
return;
if (!NetworkClient.isConnected)
{
// client is not connected ? hmm... then loading process could not have started
Debug.LogErrorFormat("Loader finished, but client is not connected");
return;
}
Feature/mirror upgrade (#127) * Updated SyncDictionary usage in SyncedBag.cs - Removed the extra class that is no longer needed for SyncDictionary's - Removed OP codes (OP_DIRTY) switch case that no longer exists (superseded by OP_SET) Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated method names Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated more string sync dictionaries Ped_Networking.cs VehicleController.cs Player.cs SyncedServerData.cs Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated NetworkTime fields in NetStats.cs Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated syncData types Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Implemented conditional compilation to replace old isHeadless Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated hooks * A few more syncDictionary upgrades * Moved away from obsolete NetworkIdentity.spawned * Updated SetDirtyBit to SetSyncVarDirtyBit in DeadBody.cs * Updated ScriptingDefineSymbols for Mirror * Updated JoinGameWindow.cs * Use latest MirrorLite commit for submodule * Use latest MirrorLite commit for submodule * Reverted EditorSettings.asset to commit b1c9d38e3ac5113e899ac34ad07bcb8a2890d18b * Reverted JoinGameWindow.cs to commit b1c9d38e3ac5113e899ac34ad07bcb8a2890d18b * Changed method for headless mode in NetCmdLineHandler.cs Changed from compiler defs to SanAndreasUnity helpers for determining headless mode in NetCmdLineHandler.cs * Re-Added ConfigureHeadlessFrameRate override on CustomNetworkManager.cs * Started updating JoinGameWindow.cs - Commented out GUI errors - Updated type 'DiscoveryInfo' to 'ServerResponse' in method ConnectFromDiscovery() params. - Updated Connect() 'port' parameter to use type 'int' rather than 'ushort' as per Mirror conventions. Co-authored-by: Lukas Olson <lukasolson@greyblockgames.com>
2022-04-02 18:15:08 +00:00
// make client ready
Feature/mirror upgrade (#127) * Updated SyncDictionary usage in SyncedBag.cs - Removed the extra class that is no longer needed for SyncDictionary's - Removed OP codes (OP_DIRTY) switch case that no longer exists (superseded by OP_SET) Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated method names Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated more string sync dictionaries Ped_Networking.cs VehicleController.cs Player.cs SyncedServerData.cs Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated NetworkTime fields in NetStats.cs Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated syncData types Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Implemented conditional compilation to replace old isHeadless Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated hooks * A few more syncDictionary upgrades * Moved away from obsolete NetworkIdentity.spawned * Updated SetDirtyBit to SetSyncVarDirtyBit in DeadBody.cs * Updated ScriptingDefineSymbols for Mirror * Updated JoinGameWindow.cs * Use latest MirrorLite commit for submodule * Use latest MirrorLite commit for submodule * Reverted EditorSettings.asset to commit b1c9d38e3ac5113e899ac34ad07bcb8a2890d18b * Reverted JoinGameWindow.cs to commit b1c9d38e3ac5113e899ac34ad07bcb8a2890d18b * Changed method for headless mode in NetCmdLineHandler.cs Changed from compiler defs to SanAndreasUnity helpers for determining headless mode in NetCmdLineHandler.cs * Re-Added ConfigureHeadlessFrameRate override on CustomNetworkManager.cs * Started updating JoinGameWindow.cs - Commented out GUI errors - Updated type 'DiscoveryInfo' to 'ServerResponse' in method ConnectFromDiscovery() params. - Updated Connect() 'port' parameter to use type 'int' rather than 'ushort' as per Mirror conventions. Co-authored-by: Lukas Olson <lukasolson@greyblockgames.com>
2022-04-02 18:15:08 +00:00
if (NetworkClient.ready)
Debug.LogErrorFormat("Client was made ready before loader finished");
else
Feature/mirror upgrade (#127) * Updated SyncDictionary usage in SyncedBag.cs - Removed the extra class that is no longer needed for SyncDictionary's - Removed OP codes (OP_DIRTY) switch case that no longer exists (superseded by OP_SET) Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated method names Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated more string sync dictionaries Ped_Networking.cs VehicleController.cs Player.cs SyncedServerData.cs Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated NetworkTime fields in NetStats.cs Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated syncData types Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Implemented conditional compilation to replace old isHeadless Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated hooks * A few more syncDictionary upgrades * Moved away from obsolete NetworkIdentity.spawned * Updated SetDirtyBit to SetSyncVarDirtyBit in DeadBody.cs * Updated ScriptingDefineSymbols for Mirror * Updated JoinGameWindow.cs * Use latest MirrorLite commit for submodule * Use latest MirrorLite commit for submodule * Reverted EditorSettings.asset to commit b1c9d38e3ac5113e899ac34ad07bcb8a2890d18b * Reverted JoinGameWindow.cs to commit b1c9d38e3ac5113e899ac34ad07bcb8a2890d18b * Changed method for headless mode in NetCmdLineHandler.cs Changed from compiler defs to SanAndreasUnity helpers for determining headless mode in NetCmdLineHandler.cs * Re-Added ConfigureHeadlessFrameRate override on CustomNetworkManager.cs * Started updating JoinGameWindow.cs - Commented out GUI errors - Updated type 'DiscoveryInfo' to 'ServerResponse' in method ConnectFromDiscovery() params. - Updated Connect() 'port' parameter to use type 'int' rather than 'ushort' as per Mirror conventions. Co-authored-by: Lukas Olson <lukasolson@greyblockgames.com>
2022-04-02 18:15:08 +00:00
{
NetworkClient.Ready();
}
// add player if specified
Feature/mirror upgrade (#127) * Updated SyncDictionary usage in SyncedBag.cs - Removed the extra class that is no longer needed for SyncDictionary's - Removed OP codes (OP_DIRTY) switch case that no longer exists (superseded by OP_SET) Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated method names Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated more string sync dictionaries Ped_Networking.cs VehicleController.cs Player.cs SyncedServerData.cs Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated NetworkTime fields in NetStats.cs Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated syncData types Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Implemented conditional compilation to replace old isHeadless Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated hooks * A few more syncDictionary upgrades * Moved away from obsolete NetworkIdentity.spawned * Updated SetDirtyBit to SetSyncVarDirtyBit in DeadBody.cs * Updated ScriptingDefineSymbols for Mirror * Updated JoinGameWindow.cs * Use latest MirrorLite commit for submodule * Use latest MirrorLite commit for submodule * Reverted EditorSettings.asset to commit b1c9d38e3ac5113e899ac34ad07bcb8a2890d18b * Reverted JoinGameWindow.cs to commit b1c9d38e3ac5113e899ac34ad07bcb8a2890d18b * Changed method for headless mode in NetCmdLineHandler.cs Changed from compiler defs to SanAndreasUnity helpers for determining headless mode in NetCmdLineHandler.cs * Re-Added ConfigureHeadlessFrameRate override on CustomNetworkManager.cs * Started updating JoinGameWindow.cs - Commented out GUI errors - Updated type 'DiscoveryInfo' to 'ServerResponse' in method ConnectFromDiscovery() params. - Updated Connect() 'port' parameter to use type 'int' rather than 'ushort' as per Mirror conventions. Co-authored-by: Lukas Olson <lukasolson@greyblockgames.com>
2022-04-02 18:15:08 +00:00
if (autoCreatePlayer && NetworkClient.localPlayer == null)
{
Feature/mirror upgrade (#127) * Updated SyncDictionary usage in SyncedBag.cs - Removed the extra class that is no longer needed for SyncDictionary's - Removed OP codes (OP_DIRTY) switch case that no longer exists (superseded by OP_SET) Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated method names Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated more string sync dictionaries Ped_Networking.cs VehicleController.cs Player.cs SyncedServerData.cs Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated NetworkTime fields in NetStats.cs Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated syncData types Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Implemented conditional compilation to replace old isHeadless Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated hooks * A few more syncDictionary upgrades * Moved away from obsolete NetworkIdentity.spawned * Updated SetDirtyBit to SetSyncVarDirtyBit in DeadBody.cs * Updated ScriptingDefineSymbols for Mirror * Updated JoinGameWindow.cs * Use latest MirrorLite commit for submodule * Use latest MirrorLite commit for submodule * Reverted EditorSettings.asset to commit b1c9d38e3ac5113e899ac34ad07bcb8a2890d18b * Reverted JoinGameWindow.cs to commit b1c9d38e3ac5113e899ac34ad07bcb8a2890d18b * Changed method for headless mode in NetCmdLineHandler.cs Changed from compiler defs to SanAndreasUnity helpers for determining headless mode in NetCmdLineHandler.cs * Re-Added ConfigureHeadlessFrameRate override on CustomNetworkManager.cs * Started updating JoinGameWindow.cs - Commented out GUI errors - Updated type 'DiscoveryInfo' to 'ServerResponse' in method ConnectFromDiscovery() params. - Updated Connect() 'port' parameter to use type 'int' rather than 'ushort' as per Mirror conventions. Co-authored-by: Lukas Olson <lukasolson@greyblockgames.com>
2022-04-02 18:15:08 +00:00
NetworkClient.AddPlayer();
}
}
Feature/mirror upgrade (#127) * Updated SyncDictionary usage in SyncedBag.cs - Removed the extra class that is no longer needed for SyncDictionary's - Removed OP codes (OP_DIRTY) switch case that no longer exists (superseded by OP_SET) Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated method names Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated more string sync dictionaries Ped_Networking.cs VehicleController.cs Player.cs SyncedServerData.cs Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated NetworkTime fields in NetStats.cs Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated syncData types Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Implemented conditional compilation to replace old isHeadless Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated hooks * A few more syncDictionary upgrades * Moved away from obsolete NetworkIdentity.spawned * Updated SetDirtyBit to SetSyncVarDirtyBit in DeadBody.cs * Updated ScriptingDefineSymbols for Mirror * Updated JoinGameWindow.cs * Use latest MirrorLite commit for submodule * Use latest MirrorLite commit for submodule * Reverted EditorSettings.asset to commit b1c9d38e3ac5113e899ac34ad07bcb8a2890d18b * Reverted JoinGameWindow.cs to commit b1c9d38e3ac5113e899ac34ad07bcb8a2890d18b * Changed method for headless mode in NetCmdLineHandler.cs Changed from compiler defs to SanAndreasUnity helpers for determining headless mode in NetCmdLineHandler.cs * Re-Added ConfigureHeadlessFrameRate override on CustomNetworkManager.cs * Started updating JoinGameWindow.cs - Commented out GUI errors - Updated type 'DiscoveryInfo' to 'ServerResponse' in method ConnectFromDiscovery() params. - Updated Connect() 'port' parameter to use type 'int' rather than 'ushort' as per Mirror conventions. Co-authored-by: Lukas Olson <lukasolson@greyblockgames.com>
2022-04-02 18:15:08 +00:00
public override void ConfigureHeadlessFrameRate()
2019-07-08 14:41:43 +00:00
{
Feature/mirror upgrade (#127) * Updated SyncDictionary usage in SyncedBag.cs - Removed the extra class that is no longer needed for SyncDictionary's - Removed OP codes (OP_DIRTY) switch case that no longer exists (superseded by OP_SET) Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated method names Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated more string sync dictionaries Ped_Networking.cs VehicleController.cs Player.cs SyncedServerData.cs Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated NetworkTime fields in NetStats.cs Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated syncData types Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Implemented conditional compilation to replace old isHeadless Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated hooks * A few more syncDictionary upgrades * Moved away from obsolete NetworkIdentity.spawned * Updated SetDirtyBit to SetSyncVarDirtyBit in DeadBody.cs * Updated ScriptingDefineSymbols for Mirror * Updated JoinGameWindow.cs * Use latest MirrorLite commit for submodule * Use latest MirrorLite commit for submodule * Reverted EditorSettings.asset to commit b1c9d38e3ac5113e899ac34ad07bcb8a2890d18b * Reverted JoinGameWindow.cs to commit b1c9d38e3ac5113e899ac34ad07bcb8a2890d18b * Changed method for headless mode in NetCmdLineHandler.cs Changed from compiler defs to SanAndreasUnity helpers for determining headless mode in NetCmdLineHandler.cs * Re-Added ConfigureHeadlessFrameRate override on CustomNetworkManager.cs * Started updating JoinGameWindow.cs - Commented out GUI errors - Updated type 'DiscoveryInfo' to 'ServerResponse' in method ConnectFromDiscovery() params. - Updated Connect() 'port' parameter to use type 'int' rather than 'ushort' as per Mirror conventions. Co-authored-by: Lukas Olson <lukasolson@greyblockgames.com>
2022-04-02 18:15:08 +00:00
//Overriden so that other scripts can set the framerate without Mirror overriding it.
2019-07-08 14:41:43 +00:00
}
}
Feature/mirror upgrade (#127) * Updated SyncDictionary usage in SyncedBag.cs - Removed the extra class that is no longer needed for SyncDictionary's - Removed OP codes (OP_DIRTY) switch case that no longer exists (superseded by OP_SET) Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated method names Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated more string sync dictionaries Ped_Networking.cs VehicleController.cs Player.cs SyncedServerData.cs Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated NetworkTime fields in NetStats.cs Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated syncData types Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Implemented conditional compilation to replace old isHeadless Signed-off-by: Lukas Olson <lukasolson@greyblockgames.com> * Updated hooks * A few more syncDictionary upgrades * Moved away from obsolete NetworkIdentity.spawned * Updated SetDirtyBit to SetSyncVarDirtyBit in DeadBody.cs * Updated ScriptingDefineSymbols for Mirror * Updated JoinGameWindow.cs * Use latest MirrorLite commit for submodule * Use latest MirrorLite commit for submodule * Reverted EditorSettings.asset to commit b1c9d38e3ac5113e899ac34ad07bcb8a2890d18b * Reverted JoinGameWindow.cs to commit b1c9d38e3ac5113e899ac34ad07bcb8a2890d18b * Changed method for headless mode in NetCmdLineHandler.cs Changed from compiler defs to SanAndreasUnity helpers for determining headless mode in NetCmdLineHandler.cs * Re-Added ConfigureHeadlessFrameRate override on CustomNetworkManager.cs * Started updating JoinGameWindow.cs - Commented out GUI errors - Updated type 'DiscoveryInfo' to 'ServerResponse' in method ConnectFromDiscovery() params. - Updated Connect() 'port' parameter to use type 'int' rather than 'ushort' as per Mirror conventions. Co-authored-by: Lukas Olson <lukasolson@greyblockgames.com>
2022-04-02 18:15:08 +00:00
}