mirror of
https://github.com/WiiLink24/wfc-server.git
synced 2026-05-06 22:43:27 -05:00
33 lines
669 B
Go
33 lines
669 B
Go
package sake
|
|
|
|
import (
|
|
"net/http"
|
|
"wwfc/common"
|
|
"wwfc/database"
|
|
)
|
|
|
|
var (
|
|
db database.Connection
|
|
)
|
|
|
|
func StartServer(reload bool) {
|
|
// Get config
|
|
config := common.GetConfig()
|
|
|
|
common.ReadGameList()
|
|
|
|
// Start SQL
|
|
db = database.Start(config)
|
|
}
|
|
|
|
func Shutdown() {
|
|
db.Close()
|
|
}
|
|
|
|
func RegisterHandlers(mux *http.ServeMux) {
|
|
mux.HandleFunc("POST /SakeStorageServer/StorageServer.asmx", handleStorageRequest)
|
|
mux.HandleFunc("GET /SakeFileServer/download.aspx", handleFileDownloadRequest)
|
|
mux.HandleFunc("POST /SakeFileServer/upload.aspx", handleFileUploadRequest)
|
|
mux.HandleFunc("GET /SakeFileServer/ghostdownload.aspx", handleMarioKartWiiGhostDownloadRequest)
|
|
}
|