Barebones PRUDP/NEX server library written in Go
Find a file
2022-03-27 20:10:19 -04:00
v1 Merge branch 'master' of https://github.com/PretendoNetwork/nex-go 2022-03-27 20:00:33 -04:00
.gitignore Add gitignore for Jetbrains files, include crunch in go.mod 2019-08-11 15:42:17 -07:00
go.work Added go.work file 2022-03-27 19:59:36 -04:00
LICENSE Added license 2022-03-27 20:00:17 -04:00
README.md Updated README 2022-03-27 20:10:19 -04:00

Barebones PRUDP/NEX server library written in Go

GoDoc

Install

go get github.com/PretendoNetwork/nex-go/v1

Usage note

This module provides a barebones PRUDP server for use with titles using the Nintendo NEX library. It does not provide any support for titles using the original Rendez-Vous library developed by Quazal. This library only provides the low level packet data, as such it is recommended to use NEX Protocols Go to develop servers.

Usage

package main

import (
	"fmt"

	nex "github.com/PretendoNetwork/nex-go"
)

func main() {
	nexServer := nex.NewServer()
	nexServer.SetPrudpVersion(0)
	nexServer.SetSignatureVersion(1)
	nexServer.SetKerberosKeySize(16)
	nexServer.SetAccessKey("ridfebb9")

	nexServer.On("Data", func(packet *nex.PacketV0) {
		request := packet.RMCRequest()

		fmt.Println("==Friends - Auth==")
		fmt.Printf("Protocol ID: %#v\n", request.ProtocolID())
		fmt.Printf("Method ID: %#v\n", request.MethodID())
		fmt.Println("==================")
	})

	nexServer.Listen(":60000")
}