|
|
@ -20,6 +20,7 @@ var options struct {
|
|
|
|
playerSpeed float64
|
|
|
|
playerSpeed float64
|
|
|
|
bombSpeed float64
|
|
|
|
bombSpeed float64
|
|
|
|
economic int
|
|
|
|
economic int
|
|
|
|
|
|
|
|
debug bool
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
var (
|
|
|
@ -90,11 +91,13 @@ func handleConnection(conn *Connection) {
|
|
|
|
func main() {
|
|
|
|
func main() {
|
|
|
|
flag.Parse()
|
|
|
|
flag.Parse()
|
|
|
|
dbconnect()
|
|
|
|
dbconnect()
|
|
|
|
|
|
|
|
|
|
|
|
rand.Seed(time.Now().UnixNano())
|
|
|
|
rand.Seed(time.Now().UnixNano())
|
|
|
|
info_log = log.New(os.Stdout, "[INFO] ", 0)
|
|
|
|
info_log = log.New(os.Stdout, "[INFO] ", 0)
|
|
|
|
error_log = log.New(os.Stderr, "[ERROR] ", 0)
|
|
|
|
error_log = log.New(os.Stderr, "[ERROR] ", 0)
|
|
|
|
|
|
|
|
|
|
|
|
setupDb()
|
|
|
|
setupDb()
|
|
|
|
|
|
|
|
setupCommands()
|
|
|
|
listener, err := net.Listen("tcp", ":9220")
|
|
|
|
listener, err := net.Listen("tcp", ":9220")
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
bail(E_No_Port, "unable to start server: %v", err)
|
|
|
|
bail(E_No_Port, "unable to start server: %v", err)
|
|
|
@ -121,4 +124,5 @@ func init() {
|
|
|
|
flag.IntVar(&options.economic, "economic", 25000, "amount of money needed to win economic victory")
|
|
|
|
flag.IntVar(&options.economic, "economic", 25000, "amount of money needed to win economic victory")
|
|
|
|
flag.Float64Var(&options.moneyMean, "money-mean", 10000, "mean amount of money on a system")
|
|
|
|
flag.Float64Var(&options.moneyMean, "money-mean", 10000, "mean amount of money on a system")
|
|
|
|
flag.Float64Var(&options.moneySigma, "money-sigma", 1500, "standard deviation in money per system")
|
|
|
|
flag.Float64Var(&options.moneySigma, "money-sigma", 1500, "standard deviation in money per system")
|
|
|
|
|
|
|
|
flag.BoolVar(&options.debug, "debug", false, "puts the game in debug mode")
|
|
|
|
}
|
|
|
|
}
|
|
|
|