helpers

package
v0.0.0-...-937b28e Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2022 License: GPL-3.0 Imports: 20 Imported by: 28

Documentation

Overview

Copyright (C) 2015 TF2Stadium Use of this source code is governed by the GPLv3 that can be found in the COPYING file.

Index

Constants

View Source
const (
	RolePlayer authority.AuthRole = iota
	RoleMod
	RoleAdmin
	RoleDeveloper
)

DO NOT CHANGE THE INTEGER VALUES OF ALREADY EXISTING ROLES.

View Source
const (
	ActionBanJoin authority.AuthAction = iota
	ActionBanCreate
	ActionBanChat
	ActionChangeRole
	ActionViewLogs
	ActionViewPage //view admin pages
	ActionDeleteChat
	ModifyServers //add/remove servers
)

You can't change the order of these

Variables

View Source
var (
	ServemeNA = &servemetf.Context{Host: "na.serveme.tf"}
	ServemeEU = &servemetf.Context{Host: "serveme.tf"}
	ServemeAU = &servemetf.Context{Host: "au.serveme.tf"}
)
View Source
var AMQPChannel *amqp.Channel
View Source
var AMQPConn *amqp.Connection
View Source
var ActionNames = map[authority.AuthAction]string{
	ActionBanCreate: "ActionBanCreate",
	ActionBanJoin:   "ActionBanJoin",
	ActionBanChat:   "ActionBanChat",

	ActionChangeRole: "ActionChangeRole",
}
View Source
var (
	Discord *dg.Session
)
View Source
var GlobalWait = new(sync.WaitGroup)

GlobalWait is used by the main signal handler to wait for all state changes to finish, so as to avoid inconsistent state changes

View Source
var HTTPClient = &http.Client{
	Timeout: 20 * time.Second,
}
View Source
var Raven *raven.Client = nil
View Source
var RoleMap = map[string]authority.AuthRole{
	"player":        RolePlayer,
	"moderator":     RoleMod,
	"administrator": RoleAdmin,
	"developer":     RoleDeveloper,
}
View Source
var RoleNames = map[authority.AuthRole]string{
	RoleDeveloper: "developer",
	RolePlayer:    "player",
	RoleMod:       "moderator",
	RoleAdmin:     "administrator",
}

Functions

func ConnectAMQP

func ConnectAMQP()

func DiscordEmoji

func DiscordEmoji(emoji string) string

func DiscordSendToChannel

func DiscordSendToChannel(channelName string, msg string)

func GetGroupMembers

func GetGroupMembers(url string) ([]string, error)

Get Steam IDs of the members of a given steam group

func GetRegion

func GetRegion(server string) (string, string)

func GetServemeContext

func GetServemeContext(addrStr string) *servemetf.Context

func GetServemeContextIP

func GetServemeContextIP(ipaddr string) *servemetf.Context

func InitGeoIPDB

func InitGeoIPDB()

func IsWhitelisted

func IsWhitelisted(steamid, url string) bool

func LockRecord

func LockRecord(id uint, recType interface{})

func RLockRecord

func RLockRecord(id uint, recType interface{})

func RUnlockRecord

func RUnlockRecord(id uint, recType interface{})

func RemoveRecord

func RemoveRecord(id uint, recType interface{})

func UnlockRecord

func UnlockRecord(id uint, recType interface{})

Types

type GroupXML

type GroupXML struct {
	//XMLName xml.Name `xml:"memberList"`
	//GroupID uint64   `xml:"groupID64"`
	Members []string `xml:"members>steamID64"`
}

type Request

type Request struct {
	Req  string      `json:"request"`
	Data interface{} `json:"data"`
}

func NewRequest

func NewRequest(request string, data interface{}) Request

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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