anticheat

package
v0.0.49 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AntiCheat

type AntiCheat struct {
	// contains filtered or unexported fields
}

func New

func New(db *sql.DB, dispatch chan func()) *AntiCheat

func (*AntiCheat) ClearAuth

func (ac *AntiCheat) ClearAuth(identifiers ...string)

Clear auth attempts on successful login

func (*AntiCheat) GetBanHistory

func (ac *AntiCheat) GetBanHistory(name string, limit int) ([]string, error)

GetBanHistory returns recent ban records (resolved by player name)

func (*AntiCheat) IsBanned

func (ac *AntiCheat) IsBanned(accountID int32, ip, hwid string) (bool, string, int64, error)

func (*AntiCheat) IssueBan

func (ac *AntiCheat) IssueBan(accountID int32, hours int, reason string, ip, hwid string) error

IssueBan creates a temporary ban (hours=0 means permanent)

func (*AntiCheat) LockAccount

func (ac *AntiCheat) LockAccount(accountID int32) error

func (*AntiCheat) LogAttackSpeedViolation

func (ac *AntiCheat) LogAttackSpeedViolation(accountID int32) bool

func (*AntiCheat) LogDamageViolation

func (ac *AntiCheat) LogDamageViolation(accountID int32, damage, maxDamage int32)

Detection helpers - track violations and auto-ban on threshold

func (*AntiCheat) LogInvalidItemViolation

func (ac *AntiCheat) LogInvalidItemViolation(accountID int32)

func (*AntiCheat) LogInvalidTradeViolation

func (ac *AntiCheat) LogInvalidTradeViolation(accountID int32, reason string)

func (*AntiCheat) LogMovementViolation

func (ac *AntiCheat) LogMovementViolation(accountID int32, distance int16, moveType byte)

func (*AntiCheat) LogSkillAbuseViolation

func (ac *AntiCheat) LogSkillAbuseViolation(accountID int32, skillID int32)

func (*AntiCheat) SetOnBan

func (ac *AntiCheat) SetOnBan(fn func(accountID int32))

func (*AntiCheat) StartCleanup

func (ac *AntiCheat) StartCleanup()

StartCleanup starts periodic cleanup of old violations/auth entries

func (*AntiCheat) Track

func (ac *AntiCheat) Track(accountID int32, violationType string, threshold int, window time.Duration) bool

Track a violation - returns true if threshold exceeded and player should be banned

func (*AntiCheat) TrackFailedAuth

func (ac *AntiCheat) TrackFailedAuth(identifier string) bool

Track failed auth attempt - returns true if should ban

func (*AntiCheat) Unban

func (ac *AntiCheat) Unban(name string) error

Unban removes all bans for an account (resolved by player name)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL