Skip to content

Commit

Permalink
Revert "Documented the attributes."
Browse files Browse the repository at this point in the history
This reverts commit 0c9bb7149f4297154012a7d6999e237e7219b8b0.
  • Loading branch information
Hertzole authored and paulpach committed Jan 14, 2019
1 parent a5cfc81 commit 9e3dcc7
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions Assets/Mirror/Runtime/CustomAttributes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,79 +10,51 @@ public class NetworkSettingsAttribute : Attribute
public float sendInterval = 0.1f;
}

/// <summary>
/// Automatically syncs a value from the server to clients.
/// </summary>
[AttributeUsage(AttributeTargets.Field)]
public class SyncVarAttribute : Attribute
{
///<summary>A function that should be called when the value changes on the client.</summary>
public string hook;
}

/// <summary>
/// Command functions must start with 'Cmd' and they allow clients to send a command to the server to invoke a method.
/// </summary>
[AttributeUsage(AttributeTargets.Method)]
public class CommandAttribute : Attribute
{
public int channel = Channels.DefaultReliable; // this is zero
}

/// <summary>
/// ClientRpc functions must start with 'Rpc' and they allow methods to be invoked on clients from the server.
/// </summary>
[AttributeUsage(AttributeTargets.Method)]
public class ClientRpcAttribute : Attribute
{
public int channel = Channels.DefaultReliable; // this is zero
}

/// <summary>
/// TargetRpc functions must start with 'Target' and they allow methods to be invoked on a specific client from the server.
/// </summary>
[AttributeUsage(AttributeTargets.Method)]
public class TargetRpcAttribute : Attribute
{
public int channel = Channels.DefaultReliable; // this is zero
}

/// <summary>
/// SyncEvent events must start with 'Event' and they allow events to be invoked on a client from the server.
/// </summary>
[AttributeUsage(AttributeTargets.Event)]
public class SyncEventAttribute : Attribute
{
public int channel = Channels.DefaultReliable; // this is zero
}

/// <summary>
/// Only allows code to be run on the server, and generates a warning if a client tries to run it.
/// </summary>
[AttributeUsage(AttributeTargets.Method)]
public class ServerAttribute : Attribute
{
}

/// <summary>
/// Only allows code to be run on the server, and does not generate a warning if a client tries to run it.
/// </summary>
[AttributeUsage(AttributeTargets.Method)]
public class ServerCallbackAttribute : Attribute
{
}

/// <summary>
/// Only allows code to be run on clients, and generates a warning if the server tries to run it.
/// </summary>
[AttributeUsage(AttributeTargets.Method)]
public class ClientAttribute : Attribute
{
}

/// <summary>
/// Only allows code to be run on clients, and does not generate a warning if the server tries to run it.
/// </summary>
[AttributeUsage(AttributeTargets.Method)]
public class ClientCallbackAttribute : Attribute
{
Expand Down

0 comments on commit 9e3dcc7

Please sign in to comment.