Merge pull request #111 from ZeruLight/feature/moderation

feature/moderation
This commit is contained in:
wish
2024-01-11 23:04:29 +11:00
committed by GitHub
8 changed files with 198 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
}