mirror of
https://github.com/PretendoNetwork/friends.git
synced 2026-04-25 07:18:36 -05:00
33 lines
1.4 KiB
Go
33 lines
1.4 KiB
Go
package nex
|
|
|
|
import (
|
|
"github.com/PretendoNetwork/friends/globals"
|
|
"github.com/PretendoNetwork/nex-go/v2/constants"
|
|
"github.com/PretendoNetwork/nex-go/v2/types"
|
|
common_ticket_granting "github.com/PretendoNetwork/nex-protocols-common-go/v2/ticket-granting"
|
|
ticket_granting "github.com/PretendoNetwork/nex-protocols-go/v2/ticket-granting"
|
|
)
|
|
|
|
func registerCommonAuthenticationServerProtocols() {
|
|
ticketGrantingProtocol := ticket_granting.NewProtocol()
|
|
commonTicketGrantingProtocol := common_ticket_granting.NewCommonProtocol(ticketGrantingProtocol)
|
|
|
|
secureStationURL := types.NewStationURL("")
|
|
secureStationURL.SetURLType(constants.StationURLPRUDPS)
|
|
secureStationURL.SetAddress(globals.Config.SecureServerHost)
|
|
secureStationURL.SetPortNumber(globals.Config.SecureServerPort)
|
|
secureStationURL.SetConnectionID(1)
|
|
secureStationURL.SetPrincipalID(types.NewPID(2))
|
|
secureStationURL.SetStreamID(1)
|
|
secureStationURL.SetStreamType(constants.StreamTypeRVSecure)
|
|
secureStationURL.SetType(2)
|
|
|
|
commonTicketGrantingProtocol.SecureServerAccount = globals.SecureEndpoint.ServerAccount
|
|
commonTicketGrantingProtocol.SessionKeyLength = 16
|
|
commonTicketGrantingProtocol.SecureStationURL = secureStationURL
|
|
commonTicketGrantingProtocol.BuildName = types.NewString(serverBuildString)
|
|
commonTicketGrantingProtocol.EnableInsecureLogin()
|
|
|
|
globals.AuthenticationEndpoint.RegisterServiceProtocol(ticketGrantingProtocol)
|
|
}
|