deltavr multiplayer 2.0

This commit is contained in:
Toomas Tamm
2023-05-08 15:56:10 +03:00
parent 978809a002
commit 07b9b9e2f4
10937 changed files with 2968397 additions and 1521012 deletions

View File

@@ -0,0 +1,51 @@
using FishNet.Connection;
using FishNet.Managing;
using System;
using UnityEngine;
namespace FishNet.Authenticating
{
/// <summary>
/// When inherited from this can be used to create a custom authentication process before clients may communicate with the server.
/// </summary>
public abstract class Authenticator : MonoBehaviour
{
#region Public.
/// <summary>
/// True if this authenticator has been intiialzied.
/// </summary>
public bool Initialized { get; private set; }
#endregion
#region Protected.
/// <summary>
/// NetworkManager for this Authenticator.
/// </summary>
protected NetworkManager NetworkManager { get; private set; }
#endregion
/// <summary>
/// Called when authenticator has concluded a result for a connection. Boolean is true if authentication passed, false if failed.
/// Server listens for this event automatically.
/// </summary>
public abstract event Action<NetworkConnection, bool> OnAuthenticationResult;
/// <summary>
/// Initializes this script for use.
/// </summary>
/// <param name="networkManager"></param>
public virtual void InitializeOnce(NetworkManager networkManager)
{
NetworkManager = networkManager;
Initialized = true;
}
/// <summary>
/// Called on the server immediately after a client connects. Can be used to send data to the client for authentication.
/// </summary>
/// <param name="connection">Connection which is not yet authenticated.</param>
public virtual void OnRemoteConnection(NetworkConnection connection) { }
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a9adfb82407774645a1f455ceb9298f9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: