Skip to content

Commit

Permalink
Merge branch 'release/46.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
alaingilbert committed Aug 2, 2021
2 parents 13958b7 + cfcb2db commit 327650c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions cmd/ogamed/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ func start(c *cli.Context) error {
// For AntiGame plugin
// Static content
e.GET("/cdn/*", ogame.GetStaticHandler)
e.GET("/assets/css/*", ogame.GetStaticHandler)
e.GET("/headerCache/*", ogame.GetStaticHandler)
e.GET("/favicon.ico", ogame.GetStaticHandler)
e.GET("/game/sw.js", ogame.GetStaticHandler)
Expand Down
2 changes: 1 addition & 1 deletion handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func PageContentHandler(c echo.Context) error {
// LoginHandler ...
func LoginHandler(c echo.Context) error {
bot := c.Get("bot").(*OGame)
if err := bot.Login(); err != nil {
if _, err := bot.LoginWithExistingCookies(); err != nil {
if err == ErrBadCredentials {
return c.JSON(http.StatusBadRequest, ErrorResp(400, err.Error()))
}
Expand Down
5 changes: 5 additions & 0 deletions id.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ func (o ID) String() string {
return res
}

// IsValid returns either or not the id is valid
func (o ID) IsValid() bool {
return o.IsDefense() || o.IsShip() || o.IsTech() || o.IsBuilding()
}

// IsFacility returns either or not the id is a facility
func (o ID) IsFacility() bool {
return o == AllianceDepotID ||
Expand Down

0 comments on commit 327650c

Please sign in to comment.