Documentation
¶
Index ¶
- Constants
- Variables
- func ErrorNameFromCode(errorCode uint32) string
- func InitErrorsData()
- func MD5Hash(text []byte) []byte
- type Client
- 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) LocalStationUrl() string
- func (client *Client) PID() uint32
- func (client *Client) Reset()
- func (client *Client) SequenceIDCounterIn() *Counter
- func (client *Client) SequenceIDCounterOut() *Counter
- 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) SetLocalStationUrl(localStationUrl string)
- func (client *Client) SetPID(pid uint32)
- func (client *Client) SetServerConnectionSignature(serverConnectionSignature []byte)
- func (client *Client) SetSessionKey(sessionKey []byte)
- func (client *Client) SignatureBase() int
- func (client *Client) SignatureKey() []byte
- func (client *Client) StartTimeoutTimer()
- func (client *Client) UpdateAccessKey(accessKey string)
- func (client *Client) UpdateRC4Key(RC4Key []byte)
- type Counter
- type DataHolder
- type DateTime
- type DummyCompression
- type ErrorsStruct
- type KerberosEncryption
- type NullData
- 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 PacketV0
- type PacketV1
- func (packet *PacketV1) Bytes() []byte
- func (packet *PacketV1) Decode() error
- func (packet *PacketV1) InitialSequenceID() uint16
- func (packet *PacketV1) MaximumSubstreamID() uint8
- func (packet *PacketV1) SetInitialSequenceID(initialSequenceID uint16)
- func (packet *PacketV1) SetMaximumSubstreamID(maximumSubstreamID uint8)
- func (packet *PacketV1) SetSubstreamID(substreamID uint8)
- func (packet *PacketV1) SetSupportedFunctions(supportedFunctions uint32)
- func (packet *PacketV1) SubstreamID() uint8
- func (packet *PacketV1) SupportedFunctions() uint32
- 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) SetSpecialProtocols(specialProtocols []byte)
- func (rvConnectionData *RVConnectionData) SetStationURL(stationURL string)
- func (rvConnectionData *RVConnectionData) SetStationURLSpecialProtocols(stationURLSpecialProtocols string)
- func (rvConnectionData *RVConnectionData) SetTime(time uint64)
- type Result
- type ResultRange
- 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) Emit(event string, packet interface{})
- func (server *Server) FindClientFromConnectionID(rvcid uint32) *Client
- func (server *Server) FindClientFromPID(pid uint32) *Client
- func (server *Server) KerberosKeySize() int
- func (server *Server) KerberosTicketVersion() int
- func (server *Server) Kick(client *Client)
- func (server *Server) Listen(address string)
- func (server *Server) NexVersion() int
- func (server *Server) On(event string, handler interface{})
- func (server *Server) PingTimeout() int
- func (server *Server) PrudpVersion() int
- 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) SetFragmentSize(fragmentSize int16)
- func (server *Server) SetKerberosKeySize(kerberosKeySize int)
- func (server *Server) SetKerberosTicketVersion(ticketVersion int)
- func (server *Server) SetNexVersion(nexVersion int)
- func (server *Server) SetPingTimeout(pingTimeout int)
- func (server *Server) SetPrudpVersion(prudpVersion int)
- func (server *Server) SetSocket(socket *net.UDPConn)
- func (server *Server) Socket() *net.UDPConn
- type StationURL
- func (station *StationURL) Address() string
- func (station *StationURL) CID() string
- func (station *StationURL) EncodeToString() string
- func (station *StationURL) FromString(str string)
- func (station *StationURL) Natf() string
- func (station *StationURL) Natm() string
- func (station *StationURL) PID() string
- func (station *StationURL) PRID() string
- func (station *StationURL) Pmp() string
- func (station *StationURL) Port() string
- func (station *StationURL) ProbeInit() string
- func (station *StationURL) RVCID() string
- func (station *StationURL) SID() string
- func (station *StationURL) Scheme() string
- func (station *StationURL) SetAddress(address string)
- func (station *StationURL) SetCID(cid string)
- func (station *StationURL) SetNatf(natf string)
- func (station *StationURL) SetNatm(natm string)
- func (station *StationURL) SetPID(pid string)
- func (station *StationURL) SetPRID(prid string)
- func (station *StationURL) SetPmp(pmp string)
- func (station *StationURL) SetPort(port string)
- func (station *StationURL) SetProbeInit(probeinit string)
- func (station *StationURL) SetRVCID(rvcid string)
- func (station *StationURL) SetSID(sid string)
- func (station *StationURL) SetScheme(scheme string)
- func (station *StationURL) SetStream(stream string)
- func (station *StationURL) SetType(transportType string)
- func (station *StationURL) SetUpnp(upnp string)
- func (station *StationURL) Stream() string
- func (station *StationURL) Type() string
- func (station *StationURL) Upnp() string
- type StreamIn
- func (stream *StreamIn) ReadBool() bool
- func (stream *StreamIn) ReadBuffer() ([]byte, error)
- func (stream *StreamIn) ReadInt32LE() int32
- func (stream *StreamIn) ReadListInt32LE() []int32
- func (stream *StreamIn) ReadListQBuffer() [][]byte
- func (stream *StreamIn) ReadListString() []string
- func (stream *StreamIn) ReadListUInt8() []uint8
- func (stream *StreamIn) ReadListUInt16LE() []uint16
- func (stream *StreamIn) ReadListUInt32LE() []uint32
- func (stream *StreamIn) ReadListUInt64LE() []uint64
- func (stream *StreamIn) ReadMap(keyFunction interface{}, valueFunction interface{}) (map[interface{}]interface{}, error)
- func (stream *StreamIn) ReadQBuffer() ([]byte, error)
- func (stream *StreamIn) ReadString() (string, error)
- func (stream *StreamIn) ReadStructure(structure StructureInterface) (StructureInterface, error)
- func (stream *StreamIn) ReadUInt8() uint8
- func (stream *StreamIn) ReadUInt16LE() uint16
- func (stream *StreamIn) ReadUInt32LE() uint32
- func (stream *StreamIn) ReadUInt64LE() uint64
- func (stream *StreamIn) ReadVariant() interface{}
- type StreamOut
- func (stream *StreamOut) WriteBool(b bool)
- func (stream *StreamOut) WriteBuffer(data []byte)
- func (stream *StreamOut) WriteDataHolder(dataholder *DataHolder)
- func (stream *StreamOut) WriteInt32LE(s32 int32)
- func (stream *StreamOut) WriteInt64LE(s64 int64)
- func (stream *StreamOut) WriteListInt64LE(list []int64)
- func (stream *StreamOut) WriteListQBuffer(buffers [][]byte)
- func (stream *StreamOut) WriteListString(strings []string)
- func (stream *StreamOut) WriteListStructure(structures interface{})
- func (stream *StreamOut) WriteListUInt8(list []uint8)
- func (stream *StreamOut) WriteListUInt16LE(list []uint16)
- func (stream *StreamOut) WriteListUInt32LE(list []uint32)
- func (stream *StreamOut) WriteListUInt64LE(list []uint64)
- func (stream *StreamOut) WriteQBuffer(data []byte)
- func (stream *StreamOut) WriteString(str string)
- func (stream *StreamOut) WriteStructure(structure StructureInterface)
- func (stream *StreamOut) WriteUInt8(u8 uint8)
- func (stream *StreamOut) WriteUInt16LE(u16 uint16)
- func (stream *StreamOut) WriteUInt32LE(u32 uint32)
- func (stream *StreamOut) WriteUInt64LE(u64 uint64)
- type Structure
- type StructureInterface
- type Ticket
- func (ticket *Ticket) Encrypt(key []byte, stream *StreamOut) []byte
- 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) Encrypt(key []byte, stream *StreamOut) []byte
- 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 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{}
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 ErrorNameFromCode ¶
func InitErrorsData ¶
func InitErrorsData()
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a connected or non-connected PRUDP client
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) LocalStationUrl ¶
LocalStationUrl returns the clients Local Station URL
func (*Client) SequenceIDCounterIn ¶
SequenceIDCounterIn returns the clients packet SequenceID counter for incoming packets
func (*Client) SequenceIDCounterOut ¶
SequenceIDCounterOut returns the clients packet SequenceID counter 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) SetLocalStationUrl ¶
SetLocalStationUrl sets the clients Local Station URL
func (*Client) SetServerConnectionSignature ¶
SetServerConnectionSignature sets the clients server-side connection signature
func (*Client) SetSessionKey ¶
SetSessionKey sets the clients session key
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) 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 DataHolder ¶
type DataHolder struct {
Name string
Object StructureInterface
}
func (*DataHolder) Bytes ¶
func (dataholder *DataHolder) Bytes(stream *StreamOut) []byte
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) 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 ErrorsStruct ¶
type ErrorsStruct struct {
Success uint32
Core struct {
Unknown uint32
NotImplemented uint32
InvalidPointer uint32
OperationAborted uint32
Exception uint32
AccessDenied uint32
InvalidHandle uint32
InvalidIndex uint32
OutOfMemory uint32
InvalidArgument uint32
Timeout uint32
InitializationFailure uint32
CallInitiationFailure uint32
RegistrationError uint32
BufferOverflow uint32
InvalidLockState uint32
InvalidSequence uint32
SystemError uint32
Cancelled uint32
}
DDL struct {
InvalidSignature uint32
IncorrectVersion uint32
}
RendezVous struct {
ConnectionFailure uint32
NotAuthenticated uint32
InvalidUsername uint32
InvalidPassword uint32
UsernameAlreadyExists uint32
AccountDisabled uint32
AccountExpired uint32
ConcurrentLoginDenied uint32
EncryptionFailure uint32
InvalidPID uint32
MaxConnectionsReached uint32
InvalidGID uint32
InvalidControlScriptID uint32
InvalidOperationInLiveEnvironment uint32
DuplicateEntry uint32
ControlScriptFailure uint32
ClassNotFound uint32
SessionVoid uint32
DDLMismatch uint32
InvalidConfiguration uint32
SessionFull uint32
InvalidGatheringPassword uint32
WithoutParticipationPeriod uint32
PersistentGatheringCreationMax uint32
PersistentGatheringParticipationMax uint32
DeniedByParticipants uint32
ParticipantInBlackList uint32
GameServerMaintenance uint32
OperationPostpone uint32
OutOfRatingRange uint32
ConnectionDisconnected uint32
InvalidOperation uint32
NotParticipatedGathering uint32
MatchmakeSessionUserPasswordUnmatch uint32
MatchmakeSessionSystemPasswordUnmatch uint32
UserIsOffline uint32
AlreadyParticipatedGathering uint32
PermissionDenied uint32
NotFriend uint32
SessionClosed uint32
DatabaseTemporarilyUnavailable uint32
InvalidUniqueId uint32
MatchmakingWithdrawn uint32
LimitExceeded uint32
AccountTemporarilyDisabled uint32
PartiallyServiceClosed uint32
ConnectionDisconnectedForConcurrentLogin uint32
}
PythonCore struct {
Exception uint32
TypeError uint32
IndexError uint32
InvalidReference uint32
CallFailure uint32
MemoryError uint32
KeyError uint32
OperationError uint32
ConversionError uint32
ValidationError uint32
}
Transport struct {
Unknown uint32
ConnectionFailure uint32
InvalidUrl uint32
InvalidKey uint32
InvalidURLType uint32
DuplicateEndpoint uint32
IOError uint32
Timeout uint32
ConnectionReset uint32
IncorrectRemoteAuthentication uint32
ServerRequestError uint32
DecompressionFailure uint32
ReliableSendBufferFullFatal uint32
UPnPCannotInit uint32
UPnPCannotAddMapping uint32
NatPMPCannotInit uint32
NatPMPCannotAddMapping uint32
UnsupportedNAT uint32
DnsError uint32
ProxyError uint32
DataRemaining uint32
NoBuffer uint32
NotFound uint32
TemporaryServerError uint32
PermanentServerError uint32
ServiceUnavailable uint32
ReliableSendBufferFull uint32
InvalidStation uint32
InvalidSubStreamID uint32
PacketBufferFull uint32
NatTraversalError uint32
NatCheckError uint32
}
DOCore struct {
StationNotReached uint32
TargetStationDisconnect uint32
LocalStationLeaving uint32
ObjectNotFound uint32
InvalidRole uint32
CallTimeout uint32
RMCDispatchFailed uint32
MigrationInProgress uint32
NoAuthority uint32
NoTargetStationSpecified uint32
JoinFailed uint32
JoinDenied uint32
ConnectivityTestFailed uint32
Unknown uint32
UnfreedReferences uint32
JobTerminationFailed uint32
InvalidState uint32
FaultRecoveryFatal uint32
FaultRecoveryJobProcessFailed uint32
StationInconsitency uint32
AbnormalMasterState uint32
VersionMismatch uint32
}
FPD struct {
NotInitialized uint32
AlreadyInitialized uint32
NotConnected uint32
Connected uint32
InitializationFailure uint32
OutOfMemory uint32
RmcFailed uint32
InvalidArgument uint32
InvalidLocalAccountID uint32
InvalidPrincipalID uint32
InvalidLocalFriendCode uint32
LocalAccountNotExists uint32
LocalAccountNotLoaded uint32
LocalAccountAlreadyLoaded uint32
FriendAlreadyExists uint32
FriendNotExists uint32
FriendNumMax uint32
NotFriend uint32
FileIO uint32
P2PInternetProhibited uint32
Unknown uint32
InvalidState uint32
AddFriendProhibited uint32
InvalidAccount uint32
BlacklistedByMe uint32
FriendAlreadyAdded uint32
MyFriendListLimitExceed uint32
RequestLimitExceed uint32
InvalidMessageID uint32
MessageIsNotMine uint32
MessageIsNotForMe uint32
FriendRequestBlocked uint32
NotInMyFriendList uint32
FriendListedByMe uint32
NotInMyBlacklist uint32
IncompatibleAccount uint32
BlockSettingChangeNotAllowed uint32
SizeLimitExceeded uint32
OperationNotAllowed uint32
NotNetworkAccount uint32
NotificationNotFound uint32
PreferenceNotInitialized uint32
FriendRequestNotAllowed uint32
}
Ranking struct {
NotInitialized uint32
InvalidArgument uint32
RegistrationError uint32
NotFound uint32
InvalidScore uint32
InvalidDataSize uint32
PermissionDenied uint32
Unknown uint32
NotImplemented uint32
}
Authentication struct {
NASAuthenticateError uint32
TokenParseError uint32
HttpConnectionError uint32
HttpDNSError uint32
HttpGetProxySetting uint32
TokenExpired uint32
ValidationFailed uint32
InvalidParam uint32
PrincipalIdUnmatched uint32
MoveCountUnmatch uint32
UnderMaintenance uint32
UnsupportedVersion uint32
ServerVersionIsOld uint32
Unknown uint32
ClientVersionIsOld uint32
AccountLibraryError uint32
ServiceNoLongerAvailable uint32
UnknownApplication uint32
ApplicationVersionIsOld uint32
OutOfService uint32
NetworkServiceLicenseRequired uint32
NetworkServiceLicenseSystemError uint32
NetworkServiceLicenseError3 uint32
NetworkServiceLicenseError4 uint32
}
DataStore struct {
Unknown uint32
InvalidArgument uint32
PermissionDenied uint32
NotFound uint32
AlreadyLocked uint32
UnderReviewing uint32
Expired uint32
InvalidCheckToken uint32
SystemFileError uint32
OverCapacity uint32
OperationNotAllowed uint32
InvalidPassword uint32
ValueNotEqual uint32
}
ServiceItem struct {
Unknown uint32
InvalidArgument uint32
EShopUnknownHttpError uint32
EShopResponseParseError uint32
NotOwned uint32
InvalidLimitationType uint32
ConsumptionRightShortage uint32
}
MatchmakeReferee struct {
Unknown uint32
InvalidArgument uint32
AlreadyExists uint32
NotParticipatedGathering uint32
NotParticipatedRound uint32
StatsNotFound uint32
RoundNotFound uint32
RoundArbitrated uint32
RoundNotArbitrated uint32
}
Subscriber struct {
Unknown uint32
InvalidArgument uint32
OverLimit uint32
PermissionDenied uint32
}
Ranking2 struct {
Unknown uint32
InvalidArgument uint32
InvalidScore uint32
}
SmartDeviceVoiceChat struct {
Unknown uint32
InvalidArgument uint32
InvalidResponse uint32
InvalidAccessToken uint32
Unauthorized uint32
AccessError uint32
UserNotFound uint32
RoomNotFound uint32
RoomNotActivated uint32
ApplicationNotSupported uint32
InternalServerError uint32
ServiceUnavailable uint32
UnexpectedError uint32
UnderMaintenance uint32
ServiceNoLongerAvailable uint32
AccountTemporarilyDisabled uint32
PermissionDenied uint32
NetworkServiceLicenseRequired uint32
AccountLibraryError uint32
GameModeNotFound uint32
}
Screening struct {
Unknown uint32
InvalidArgument uint32
NotFound uint32
}
Custom struct {
Unknown uint32
}
Ess struct {
Unknown uint32
GameSessionError uint32
GameSessionMaintenance uint32
}
}
var Errors ErrorsStruct
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
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 NullData ¶
type NullData struct {
*Structure
}
NullData represents a structure with no data
func (*NullData) ExtractFromStream ¶
ExtractFromStream does nothing for NullData
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 {
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
RMCRequest() RMCRequest
Bytes() []byte
}
PacketInterface implements all Packet methods
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) 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) InitialSequenceID ¶
InitialSequenceID returns the packet initial sequence ID for unreliable packets
func (*PacketV1) MaximumSubstreamID ¶
MaximumSubstreamID returns the packet maximum substream ID
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) 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 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 sets the RMC request customID
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)
CallID sets the RMC request callID
func (*RMCRequest) SetCustomID ¶
func (request *RMCRequest) SetCustomID(customID uint16)
CustomID sets the RMC request customID
func (*RMCRequest) SetMethodID ¶
func (request *RMCRequest) SetMethodID(methodID uint32)
MethodID sets the RMC request methodID
func (*RMCRequest) SetParameters ¶
func (request *RMCRequest) SetParameters(parameters []byte)
Parameters sets the RMC request parameters
func (*RMCRequest) SetProtocolID ¶
func (request *RMCRequest) SetProtocolID(protocolID uint8)
ProtocolID sets the RMC request protocolID
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) 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) 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 uint64)
SetTime sets the RVConnectionData time
type Result ¶
type Result struct {
ResultCode uint32
}
Result is sent in methods which query large objects
func (*Result) ExtractFromStream ¶
ExtractFromStream extracts a Result structure from a stream
type ResultRange ¶
ResultRange is sent in methods which query large objects
func (*ResultRange) ExtractFromStream ¶
func (resultRange *ResultRange) ExtractFromStream(stream *StreamIn) error
ExtractFromStream extracts a ResultRange structure from a stream
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) FindClientFromConnectionID ¶
FindClientFromConnectionID finds a client by their Connection ID
func (*Server) FindClientFromPID ¶
FindClientFromPID finds a client by their PID
func (*Server) KerberosKeySize ¶
KerberosKeySize returns the server kerberos key size
func (*Server) KerberosTicketVersion ¶
KerberosTicketVersion returns the server kerberos ticket contents version
func (*Server) NexVersion ¶
NexVersion returns the server NEX version
func (*Server) PingTimeout ¶
PingTimeout returns the server ping timeout time in seconds
func (*Server) PrudpVersion ¶
PrudpVersion returns the server PRUDP 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) SetFragmentSize ¶
SetFragmentSize sets the packet fragment size
func (*Server) SetKerberosKeySize ¶
SetKerberosKeySize sets the server kerberos key size
func (*Server) SetKerberosTicketVersion ¶
SetKerberosTicketVersion sets the server kerberos ticket contents version
func (*Server) SetNexVersion ¶
SetNexVersion sets the server NEX version
func (*Server) SetPingTimeout ¶
SetPingTimeout sets the server ping timeout time in seconds
func (*Server) SetPrudpVersion ¶
SetPrudpVersion sets the server PRUDP version
type StationURL ¶
type StationURL struct {
// contains filtered or unexported fields
}
StationURL contains the data for a NEX station URL
func NewStationURL ¶
func NewStationURL(str string) *StationURL
func (*StationURL) Address ¶
func (station *StationURL) Address() string
func (*StationURL) CID ¶
func (station *StationURL) CID() string
func (*StationURL) EncodeToString ¶
func (station *StationURL) EncodeToString() string
EncodeToString encodes the StationURL into a string
func (*StationURL) FromString ¶
func (station *StationURL) FromString(str string)
FromString parses the StationURL data from a string
func (*StationURL) Natf ¶
func (station *StationURL) Natf() string
func (*StationURL) Natm ¶
func (station *StationURL) Natm() string
func (*StationURL) PID ¶
func (station *StationURL) PID() string
func (*StationURL) PRID ¶
func (station *StationURL) PRID() string
func (*StationURL) Pmp ¶
func (station *StationURL) Pmp() string
func (*StationURL) Port ¶
func (station *StationURL) Port() string
func (*StationURL) ProbeInit ¶
func (station *StationURL) ProbeInit() string
func (*StationURL) RVCID ¶
func (station *StationURL) RVCID() string
func (*StationURL) SID ¶
func (station *StationURL) SID() string
func (*StationURL) Scheme ¶
func (station *StationURL) Scheme() string
func (*StationURL) SetAddress ¶
func (station *StationURL) SetAddress(address string)
SetAddress sets the StationURL address
func (*StationURL) SetCID ¶
func (station *StationURL) SetCID(cid string)
SetCID sets the StationURL CID
func (*StationURL) SetNatf ¶
func (station *StationURL) SetNatf(natf string)
SetNatf sets the StationURL Natf
func (*StationURL) SetNatm ¶
func (station *StationURL) SetNatm(natm string)
SetNatm sets the StationURL Natm
func (*StationURL) SetPID ¶
func (station *StationURL) SetPID(pid string)
SetPid sets the StationURL PID
func (*StationURL) SetPRID ¶
func (station *StationURL) SetPRID(prid string)
SetPRID sets the StationURL PRID
func (*StationURL) SetPmp ¶
func (station *StationURL) SetPmp(pmp string)
SetPmp sets the StationURL Pmp
func (*StationURL) SetPort ¶
func (station *StationURL) SetPort(port string)
SetPort sets the StationURL port
func (*StationURL) SetProbeInit ¶
func (station *StationURL) SetProbeInit(probeinit string)
SetProbeInit sets the StationURL ProbeInit
func (*StationURL) SetRVCID ¶
func (station *StationURL) SetRVCID(rvcid string)
SetRVCID sets the StationURL RVCID
func (*StationURL) SetSID ¶
func (station *StationURL) SetSID(sid string)
SetSID sets the StationURL SID
func (*StationURL) SetScheme ¶
func (station *StationURL) SetScheme(scheme string)
SetScheme sets the StationURL scheme
func (*StationURL) SetStream ¶
func (station *StationURL) SetStream(stream string)
SetStream sets the StationURL stream
func (*StationURL) SetType ¶
func (station *StationURL) SetType(transportType string)
SetType sets the StationURL transportType
func (*StationURL) SetUpnp ¶
func (station *StationURL) SetUpnp(upnp string)
SetUpnp sets the StationURL Upnp
func (*StationURL) Stream ¶
func (station *StationURL) Stream() string
func (*StationURL) Type ¶
func (station *StationURL) Type() string
func (*StationURL) Upnp ¶
func (station *StationURL) Upnp() string
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) ReadInt32LE ¶
ReadInt32LE reads a int32
func (*StreamIn) ReadListInt32LE ¶
ReadListInt32LE reads a list of int32 types
func (*StreamIn) ReadListQBuffer ¶
ReadListQBuffer reads a list of NEX QBuffer types
func (*StreamIn) ReadListString ¶
ReadListString reads a list of NEX String types
func (*StreamIn) ReadListUInt8 ¶
ReadListUInt8 reads a list of uint8 types
func (*StreamIn) ReadListUInt16LE ¶
ReadListUInt16LE reads a list of uint16 types
func (*StreamIn) ReadListUInt32LE ¶
ReadListUInt32LE reads a list of uint32 types
func (*StreamIn) ReadListUInt64LE ¶
ReadListUInt64LE reads a list of uint64 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) 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) ReadUInt16LE ¶
ReadUInt16LE reads a uint16
func (*StreamIn) ReadUInt32LE ¶
ReadUInt32LE reads a uint32
func (*StreamIn) ReadUInt64LE ¶
ReadUInt64LE reads a uint64
func (*StreamIn) ReadVariant ¶
func (stream *StreamIn) ReadVariant() interface{}
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) WriteInt32LE ¶
WriteInt32LE writes a int32 as LE
func (*StreamOut) WriteInt64LE ¶
WriteInt64LE writes a int64 as LE
func (*StreamOut) WriteListInt64LE ¶
WriteListInt64LE writes a list of int64 types
func (*StreamOut) WriteListQBuffer ¶
WriteListQBuffer writes a list of NEX qBuffer 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) WriteListUInt8 ¶
WriteListUInt8 writes a list of uint8 types
func (*StreamOut) WriteListUInt16LE ¶
WriteListUInt16LE writes a list of uint16 types
func (*StreamOut) WriteListUInt32LE ¶
WriteListUInt32LE writes a list of uint32 types
func (*StreamOut) WriteListUInt64LE ¶
WriteListUInt64LE writes a list of uint64 types
func (*StreamOut) WriteQBuffer ¶
WriteQBuffer writes a NEX qBuffer 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) WriteUInt8 ¶
WriteUInt8 writes a uint8
func (*StreamOut) WriteUInt16LE ¶
WriteUInt16LE writes a uint16 as LE
func (*StreamOut) WriteUInt32LE ¶
WriteUInt32LE writes a uint32 as LE
func (*StreamOut) WriteUInt64LE ¶
WriteUInt64LE writes a uint64 as LE
type Structure ¶
type Structure struct {
StructureInterface
}
Structure represents a nex Structure type
func (*Structure) Hierarchy ¶
func (structure *Structure) Hierarchy() []StructureInterface
Hierarchy returns a Structure hierarchy
type StructureInterface ¶
type StructureInterface interface {
Hierarchy() []StructureInterface
ExtractFromStream(*StreamIn) error
Bytes(*StreamOut) []byte
}
StructureInterface implements all Structure methods
type Ticket ¶
type Ticket struct {
// contains filtered or unexported fields
}
Ticket represents a Kerberos authentication ticket
func NewKerberosTicket ¶
func NewKerberosTicket() *Ticket
NewKerberosTicket returns a new Ticket instance
func (*Ticket) Encrypt ¶
Encrypt writes the ticket data to the provided stream and returns the encrypted byte slice
func (*Ticket) InternalData ¶
InternalData returns the Tickets internal data buffer
func (*Ticket) SessionKey ¶
SessionKey returns the Tickets session key
func (*Ticket) SetInternalData ¶
SetInternalData sets the Tickets internal data buffer
func (*Ticket) SetSessionKey ¶
SetSessionKey sets the Tickets session key
func (*Ticket) SetTargetPID ¶
SetTargetPID sets the Tickets target PID
type TicketInternalData ¶
type TicketInternalData struct {
// contains filtered or unexported fields
}
TicketInternalData contains information sent to the secure server
func NewKerberosTicketInternalData ¶
func NewKerberosTicketInternalData() *TicketInternalData
NewKerberosTicketInternalData returns a new TicketInternalData instance
func (*TicketInternalData) Encrypt ¶
func (ticketInternalData *TicketInternalData) Encrypt(key []byte, stream *StreamOut) []byte
Encrypt writes the ticket data to the provided stream and returns the encrypted byte slice
func (*TicketInternalData) SessionKey ¶
func (ticketInternalData *TicketInternalData) SessionKey() []byte
SessionKey returns the TicketInternalDatas session key
func (*TicketInternalData) SetSessionKey ¶
func (ticketInternalData *TicketInternalData) SetSessionKey(sessionKey []byte)
SetSessionKey sets the TicketInternalDatas session key
func (*TicketInternalData) SetTimestamp ¶
func (ticketInternalData *TicketInternalData) SetTimestamp(timestamp *DateTime)
SetSessionKey sets the TicketInternalDatas session key
func (*TicketInternalData) SetUserPID ¶
func (ticketInternalData *TicketInternalData) SetUserPID(userPID uint32)
SetUserPID sets the TicketInternalDatas user PID
func (*TicketInternalData) Timestamp ¶
func (ticketInternalData *TicketInternalData) Timestamp() *DateTime
Timestamp returns the TicketInternalDatas timestamp
func (*TicketInternalData) UserPID ¶
func (ticketInternalData *TicketInternalData) UserPID() uint32
UserPID returns the TicketInternalDatas user PID
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)