MCPcopy Create free account
hub / github.com/GoMudEngine/GoMud / NewUserRecord

Function NewUserRecord

internal/users/userrecord.go:60–84  ·  view source on GitHub ↗
(userId int, connectionId uint64)

Source from the content-addressed store, hash-verified

58}
59
60func NewUserRecord(userId int, connectionId uint64) *UserRecord {
61
62 c := configs.GetGamePlayConfig()
63
64 u := &UserRecord{
65 connectionId: connectionId,
66 UserId: userId,
67 Role: RoleUser,
68 Username: "",
69 Password: "",
70 Macros: make(map[string]string),
71 Character: characters.New(),
72 ConfigOptions: map[string]any{},
73 Joined: time.Now(),
74 connectionTime: time.Now(),
75 tempDataStore: make(map[string]any),
76 EventLog: UserLog{},
77 }
78
79 if c.Death.PermaDeath {
80 u.Character.ExtraLives = int(c.LivesStart)
81 }
82
83 return u
84}
85
86func (u *UserRecord) ClientSettings() connections.ClientSettings {
87 return connections.GetClientSettings(u.connectionId)

Callers 3

FinalizeLoginOrCreateFunction · 0.92
apiV1CreateUserFunction · 0.92
setupAuthTestUsersFunction · 0.92

Calls 2

GetGamePlayConfigFunction · 0.92
NewFunction · 0.92

Tested by 1

setupAuthTestUsersFunction · 0.74