29 lines
447 B
Go
29 lines
447 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"os"
|
||
|
"time"
|
||
|
"velvettear/godyn/client"
|
||
|
"velvettear/godyn/config"
|
||
|
"velvettear/godyn/log"
|
||
|
"velvettear/godyn/server"
|
||
|
)
|
||
|
|
||
|
// version := "0.1"
|
||
|
|
||
|
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)
|
||
|
}
|