Documentation ¶
Overview ¶
Package protocol implements the NAT Traversal protocol
Package protocol implements the NAT Traversal protocol ¶
Package protocol implements the NAT Traversal protocol ¶
Package protocol implements the NAT Traversal protocol ¶
Package protocol implements the NAT Traversal protocol ¶
Package protocol implements the NAT Traversal protocol ¶
Package protocol implements the Persistent Store protocol ¶
Package protocol implements the NAT Traversal protocol
Index ¶
- Constants
- type Interface
- type Protocol
- func (protocol *Protocol) Endpoint() nex.EndpointInterface
- func (protocol *Protocol) HandlePacket(packet nex.PacketInterface)
- func (protocol *Protocol) SetEndpoint(endpoint nex.EndpointInterface)
- func (protocol *Protocol) SetHandlerFindByGroup(...)
- func (protocol *Protocol) SetHandlerFindItemsBySQLQuery(...)
- func (protocol *Protocol) SetHandlerGetCustomItem(...)
- func (protocol *Protocol) SetHandlerGetItem(...)
- func (protocol *Protocol) SetHandlerInsertCustomItem(...)
- func (protocol *Protocol) SetHandlerInsertItem(...)
- func (protocol *Protocol) SetHandlerRemoveItem(...)
Constants ¶
const ( // ProtocolID is the protocol ID for the Persistent Store protocol ProtocolID = 0x18 // MethodFindByGroup is the method ID for method FindByGroup MethodFindByGroup = 0x1 // MethodInsertItem is the method ID for method InsertItem MethodInsertItem = 0x2 // MethodRemoveItem is the method ID for method RemoveItem MethodRemoveItem = 0x3 // MethodGetItem is the method ID for method GetItem MethodGetItem = 0x4 // MethodInsertCustomItem is the method ID for method InsertCustomItem MethodInsertCustomItem = 0x5 // MethodGetCustomItem is the method ID for method GetCustomItem MethodGetCustomItem = 0x6 // MethodFindItemsBySQLQuery is the method ID for method FindItemsBySQLQuery MethodFindItemsBySQLQuery = 0x7 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Interface ¶
type Interface interface { Endpoint() nex.EndpointInterface SetEndpoint(endpoint nex.EndpointInterface) SetHandlerFindByGroup(handler func(err error, packet nex.PacketInterface, callID uint32, uiGroup *types.PrimitiveU32) (*nex.RMCMessage, *nex.Error)) SetHandlerInsertItem(handler func(err error, packet nex.PacketInterface, callID uint32, uiGroup *types.PrimitiveU32, strTag *types.String, bufData *types.Buffer, bReplace *types.PrimitiveBool) (*nex.RMCMessage, *nex.Error)) SetHandlerRemoveItem(handler func(err error, packet nex.PacketInterface, callID uint32, uiGroup *types.PrimitiveU32, strTag *types.String) (*nex.RMCMessage, *nex.Error)) SetHandlerGetItem(handler func(err error, packet nex.PacketInterface, callID uint32, uiGroup *types.PrimitiveU32, strTag *types.String) (*nex.RMCMessage, *nex.Error)) SetHandlerInsertCustomItem(handler func(err error, packet nex.PacketInterface, callID uint32, uiGroup *types.PrimitiveU32, strTag *types.String, hData *types.AnyDataHolder, bReplace *types.PrimitiveBool) (*nex.RMCMessage, *nex.Error)) SetHandlerGetCustomItem(handler func(err error, packet nex.PacketInterface, callID uint32, uiGroup *types.PrimitiveU32, strTag *types.String) (*nex.RMCMessage, *nex.Error)) SetHandlerFindItemsBySQLQuery(handler func(err error, packet nex.PacketInterface, callID uint32, uiGroup *types.PrimitiveU32, strTag *types.String, strQuery *types.String) (*nex.RMCMessage, *nex.Error)) }
Interface implements the methods present on the Persistent Store protocol struct
type Protocol ¶
type Protocol struct { FindByGroup func(err error, packet nex.PacketInterface, callID uint32, uiGroup *types.PrimitiveU32) (*nex.RMCMessage, *nex.Error) InsertItem func(err error, packet nex.PacketInterface, callID uint32, uiGroup *types.PrimitiveU32, strTag *types.String, bufData *types.Buffer, bReplace *types.PrimitiveBool) (*nex.RMCMessage, *nex.Error) RemoveItem func(err error, packet nex.PacketInterface, callID uint32, uiGroup *types.PrimitiveU32, strTag *types.String) (*nex.RMCMessage, *nex.Error) GetItem func(err error, packet nex.PacketInterface, callID uint32, uiGroup *types.PrimitiveU32, strTag *types.String) (*nex.RMCMessage, *nex.Error) InsertCustomItem func(err error, packet nex.PacketInterface, callID uint32, uiGroup *types.PrimitiveU32, strTag *types.String, hData *types.AnyDataHolder, bReplace *types.PrimitiveBool) (*nex.RMCMessage, *nex.Error) GetCustomItem func(err error, packet nex.PacketInterface, callID uint32, uiGroup *types.PrimitiveU32, strTag *types.String) (*nex.RMCMessage, *nex.Error) FindItemsBySQLQuery func(err error, packet nex.PacketInterface, callID uint32, uiGroup *types.PrimitiveU32, strTag *types.String, strQuery *types.String) (*nex.RMCMessage, *nex.Error) Patches nex.ServiceProtocol PatchedMethods []uint32 // contains filtered or unexported fields }
Protocol handles the Persistent Store protocol
func (*Protocol) Endpoint ¶
func (protocol *Protocol) Endpoint() nex.EndpointInterface
Endpoint returns the endpoint implementing the protocol
func (*Protocol) HandlePacket ¶
func (protocol *Protocol) HandlePacket(packet nex.PacketInterface)
HandlePacket sends the packet to the correct RMC method handler
func (*Protocol) SetEndpoint ¶
func (protocol *Protocol) SetEndpoint(endpoint nex.EndpointInterface)
SetEndpoint sets the endpoint implementing the protocol
func (*Protocol) SetHandlerFindByGroup ¶
func (protocol *Protocol) SetHandlerFindByGroup(handler func(err error, packet nex.PacketInterface, callID uint32, uiGroup *types.PrimitiveU32) (*nex.RMCMessage, *nex.Error))
SetHandlerFindByGroup sets the handler for the FindByGroup method
func (*Protocol) SetHandlerFindItemsBySQLQuery ¶
func (protocol *Protocol) SetHandlerFindItemsBySQLQuery(handler func(err error, packet nex.PacketInterface, callID uint32, uiGroup *types.PrimitiveU32, strTag *types.String, strQuery *types.String) (*nex.RMCMessage, *nex.Error))
SetHandlerFindItemsBySQLQuery sets the handler for the FindItemsBySQLQuery method
func (*Protocol) SetHandlerGetCustomItem ¶
func (protocol *Protocol) SetHandlerGetCustomItem(handler func(err error, packet nex.PacketInterface, callID uint32, uiGroup *types.PrimitiveU32, strTag *types.String) (*nex.RMCMessage, *nex.Error))
SetHandlerGetCustomItem sets the handler for the GetCustomItem method
func (*Protocol) SetHandlerGetItem ¶
func (protocol *Protocol) SetHandlerGetItem(handler func(err error, packet nex.PacketInterface, callID uint32, uiGroup *types.PrimitiveU32, strTag *types.String) (*nex.RMCMessage, *nex.Error))
SetHandlerGetItem sets the handler for the GetItem method
func (*Protocol) SetHandlerInsertCustomItem ¶
func (protocol *Protocol) SetHandlerInsertCustomItem(handler func(err error, packet nex.PacketInterface, callID uint32, uiGroup *types.PrimitiveU32, strTag *types.String, hData *types.AnyDataHolder, bReplace *types.PrimitiveBool) (*nex.RMCMessage, *nex.Error))
SetHandlerInsertCustomItem sets the handler for the InsertCustomItem method
func (*Protocol) SetHandlerInsertItem ¶
func (protocol *Protocol) SetHandlerInsertItem(handler func(err error, packet nex.PacketInterface, callID uint32, uiGroup *types.PrimitiveU32, strTag *types.String, bufData *types.Buffer, bReplace *types.PrimitiveBool) (*nex.RMCMessage, *nex.Error))
SetHandlerInsertItem sets the handler for the InsertItem method
func (*Protocol) SetHandlerRemoveItem ¶
func (protocol *Protocol) SetHandlerRemoveItem(handler func(err error, packet nex.PacketInterface, callID uint32, uiGroup *types.PrimitiveU32, strTag *types.String) (*nex.RMCMessage, *nex.Error))
SetHandlerRemoveItem sets the handler for the RemoveItem method