mirror of
https://github.com/WiiLink24/wfc-server.git
synced 2026-09-08 16:45:28 -05:00
GameStats,ServerBrowser: Fix invalid state path
This commit is contained in:
@@ -70,7 +70,7 @@ func StartServer(reload bool) {
|
||||
|
||||
if reload {
|
||||
// Load state
|
||||
file, err := os.Open("/state/gstats_sessions.gob")
|
||||
file, err := os.Open("state/gstats_sessions.gob")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@@ -93,12 +93,14 @@ func StartServer(reload bool) {
|
||||
delete(sessionsByConnIndex, session.ConnIndex)
|
||||
}
|
||||
}
|
||||
|
||||
logging.Notice("GSTATS", "Loaded", aurora.Cyan(len(sessionsByConnIndex)), "sessions")
|
||||
}
|
||||
}
|
||||
|
||||
func Shutdown() {
|
||||
// Save state
|
||||
file, err := os.OpenFile("/state/gstats_sessions.gob", os.O_CREATE|os.O_WRONLY, 0644)
|
||||
file, err := os.OpenFile("state/gstats_sessions.gob", os.O_CREATE|os.O_WRONLY, 0644)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@@ -111,6 +113,10 @@ func Shutdown() {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
pool.Close()
|
||||
|
||||
logging.Notice("GSTATS", "Saved", aurora.Cyan(len(sessionsByConnIndex)), "sessions")
|
||||
}
|
||||
|
||||
func NewConnection(index uint64, address string) {
|
||||
|
||||
@@ -42,7 +42,7 @@ func StartServer(reload bool) {
|
||||
}
|
||||
|
||||
// Load connection state
|
||||
file, err := os.Open("/state/sb_connections.gob")
|
||||
file, err := os.Open("state/sb_connections.gob")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@@ -55,11 +55,13 @@ func StartServer(reload bool) {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
logging.Notice("SB", "Loaded", aurora.Cyan(len(connBuffers)), "connections")
|
||||
}
|
||||
|
||||
func Shutdown() {
|
||||
// Save connection state
|
||||
file, err := os.OpenFile("/state/sb_connections.gob", os.O_CREATE|os.O_WRONLY, 0644)
|
||||
file, err := os.OpenFile("state/sb_connections.gob", os.O_CREATE|os.O_WRONLY, 0644)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@@ -71,6 +73,8 @@ func Shutdown() {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
logging.Notice("SB", "Saved", aurora.Cyan(len(connBuffers)), "connections")
|
||||
}
|
||||
|
||||
func NewConnection(index uint64, address string) {
|
||||
|
||||
Reference in New Issue
Block a user