This repository was archived by the owner on Mar 18, 2026. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
87 lines (68 loc) · 1.86 KB
/
Copy pathmain.go
File metadata and controls
87 lines (68 loc) · 1.86 KB
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
77
78
79
80
81
82
83
84
85
86
87
// Command fsnotify provides example usage of the fsnotify library.
package main
import (
"github.com/forquare/manaha-minder/actions"
"github.com/forquare/manaha-minder/config"
"github.com/forquare/manaha-minder/player"
"github.com/forquare/manaha-minder/serverAdmin"
"github.com/forquare/manaha-minder/utils"
logger "github.com/sirupsen/logrus"
)
var Version string
func main() {
done := make(chan bool)
// Print version
logger.Info("Manaha Minder " + Version)
// Set debug until we parse config
logger.SetLevel(logger.DebugLevel)
// Load config
config := config.GetConfig()
// Set log level
l, _ := logger.ParseLevel(config.ManahaMinder.LogLevel)
logger.SetLevel(l)
// Load database
utils.GetDatabase()
// Init locker
utils.InitLocker()
// Start log scraper
go utils.LogScraper(config.MinecraftServer.LatestLog)
// Start accounting
go player.Accounting()
if config.Activity.LogActivity {
// Start status setter
if config.Activity.GenerateStatusTable {
go player.StatusSetter()
}
// Run calculator
if config.Activity.RecalculateActivityOnStartup {
go player.RecalculateTimePlayed()
}
}
// Start actions
go actions.StartActions()
// Set server restart timer
if config.MinecraftServer.Restart.Enabled {
go serverAdmin.SetServerRestart(config.MinecraftServer.Restart.Cron)
}
// Start watchdog
if config.MinecraftServer.Watchdog {
go serverAdmin.Watchdog()
}
// Log decompression
if config.MinecraftServer.LogDecompress {
go serverAdmin.LogDecompressor()
}
// Block forever
<-done
}
/*
log.Trace("Something very low level.")
log.Debug("Useful debugging information.")
log.Info("Something noteworthy happened!")
log.Warn("You should probably take a look at this.")
log.Error("Something failed but I'm not quitting.")
// Calls os.Exit(1) after logging
log.Fatal("Bye.")
// Calls panic() after logging
log.Panic("I'm bailing.")
*/