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

Method HasKey

internal/characters/character.go:325–331  ·  view source on GitHub ↗
(lockId string, difficulty int)

Source from the content-addressed store, hash-verified

323}
324
325func (c *Character) HasKey(lockId string, difficulty int) (hasKey bool, hasSequence bool) {
326
327 sequence := util.GetLockSequence(lockId, difficulty, string(configs.GetServerConfig().Seed))
328
329 // Check whether they ahve a key for this lock
330 return c.GetKey(`key-`+lockId) != ``, c.GetKey(lockId) == sequence
331}
332
333func (c *Character) KeyCount() int {
334 if c.KeyRing == nil {

Callers 5

GetRoomNodeMethod · 0.80
GetLimitedMapMethod · 0.80
GoFunction · 0.80
UnlockFunction · 0.80
LockFunction · 0.80

Calls 3

GetKeyMethod · 0.95
GetLockSequenceFunction · 0.92
GetServerConfigFunction · 0.92

Tested by

no test coverage detected