This repository has been archived by the owner on Oct 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinstance.go
76 lines (67 loc) · 1.51 KB
/
instance.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package main
import (
"log"
"os"
"sync"
"sync/atomic"
"time"
"github.com/maxsupermanhd/lac/v2"
)
type instanceState int
const (
instanceStateInitial instanceState = iota
instanceStateStarting
instanceStateInLobby
instanceStateInGame
instanceStateExiting
instanceStateExited
)
type adminsPolicy int
const (
adminsPolicyNobody adminsPolicy = iota
adminsPolicySuperadmins
adminsPolicyModerators
adminsPolicyWhitelist
)
type joinDispatch struct {
AllowChat bool
Messages []string
Issued time.Time
}
type instanceSettings struct {
GamePort int
MapName string
MapHash string
PlayerCount int
TimeLimit int
Mods string
DisplayCategory int
RatingCategories []int
}
type instance struct {
Id int64
LobbyId int
GameId int
DebugTriggered bool
ConfDir string
BinPath string
Admins []string
AdminsPolicy adminsPolicy
OnJoinDispatch map[string]joinDispatch
QueueName string
AutodetectedVersion string
state atomic.Int64
StateSaved int
cfg lac.Conf
cfgs []lac.Conf
RestoreCfgs []map[string]any
Settings instanceSettings
logger *log.Logger
stdin *os.File
stdout *os.File
stderr *os.File
Pid int
recovered bool
commands chan instanceCommand
wg sync.WaitGroup
}