Skip to content

Commit 1bb6890

Browse files
authored
Allow username generator functions to check any incoming username. (#75)
1 parent 322b839 commit 1bb6890

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

base.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,9 @@ type System interface {
213213
}
214214

215215
// UsernameOverrideFn can be used to provide a different username generation strategy from the default in Nakama server.
216-
type UsernameOverrideFn func() string
216+
// Requested username indicates what the username would otherwise be set to, if the incoming request specified a value.
217+
// The function is always expected to return a value, and returning "" defers to Nakama's built-in behaviour.
218+
type UsernameOverrideFn func(requestedUsername string) string
217219

218220
// WithAchievementsSystem configures an AchievementsSystem type and optionally registers its RPCs with the game server.
219221
func WithAchievementsSystem(configFile string, register bool) SystemConfig {

0 commit comments

Comments
 (0)