NetworkClient

This commit is contained in:
Chris Langsenkamp 2019-07-29 12:55:38 -04:00
parent 99682a43bc
commit f6a441438e

View File

@ -22,6 +22,10 @@ public enum ConnectState
/// </summary>
public class NetworkClient
{
/// <summary>
/// Obsolete: Use NetworkClient directly.
/// <para>Singleton isn't needed anymore, all functions are static now. For example: NetworkClient.Send(message) instead of NetworkClient.singleton.Send(message).</para>
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never), Obsolete("Use NetworkClient directly. Singleton isn't needed anymore, all functions are static now. For example: NetworkClient.Send(message) instead of NetworkClient.singleton.Send(message).")]
public static NetworkClient singleton = new NetworkClient();
@ -218,6 +222,9 @@ static void RemoveTransportHandlers()
Transport.activeTransport.OnClientError.RemoveListener(OnError);
}
/// <summary>
/// Obsolete: Use SendMessage<T> instead with no message id instead
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never), Obsolete("Use SendMessage<T> instead with no message id instead")]
public static bool Send(short msgType, MessageBase msg)
{
@ -326,6 +333,9 @@ void GenerateError(byte error)
}
*/
/// <summary>
/// Obsolete: Use NetworkTime.rtt instead
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never), Obsolete("Use NetworkTime.rtt instead")]
public static float GetRTT()
{
@ -364,6 +374,9 @@ internal static void RegisterSystemHandlers(bool localClient)
RegisterHandler<SyncEventMessage>(ClientScene.OnSyncEventMessage);
}
/// <summary>
/// Obsolete: Use RegisterHandler<T> instead
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never), Obsolete("Use RegisterHandler<T> instead")]
public static void RegisterHandler(int msgType, NetworkMessageDelegate handler)
{
@ -374,6 +387,9 @@ public static void RegisterHandler(int msgType, NetworkMessageDelegate handler)
handlers[msgType] = handler;
}
/// <summary>
/// Obsolete: Use RegisterHandler<T> instead
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never), Obsolete("Use RegisterHandler<T> instead")]
public static void RegisterHandler(MsgType msgType, NetworkMessageDelegate handler)
{
@ -396,12 +412,18 @@ public static void RegisterHandler(MsgType msgType, NetworkMessageDelegate handl
handlers[msgType] = MessagePacker.MessageHandler<T>(handler);
}
/// <summary>
/// Obsolete: Use UnregisterHandler<T> instead
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never), Obsolete("Use UnregisterHandler<T> instead")]
public static void UnregisterHandler(int msgType)
{
handlers.Remove(msgType);
}
/// <summary>
/// Obsolete: Use UnregisterHandler<T> instead
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never), Obsolete("Use UnregisterHandler<T> instead")]
public static void UnregisterHandler(MsgType msgType)
{
@ -430,6 +452,9 @@ public static void Shutdown()
connectState = ConnectState.None;
}
/// <summary>
/// Obsolete: Call NetworkClient.Shutdown() instead. There is only one client.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never), Obsolete("Call NetworkClient.Shutdown() instead. There is only one client.")]
public static void ShutdownAll()
{