mirror of
https://github.com/PretendoNetwork/friends.git
synced 2026-08-02 16:13:00 -05:00
chore: add guest account
This commit is contained in:
parent
491b475a9c
commit
d6fdde6161
|
|
@ -19,6 +19,10 @@ func AccountDetailsByPID(pid *types.PID) (*nex.Account, *nex.Error) {
|
|||
return SecureEndpoint.ServerAccount, nil
|
||||
}
|
||||
|
||||
if pid.Equals(GuestAccount.PID) {
|
||||
return GuestAccount, nil
|
||||
}
|
||||
|
||||
ctx := metadata.NewOutgoingContext(context.Background(), GRPCAccountCommonMetadata)
|
||||
|
||||
response, err := GRPCAccountClient.GetNEXPassword(ctx, &pb.GetNEXPasswordRequest{Pid: pid.LegacyValue()})
|
||||
|
|
|
|||
|
|
@ -20,6 +20,10 @@ func AccountDetailsByUsername(username string) (*nex.Account, *nex.Error) {
|
|||
return SecureEndpoint.ServerAccount, nil
|
||||
}
|
||||
|
||||
if username == GuestAccount.Username {
|
||||
return GuestAccount, nil
|
||||
}
|
||||
|
||||
// TODO - This is fine for our needs, but not for servers which use non-PID usernames?
|
||||
pid, err := strconv.Atoi(username)
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import (
|
|||
)
|
||||
|
||||
var Logger *plogger.Logger
|
||||
var GuestAccount *nex.Account
|
||||
var KerberosPassword = "password" // * Default password
|
||||
var AuthenticationServer *nex.PRUDPServer
|
||||
var AuthenticationEndpoint *nex.PRUDPEndPoint
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ func StartSecureServer() {
|
|||
globals.SecureEndpoint.AccountDetailsByUsername = globals.AccountDetailsByUsername
|
||||
globals.SecureEndpoint.ServerAccount = nex.NewAccount(types.NewPID(2), "Quazal Rendez-Vous", os.Getenv("PN_FRIENDS_CONFIG_SECURE_PASSWORD"))
|
||||
|
||||
globals.GuestAccount = nex.NewAccount(types.NewPID(100), "guest", "MMQea3n!fsik") // * Guest account password is always the same, known to all consoles
|
||||
|
||||
globals.SecureEndpoint.OnConnectionEnded(func(connection *nex.PRUDPConnection) {
|
||||
pid := connection.PID().LegacyValue()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user