Skip to content

ItzSwirlz/nex-protocols-go

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NEX Protocols Go

NEX servers with protocol support in Go

GoDoc

Other NEX libraries

nex-go - Barebones NEX/PRUDP server implementation

nex-protocols-common-go - NEX protocols used by many games with premade handlers and a high level API

Install

go get github.com/PretendoNetwork/nex-protocols-go/v2

Usage

nex-protocols-go provides a higher level API than the NEX Go module to the underlying PRUDP server by providing a set of NEX protocols. This module only provides access to the lower level raw RMC method calls, however, and all method handlers must be defined in full manually. For a higher level API, see the common NEX method handlers module

Example, friends (Wii U) authentication server

For a complete example, see the complete Friends Server, and other game servers

package main

import (
	nex "github.com/PretendoNetwork/nex-go/v2"
	ticket_granting "github.com/PretendoNetwork/nex-protocols-go/v2/ticket-granting"
)

var nexServer *nex.PRUDPServer

func main() {
	nexServer := nex.NewPRUDPServer()

	endpoint := nex.NewPRUDPEndPoint(1)
	endpoint.ServerAccount = nex.NewAccount(types.NewPID(1), "Quazal Authentication", "password"))
	endpoint.AccountDetailsByPID = accountDetailsByPID
	endpoint.AccountDetailsByUsername = accountDetailsByUsername

	nexServer.BindPRUDPEndPoint(endpoint)
	nexServer.SetFragmentSize(962)
	nexServer.LibraryVersions.SetDefault(nex.NewLibraryVersion(1, 1, 0))
	nexServer.SessionKeyLength = 16
	nexServer.AccessKey = "ridfebb9"

	ticketGrantingProtocol := ticket_granting.NewProtocol(endpoint)

	// Handle Login RMC method
	ticketGrantingProtocol.Login = login

	// Handle RequestTicket RMC method
	ticketGrantingProtocol.RequestTicket = requestTicket

	// Register the protocol on the endpoint
	endpoint.RegisterServiceProtocol(ticketGrantingProtocol)

	nexServer.Listen(60000)
}

About

NEX servers with protocol support in Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%