mod

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: AGPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const AddressToContact = "conduct@woogles.io"
View Source
const EmailTemplateName = "email"
View Source
const TermsOfServiceURL = "https://woogles.io/terms"

Variables

View Source
var AutomodUserId string = "AUTOMOD"
View Source
var BehaviorToString map[ms.NotoriousGameType]string = map[ms.NotoriousGameType]string{
	ms.NotoriousGameType_NO_PLAY_DENIED_NUDGE: "No Play (Denied Nudge)",
	ms.NotoriousGameType_EXCESSIVE_PHONIES:    "Excessive Phonies",
	ms.NotoriousGameType_NO_PLAY:              "No Play",
	ms.NotoriousGameType_SITTING:              "Sitting",
	ms.NotoriousGameType_SANDBAG:              "Premature Resignation",
}
View Source
var DurationMultiplier int = 24 * 60 * 60
View Source
var EmailTemplate string
View Source
var ExcessivePhonyMinimum int = 3
View Source
var ExcessivePhonyThreshold float64 = 0.5
View Source
var IsTesting = strings.HasSuffix(os.Args[0], ".test")
View Source
var ModActionEmailMap = map[ms.ModActionType]string{
	ms.ModActionType_MUTE:                    "Disable Chat",
	ms.ModActionType_SUSPEND_ACCOUNT:         "Account Suspension",
	ms.ModActionType_SUSPEND_RATED_GAMES:     "Suspend Rated Games",
	ms.ModActionType_SUSPEND_GAMES:           "Suspend Games",
	ms.ModActionType_RESET_RATINGS:           "Reset Ratings",
	ms.ModActionType_RESET_STATS:             "Reset Statistics",
	ms.ModActionType_RESET_STATS_AND_RATINGS: "Reset Ratings and Statistics",
}
View Source
var ModActionTextMap = map[ms.ModActionType]string{
	ms.ModActionType_MUTE:                "chatting",
	ms.ModActionType_SUSPEND_ACCOUNT:     "logging in",
	ms.ModActionType_SUSPEND_RATED_GAMES: "playing rated games",
	ms.ModActionType_SUSPEND_GAMES:       "playing games",
}
View Source
var NotorietyDecrement int = 1
View Source
var NotorietyThreshold int = 10

var InsurmountablePerTurnScore int = 70

View Source
var RemovalDuration = 60
View Source
var SandbaggingThreshold int = 3
View Source
var UnreasonableTime int = 5 * 60

Functions

func ActionExists

func ActionExists(ctx context.Context, userStore user.Store, uuid string, forceInsistLogout bool, actionTypes []ms.ModActionType) (bool, error)

DB version of the ActionExists function above for testing purposes This can be deleted once the above function uses the DB to get the actions.

func ApplyActions

func ApplyActions(ctx context.Context, us user.Store, cs user.ChatStore, applierUserId string, actions []*ms.ModAction) error

func Automod

func Automod(ctx context.Context, us user.Store, ns NotorietyStore, u0 *entity.User, u1 *entity.User, g *entity.Game) error

func CensorHistory

func CensorHistory(ctx context.Context, userStore user.Store, hist *macondopb.GameHistory) *macondopb.GameHistory

func FormatNotorietyReport

func FormatNotorietyReport(ctx context.Context, ns NotorietyStore, uuid string, limit int) (string, error)

func GetActionHistory

func GetActionHistory(ctx context.Context, us user.Store, uuid string) ([]*ms.ModAction, error)

func GetActions

func GetActions(ctx context.Context, us user.Store, uuid string) (map[string]*ms.ModAction, error)

func GetNotorietyReport

func GetNotorietyReport(ctx context.Context, us user.Store, ns NotorietyStore, uuid string, limit int) (int, []*ms.NotoriousGame, error)

func IsCensorable

func IsCensorable(ctx context.Context, userStore user.Store, uuid string) bool

func IsRemoval

func IsRemoval(action *ms.ModAction) bool

func RemoveActions

func RemoveActions(ctx context.Context, userStore user.Store, removerUserId string, actions []*ms.ModAction) error

func ResetNotoriety

func ResetNotoriety(ctx context.Context, us user.Store, ns NotorietyStore, uuid string) error

Types

type EmailInfo

type EmailInfo struct {
	Username          string
	TermsOfServiceURL string
	Action            string
	StartTime         string
	EndTime           string
	AddressToContact  string
	IsCheater         bool
	IsDeletion        bool
}

type ModService

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

func NewModService

func NewModService(us user.Store, cs user.ChatStore) *ModService

func (*ModService) ApplyActions

func (*ModService) GetActionHistory

func (*ModService) GetActions

func (*ModService) GetNotorietyReport

func (*ModService) RemoveActions

type NotorietyStore

type NotorietyStore interface {
	AddNotoriousGame(ctx context.Context, gameID string, playerID string, gameType int, time int64) error
	GetNotoriousGames(ctx context.Context, playerID string, limit int) ([]*ms.NotoriousGame, error)
	DeleteNotoriousGames(ctx context.Context, playerID string) error
}

type UserModeratedError

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

func (*UserModeratedError) Error

func (u *UserModeratedError) Error() string

Jump to

Keyboard shortcuts

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