add support for operator accounts & bans

This commit is contained in:
wish
2024-01-03 19:08:45 +11:00
parent 8cd114988d
commit e0615dcd0c
5 changed files with 60 additions and 10 deletions

View File

@@ -309,3 +309,12 @@ func (s *Session) NextObjectID() uint32 {
bf.Seek(0, 0)
return bf.ReadUint32()
}
func (s *Session) isOp() bool {
var op bool
err := s.server.db.QueryRow(`SELECT op FROM users u WHERE u.id=(SELECT c.user_id FROM characters c WHERE c.id=$1)`, s.charID).Scan(&op)
if err == nil && op {
return true
}
return false
}