27 lines
426 B
Go
27 lines
426 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"os"
|
||
|
"time"
|
||
|
"velvettear/godyn/client"
|
||
|
"velvettear/godyn/config"
|
||
|
"velvettear/godyn/log"
|
||
|
"velvettear/godyn/server"
|
||
|
)
|
||
|
|
||
|
func main() {
|
||
|
timestamp := time.Now()
|
||
|
config.Initialize()
|
||
|
if config.ServerMode() {
|
||
|
server.Run()
|
||
|
} else {
|
||
|
client.Run()
|
||
|
}
|
||
|
exit(timestamp, 0)
|
||
|
}
|
||
|
|
||
|
func exit(timestamp time.Time, code int) {
|
||
|
log.InfoTimed("godyn finished - exiting...", timestamp.UnixMilli())
|
||
|
os.Exit(code)
|
||
|
}
|