-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
39 lines (30 loc) · 874 Bytes
/
main.go
File metadata and controls
39 lines (30 loc) · 874 Bytes
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
package main
import (
"fmt"
"plugin-master/api"
"plugin-master/exporter"
"time"
)
func main() {
go exporter.Run()
go webapi.Run()
writer()
}
func writer() {
time.Sleep(time.Millisecond * 500)
for {
webapi.AmountStatsMutex.RLock()
var bungeecordPlayerCount = webapi.AmountStats["bungeecordPlayerCount"]
var velocityPlayerCount = webapi.AmountStats["velocityPlayerCount"]
var spigotPlayerCount = webapi.AmountStats["spigotPlayerCount"]
var restPlayerCount = webapi.AmountStats["PlayerCount"]
webapi.AmountStatsMutex.RUnlock()
fmt.Println(
"PlayerCount (", bungeecordPlayerCount+velocityPlayerCount+spigotPlayerCount+restPlayerCount, ") [ "+
"Bungee(", bungeecordPlayerCount, ") "+
"Velocity(", velocityPlayerCount, ") "+
"Spigot(", spigotPlayerCount, ") "+
"Rest(", restPlayerCount, ") ]")
time.Sleep(time.Second * 5)
}
}