Search Results for

    Show / Hide Table of Contents

    MessageHandlerAttribute Class

    Namespace: Riptide
    Assembly: RiptideNetworking.dll

    Specifies a method as the message handler for messages with the given ID.

    [AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = false)]
    public sealed class MessageHandlerAttribute : Attribute
    Inheritance
    object
    Attribute
    MessageHandlerAttribute

    Remarks

    In order for a method to qualify as a message handler, it must match a valid message handler method signature. Servers will only use methods marked with this attribute if they match the Server.MessageHandler signature, and Clients will only use methods marked with this attribute if they match the Client.MessageHandler signature.

    Methods marked with this attribute which match neither of the valid message handler signatures will not be used by Servers or Clients and will cause warnings at runtime.

    If you want a Server or Client to only use a subset of all message handler methods, you can do so by setting up custom message handler groups. Simply set the group ID in the MessageHandlerAttribute(ushort, byte) constructor and pass the same value to the Start(ushort, ushort, byte, bool) or Connect(string, int, byte, Message, bool) method. This will make that Server or Client only use message handlers which have the same group ID.

    Inherited Members
    Attribute.Equals(object)
    Attribute.GetCustomAttribute(Assembly, Type)
    Attribute.GetCustomAttribute(Assembly, Type, bool)
    Attribute.GetCustomAttribute(MemberInfo, Type)
    Attribute.GetCustomAttribute(MemberInfo, Type, bool)
    Attribute.GetCustomAttribute(Module, Type)
    Attribute.GetCustomAttribute(Module, Type, bool)
    Attribute.GetCustomAttribute(ParameterInfo, Type)
    Attribute.GetCustomAttribute(ParameterInfo, Type, bool)
    Attribute.GetCustomAttributes(Assembly)
    Attribute.GetCustomAttributes(Assembly, bool)
    Attribute.GetCustomAttributes(Assembly, Type)
    Attribute.GetCustomAttributes(Assembly, Type, bool)
    Attribute.GetCustomAttributes(MemberInfo)
    Attribute.GetCustomAttributes(MemberInfo, bool)
    Attribute.GetCustomAttributes(MemberInfo, Type)
    Attribute.GetCustomAttributes(MemberInfo, Type, bool)
    Attribute.GetCustomAttributes(Module)
    Attribute.GetCustomAttributes(Module, bool)
    Attribute.GetCustomAttributes(Module, Type)
    Attribute.GetCustomAttributes(Module, Type, bool)
    Attribute.GetCustomAttributes(ParameterInfo)
    Attribute.GetCustomAttributes(ParameterInfo, bool)
    Attribute.GetCustomAttributes(ParameterInfo, Type)
    Attribute.GetCustomAttributes(ParameterInfo, Type, bool)
    Attribute.GetHashCode()
    Attribute.IsDefaultAttribute()
    Attribute.IsDefined(Assembly, Type)
    Attribute.IsDefined(Assembly, Type, bool)
    Attribute.IsDefined(MemberInfo, Type)
    Attribute.IsDefined(MemberInfo, Type, bool)
    Attribute.IsDefined(Module, Type)
    Attribute.IsDefined(Module, Type, bool)
    Attribute.IsDefined(ParameterInfo, Type)
    Attribute.IsDefined(ParameterInfo, Type, bool)
    Attribute.Match(object)
    Attribute.TypeId
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()

    Constructors

    MessageHandlerAttribute(ushort, byte)

    Initializes a new instance of the MessageHandlerAttribute class with the messageId and groupId values.

    Fields

    GroupId

    The ID of the group of message handlers which this method belongs to.

    MessageId

    The ID of the message type which this method is meant to handle.

    • Improve this Doc
    • View Source
    • Support Riptide
    In This Article
    Back to top Copyright © Tom Weiland 2022
    Made with DocFX