1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2025-02-04 07:37:48 -05:00
OpenDiablo2/main.go

46 lines
984 B
Go
Raw Normal View History

2019-10-24 09:31:59 -04:00
package main
import (
"log"
"github.com/gravestench/akara"
"gopkg.in/alecthomas/kingpin.v2"
"github.com/OpenDiablo2/OpenDiablo2/d2app"
2020-11-22 16:54:18 -05:00
"github.com/OpenDiablo2/OpenDiablo2/d2core/d2systems"
2019-10-24 09:31:59 -04:00
)
2019-11-06 22:12:15 -05:00
// GitBranch is set by the CI build process to the name of the branch
//nolint:gochecknoglobals // This is filled in by the build system
var GitBranch string
2019-11-06 22:12:15 -05:00
// GitCommit is set by the CI build process to the commit hash
//nolint:gochecknoglobals // This is filled in by the build system
var GitCommit string
2019-10-24 09:31:59 -04:00
func main() {
ecs := kingpin.Flag("ecs", "start the ecs implementation").Bool()
kingpin.Parse()
if *ecs {
cfg := akara.NewWorldConfig()
cfg.
With(d2systems.NewAppBootstrapSystem()).
With(d2systems.NewGameClientBootstrapSystem())
akara.NewWorld(cfg)
return
}
log.SetFlags(log.Lshortfile)
log.Println("OpenDiablo2 - Open source Diablo 2 engine")
instance := d2app.Create(GitBranch, GitCommit)
if err := instance.Run(); err != nil {
return
2020-07-08 09:16:16 -04:00
}
}