Now gets ingame!

This commit is contained in:
Andrew Gutekanst
2019-12-24 16:06:40 +09:00
parent e5066d4f8b
commit 319cfcb2f7
9 changed files with 517 additions and 79 deletions

29
main.go
View File

@@ -1,16 +1,43 @@
package main
import (
"database/sql"
"fmt"
"time"
"github.com/Andoryuuta/Erupe/signserver"
_ "github.com/lib/pq"
)
func main() {
fmt.Println("Starting!")
// Load the config.toml configuration.
// TODO(Andoryuuta): implement config loading.
// Create the postgres DB pool.
db, err := sql.Open("postgres", "host=localhost port=5432 user=postgres password=admin dbname=erupe sslmode=disable")
if err != nil {
panic(err)
}
// Test the DB connection.
err = db.Ping()
if err != nil {
panic(err)
}
// Finally start our server(s).
go serveLauncherHTML(":80")
go doEntranceServer(":53310")
go doSignServer(":53312")
signServer := signserver.NewServer(
&signserver.Config{
DB: db,
ListenAddr: ":53312",
})
go signServer.Listen()
go doChannelServer(":54001")
for {