Documentation
¶
Overview ¶
Package nex implements an API for creating bare-bones NEX servers and clients and provides the underlying PRUDP implementation
No NEX protocols are implemented in this package. For NEX protocols see https://github.com/PretendoNetwork/nex-protocols-go
No PIA code is implemented in this package
Index ¶
- Constants
- Variables
- func DeriveKerberosKey(pid uint32, password []byte) []byte
- func ErrorNameFromCode(errorCode uint32) string
- func MD5Hash(text []byte) []byte
- func RegisterDataHolderType(name string, structure StructureInterface)
- type Client
- func (client *Client) AddStationURL(stationURL *StationURL)
- func (client *Client) Address() *net.UDPAddr
- func (client *Client) Cipher() *rc4.Cipher
- func (client *Client) ClientConnectionSignature() []byte
- func (client *Client) ConnectionID() uint32
- func (client *Client) Decipher() *rc4.Cipher
- func (client *Client) IncreasePingTimeoutTime(seconds int)
- func (client *Client) PID() uint32
- func (client *Client) PRUDPProtocolMinorVersion() int
- func (client *Client) Reset() error
- func (client *Client) SequenceIDCounterIn() *Counter
- func (client *Client) SequenceIDOutManager() *SequenceIDManager
- func (client *Client) Server() *Server
- func (client *Client) ServerConnectionSignature() []byte
- func (client *Client) SessionKey() []byte
- func (client *Client) SetClientConnectionSignature(clientConnectionSignature []byte)
- func (client *Client) SetConnected(connected bool)
- func (client *Client) SetConnectionID(connectionID uint32)
- func (client *Client) SetPID(pid uint32)
- func (client *Client) SetPRUDPProtocolMinorVersion(prudpProtocolMinorVersion int)
- func (client *Client) SetServerConnectionSignature(serverConnectionSignature []byte)
- func (client *Client) SetSessionKey(sessionKey []byte)
- func (client *Client) SetStationURLs(stationURLs []*StationURL)
- func (client *Client) SetSupportedFunctions(supportedFunctions int)
- func (client *Client) SignatureBase() int
- func (client *Client) SignatureKey() []byte
- func (client *Client) StartTimeoutTimer()
- func (client *Client) StationURLs() []*StationURL
- func (client *Client) StopTimeoutTimer()
- func (client *Client) SupportedFunctions() int
- func (client *Client) UpdateAccessKey(accessKey string)
- func (client *Client) UpdateRC4Key(key []byte) error
- type Counter
- type Data
- func (data *Data) Bytes(stream *StreamOut) []byte
- func (data *Data) Copy() StructureInterface
- func (data *Data) Equals(structure StructureInterface) bool
- func (data *Data) ExtractFromStream(stream *StreamIn) error
- func (data *Data) FormatToString(indentationLevel int) string
- func (data *Data) String() string
- type DataHolder
- func (dataHolder *DataHolder) Bytes(stream *StreamOut) []byte
- func (dataHolder *DataHolder) Copy() *DataHolder
- func (dataHolder *DataHolder) Equals(other *DataHolder) bool
- func (dataHolder *DataHolder) ExtractFromStream(stream *StreamIn) error
- func (dataHolder *DataHolder) FormatToString(indentationLevel int) string
- func (dataHolder *DataHolder) ObjectData() StructureInterface
- func (dataHolder *DataHolder) SetObjectData(objectData StructureInterface)
- func (dataHolder *DataHolder) SetTypeName(typeName string)
- func (dataHolder *DataHolder) String() string
- func (dataHolder *DataHolder) TypeName() string
- type DateTime
- func (datetime *DateTime) Copy() *DateTime
- func (datetime *DateTime) Day() int
- func (datetime *DateTime) Equals(other *DateTime) bool
- func (datetime *DateTime) FormatToString(indentationLevel int) string
- func (datetime *DateTime) FromTimestamp(timestamp time.Time) uint64
- func (datetime *DateTime) Hour() int
- func (datetime *DateTime) Make(year, month, day, hour, minute, second int) uint64
- func (datetime *DateTime) Minute() int
- func (datetime *DateTime) Month() time.Month
- func (datetime *DateTime) Now() uint64
- func (datetime *DateTime) Second() int
- func (datetime *DateTime) Standard() time.Time
- func (datetime *DateTime) String() string
- func (datetime *DateTime) UTC() uint64
- func (datetime *DateTime) Value() uint64
- func (datetime *DateTime) Year() int
- type DummyCompression
- type HPPPacket
- func (packet *HPPPacket) AccessKeySignature() []byte
- func (packet *HPPPacket) PasswordSignature() []byte
- func (packet *HPPPacket) SetAccessKeySignature(accessKeySignature string)
- func (packet *HPPPacket) SetPasswordSignature(passwordSignature string)
- func (packet *HPPPacket) ValidateAccessKey() error
- func (packet *HPPPacket) ValidatePassword() error
- type KerberosEncryption
- type MutexMap
- type NEXVersion
- type Packet
- func (packet *Packet) AddFlag(flag uint16)
- func (packet *Packet) ClearFlag(flag uint16)
- func (packet *Packet) ConnectionSignature() []byte
- func (packet *Packet) Data() []byte
- func (packet *Packet) Destination() uint8
- func (packet *Packet) Flags() uint16
- func (packet *Packet) FragmentID() uint8
- func (packet *Packet) HasFlag(flag uint16) bool
- func (packet *Packet) Payload() []byte
- func (packet *Packet) RMCRequest() RMCRequest
- func (packet *Packet) Sender() *Client
- func (packet *Packet) SequenceID() uint16
- func (packet *Packet) SessionID() uint8
- func (packet *Packet) SetConnectionSignature(connectionSignature []byte)
- func (packet *Packet) SetDestination(destination uint8)
- func (packet *Packet) SetFlags(bitmask uint16)
- func (packet *Packet) SetFragmentID(fragmentID uint8)
- func (packet *Packet) SetPayload(payload []byte)
- func (packet *Packet) SetSequenceID(sequenceID uint16)
- func (packet *Packet) SetSessionID(sessionID uint8)
- func (packet *Packet) SetSignature(signature []byte)
- func (packet *Packet) SetSource(source uint8)
- func (packet *Packet) SetType(packetType uint16)
- func (packet *Packet) SetVersion(version uint8)
- func (packet *Packet) Signature() []byte
- func (packet *Packet) Source() uint8
- func (packet *Packet) Type() uint16
- func (packet *Packet) Version() uint8
- type PacketInterface
- type PacketManager
- type PacketResendManager
- type PacketV0
- type PacketV1
- func (packet *PacketV1) Bytes() []byte
- func (packet *PacketV1) Decode() error
- func (packet *PacketV1) DecryptPayload() error
- func (packet *PacketV1) InitialSequenceID() uint16
- func (packet *PacketV1) MaximumSubstreamID() uint8
- func (packet *PacketV1) PRUDPProtocolMinorVersion() int
- func (packet *PacketV1) SetInitialSequenceID(initialSequenceID uint16)
- func (packet *PacketV1) SetMaximumSubstreamID(maximumSubstreamID uint8)
- func (packet *PacketV1) SetPRUDPProtocolMinorVersion(prudpProtocolMinorVersion int)
- func (packet *PacketV1) SetSubstreamID(substreamID uint8)
- func (packet *PacketV1) SetSupportedFunctions(supportedFunctions int)
- func (packet *PacketV1) SubstreamID() uint8
- func (packet *PacketV1) SupportedFunctions() int
- type PendingPacket
- type RMCRequest
- func (request *RMCRequest) Bytes() []byte
- func (request *RMCRequest) CallID() uint32
- func (request *RMCRequest) CustomID() uint16
- func (request *RMCRequest) FromBytes(data []byte) error
- func (request *RMCRequest) MethodID() uint32
- func (request *RMCRequest) Parameters() []byte
- func (request *RMCRequest) ProtocolID() uint8
- func (request *RMCRequest) SetCallID(callID uint32)
- func (request *RMCRequest) SetCustomID(customID uint16)
- func (request *RMCRequest) SetMethodID(methodID uint32)
- func (request *RMCRequest) SetParameters(parameters []byte)
- func (request *RMCRequest) SetProtocolID(protocolID uint8)
- type RMCResponse
- type RVConnectionData
- func (rvConnectionData *RVConnectionData) Bytes(stream *StreamOut) []byte
- func (rvConnectionData *RVConnectionData) Copy() StructureInterface
- func (rvConnectionData *RVConnectionData) Equals(structure StructureInterface) bool
- func (rvConnectionData *RVConnectionData) FormatToString(indentationLevel int) string
- func (rvConnectionData *RVConnectionData) SetSpecialProtocols(specialProtocols []byte)
- func (rvConnectionData *RVConnectionData) SetStationURL(stationURL string)
- func (rvConnectionData *RVConnectionData) SetStationURLSpecialProtocols(stationURLSpecialProtocols string)
- func (rvConnectionData *RVConnectionData) SetTime(time *DateTime)
- func (rvConnectionData *RVConnectionData) String() string
- type Result
- func (result *Result) Bytes(stream *StreamOut) []byte
- func (result *Result) Copy() *Result
- func (result *Result) Equals(other *Result) bool
- func (result *Result) ExtractFromStream(stream *StreamIn) error
- func (result *Result) FormatToString(indentationLevel int) string
- func (result *Result) IsError() bool
- func (result *Result) IsSuccess() bool
- func (result *Result) String() string
- type ResultRange
- func (resultRange *ResultRange) Copy() StructureInterface
- func (resultRange *ResultRange) Equals(structure StructureInterface) bool
- func (resultRange *ResultRange) ExtractFromStream(stream *StreamIn) error
- func (resultRange *ResultRange) FormatToString(indentationLevel int) string
- func (resultRange *ResultRange) String() string
- type SequenceIDManager
- type Server
- func (server *Server) AccessKey() string
- func (server *Server) AcknowledgePacket(packet PacketInterface, payload []byte)
- func (server *Server) ClientConnected(client *Client) bool
- func (server *Server) ConnectionIDCounter() *Counter
- func (server *Server) DataStoreProtocolVersion() *NEXVersion
- func (server *Server) Emit(event string, packet interface{})
- func (server *Server) FindClientFromConnectionID(rvcid uint32) *Client
- func (server *Server) FindClientFromPID(pid uint32) *Client
- func (server *Server) GracefulKick(client *Client)
- func (server *Server) GracefulKickAll()
- func (server *Server) HPPListen(address string)
- func (server *Server) KerberosKeySize() int
- func (server *Server) KerberosPassword() string
- func (server *Server) KerberosTicketVersion() int
- func (server *Server) Listen(address string)
- func (server *Server) MatchMakingProtocolVersion() *NEXVersion
- func (server *Server) MessagingProtocolVersion() *NEXVersion
- func (server *Server) NATTraversalProtocolVersion() *NEXVersion
- func (server *Server) NEXVersion() *NEXVersion
- func (server *Server) On(event string, handler interface{})
- func (server *Server) PRUDPProtocolMinorVersion() int
- func (server *Server) PRUDPVersion() int
- func (server *Server) PasswordFromPIDFunction() func(pid uint32) (string, uint32)
- func (server *Server) PingTimeout() int
- func (server *Server) Ranking2ProtocolVersion() *NEXVersion
- func (server *Server) RankingProtocolVersion() *NEXVersion
- func (server *Server) Send(packet PacketInterface)
- func (server *Server) SendFragment(packet PacketInterface, fragmentID uint8)
- func (server *Server) SendPing(client *Client)
- func (server *Server) SendRaw(conn *net.UDPAddr, data []byte)
- func (server *Server) SetAccessKey(accessKey string)
- func (server *Server) SetDataStoreProtocolVersion(nexVersion *NEXVersion)
- func (server *Server) SetDefaultNEXVersion(nexVersion *NEXVersion)
- func (server *Server) SetEmulatedPacketDropPercent(forRecv bool, percent int)
- func (server *Server) SetFragmentSize(fragmentSize int16)
- func (server *Server) SetKerberosKeySize(kerberosKeySize int)
- func (server *Server) SetKerberosPassword(kerberosPassword string)
- func (server *Server) SetKerberosTicketVersion(ticketVersion int)
- func (server *Server) SetMatchMakingProtocolVersion(nexVersion *NEXVersion)
- func (server *Server) SetMessagingProtocolVersion(nexVersion *NEXVersion)
- func (server *Server) SetNATTraversalProtocolVersion(nexVersion *NEXVersion)
- func (server *Server) SetPRUDPProtocolMinorVersion(prudpProtocolMinorVersion int)
- func (server *Server) SetPRUDPVersion(prudpVersion int)
- func (server *Server) SetPasswordFromPIDFunction(handler func(pid uint32) (string, uint32))
- func (server *Server) SetPingTimeout(pingTimeout int)
- func (server *Server) SetRanking2ProtocolVersion(nexVersion *NEXVersion)
- func (server *Server) SetRankingProtocolVersion(nexVersion *NEXVersion)
- func (server *Server) SetResendMaxIterations(resendMaxIterations int)
- func (server *Server) SetResendTimeout(resendTimeout time.Duration)
- func (server *Server) SetResendTimeoutIncrement(resendTimeoutIncrement time.Duration)
- func (server *Server) SetSocket(socket *net.UDPConn)
- func (server *Server) SetSupportedFunctions(supportedFunctions int)
- func (server *Server) SetUtilityProtocolVersion(nexVersion *NEXVersion)
- func (server *Server) Socket() *net.UDPConn
- func (server *Server) SupportedFunctions() int
- func (server *Server) TimeoutKick(client *Client)
- func (server *Server) UtilityProtocolVersion() *NEXVersion
- type StationURL
- func (stationURL *StationURL) Address() string
- func (stationURL *StationURL) CID() uint32
- func (stationURL *StationURL) Copy() *StationURL
- func (stationURL *StationURL) EncodeToString() string
- func (stationURL *StationURL) Equals(other *StationURL) bool
- func (stationURL *StationURL) FormatToString(indentationLevel int) string
- func (stationURL *StationURL) FromString(str string)
- func (stationURL *StationURL) IsLocal() bool
- func (stationURL *StationURL) IsPublic() bool
- func (stationURL *StationURL) Natf() uint32
- func (stationURL *StationURL) Natm() uint32
- func (stationURL *StationURL) PID() uint32
- func (stationURL *StationURL) PL() uint32
- func (stationURL *StationURL) PRID() uint32
- func (stationURL *StationURL) Pmp() uint32
- func (stationURL *StationURL) Port() uint32
- func (stationURL *StationURL) ProbeInit() uint32
- func (stationURL *StationURL) RVCID() uint32
- func (stationURL *StationURL) SID() uint32
- func (stationURL *StationURL) Scheme() string
- func (stationURL *StationURL) SetAddress(address string)
- func (stationURL *StationURL) SetCID(cid uint32)
- func (stationURL *StationURL) SetLocal()
- func (stationURL *StationURL) SetNatf(natf uint32)
- func (stationURL *StationURL) SetNatm(natm uint32)
- func (stationURL *StationURL) SetPID(pid uint32)
- func (stationURL *StationURL) SetPL(pl uint32)
- func (stationURL *StationURL) SetPRID(prid uint32)
- func (stationURL *StationURL) SetPmp(pmp uint32)
- func (stationURL *StationURL) SetPort(port uint32)
- func (stationURL *StationURL) SetProbeInit(probeinit uint32)
- func (stationURL *StationURL) SetPublic()
- func (stationURL *StationURL) SetRVCID(rvcid uint32)
- func (stationURL *StationURL) SetSID(sid uint32)
- func (stationURL *StationURL) SetScheme(scheme string)
- func (stationURL *StationURL) SetStream(stream uint32)
- func (stationURL *StationURL) SetType(transportType uint32)
- func (stationURL *StationURL) SetUpnp(upnp uint32)
- func (stationURL *StationURL) Stream() uint32
- func (stationURL *StationURL) String() string
- func (stationURL *StationURL) Type() uint32
- func (stationURL *StationURL) Upnp() uint32
- type StreamIn
- func (stream *StreamIn) ReadBool() (bool, error)
- func (stream *StreamIn) ReadBuffer() ([]byte, error)
- func (stream *StreamIn) ReadDataHolder() (*DataHolder, error)
- func (stream *StreamIn) ReadDateTime() (*DateTime, error)
- func (stream *StreamIn) ReadFloat32BE() (float32, error)
- func (stream *StreamIn) ReadFloat32LE() (float32, error)
- func (stream *StreamIn) ReadFloat64BE() (float64, error)
- func (stream *StreamIn) ReadFloat64LE() (float64, error)
- func (stream *StreamIn) ReadInt16BE() (int16, error)
- func (stream *StreamIn) ReadInt16LE() (int16, error)
- func (stream *StreamIn) ReadInt32BE() (int32, error)
- func (stream *StreamIn) ReadInt32LE() (int32, error)
- func (stream *StreamIn) ReadInt64BE() (int64, error)
- func (stream *StreamIn) ReadInt64LE() (int64, error)
- func (stream *StreamIn) ReadInt8() (int8, error)
- func (stream *StreamIn) ReadListBuffer() ([][]byte, error)
- func (stream *StreamIn) ReadListDataHolder() ([]*DataHolder, error)
- func (stream *StreamIn) ReadListFloat32BE() ([]float32, error)
- func (stream *StreamIn) ReadListFloat32LE() ([]float32, error)
- func (stream *StreamIn) ReadListFloat64BE() ([]float64, error)
- func (stream *StreamIn) ReadListFloat64LE() ([]float64, error)
- func (stream *StreamIn) ReadListInt16BE() ([]int16, error)
- func (stream *StreamIn) ReadListInt16LE() ([]int16, error)
- func (stream *StreamIn) ReadListInt32BE() ([]int32, error)
- func (stream *StreamIn) ReadListInt32LE() ([]int32, error)
- func (stream *StreamIn) ReadListInt64BE() ([]int64, error)
- func (stream *StreamIn) ReadListInt64LE() ([]int64, error)
- func (stream *StreamIn) ReadListInt8() ([]int8, error)
- func (stream *StreamIn) ReadListQBuffer() ([][]byte, error)
- func (stream *StreamIn) ReadListStationURL() ([]*StationURL, error)
- func (stream *StreamIn) ReadListString() ([]string, error)
- func (stream *StreamIn) ReadListStructure(structure StructureInterface) (interface{}, error)
- func (stream *StreamIn) ReadListUInt16BE() ([]uint16, error)
- func (stream *StreamIn) ReadListUInt16LE() ([]uint16, error)
- func (stream *StreamIn) ReadListUInt32BE() ([]uint32, error)
- func (stream *StreamIn) ReadListUInt32LE() ([]uint32, error)
- func (stream *StreamIn) ReadListUInt64BE() ([]uint64, error)
- func (stream *StreamIn) ReadListUInt64LE() ([]uint64, error)
- func (stream *StreamIn) ReadListUInt8() ([]uint8, error)
- func (stream *StreamIn) ReadMap(keyFunction interface{}, valueFunction interface{}) (map[interface{}]interface{}, error)
- func (stream *StreamIn) ReadQBuffer() ([]byte, error)
- func (stream *StreamIn) ReadRemaining() []byte
- func (stream *StreamIn) ReadStationURL() (*StationURL, error)
- func (stream *StreamIn) ReadString() (string, error)
- func (stream *StreamIn) ReadStructure(structure StructureInterface) (StructureInterface, error)
- func (stream *StreamIn) ReadUInt16BE() (uint16, error)
- func (stream *StreamIn) ReadUInt16LE() (uint16, error)
- func (stream *StreamIn) ReadUInt32BE() (uint32, error)
- func (stream *StreamIn) ReadUInt32LE() (uint32, error)
- func (stream *StreamIn) ReadUInt64BE() (uint64, error)
- func (stream *StreamIn) ReadUInt64LE() (uint64, error)
- func (stream *StreamIn) ReadUInt8() (uint8, error)
- func (stream *StreamIn) ReadVariant() (*Variant, error)
- func (stream *StreamIn) Remaining() int
- type StreamOut
- func (stream *StreamOut) WriteBool(b bool)
- func (stream *StreamOut) WriteBuffer(data []byte)
- func (stream *StreamOut) WriteDataHolder(dataholder *DataHolder)
- func (stream *StreamOut) WriteDateTime(datetime *DateTime)
- func (stream *StreamOut) WriteFloat32BE(f32 float32)
- func (stream *StreamOut) WriteFloat32LE(f32 float32)
- func (stream *StreamOut) WriteFloat64BE(f64 float64)
- func (stream *StreamOut) WriteFloat64LE(f64 float64)
- func (stream *StreamOut) WriteInt16BE(s16 int16)
- func (stream *StreamOut) WriteInt16LE(s16 int16)
- func (stream *StreamOut) WriteInt32BE(s32 int32)
- func (stream *StreamOut) WriteInt32LE(s32 int32)
- func (stream *StreamOut) WriteInt64BE(s64 int64)
- func (stream *StreamOut) WriteInt64LE(s64 int64)
- func (stream *StreamOut) WriteInt8(s8 int8)
- func (stream *StreamOut) WriteListBuffer(buffers [][]byte)
- func (stream *StreamOut) WriteListDataHolder(dataholders []*DataHolder)
- func (stream *StreamOut) WriteListFloat32BE(list []float32)
- func (stream *StreamOut) WriteListFloat32LE(list []float32)
- func (stream *StreamOut) WriteListFloat64BE(list []float64)
- func (stream *StreamOut) WriteListFloat64LE(list []float64)
- func (stream *StreamOut) WriteListInt16BE(list []int16)
- func (stream *StreamOut) WriteListInt16LE(list []int16)
- func (stream *StreamOut) WriteListInt32BE(list []int32)
- func (stream *StreamOut) WriteListInt32LE(list []int32)
- func (stream *StreamOut) WriteListInt64BE(list []int64)
- func (stream *StreamOut) WriteListInt64LE(list []int64)
- func (stream *StreamOut) WriteListInt8(list []int8)
- func (stream *StreamOut) WriteListQBuffer(buffers [][]byte)
- func (stream *StreamOut) WriteListResult(results []*Result)
- func (stream *StreamOut) WriteListStationURL(stationURLs []*StationURL)
- func (stream *StreamOut) WriteListString(strings []string)
- func (stream *StreamOut) WriteListStructure(structures interface{})
- func (stream *StreamOut) WriteListUInt16BE(list []uint16)
- func (stream *StreamOut) WriteListUInt16LE(list []uint16)
- func (stream *StreamOut) WriteListUInt32BE(list []uint32)
- func (stream *StreamOut) WriteListUInt32LE(list []uint32)
- func (stream *StreamOut) WriteListUInt64BE(list []uint64)
- func (stream *StreamOut) WriteListUInt64LE(list []uint64)
- func (stream *StreamOut) WriteListUInt8(list []uint8)
- func (stream *StreamOut) WriteMap(mapType interface{})
- func (stream *StreamOut) WriteQBuffer(data []byte)
- func (stream *StreamOut) WriteResult(result *Result)
- func (stream *StreamOut) WriteString(str string)
- func (stream *StreamOut) WriteStructure(structure StructureInterface)
- func (stream *StreamOut) WriteUInt16BE(u16 uint16)
- func (stream *StreamOut) WriteUInt16LE(u16 uint16)
- func (stream *StreamOut) WriteUInt32BE(u32 uint32)
- func (stream *StreamOut) WriteUInt32LE(u32 uint32)
- func (stream *StreamOut) WriteUInt64BE(u64 uint64)
- func (stream *StreamOut) WriteUInt64LE(u64 uint64)
- func (stream *StreamOut) WriteUInt8(u8 uint8)
- func (stream *StreamOut) WriteVariant(variant *Variant)
- type Structure
- type StructureInterface
- type Ticket
- func (ticket *Ticket) Encrypt(key []byte, stream *StreamOut) ([]byte, error)
- func (ticket *Ticket) InternalData() []byte
- func (ticket *Ticket) SessionKey() []byte
- func (ticket *Ticket) SetInternalData(internalData []byte)
- func (ticket *Ticket) SetSessionKey(sessionKey []byte)
- func (ticket *Ticket) SetTargetPID(targetPID uint32)
- func (ticket *Ticket) TargetPID() uint32
- type TicketInternalData
- func (ticketInternalData *TicketInternalData) Decrypt(stream *StreamIn, key []byte) error
- func (ticketInternalData *TicketInternalData) Encrypt(key []byte, stream *StreamOut) ([]byte, error)
- func (ticketInternalData *TicketInternalData) SessionKey() []byte
- func (ticketInternalData *TicketInternalData) SetSessionKey(sessionKey []byte)
- func (ticketInternalData *TicketInternalData) SetTimestamp(timestamp *DateTime)
- func (ticketInternalData *TicketInternalData) SetUserPID(userPID uint32)
- func (ticketInternalData *TicketInternalData) Timestamp() *DateTime
- func (ticketInternalData *TicketInternalData) UserPID() uint32
- type Variant
- func (variant *Variant) Bytes(stream *StreamOut) []byte
- func (variant *Variant) Copy() *Variant
- func (variant *Variant) Equals(other *Variant) bool
- func (variant *Variant) ExtractFromStream(stream *StreamIn) error
- func (variant *Variant) FormatToString(indentationLevel int) string
- func (variant *Variant) String() string
- type ZLibCompression
Constants ¶
const ( // FlagAck is the ID for the PRUDP Ack Flag FlagAck uint16 = 0x1 // FlagReliable is the ID for the PRUDP Reliable Flag FlagReliable uint16 = 0x2 // FlagNeedsAck is the ID for the PRUDP NeedsAck Flag FlagNeedsAck uint16 = 0x4 // FlagHasSize is the ID for the PRUDP HasSize Flag FlagHasSize uint16 = 0x8 // FlagMultiAck is the ID for the PRUDP MultiAck Flag FlagMultiAck uint16 = 0x200 )
const ( // SynPacket is the ID for the PRUDP Syn Packet type SynPacket uint16 = 0x0 // ConnectPacket is the ID for the PRUDP Connect Packet type ConnectPacket uint16 = 0x1 // DataPacket is the ID for the PRUDP Data Packet type DataPacket uint16 = 0x2 // DisconnectPacket is the ID for the PRUDP Disconnect Packet type DisconnectPacket uint16 = 0x3 // PingPacket is the ID for the PRUDP Ping Packet type PingPacket uint16 = 0x4 )
Variables ¶
var ErrorNames = map[uint32]string{}
ErrorNames contains a map of all the error string names, indexed by the error ID
var Errors nexerrors
Errors provides a struct containing error codes using dot-notation
var Magic = []byte{0xEA, 0xD0}
Magic is the expected PRUDPv1 magic number
var OptionAllFunctions = 0xFFFFFFFF
OptionAllFunctions is used with OptionSupportedFunctions to support all methods
var OptionConnectionSignature uint8 = 1
OptionConnectionSignature is the ID for the Connection Signature option in PRUDP v1 packets
var OptionFragmentID uint8 = 2
OptionFragmentID is the ID for the Fragment ID option in PRUDP v1 packets
var OptionInitialSequenceID uint8 = 3
OptionInitialSequenceID is the ID for the initial sequence ID option in PRUDP v1 packets
var OptionMaxSubstreamID uint8 = 4
OptionMaxSubstreamID is the ID for the max substream ID option in PRUDP v1 packets
var OptionSupportedFunctions uint8 = 0
OptionSupportedFunctions is the ID for the Supported Functions option in PRUDP v1 packets
Functions ¶
func DeriveKerberosKey ¶ added in v1.0.6
DeriveKerberosKey derives a users kerberos encryption key based on their PID and password
func ErrorNameFromCode ¶ added in v1.0.5
ErrorNameFromCode returns an error code string for the provided error code
func RegisterDataHolderType ¶ added in v1.0.7
func RegisterDataHolderType(name string, structure StructureInterface)
RegisterDataHolderType registers a structure to be a valid type in the DataHolder structure
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a connected or non-connected PRUDP client
func (*Client) AddStationURL ¶ added in v1.0.36
func (client *Client) AddStationURL(stationURL *StationURL)
AddStationURL adds the StationURL to the clients StationURLs
func (*Client) ClientConnectionSignature ¶
ClientConnectionSignature returns the clients client-side connection signature
func (*Client) ConnectionID ¶
ConnectionID returns the clients Connection ID
func (*Client) IncreasePingTimeoutTime ¶
IncreasePingTimeoutTime adds a number of seconds to the check timer
func (*Client) PRUDPProtocolMinorVersion ¶ added in v1.0.9
PRUDPProtocolMinorVersion returns the client PRUDP minor version
func (*Client) SequenceIDCounterIn ¶
SequenceIDCounterIn returns the clients packet SequenceID counter for incoming packets
func (*Client) SequenceIDOutManager ¶ added in v1.0.41
func (client *Client) SequenceIDOutManager() *SequenceIDManager
SequenceIDOutManager returns the clients packet SequenceID manager for out-going packets
func (*Client) ServerConnectionSignature ¶
ServerConnectionSignature returns the clients server-side connection signature
func (*Client) SessionKey ¶
SessionKey returns the clients session key
func (*Client) SetClientConnectionSignature ¶
SetClientConnectionSignature sets the clients client-side connection signature
func (*Client) SetConnected ¶
SetConnected sets the clients connection status
func (*Client) SetConnectionID ¶
SetConnectionID sets the clients Connection ID
func (*Client) SetPRUDPProtocolMinorVersion ¶ added in v1.0.9
SetPRUDPProtocolMinorVersion sets the client PRUDP minor
func (*Client) SetServerConnectionSignature ¶
SetServerConnectionSignature sets the clients server-side connection signature
func (*Client) SetSessionKey ¶
SetSessionKey sets the clients session key
func (*Client) SetStationURLs ¶ added in v1.0.21
func (client *Client) SetStationURLs(stationURLs []*StationURL)
SetStationURLs sets the clients Station URLs
func (*Client) SetSupportedFunctions ¶ added in v1.0.9
SetSupportedFunctions sets the supported PRUDP functions by the client
func (*Client) SignatureBase ¶
SignatureBase returns the v0 checksum signature base
func (*Client) SignatureKey ¶
SignatureKey returns signature key
func (*Client) StartTimeoutTimer ¶
func (client *Client) StartTimeoutTimer()
StartTimeoutTimer begins the packet timeout timer
func (*Client) StationURLs ¶ added in v1.0.21
func (client *Client) StationURLs() []*StationURL
StationURLs returns the clients Station URLs
func (*Client) StopTimeoutTimer ¶ added in v1.0.41
func (client *Client) StopTimeoutTimer()
StopTimeoutTimer stops the packet timeout timer
func (*Client) SupportedFunctions ¶ added in v1.0.9
SupportedFunctions returns the supported PRUDP functions by the client
func (*Client) UpdateAccessKey ¶
UpdateAccessKey sets the client signature base and signature key
func (*Client) UpdateRC4Key ¶
UpdateRC4Key sets the client RC4 stream key
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
Counter represents an incremental counter
func NewCounter ¶
NewCounter returns a new Counter, with a starting number
type Data ¶ added in v1.0.7
type Data struct {
Structure
}
Data represents a structure with no data
func (*Data) Copy ¶ added in v1.0.23
func (data *Data) Copy() StructureInterface
Copy returns a new copied instance of Data
func (*Data) Equals ¶ added in v1.0.23
func (data *Data) Equals(structure StructureInterface) bool
Equals checks if the passed Structure contains the same data as the current instance
func (*Data) ExtractFromStream ¶ added in v1.0.7
ExtractFromStream does nothing for Data
func (*Data) FormatToString ¶ added in v1.0.28
FormatToString pretty-prints the struct data using the provided indentation level
type DataHolder ¶
type DataHolder struct {
// contains filtered or unexported fields
}
DataHolder represents a structure which can hold any other structure
func (*DataHolder) Bytes ¶
func (dataHolder *DataHolder) Bytes(stream *StreamOut) []byte
Bytes encodes the DataHolder and returns a byte array
func (*DataHolder) Copy ¶ added in v1.0.24
func (dataHolder *DataHolder) Copy() *DataHolder
Copy returns a new copied instance of DataHolder
func (*DataHolder) Equals ¶ added in v1.0.24
func (dataHolder *DataHolder) Equals(other *DataHolder) bool
Equals checks if the passed Structure contains the same data as the current instance
func (*DataHolder) ExtractFromStream ¶ added in v1.0.7
func (dataHolder *DataHolder) ExtractFromStream(stream *StreamIn) error
ExtractFromStream extracts a DataHolder structure from a stream
func (*DataHolder) FormatToString ¶ added in v1.0.28
func (dataHolder *DataHolder) FormatToString(indentationLevel int) string
FormatToString pretty-prints the struct data using the provided indentation level
func (*DataHolder) ObjectData ¶ added in v1.0.7
func (dataHolder *DataHolder) ObjectData() StructureInterface
ObjectData returns the DataHolder internal object data
func (*DataHolder) SetObjectData ¶ added in v1.0.7
func (dataHolder *DataHolder) SetObjectData(objectData StructureInterface)
SetObjectData sets the DataHolder internal object data
func (*DataHolder) SetTypeName ¶ added in v1.0.7
func (dataHolder *DataHolder) SetTypeName(typeName string)
SetTypeName sets the DataHolder type name
func (*DataHolder) String ¶ added in v1.0.28
func (dataHolder *DataHolder) String() string
String returns a string representation of the struct
func (*DataHolder) TypeName ¶ added in v1.0.7
func (dataHolder *DataHolder) TypeName() string
TypeName returns the DataHolder type name
type DateTime ¶
type DateTime struct {
// contains filtered or unexported fields
}
DateTime represents a NEX DateTime type
func NewDateTime ¶
NewDateTime returns a new DateTime instance
func (*DateTime) Equals ¶ added in v1.0.24
Equals checks if the passed Structure contains the same data as the current instance
func (*DateTime) FormatToString ¶ added in v1.0.28
FormatToString pretty-prints the struct data using the provided indentation level
func (*DateTime) FromTimestamp ¶
FromTimestamp converts a Time timestamp into a NEX DateTime
type DummyCompression ¶
type DummyCompression struct{}
DummyCompression represents no compression
func (*DummyCompression) Compress ¶
func (compression *DummyCompression) Compress(data []byte) []byte
Compress returns the data as-is
func (*DummyCompression) Decompress ¶
func (compression *DummyCompression) Decompress(data []byte) []byte
Decompress returns the data as-is
type HPPPacket ¶ added in v1.0.20
type HPPPacket struct { Packet // contains filtered or unexported fields }
HPPPacket represents an HPP packet
func NewHPPPacket ¶ added in v1.0.20
NewHPPPacket returns a new HPP packet
func (*HPPPacket) AccessKeySignature ¶ added in v1.0.20
AccessKeySignature returns the packet access key signature
func (*HPPPacket) PasswordSignature ¶ added in v1.0.20
PasswordSignature returns the packet password signature
func (*HPPPacket) SetAccessKeySignature ¶ added in v1.0.20
SetAccessKeySignature sets the packet access key signature
func (*HPPPacket) SetPasswordSignature ¶ added in v1.0.20
SetPasswordSignature sets the packet password signature
func (*HPPPacket) ValidateAccessKey ¶ added in v1.0.20
ValidateAccessKey checks if the access key signature is valid
func (*HPPPacket) ValidatePassword ¶ added in v1.0.20
ValidatePassword checks if the password signature is valid
type KerberosEncryption ¶
type KerberosEncryption struct {
// contains filtered or unexported fields
}
KerberosEncryption is used to encrypt/decrypt using Kerberos
func NewKerberosEncryption ¶
func NewKerberosEncryption(key []byte) (*KerberosEncryption, error)
NewKerberosEncryption returns a new KerberosEncryption instance
func (*KerberosEncryption) Decrypt ¶
func (encryption *KerberosEncryption) Decrypt(buffer []byte) []byte
Decrypt will decrypt the given data using Kerberos
func (*KerberosEncryption) Encrypt ¶
func (encryption *KerberosEncryption) Encrypt(buffer []byte) []byte
Encrypt will encrypt the given data using Kerberos
func (*KerberosEncryption) Validate ¶
func (encryption *KerberosEncryption) Validate(buffer []byte) bool
Validate will check the HMAC of the encrypted data
type MutexMap ¶ added in v1.0.41
type MutexMap[K comparable, V any] struct { *sync.RWMutex // contains filtered or unexported fields }
MutexMap implements a map type with go routine safe accessors through mutex locks. Embeds sync.RWMutex
func NewMutexMap ¶ added in v1.0.41
func NewMutexMap[K comparable, V any]() *MutexMap[K, V]
NewMutexMap returns a new instance of MutexMap with the provided key/value types
func (*MutexMap[K, V]) Clear ¶ added in v1.0.41
func (m *MutexMap[K, V]) Clear(callback func(key K, value V))
Clear removes all items from the `real` map Accepts an optional callback function ran for every item before it is deleted
func (*MutexMap[K, V]) Delete ¶ added in v1.0.41
func (m *MutexMap[K, V]) Delete(key K)
Delete removes a key from the internal map
func (*MutexMap[K, V]) Each ¶ added in v1.0.41
func (m *MutexMap[K, V]) Each(callback func(key K, value V))
Each runs a callback function for every item in the map The map should not be modified inside the callback function
type NEXVersion ¶ added in v1.0.15
type NEXVersion struct { Major int Minor int Patch int GameSpecificPatch string // contains filtered or unexported fields }
NEXVersion represents a NEX library version
func NewNEXVersion ¶ added in v1.0.29
func NewNEXVersion(major, minor, patch int) *NEXVersion
NewNEXVersion returns a new NEXVersion
func NewPatchedNEXVersion ¶ added in v1.0.29
func NewPatchedNEXVersion(major, minor, patch int, gameSpecificPatch string) *NEXVersion
NewPatchedNEXVersion returns a new NEXVersion with a game specific patch
func (*NEXVersion) Copy ¶ added in v1.0.29
func (nexVersion *NEXVersion) Copy() *NEXVersion
Copy returns a new copied instance of NEXVersion
func (*NEXVersion) GreaterOrEqual ¶ added in v1.0.38
func (nexVersion *NEXVersion) GreaterOrEqual(compare string) bool
GreaterOrEqual compares if the given semver is greater than or equal to the current version
func (*NEXVersion) LessOrEqual ¶ added in v1.0.38
func (nexVersion *NEXVersion) LessOrEqual(compare string) bool
LessOrEqual compares if the given semver is lesser than or equal to the current version
type Packet ¶
type Packet struct { PacketInterface // contains filtered or unexported fields }
Packet represents a generic PRUDP packet
func (*Packet) ConnectionSignature ¶
ConnectionSignature returns the packet connection signature
func (*Packet) Data ¶
Data returns bytes used to create the packet (this is not the same as Bytes())
func (*Packet) Destination ¶
Destination returns the packet destination
func (*Packet) FragmentID ¶
FragmentID returns the packet fragmentID
func (*Packet) RMCRequest ¶
func (packet *Packet) RMCRequest() RMCRequest
RMCRequest returns the packet RMC request
func (*Packet) SequenceID ¶
SequenceID returns the packet sequenceID
func (*Packet) SetConnectionSignature ¶
SetConnectionSignature sets the packet connection signature
func (*Packet) SetDestination ¶
SetDestination sets the packet destination
func (*Packet) SetFragmentID ¶
SetFragmentID sets the packet fragmentID
func (*Packet) SetPayload ¶
SetPayload sets the packet payload
func (*Packet) SetSequenceID ¶
SetSequenceID sets the packet sequenceID
func (*Packet) SetSessionID ¶
SetSessionID sets the packet sessionID
func (*Packet) SetSignature ¶
SetSignature sets the packet signature
func (*Packet) SetVersion ¶
SetVersion sets the packet PRUDP version
type PacketInterface ¶
type PacketInterface interface { Data() []byte Sender() *Client SetVersion(version uint8) Version() uint8 SetSource(source uint8) Source() uint8 SetDestination(destination uint8) Destination() uint8 SetType(packetType uint16) Type() uint16 SetFlags(bitmask uint16) Flags() uint16 HasFlag(flag uint16) bool AddFlag(flag uint16) ClearFlag(flag uint16) SetSessionID(sessionID uint8) SessionID() uint8 SetSignature(signature []byte) Signature() []byte SetSequenceID(sequenceID uint16) SequenceID() uint16 SetConnectionSignature(connectionSignature []byte) ConnectionSignature() []byte SetFragmentID(fragmentID uint8) FragmentID() uint8 SetPayload(payload []byte) Payload() []byte DecryptPayload() error RMCRequest() RMCRequest Bytes() []byte }
PacketInterface implements all Packet methods
type PacketManager ¶ added in v1.0.41
type PacketManager struct {
// contains filtered or unexported fields
}
PacketManager implements an API for pushing/popping packets in the correct order
func NewPacketManager ¶ added in v1.0.41
func NewPacketManager() *PacketManager
NewPacketManager returns a new PacketManager
func (*PacketManager) Next ¶ added in v1.0.41
func (p *PacketManager) Next() PacketInterface
Next gets the next packet in the sequence. Returns nil if the next packet has not been sent yet
func (*PacketManager) Push ¶ added in v1.0.41
func (p *PacketManager) Push(packet PacketInterface)
Push adds a packet to the pool to choose from in Next
func (*PacketManager) RemoveByIndex ¶ added in v1.0.41
func (p *PacketManager) RemoveByIndex(i int)
RemoveByIndex removes a packet from the pool using it's index in the slice
type PacketResendManager ¶ added in v1.0.41
type PacketResendManager struct {
// contains filtered or unexported fields
}
PacketResendManager manages all the pending packets sent the client waiting to be ACKed
func NewPacketResendManager ¶ added in v1.0.41
func NewPacketResendManager(timeoutTime time.Duration, timeoutIncrement time.Duration, maxIterations int) *PacketResendManager
NewPacketResendManager returns a new PacketResendManager
func (*PacketResendManager) Add ¶ added in v1.0.41
func (p *PacketResendManager) Add(packet PacketInterface)
Add creates a PendingPacket, adds it to the pool, and begins it's timeout timer
func (*PacketResendManager) Clear ¶ added in v1.0.41
func (p *PacketResendManager) Clear()
Clear removes all packets from pool and stops their timers
func (*PacketResendManager) Remove ¶ added in v1.0.41
func (p *PacketResendManager) Remove(sequenceID uint16)
Remove removes a packet from pool and stops it's timer
type PacketV0 ¶
type PacketV0 struct { Packet // contains filtered or unexported fields }
PacketV0 reresents a PRUDPv0 packet
func NewPacketV0 ¶
NewPacketV0 returns a new PRUDPv0 packet
func (*PacketV0) DecryptPayload ¶ added in v1.0.41
DecryptPayload decrypts the packets payload and sets the RMC request data
func (*PacketV0) SetChecksum ¶
SetChecksum sets the packet checksum
type PacketV1 ¶
type PacketV1 struct { Packet // contains filtered or unexported fields }
PacketV1 reresents a PRUDPv1 packet
func NewPacketV1 ¶
NewPacketV1 returns a new PRUDPv1 packet
func (*PacketV1) DecryptPayload ¶ added in v1.0.41
DecryptPayload decrypts the packets payload and sets the RMC request data
func (*PacketV1) InitialSequenceID ¶
InitialSequenceID returns the packet initial sequence ID for unreliable packets
func (*PacketV1) MaximumSubstreamID ¶
MaximumSubstreamID returns the packet maximum substream ID
func (*PacketV1) PRUDPProtocolMinorVersion ¶ added in v1.0.9
PRUDPProtocolMinorVersion returns the packet PRUDP minor version
func (*PacketV1) SetInitialSequenceID ¶
SetInitialSequenceID sets the packet initial sequence ID for unreliable packets
func (*PacketV1) SetMaximumSubstreamID ¶
SetMaximumSubstreamID sets the packet maximum substream ID
func (*PacketV1) SetPRUDPProtocolMinorVersion ¶ added in v1.0.9
SetPRUDPProtocolMinorVersion sets the packet PRUDP minor version
func (*PacketV1) SetSubstreamID ¶
SetSubstreamID sets the packet substream ID
func (*PacketV1) SetSupportedFunctions ¶
SetSupportedFunctions sets the packet supported functions flags
func (*PacketV1) SubstreamID ¶
SubstreamID returns the packet substream ID
func (*PacketV1) SupportedFunctions ¶
SupportedFunctions returns the packet supported functions flags
type PendingPacket ¶ added in v1.0.41
type PendingPacket struct {
// contains filtered or unexported fields
}
PendingPacket represents a packet which the server has sent but not received an ACK for it handles it's own retransmission on a per-packet timer
func NewPendingPacket ¶ added in v1.0.41
func NewPendingPacket(packet PacketInterface, timeoutTime time.Duration, timeoutIncrement time.Duration, maxIterations int) *PendingPacket
NewPendingPacket returns a new PendingPacket
func (*PendingPacket) BeginTimeoutTimer ¶ added in v1.0.41
func (p *PendingPacket) BeginTimeoutTimer()
BeginTimeoutTimer starts the pending packets timeout timer until it is either stopped or maxIterations is hit
func (*PendingPacket) StopTimeoutTimer ¶ added in v1.0.41
func (p *PendingPacket) StopTimeoutTimer()
StopTimeoutTimer stops the packet retransmission timer
type RMCRequest ¶
type RMCRequest struct {
// contains filtered or unexported fields
}
RMCRequest represets a RMC request
func (*RMCRequest) Bytes ¶
func (request *RMCRequest) Bytes() []byte
Bytes converts a RMCRequest struct into a usable byte array
func (*RMCRequest) CallID ¶
func (request *RMCRequest) CallID() uint32
CallID sets the RMC request callID
func (*RMCRequest) CustomID ¶
func (request *RMCRequest) CustomID() uint16
CustomID returns the RMC request custom ID
func (*RMCRequest) FromBytes ¶
func (request *RMCRequest) FromBytes(data []byte) error
FromBytes converts a byte slice into a RMCRequest
func (*RMCRequest) MethodID ¶
func (request *RMCRequest) MethodID() uint32
MethodID sets the RMC request methodID
func (*RMCRequest) Parameters ¶
func (request *RMCRequest) Parameters() []byte
Parameters sets the RMC request parameters
func (*RMCRequest) ProtocolID ¶
func (request *RMCRequest) ProtocolID() uint8
ProtocolID sets the RMC request protocolID
func (*RMCRequest) SetCallID ¶
func (request *RMCRequest) SetCallID(callID uint32)
SetCallID sets the RMC request call ID
func (*RMCRequest) SetCustomID ¶
func (request *RMCRequest) SetCustomID(customID uint16)
SetCustomID sets the RMC request custom ID
func (*RMCRequest) SetMethodID ¶
func (request *RMCRequest) SetMethodID(methodID uint32)
SetMethodID sets the RMC request method ID
func (*RMCRequest) SetParameters ¶
func (request *RMCRequest) SetParameters(parameters []byte)
SetParameters sets the RMC request parameters
func (*RMCRequest) SetProtocolID ¶
func (request *RMCRequest) SetProtocolID(protocolID uint8)
SetProtocolID sets the RMC request protocol ID
type RMCResponse ¶
type RMCResponse struct {
// contains filtered or unexported fields
}
RMCResponse represents a RMC response
func NewRMCResponse ¶
func NewRMCResponse(protocolID uint8, callID uint32) RMCResponse
NewRMCResponse returns a new RMCResponse
func (*RMCResponse) Bytes ¶
func (response *RMCResponse) Bytes() []byte
Bytes converts a RMCResponse struct into a usable byte array
func (*RMCResponse) CustomID ¶ added in v1.0.11
func (response *RMCResponse) CustomID() uint16
CustomID returns the RMC response customID
func (*RMCResponse) SetCustomID ¶ added in v1.0.11
func (response *RMCResponse) SetCustomID(customID uint16)
SetCustomID sets the RMC response customID
func (*RMCResponse) SetError ¶
func (response *RMCResponse) SetError(errorCode uint32)
SetError sets the RMCResponse payload to an instance of RMCError
func (*RMCResponse) SetSuccess ¶
func (response *RMCResponse) SetSuccess(methodID uint32, data []byte)
SetSuccess sets the RMCResponse payload to an instance of RMCSuccess
type RVConnectionData ¶
type RVConnectionData struct { Structure // contains filtered or unexported fields }
RVConnectionData represents a nex RVConnectionData type
func NewRVConnectionData ¶
func NewRVConnectionData() *RVConnectionData
NewRVConnectionData returns a new RVConnectionData
func (*RVConnectionData) Bytes ¶
func (rvConnectionData *RVConnectionData) Bytes(stream *StreamOut) []byte
Bytes encodes the RVConnectionData and returns a byte array
func (*RVConnectionData) Copy ¶ added in v1.0.23
func (rvConnectionData *RVConnectionData) Copy() StructureInterface
Copy returns a new copied instance of RVConnectionData
func (*RVConnectionData) Equals ¶ added in v1.0.23
func (rvConnectionData *RVConnectionData) Equals(structure StructureInterface) bool
Equals checks if the passed Structure contains the same data as the current instance
func (*RVConnectionData) FormatToString ¶ added in v1.0.28
func (rvConnectionData *RVConnectionData) FormatToString(indentationLevel int) string
FormatToString pretty-prints the struct data using the provided indentation level
func (*RVConnectionData) SetSpecialProtocols ¶
func (rvConnectionData *RVConnectionData) SetSpecialProtocols(specialProtocols []byte)
SetSpecialProtocols sets the RVConnectionData special protocol list (unused by Nintendo)
func (*RVConnectionData) SetStationURL ¶
func (rvConnectionData *RVConnectionData) SetStationURL(stationURL string)
SetStationURL sets the RVConnectionData station URL
func (*RVConnectionData) SetStationURLSpecialProtocols ¶
func (rvConnectionData *RVConnectionData) SetStationURLSpecialProtocols(stationURLSpecialProtocols string)
SetStationURLSpecialProtocols sets the RVConnectionData special station URL (unused by Nintendo)
func (*RVConnectionData) SetTime ¶
func (rvConnectionData *RVConnectionData) SetTime(time *DateTime)
SetTime sets the RVConnectionData time
func (*RVConnectionData) String ¶ added in v1.0.28
func (rvConnectionData *RVConnectionData) String() string
String returns a string representation of the struct
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
Result is sent in methods which query large objects
func NewResultError ¶ added in v1.0.6
NewResultError returns a new Result set as an error
func NewResultSuccess ¶ added in v1.0.6
NewResultSuccess returns a new Result set as a success
func (*Result) Equals ¶ added in v1.0.24
Equals checks if the passed Structure contains the same data as the current instance
func (*Result) ExtractFromStream ¶
ExtractFromStream extracts a Result structure from a stream
func (*Result) FormatToString ¶ added in v1.0.28
FormatToString pretty-prints the struct data using the provided indentation level
type ResultRange ¶
ResultRange is sent in methods which query large objects
func (*ResultRange) Copy ¶ added in v1.0.23
func (resultRange *ResultRange) Copy() StructureInterface
Copy returns a new copied instance of ResultRange
func (*ResultRange) Equals ¶ added in v1.0.23
func (resultRange *ResultRange) Equals(structure StructureInterface) bool
Equals checks if the passed Structure contains the same data as the current instance
func (*ResultRange) ExtractFromStream ¶
func (resultRange *ResultRange) ExtractFromStream(stream *StreamIn) error
ExtractFromStream extracts a ResultRange structure from a stream
func (*ResultRange) FormatToString ¶ added in v1.0.28
func (resultRange *ResultRange) FormatToString(indentationLevel int) string
FormatToString pretty-prints the struct data using the provided indentation level
func (*ResultRange) String ¶ added in v1.0.28
func (resultRange *ResultRange) String() string
String returns a string representation of the struct
type SequenceIDManager ¶ added in v1.0.41
type SequenceIDManager struct {
// contains filtered or unexported fields
}
SequenceIDManager implements an API for managing the sequence IDs of different packet streams on a client
func NewSequenceIDManager ¶ added in v1.0.41
func NewSequenceIDManager() *SequenceIDManager
NewSequenceIDManager returns a new SequenceIDManager
func (*SequenceIDManager) Next ¶ added in v1.0.41
func (s *SequenceIDManager) Next(packet PacketInterface) uint32
Next gets the next sequence ID for the packet. Returns 0 for an unsupported packet
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents a PRUDP server
func (*Server) AcknowledgePacket ¶
func (server *Server) AcknowledgePacket(packet PacketInterface, payload []byte)
AcknowledgePacket acknowledges that the given packet was recieved
func (*Server) ClientConnected ¶
ClientConnected checks if a given client is stored on the server
func (*Server) ConnectionIDCounter ¶
ConnectionIDCounter gets the server connection ID counter
func (*Server) DataStoreProtocolVersion ¶ added in v1.0.15
func (server *Server) DataStoreProtocolVersion() *NEXVersion
DataStoreProtocolVersion returns the servers DataStore protocol version
func (*Server) FindClientFromConnectionID ¶
FindClientFromConnectionID finds a client by their Connection ID
func (*Server) FindClientFromPID ¶
FindClientFromPID finds a client by their PID
func (*Server) GracefulKick ¶ added in v1.0.20
GracefulKick removes an active client from the server
func (*Server) GracefulKickAll ¶ added in v1.0.20
func (server *Server) GracefulKickAll()
GracefulKickAll removes all clients from the server
func (*Server) KerberosKeySize ¶
KerberosKeySize returns the server kerberos key size
func (*Server) KerberosPassword ¶ added in v1.0.6
KerberosPassword returns the server kerberos password
func (*Server) KerberosTicketVersion ¶ added in v1.0.5
KerberosTicketVersion returns the server kerberos ticket contents version
func (*Server) MatchMakingProtocolVersion ¶ added in v1.0.15
func (server *Server) MatchMakingProtocolVersion() *NEXVersion
MatchMakingProtocolVersion returns the servers MatchMaking protocol version
func (*Server) MessagingProtocolVersion ¶ added in v1.0.15
func (server *Server) MessagingProtocolVersion() *NEXVersion
MessagingProtocolVersion returns the servers Messaging protocol version
func (*Server) NATTraversalProtocolVersion ¶ added in v1.0.29
func (server *Server) NATTraversalProtocolVersion() *NEXVersion
NATTraversalProtocolVersion returns the servers NAT Traversal protocol version
func (*Server) NEXVersion ¶ added in v1.0.15
func (server *Server) NEXVersion() *NEXVersion
NEXVersion returns the server NEX version
func (*Server) PRUDPProtocolMinorVersion ¶ added in v1.0.9
PRUDPProtocolMinorVersion returns the server PRUDP minor version
func (*Server) PRUDPVersion ¶ added in v1.0.15
PRUDPVersion returns the server PRUDP version
func (*Server) PasswordFromPIDFunction ¶ added in v1.0.20
PasswordFromPIDFunction returns the function for HPP or the auth server to get a NEX password using the PID
func (*Server) PingTimeout ¶
PingTimeout returns the server ping timeout time in seconds
func (*Server) Ranking2ProtocolVersion ¶ added in v1.0.15
func (server *Server) Ranking2ProtocolVersion() *NEXVersion
Ranking2ProtocolVersion returns the servers Ranking2 protocol version
func (*Server) RankingProtocolVersion ¶ added in v1.0.15
func (server *Server) RankingProtocolVersion() *NEXVersion
RankingProtocolVersion returns the servers Ranking protocol version
func (*Server) SendFragment ¶
func (server *Server) SendFragment(packet PacketInterface, fragmentID uint8)
SendFragment sends a packet fragment to the client
func (*Server) SetAccessKey ¶
SetAccessKey sets the server access key
func (*Server) SetDataStoreProtocolVersion ¶ added in v1.0.15
func (server *Server) SetDataStoreProtocolVersion(nexVersion *NEXVersion)
SetDataStoreProtocolVersion sets the servers DataStore protocol version
func (*Server) SetDefaultNEXVersion ¶ added in v1.0.15
func (server *Server) SetDefaultNEXVersion(nexVersion *NEXVersion)
SetDefaultNEXVersion sets the default NEX protocol versions
func (*Server) SetEmulatedPacketDropPercent ¶ added in v1.0.41
SetEmulatedPacketDropPercent sets the percentage of emulated sent and received dropped packets
func (*Server) SetFragmentSize ¶
SetFragmentSize sets the packet fragment size
func (*Server) SetKerberosKeySize ¶
SetKerberosKeySize sets the server kerberos key size
func (*Server) SetKerberosPassword ¶ added in v1.0.6
SetKerberosPassword sets the server kerberos password
func (*Server) SetKerberosTicketVersion ¶ added in v1.0.5
SetKerberosTicketVersion sets the server kerberos ticket contents version
func (*Server) SetMatchMakingProtocolVersion ¶ added in v1.0.15
func (server *Server) SetMatchMakingProtocolVersion(nexVersion *NEXVersion)
SetMatchMakingProtocolVersion sets the servers MatchMaking protocol version
func (*Server) SetMessagingProtocolVersion ¶ added in v1.0.15
func (server *Server) SetMessagingProtocolVersion(nexVersion *NEXVersion)
SetMessagingProtocolVersion sets the servers Messaging protocol version
func (*Server) SetNATTraversalProtocolVersion ¶ added in v1.0.29
func (server *Server) SetNATTraversalProtocolVersion(nexVersion *NEXVersion)
SetNATTraversalProtocolVersion sets the servers NAT Traversal protocol version
func (*Server) SetPRUDPProtocolMinorVersion ¶ added in v1.0.9
SetPRUDPProtocolMinorVersion sets the server PRUDP minor
func (*Server) SetPRUDPVersion ¶ added in v1.0.15
SetPRUDPVersion sets the server PRUDP version
func (*Server) SetPasswordFromPIDFunction ¶ added in v1.0.20
SetPasswordFromPIDFunction sets the function for HPP or the auth server to get a NEX password using the PID
func (*Server) SetPingTimeout ¶
SetPingTimeout sets the server ping timeout time in seconds
func (*Server) SetRanking2ProtocolVersion ¶ added in v1.0.15
func (server *Server) SetRanking2ProtocolVersion(nexVersion *NEXVersion)
SetRanking2ProtocolVersion sets the servers Ranking2 protocol version
func (*Server) SetRankingProtocolVersion ¶ added in v1.0.15
func (server *Server) SetRankingProtocolVersion(nexVersion *NEXVersion)
SetRankingProtocolVersion sets the servers Ranking protocol version
func (*Server) SetResendMaxIterations ¶ added in v1.0.41
SetResendMaxIterations sets the max number of times a packet can try to resend before assuming the client is dead
func (*Server) SetResendTimeout ¶ added in v1.0.41
SetResendTimeout sets the time that a packet should wait before resending to the client
func (*Server) SetResendTimeoutIncrement ¶ added in v1.0.41
SetResendTimeoutIncrement sets how much to increment the resendTimeout every time a packet is resent to the client
func (*Server) SetSupportedFunctions ¶ added in v1.0.9
SetSupportedFunctions sets the supported PRUDP functions by the server
func (*Server) SetUtilityProtocolVersion ¶ added in v1.0.15
func (server *Server) SetUtilityProtocolVersion(nexVersion *NEXVersion)
SetUtilityProtocolVersion sets the servers Utility protocol version
func (*Server) SupportedFunctions ¶ added in v1.0.9
SupportedFunctions returns the supported PRUDP functions by the server
func (*Server) TimeoutKick ¶ added in v1.0.20
TimeoutKick removes a client from the server for inactivity
func (*Server) UtilityProtocolVersion ¶ added in v1.0.15
func (server *Server) UtilityProtocolVersion() *NEXVersion
UtilityProtocolVersion returns the servers Utility protocol version
type StationURL ¶
type StationURL struct {
// contains filtered or unexported fields
}
StationURL contains the data for a NEX station URL. Uses uint32 pointers to check for nil, 0 is valid
func NewStationURL ¶
func NewStationURL(str string) *StationURL
NewStationURL returns a new StationURL
func (*StationURL) Address ¶
func (stationURL *StationURL) Address() string
Address returns the StationURL address
func (*StationURL) CID ¶
func (stationURL *StationURL) CID() uint32
CID returns the StationURL CID value
func (*StationURL) Copy ¶ added in v1.0.24
func (stationURL *StationURL) Copy() *StationURL
Copy returns a new copied instance of StationURL
func (*StationURL) EncodeToString ¶
func (stationURL *StationURL) EncodeToString() string
EncodeToString encodes the StationURL into a string
func (*StationURL) Equals ¶ added in v1.0.24
func (stationURL *StationURL) Equals(other *StationURL) bool
Equals checks if the passed Structure contains the same data as the current instance
func (*StationURL) FormatToString ¶ added in v1.0.28
func (stationURL *StationURL) FormatToString(indentationLevel int) string
FormatToString pretty-prints the struct data using the provided indentation level
func (*StationURL) FromString ¶
func (stationURL *StationURL) FromString(str string)
FromString parses the StationURL data from a string
func (*StationURL) IsLocal ¶ added in v1.0.36
func (stationURL *StationURL) IsLocal() bool
IsLocal checks if the StationURL is a local URL
func (*StationURL) IsPublic ¶ added in v1.0.36
func (stationURL *StationURL) IsPublic() bool
IsPublic checks if the StationURL is a public URL
func (*StationURL) Natf ¶
func (stationURL *StationURL) Natf() uint32
Natf returns the StationURL Natf value
func (*StationURL) Natm ¶
func (stationURL *StationURL) Natm() uint32
Natm returns the StationURL Natm value
func (*StationURL) PID ¶
func (stationURL *StationURL) PID() uint32
PID returns the StationURL PID value
func (*StationURL) PL ¶ added in v1.0.37
func (stationURL *StationURL) PL() uint32
PL returns the StationURL Pl
func (*StationURL) PRID ¶
func (stationURL *StationURL) PRID() uint32
PRID returns the StationURL PRID value
func (*StationURL) Pmp ¶
func (stationURL *StationURL) Pmp() uint32
Pmp returns the StationURL Pmp value
func (*StationURL) Port ¶
func (stationURL *StationURL) Port() uint32
Port returns the StationURL port
func (*StationURL) ProbeInit ¶
func (stationURL *StationURL) ProbeInit() uint32
ProbeInit returns the StationURL ProbeInit value
func (*StationURL) RVCID ¶
func (stationURL *StationURL) RVCID() uint32
RVCID returns the StationURL RVCID
func (*StationURL) SID ¶
func (stationURL *StationURL) SID() uint32
SID returns the StationURL SID value
func (*StationURL) Scheme ¶
func (stationURL *StationURL) Scheme() string
Scheme returns the StationURL scheme type
func (*StationURL) SetAddress ¶
func (stationURL *StationURL) SetAddress(address string)
SetAddress sets the StationURL address
func (*StationURL) SetCID ¶
func (stationURL *StationURL) SetCID(cid uint32)
SetCID sets the StationURL CID
func (*StationURL) SetLocal ¶ added in v1.0.36
func (stationURL *StationURL) SetLocal()
SetLocal marks the StationURL as an local URL
func (*StationURL) SetNatf ¶
func (stationURL *StationURL) SetNatf(natf uint32)
SetNatf sets the StationURL Natf
func (*StationURL) SetNatm ¶
func (stationURL *StationURL) SetNatm(natm uint32)
SetNatm sets the StationURL Natm
func (*StationURL) SetPID ¶ added in v1.0.5
func (stationURL *StationURL) SetPID(pid uint32)
SetPID sets the StationURL PID
func (*StationURL) SetPL ¶ added in v1.0.37
func (stationURL *StationURL) SetPL(pl uint32)
SetPL sets the StationURL Pl
func (*StationURL) SetPRID ¶
func (stationURL *StationURL) SetPRID(prid uint32)
SetPRID sets the StationURL PRID
func (*StationURL) SetPmp ¶
func (stationURL *StationURL) SetPmp(pmp uint32)
SetPmp sets the StationURL Pmp
func (*StationURL) SetPort ¶
func (stationURL *StationURL) SetPort(port uint32)
SetPort sets the StationURL port
func (*StationURL) SetProbeInit ¶
func (stationURL *StationURL) SetProbeInit(probeinit uint32)
SetProbeInit sets the StationURL ProbeInit
func (*StationURL) SetPublic ¶ added in v1.0.36
func (stationURL *StationURL) SetPublic()
SetPublic marks the StationURL as an public URL
func (*StationURL) SetRVCID ¶
func (stationURL *StationURL) SetRVCID(rvcid uint32)
SetRVCID sets the StationURL RVCID
func (*StationURL) SetSID ¶
func (stationURL *StationURL) SetSID(sid uint32)
SetSID sets the StationURL SID
func (*StationURL) SetScheme ¶
func (stationURL *StationURL) SetScheme(scheme string)
SetScheme sets the StationURL scheme
func (*StationURL) SetStream ¶
func (stationURL *StationURL) SetStream(stream uint32)
SetStream sets the StationURL stream
func (*StationURL) SetType ¶
func (stationURL *StationURL) SetType(transportType uint32)
SetType sets the StationURL transportType
func (*StationURL) SetUpnp ¶
func (stationURL *StationURL) SetUpnp(upnp uint32)
SetUpnp sets the StationURL Upnp
func (*StationURL) Stream ¶
func (stationURL *StationURL) Stream() uint32
Stream returns the StationURL stream value
func (*StationURL) String ¶ added in v1.0.28
func (stationURL *StationURL) String() string
String returns a string representation of the struct
func (*StationURL) Type ¶
func (stationURL *StationURL) Type() uint32
Type returns the StationURL type
func (*StationURL) Upnp ¶
func (stationURL *StationURL) Upnp() uint32
Upnp returns the StationURL Upnp value
type StreamIn ¶
StreamIn is an input stream abstraction of github.com/superwhiskers/crunch with nex type support
func NewStreamIn ¶
NewStreamIn returns a new NEX input stream
func (*StreamIn) ReadBuffer ¶
ReadBuffer reads a nex Buffer type
func (*StreamIn) ReadDataHolder ¶ added in v1.0.7
func (stream *StreamIn) ReadDataHolder() (*DataHolder, error)
ReadDataHolder reads a DataHolder type
func (*StreamIn) ReadDateTime ¶ added in v1.0.6
ReadDateTime reads a DateTime type
func (*StreamIn) ReadFloat32BE ¶ added in v1.0.26
ReadFloat32BE reads a Big-Endian encoded float32
func (*StreamIn) ReadFloat32LE ¶ added in v1.0.26
ReadFloat32LE reads a Little-Endian encoded float32
func (*StreamIn) ReadFloat64BE ¶ added in v1.0.26
ReadFloat64BE reads a Big-Endian encoded float64
func (*StreamIn) ReadFloat64LE ¶ added in v1.0.25
ReadFloat64LE reads a Little-Endian encoded float64
func (*StreamIn) ReadInt16BE ¶ added in v1.0.26
ReadInt16BE reads a Big-Endian encoded int16
func (*StreamIn) ReadInt16LE ¶ added in v1.0.26
ReadInt16LE reads a Little-Endian encoded int16
func (*StreamIn) ReadInt32BE ¶ added in v1.0.26
ReadInt32BE reads a Big-Endian encoded int32
func (*StreamIn) ReadInt32LE ¶
ReadInt32LE reads a Little-Endian encoded int32
func (*StreamIn) ReadInt64BE ¶ added in v1.0.26
ReadInt64BE reads a Big-Endian encoded int64
func (*StreamIn) ReadInt64LE ¶ added in v1.0.25
ReadInt64LE reads a Little-Endian encoded int64
func (*StreamIn) ReadListBuffer ¶ added in v1.0.31
ReadListBuffer reads a list of NEX Buffer types
func (*StreamIn) ReadListDataHolder ¶ added in v1.0.39
func (stream *StreamIn) ReadListDataHolder() ([]*DataHolder, error)
ReadListDataHolder reads a list of NEX DataHolder types
func (*StreamIn) ReadListFloat32BE ¶ added in v1.0.26
ReadListFloat32BE reads a list of Big-Endian encoded float32 types
func (*StreamIn) ReadListFloat32LE ¶ added in v1.0.26
ReadListFloat32LE reads a list of Little-Endian encoded float32 types
func (*StreamIn) ReadListFloat64BE ¶ added in v1.0.26
ReadListFloat64BE reads a list of Big-Endian encoded float64 types
func (*StreamIn) ReadListFloat64LE ¶ added in v1.0.26
ReadListFloat64LE reads a list of Little-Endian encoded float64 types
func (*StreamIn) ReadListInt16BE ¶ added in v1.0.26
ReadListInt16BE reads a list of Big-Endian encoded uint16 types
func (*StreamIn) ReadListInt16LE ¶ added in v1.0.26
ReadListInt16LE reads a list of Little-Endian encoded int16 types
func (*StreamIn) ReadListInt32BE ¶ added in v1.0.26
ReadListInt32BE reads a list of Big-Endian encoded int32 types
func (*StreamIn) ReadListInt32LE ¶
ReadListInt32LE reads a list of Little-Endian encoded int32 types
func (*StreamIn) ReadListInt64BE ¶ added in v1.0.26
ReadListInt64BE reads a list of Big-Endian encoded int64 types
func (*StreamIn) ReadListInt64LE ¶ added in v1.0.26
ReadListInt64LE reads a list of Little-Endian encoded int64 types
func (*StreamIn) ReadListInt8 ¶ added in v1.0.26
ReadListInt8 reads a list of int8 types
func (*StreamIn) ReadListQBuffer ¶
ReadListQBuffer reads a list of NEX qBuffer types
func (*StreamIn) ReadListStationURL ¶ added in v1.0.16
func (stream *StreamIn) ReadListStationURL() ([]*StationURL, error)
ReadListStationURL reads a list of NEX Station URL types
func (*StreamIn) ReadListString ¶
ReadListString reads a list of NEX String types
func (*StreamIn) ReadListStructure ¶ added in v1.0.16
func (stream *StreamIn) ReadListStructure(structure StructureInterface) (interface{}, error)
ReadListStructure reads and returns a list structure types
func (*StreamIn) ReadListUInt16BE ¶ added in v1.0.26
ReadListUInt16BE reads a list of Big-Endian encoded uint16 types
func (*StreamIn) ReadListUInt16LE ¶
ReadListUInt16LE reads a list of Little-Endian encoded uint16 types
func (*StreamIn) ReadListUInt32BE ¶ added in v1.0.26
ReadListUInt32BE reads a list of Big-Endian encoded uint32 types
func (*StreamIn) ReadListUInt32LE ¶
ReadListUInt32LE reads a list of Little-Endian encoded uint32 types
func (*StreamIn) ReadListUInt64BE ¶ added in v1.0.26
ReadListUInt64BE reads a list of Big-Endian encoded uint64 types
func (*StreamIn) ReadListUInt64LE ¶
ReadListUInt64LE reads a list of Little-Endian encoded uint64 types
func (*StreamIn) ReadListUInt8 ¶
ReadListUInt8 reads a list of uint8 types
func (*StreamIn) ReadMap ¶
func (stream *StreamIn) ReadMap(keyFunction interface{}, valueFunction interface{}) (map[interface{}]interface{}, error)
ReadMap reads a Map type with the given key and value types
func (*StreamIn) ReadQBuffer ¶
ReadQBuffer reads a nex qBuffer type
func (*StreamIn) ReadRemaining ¶ added in v1.0.41
ReadRemaining reads all the data left to be read in the buffer
func (*StreamIn) ReadStationURL ¶ added in v1.0.16
func (stream *StreamIn) ReadStationURL() (*StationURL, error)
ReadStationURL reads a StationURL type
func (*StreamIn) ReadString ¶
ReadString reads and returns a nex string type
func (*StreamIn) ReadStructure ¶
func (stream *StreamIn) ReadStructure(structure StructureInterface) (StructureInterface, error)
ReadStructure reads a nex Structure type
func (*StreamIn) ReadUInt16BE ¶ added in v1.0.26
ReadUInt16BE reads a Big-Endian encoded uint16
func (*StreamIn) ReadUInt16LE ¶
ReadUInt16LE reads a Little-Endian encoded uint16
func (*StreamIn) ReadUInt32BE ¶ added in v1.0.13
ReadUInt32BE reads a Big-Endian encoded uint32
func (*StreamIn) ReadUInt32LE ¶
ReadUInt32LE reads a Little-Endian encoded uint32
func (*StreamIn) ReadUInt64BE ¶ added in v1.0.13
ReadUInt64BE reads a Big-Endian encoded uint64
func (*StreamIn) ReadUInt64LE ¶
ReadUInt64LE reads a Little-Endian encoded uint64
func (*StreamIn) ReadVariant ¶
ReadVariant reads a Variant type. This type can hold 7 different types
type StreamOut ¶
StreamOut is an abstraction of github.com/superwhiskers/crunch with nex type support
func NewStreamOut ¶
NewStreamOut returns a new nex output stream
func (*StreamOut) WriteBuffer ¶
WriteBuffer writes a NEX Buffer type
func (*StreamOut) WriteDataHolder ¶
func (stream *StreamOut) WriteDataHolder(dataholder *DataHolder)
WriteDataHolder writes a NEX DataHolder type
func (*StreamOut) WriteDateTime ¶ added in v1.0.14
WriteDateTime writes a NEX DateTime type
func (*StreamOut) WriteFloat32BE ¶ added in v1.0.26
WriteFloat32BE writes a float32 as BE
func (*StreamOut) WriteFloat32LE ¶ added in v1.0.26
WriteFloat32LE writes a float32 as LE
func (*StreamOut) WriteFloat64BE ¶ added in v1.0.26
WriteFloat64BE writes a float64 as BE
func (*StreamOut) WriteFloat64LE ¶ added in v1.0.25
WriteFloat64LE writes a float64 as LE
func (*StreamOut) WriteInt16BE ¶ added in v1.0.26
WriteInt16BE writes a uint16 as BE
func (*StreamOut) WriteInt16LE ¶ added in v1.0.26
WriteInt16LE writes a uint16 as LE
func (*StreamOut) WriteInt32BE ¶ added in v1.0.26
WriteInt32BE writes a int32 as BE
func (*StreamOut) WriteInt32LE ¶
WriteInt32LE writes a int32 as LE
func (*StreamOut) WriteInt64BE ¶ added in v1.0.26
WriteInt64BE writes a int64 as BE
func (*StreamOut) WriteInt64LE ¶
WriteInt64LE writes a int64 as LE
func (*StreamOut) WriteListBuffer ¶ added in v1.0.31
WriteListBuffer writes a list of NEX Buffer types
func (*StreamOut) WriteListDataHolder ¶ added in v1.0.39
func (stream *StreamOut) WriteListDataHolder(dataholders []*DataHolder)
WriteListDataHolder writes a NEX DataHolder type
func (*StreamOut) WriteListFloat32BE ¶ added in v1.0.26
WriteListFloat32BE writes a list of Big-Endian encoded float32 types
func (*StreamOut) WriteListFloat32LE ¶ added in v1.0.26
WriteListFloat32LE writes a list of Little-Endian encoded float32 types
func (*StreamOut) WriteListFloat64BE ¶ added in v1.0.26
WriteListFloat64BE writes a list of Big-Endian encoded float64 types
func (*StreamOut) WriteListFloat64LE ¶ added in v1.0.26
WriteListFloat64LE writes a list of Little-Endian encoded float64 types
func (*StreamOut) WriteListInt16BE ¶ added in v1.0.26
WriteListInt16BE writes a list of Big-Endian encoded int16 types
func (*StreamOut) WriteListInt16LE ¶ added in v1.0.26
WriteListInt16LE writes a list of Little-Endian encoded int16 types
func (*StreamOut) WriteListInt32BE ¶ added in v1.0.26
WriteListInt32BE writes a list of Big-Endian encoded int32 types
func (*StreamOut) WriteListInt32LE ¶ added in v1.0.26
WriteListInt32LE writes a list of Little-Endian encoded int32 types
func (*StreamOut) WriteListInt64BE ¶ added in v1.0.26
WriteListInt64BE writes a list of Big-Endian encoded int64 types
func (*StreamOut) WriteListInt64LE ¶
WriteListInt64LE writes a list of Little-Endian encoded int64 types
func (*StreamOut) WriteListInt8 ¶ added in v1.0.26
WriteListInt8 writes a list of int8 types
func (*StreamOut) WriteListQBuffer ¶
WriteListQBuffer writes a list of NEX qBuffer types
func (*StreamOut) WriteListResult ¶ added in v1.0.6
WriteListResult writes a list of NEX Result types
func (*StreamOut) WriteListStationURL ¶ added in v1.0.30
func (stream *StreamOut) WriteListStationURL(stationURLs []*StationURL)
WriteListStationURL writes a list of NEX StationURL types
func (*StreamOut) WriteListString ¶
WriteListString writes a list of NEX String types
func (*StreamOut) WriteListStructure ¶
func (stream *StreamOut) WriteListStructure(structures interface{})
WriteListStructure writes a list of NEX Structure types
func (*StreamOut) WriteListUInt16BE ¶ added in v1.0.26
WriteListUInt16BE writes a list of Big-Endian encoded uint16 types
func (*StreamOut) WriteListUInt16LE ¶
WriteListUInt16LE writes a list of Little-Endian encoded uint16 types
func (*StreamOut) WriteListUInt32BE ¶ added in v1.0.26
WriteListUInt32BE writes a list of Big-Endian encoded uint32 types
func (*StreamOut) WriteListUInt32LE ¶
WriteListUInt32LE writes a list of Little-Endian encoded uint32 types
func (*StreamOut) WriteListUInt64BE ¶ added in v1.0.26
WriteListUInt64BE writes a list of Big-Endian encoded uint64 types
func (*StreamOut) WriteListUInt64LE ¶
WriteListUInt64LE writes a list of Little-Endian encoded uint64 types
func (*StreamOut) WriteListUInt8 ¶
WriteListUInt8 writes a list of uint8 types
func (*StreamOut) WriteMap ¶ added in v1.0.25
func (stream *StreamOut) WriteMap(mapType interface{})
WriteMap writes a Map type with the given key and value types
func (*StreamOut) WriteQBuffer ¶
WriteQBuffer writes a NEX qBuffer type
func (*StreamOut) WriteResult ¶ added in v1.0.6
WriteResult writes a NEX Result type
func (*StreamOut) WriteString ¶
WriteString writes a NEX string type
func (*StreamOut) WriteStructure ¶
func (stream *StreamOut) WriteStructure(structure StructureInterface)
WriteStructure writes a nex Structure type
func (*StreamOut) WriteUInt16BE ¶ added in v1.0.26
WriteUInt16BE writes a uint16 as BE
func (*StreamOut) WriteUInt16LE ¶
WriteUInt16LE writes a uint16 as LE
func (*StreamOut) WriteUInt32BE ¶ added in v1.0.26
WriteUInt32BE writes a uint32 as BE
func (*StreamOut) WriteUInt32LE ¶
WriteUInt32LE writes a uint32 as LE
func (*StreamOut) WriteUInt64BE ¶ added in v1.0.26
WriteUInt64BE writes a uint64 as BE
func (*StreamOut) WriteUInt64LE ¶
WriteUInt64LE writes a uint64 as LE
func (*StreamOut) WriteUInt8 ¶
WriteUInt8 writes a uint8
func (*StreamOut) WriteVariant ¶ added in v1.0.25
WriteVariant writes a Variant type
type Structure ¶
type Structure struct { StructureInterface // contains filtered or unexported fields }
Structure represents a nex Structure type
func (*Structure) ParentType ¶ added in v1.0.23
func (structure *Structure) ParentType() StructureInterface
ParentType returns the Structures parent type. nil if the type does not inherit another Structure
func (*Structure) SetParentType ¶ added in v1.0.23
func (structure *Structure) SetParentType(parentType StructureInterface)
SetParentType sets the Structures parent type
func (*Structure) SetStructureVersion ¶ added in v1.0.26
SetStructureVersion sets the structures version. Only used in NEX 3.5+
func (*Structure) StructureVersion ¶ added in v1.0.26
StructureVersion returns the structures version. Only used in NEX 3.5+
type StructureInterface ¶
type StructureInterface interface { SetParentType(StructureInterface) ParentType() StructureInterface SetStructureVersion(uint8) StructureVersion() uint8 ExtractFromStream(*StreamIn) error Bytes(*StreamOut) []byte Copy() StructureInterface Equals(StructureInterface) bool FormatToString(int) string }
StructureInterface implements all Structure methods
type Ticket ¶
type Ticket struct {
// contains filtered or unexported fields
}
Ticket represents a Kerberos authentication ticket
func NewKerberosTicket ¶ added in v1.0.5
func NewKerberosTicket() *Ticket
NewKerberosTicket returns a new Ticket instance
func (*Ticket) Encrypt ¶ added in v1.0.5
Encrypt writes the ticket data to the provided stream and returns the encrypted byte slice
func (*Ticket) InternalData ¶ added in v1.0.5
InternalData returns the Tickets internal data buffer
func (*Ticket) SessionKey ¶ added in v1.0.5
SessionKey returns the Tickets session key
func (*Ticket) SetInternalData ¶ added in v1.0.5
SetInternalData sets the Tickets internal data buffer
func (*Ticket) SetSessionKey ¶ added in v1.0.5
SetSessionKey sets the Tickets session key
func (*Ticket) SetTargetPID ¶ added in v1.0.5
SetTargetPID sets the Tickets target PID
type TicketInternalData ¶ added in v1.0.5
type TicketInternalData struct {
// contains filtered or unexported fields
}
TicketInternalData contains information sent to the secure server
func NewKerberosTicketInternalData ¶ added in v1.0.5
func NewKerberosTicketInternalData() *TicketInternalData
NewKerberosTicketInternalData returns a new TicketInternalData instance
func (*TicketInternalData) Decrypt ¶ added in v1.0.6
func (ticketInternalData *TicketInternalData) Decrypt(stream *StreamIn, key []byte) error
Decrypt decrypts the given data and populates the struct
func (*TicketInternalData) Encrypt ¶ added in v1.0.5
func (ticketInternalData *TicketInternalData) Encrypt(key []byte, stream *StreamOut) ([]byte, error)
Encrypt writes the ticket data to the provided stream and returns the encrypted byte slice
func (*TicketInternalData) SessionKey ¶ added in v1.0.5
func (ticketInternalData *TicketInternalData) SessionKey() []byte
SessionKey returns the TicketInternalDatas session key
func (*TicketInternalData) SetSessionKey ¶ added in v1.0.5
func (ticketInternalData *TicketInternalData) SetSessionKey(sessionKey []byte)
SetSessionKey sets the TicketInternalDatas session key
func (*TicketInternalData) SetTimestamp ¶ added in v1.0.5
func (ticketInternalData *TicketInternalData) SetTimestamp(timestamp *DateTime)
SetTimestamp sets the TicketInternalDatas timestamp
func (*TicketInternalData) SetUserPID ¶ added in v1.0.5
func (ticketInternalData *TicketInternalData) SetUserPID(userPID uint32)
SetUserPID sets the TicketInternalDatas user PID
func (*TicketInternalData) Timestamp ¶ added in v1.0.5
func (ticketInternalData *TicketInternalData) Timestamp() *DateTime
Timestamp returns the TicketInternalDatas timestamp
func (*TicketInternalData) UserPID ¶ added in v1.0.5
func (ticketInternalData *TicketInternalData) UserPID() uint32
UserPID returns the TicketInternalDatas user PID
type Variant ¶ added in v1.0.24
type Variant struct { TypeID uint8 // * In reality this type does not have this many fields // * It only stores the type ID and then the value // * However to get better typing, we opt to store each possible // * type as it's own field and just check typeID to know which it has Int64 int64 Float64 float64 Bool bool Str string DateTime *DateTime UInt64 uint64 }
Variant can hold one of 7 types; nil, int64, float64, bool, string, DateTime, or uint64
func (*Variant) Equals ¶ added in v1.0.24
Equals checks if the passed Structure contains the same data as the current instance
func (*Variant) ExtractFromStream ¶ added in v1.0.24
ExtractFromStream extracts a Variant structure from a stream
func (*Variant) FormatToString ¶ added in v1.0.28
FormatToString pretty-prints the struct data using the provided indentation level
type ZLibCompression ¶
type ZLibCompression struct{}
ZLibCompression represents ZLib compression
func (*ZLibCompression) Compress ¶
func (compression *ZLibCompression) Compress(data []byte) []byte
Compress returns the data as-is (needs to be updated to return ZLib compressed data)
func (*ZLibCompression) Decompress ¶
func (compression *ZLibCompression) Decompress(data []byte) []byte
Decompress returns the data as-is (needs to be updated to return ZLib decompressed data)
Source Files
¶
- client.go
- compression.go
- counter.go
- errors.go
- hpp_packet.go
- init.go
- kerberos.go
- md5.go
- mutex_map.go
- nex_version.go
- packet.go
- packet_flags.go
- packet_interface.go
- packet_manager.go
- packet_resend_manager.go
- packet_types.go
- packet_v0.go
- packet_v1.go
- rmc.go
- sequence_id_manager.go
- server.go
- stream_in.go
- stream_out.go
- sum.go
- types.go