mod

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2022 License: AGPL-3.0 Imports: 28 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 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, us user.Store, uuid string, forceInsistLogout bool, actionTypes []ms.ModActionType) (bool, error)

func ApplyActions

func ApplyActions(ctx context.Context, us user.Store, cs user.ChatStore, 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, us user.Store, hist *macondopb.GameHistory) *macondopb.GameHistory

func FormatNotorietyReport

func FormatNotorietyReport(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, us user.Store, uuid string) bool

func IsRemoval

func IsRemoval(action *ms.ModAction) bool

func RemoveActions

func RemoveActions(ctx context.Context, us user.Store, 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 (ms *ModService) ApplyActions(ctx context.Context, req *pb.ModActionsList) (*pb.ModActionResponse, error)

func (*ModService) GetActionHistory

func (ms *ModService) GetActionHistory(ctx context.Context, req *pb.GetActionsRequest) (*pb.ModActionsList, error)

func (*ModService) GetActions

func (ms *ModService) GetActions(ctx context.Context, req *pb.GetActionsRequest) (*pb.ModActionsMap, error)

func (*ModService) GetNotorietyReport

func (ms *ModService) GetNotorietyReport(ctx context.Context, req *pb.GetNotorietyReportRequest) (*pb.NotorietyReport, error)

func (*ModService) RemoveActions

func (ms *ModService) RemoveActions(ctx context.Context, req *pb.ModActionsList) (*pb.ModActionResponse, error)

func (*ModService) ResetNotoriety

type NotorietyStore

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

Jump to

Keyboard shortcuts

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