wrapper

package
v0.0.0-...-11d5444 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2022 License: MIT Imports: 55 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OverviewPageName         = "overview"
	PreferencesPageName      = "preferences"
	ResourceSettingsPageName = "resourceSettings"
	DefensesPageName         = "defenses"
	LfBuildingsPageName      = "lfbuildings"
	LfResearchPageName       = "lfresearch"
	SuppliesPageName         = "supplies"
	FacilitiesPageName       = "facilities"
	FleetdispatchPageName    = "fleetdispatch"
	ShipyardPageName         = "shipyard"
	MovementPageName         = "movement"
	ResearchPageName         = "research"
	PlanetlayerPageName      = "planetlayer"
	LogoutPageName           = "logout"
	JumpgatelayerPageName    = "jumpgatelayer"
	TraderOverviewPageName   = "traderOverview"
	GalaxyPageName           = "galaxy"
	AlliancePageName         = "alliance"
	PremiumPageName          = "premium"
	ShopPageName             = "shop"
	RewardsPageName          = "rewards"
	HighscorePageName        = "highscore"
	BuddiesPageName          = "buddies"
	MessagesPageName         = "messages"
	ChatPageName             = "chat"

	FetchTechsName         = "fetchTechs"
	FetchResourcesPageName = "fetchResources"

	// ajax pages
	RocketlayerPageName            = "rocketlayer"
	FetchEventboxAjaxPageName      = "fetchEventbox"
	FetchResourcesAjaxPageName     = "fetchResources"
	GalaxyContentAjaxPageName      = "galaxyContent"
	EventListAjaxPageName          = "eventList"
	AjaxChatAjaxPageName           = "ajaxChat"
	NoticesAjaxPageName            = "notices"
	RepairlayerAjaxPageName        = "repairlayer"
	TechtreeAjaxPageName           = "techtree"
	PhalanxAjaxPageName            = "phalanx"
	ShareReportOverlayAjaxPageName = "shareReportOverlay"
	JumpgatelayerAjaxPageName      = "jumpgatelayer"
	FederationlayerAjaxPageName    = "federationlayer"
	UnionchangeAjaxPageName        = "unionchange"
	ChangenickAjaxPageName         = "changenick"
	PlanetlayerAjaxPageName        = "planetlayer"
	TraderlayerAjaxPageName        = "traderlayer"
	PlanetRenameAjaxPageName       = "planetRename"
	RightmenuAjaxPageName          = "rightmenu"
	AllianceOverviewAjaxPageName   = "allianceOverview"
	SupportAjaxPageName            = "support"
	BuffActivationAjaxPageName     = "buffActivation"
	AuctioneerAjaxPageName         = "auctioneer"
	HighscoreContentAjaxPageName   = "highscoreContent"
)

Page names

View Source
const (
	Lobby         = "lobby"
	LobbyPioneers = "lobby-pioneers"
)

Lobby constants

View Source
const (
	EspionageMessagesTabID            ogame.MessagesTabID = 20
	CombatReportsMessagesTabID        ogame.MessagesTabID = 21
	ExpeditionsMessagesTabID          ogame.MessagesTabID = 22
	UnionsTransportMessagesTabID      ogame.MessagesTabID = 23
	OtherMessagesTabID                ogame.MessagesTabID = 24
	MarketplacePurchasesMessagesTabID ogame.MessagesTabID = 26
	MarketplaceSalesMessagesTabID     ogame.MessagesTabID = 27
)
View Source
const ChallengeIDCookieName = "gf-challenge-id"
View Source
const TokenCookieName = "gf-token-production"

TokenCookieName ogame cookie name for token id

Variables

View Source
var (
	ErrEmailInvalid    = &RegisterError{"Please enter a valid email address."}
	ErrEmailUsed       = &RegisterError{"Failed to create new lobby, email already used."}
	ErrPasswordInvalid = &RegisterError{"Must contain at least 10 characters including at least one upper and lowercase letter and a number."}
)
View Source
var DefaultGetServerDataWrapper = func(getServerDataFn func() (ServerData, error)) (ServerData, error) {
	return getServerDataFn()
}

DefaultGetServerDataWrapper ...

View Source
var DefaultLoginWrapper = func(loginFn func() (bool, error)) error {
	_, err := loginFn()
	return err
}

DefaultLoginWrapper ...

Functions

func ActivateCelestialItemHandler

func ActivateCelestialItemHandler(c echo.Context) error

ActivateCelestialItemHandler ...

func BuildBuildingHandler

func BuildBuildingHandler(c echo.Context) error

BuildBuildingHandler ...

func BuildCancelableHandler

func BuildCancelableHandler(c echo.Context) error

BuildCancelableHandler ...

func BuildDefenseHandler

func BuildDefenseHandler(c echo.Context) error

BuildDefenseHandler ...

func BuildHandler

func BuildHandler(c echo.Context) error

BuildHandler ...

func BuildProductionHandler

func BuildProductionHandler(c echo.Context) error

BuildProductionHandler ...

func BuildShipsHandler

func BuildShipsHandler(c echo.Context) error

BuildShipsHandler ...

func BuildTechnologyHandler

func BuildTechnologyHandler(c echo.Context) error

BuildTechnologyHandler ...

func BuyOfferOfTheDayHandler

func BuyOfferOfTheDayHandler(c echo.Context) error

BuyOfferOfTheDayHandler ...

func CalcFlightTime

func CalcFlightTime(origin, destination ogame.Coordinate, universeSize, nbSystems int64, donutGalaxy, donutSystem bool,
	fleetDeutSaveFactor, speed float64, universeSpeedFleet int64, ships ogame.ShipsInfos, techs ogame.Researches, characterClass ogame.CharacterClass) (secs, fuel int64)

CalcFlightTime ...

func CancelBuildingHandler

func CancelBuildingHandler(c echo.Context) error

CancelBuildingHandler ...

func CancelFleetHandler

func CancelFleetHandler(c echo.Context) error

CancelFleetHandler ...

func CancelResearchHandler

func CancelResearchHandler(c echo.Context) error

CancelResearchHandler ...

func ConstructionsBeingBuiltHandler

func ConstructionsBeingBuiltHandler(c echo.Context) error

ConstructionsBeingBuiltHandler ...

func DebugGalaxy

func DebugGalaxy(opt *Options)

DebugGalaxy option to debug galaxy

func DeleteEspionageMessagesHandler

func DeleteEspionageMessagesHandler(c echo.Context) error

DeleteEspionageMessagesHandler ...

func DeleteMessageHandler

func DeleteMessageHandler(c echo.Context) error

DeleteMessageHandler ...

func DeleteMessagesFromTabHandler

func DeleteMessagesFromTabHandler(c echo.Context) error

DeleteMessagesFromTabHandler ...

func Distance

func Distance(c1, c2 ogame.Coordinate, universeSize, nbSystems int64, donutGalaxy, donutSystem bool) (distance int64)

Distance returns the distance between two coordinates

func DoAuctionHandler

func DoAuctionHandler(c echo.Context) error

DoAuctionHandler (`celestialID=metal:crystal:deuterium` eg: `123456=123:456:789`)

func GalaxyInfosHandler

func GalaxyInfosHandler(c echo.Context) error

GalaxyInfosHandler ...

func GetAlliancePageContentHandler

func GetAlliancePageContentHandler(c echo.Context) error

GetAlliancePageContentHandler ...

func GetAttacksHandler

func GetAttacksHandler(c echo.Context) error

GetAttacksHandler ...

func GetAuctionHandler

func GetAuctionHandler(c echo.Context) error

GetAuctionHandler ...

func GetCaptchaChallengeHandler

func GetCaptchaChallengeHandler(c echo.Context) error

GetCaptchaChallengeHandler ...

func GetCaptchaHandler

func GetCaptchaHandler(c echo.Context) error

GetCaptchaHandler ...

func GetCaptchaSolverHandler

func GetCaptchaSolverHandler(c echo.Context) error

GetCaptchaSolverHandler ...

func GetCelestialItemsHandler

func GetCelestialItemsHandler(c echo.Context) error

GetCelestialItemsHandler ...

func GetCharacterClassHandler

func GetCharacterClassHandler(c echo.Context) error

GetCharacterClassHandler ...

func GetClientWithProxy

func GetClientWithProxy(proxyAddr, proxyUsername, proxyPassword, proxyType string, config *tls.Config) (*http.Client, error)

GetClientWithProxy ...

func GetDefenseHandler

func GetDefenseHandler(c echo.Context) error

GetDefenseHandler ...

func GetEmpireHandler

func GetEmpireHandler(c echo.Context) error

GetEmpireHandler ...

func GetEspionageReportForHandler

func GetEspionageReportForHandler(c echo.Context) error

GetEspionageReportForHandler ...

func GetEspionageReportHandler

func GetEspionageReportHandler(c echo.Context) error

GetEspionageReportHandler ...

func GetEspionageReportMessagesHandler

func GetEspionageReportMessagesHandler(c echo.Context) error

GetEspionageReportMessagesHandler ...

func GetFacilitiesHandler

func GetFacilitiesHandler(c echo.Context) error

GetFacilitiesHandler ...

func GetFleetSpeedForMission

func GetFleetSpeedForMission(serverData ServerData, missionID ogame.MissionID) int64

GetFleetSpeedForMission ...

func GetFleetsHandler

func GetFleetsHandler(c echo.Context) error

GetFleetsHandler ...

func GetFromGameHandler

func GetFromGameHandler(c echo.Context) error

GetFromGameHandler ...

func GetLanguageHandler

func GetLanguageHandler(c echo.Context) error

GetLanguageHandler ...

func GetLfBuildingsHandler

func GetLfBuildingsHandler(c echo.Context) error

GetLfBuildingsHandler ...

func GetLfResearchHandler

func GetLfResearchHandler(c echo.Context) error

GetLfResearchHandler ...

func GetLoginLink(client httpclient.IHttpClient, ctx context.Context, lobby string, userAccount Account, bearerToken string) (string, error)

func GetMoonByCoordHandler

func GetMoonByCoordHandler(c echo.Context) error

GetMoonByCoordHandler ...

func GetMoonHandler

func GetMoonHandler(c echo.Context) error

GetMoonHandler ...

func GetMoonsHandler

func GetMoonsHandler(c echo.Context) error

GetMoonsHandler ...

func GetPlanetByCoordHandler

func GetPlanetByCoordHandler(c echo.Context) error

GetPlanetByCoordHandler ...

func GetPlanetHandler

func GetPlanetHandler(c echo.Context) error

GetPlanetHandler ...

func GetPlanetsHandler

func GetPlanetsHandler(c echo.Context) error

GetPlanetsHandler ...

func GetPriceHandler

func GetPriceHandler(c echo.Context) error

GetPriceHandler ...

func GetProductionHandler

func GetProductionHandler(c echo.Context) error

GetProductionHandler ...

func GetPublicIPHandler

func GetPublicIPHandler(c echo.Context) error

GetPublicIPHandler ...

func GetRequirementsHandler

func GetRequirementsHandler(c echo.Context) error

GetRequirementsHandler ...

func GetResearchHandler

func GetResearchHandler(c echo.Context) error

GetResearchHandler ...

func GetResourceSettingsHandler

func GetResourceSettingsHandler(c echo.Context) error

GetResourceSettingsHandler ...

func GetResourcesBuildingsHandler

func GetResourcesBuildingsHandler(c echo.Context) error

GetResourcesBuildingsHandler ...

func GetResourcesDetailsHandler

func GetResourcesDetailsHandler(c echo.Context) error

GetResourcesDetailsHandler ...

func GetResourcesHandler

func GetResourcesHandler(c echo.Context) error

GetResourcesHandler ...

func GetServerDataHandler

func GetServerDataHandler(c echo.Context) error

GetServerDataHandler ...

func GetServerHandler

func GetServerHandler(c echo.Context) error

GetServerHandler ...

func GetShipsHandler

func GetShipsHandler(c echo.Context) error

GetShipsHandler ...

func GetSlotsHandler

func GetSlotsHandler(c echo.Context) error

GetSlotsHandler ...

func GetStaticHEADHandler

func GetStaticHEADHandler(c echo.Context) error

GetStaticHEADHandler ...

func GetStaticHandler

func GetStaticHandler(c echo.Context) error

GetStaticHandler ...

func GetUniverseNameHandler

func GetUniverseNameHandler(c echo.Context) error

GetUniverseNameHandler ...

func GetUniverseSpeedFleetHandler

func GetUniverseSpeedFleetHandler(c echo.Context) error

GetUniverseSpeedFleetHandler ...

func GetUniverseSpeedHandler

func GetUniverseSpeedHandler(c echo.Context) error

GetUniverseSpeedHandler ...

func GetUserInfosHandler

func GetUserInfosHandler(c echo.Context) error

GetUserInfosHandler ...

func GetUsernameHandler

func GetUsernameHandler(c echo.Context) error

GetUsernameHandler ...

func HasAdmiralHandler

func HasAdmiralHandler(c echo.Context) error

HasAdmiralHandler ...

func HasCommanderHandler

func HasCommanderHandler(c echo.Context) error

HasCommanderHandler ...

func HasEngineerHandler

func HasEngineerHandler(c echo.Context) error

HasEngineerHandler ...

func HasGeologistHandler

func HasGeologistHandler(c echo.Context) error

HasGeologistHandler ...

func HasTechnocratHandler

func HasTechnocratHandler(c echo.Context) error

HasTechnocratHandler ...

func HomeHandler

func HomeHandler(c echo.Context) error

HomeHandler ...

func IsAjaxPage

func IsAjaxPage(vals url.Values) bool

IsAjaxPage either the requested page is a partial/ajax page

func IsEmpirePage

func IsEmpirePage(vals url.Values) bool

func IsKnowFullPage

func IsKnowFullPage(vals url.Values) bool

IsKnowFullPage ...

func IsUnderAttackHandler

func IsUnderAttackHandler(c echo.Context) error

IsUnderAttackHandler ...

func IsVacationModeHandler

func IsVacationModeHandler(c echo.Context) error

IsVacationModeHandler ...

func JumpGateHandler

func JumpGateHandler(c echo.Context) error

JumpGateHandler ...

func LoginHandler

func LoginHandler(c echo.Context) error

LoginHandler ...

func LogoutHandler

func LogoutHandler(c echo.Context) error

LogoutHandler ...

func PageContentHandler

func PageContentHandler(c echo.Context) error

PageContentHandler ... curl 127.0.0.1:1234/bot/page-content -d 'page=overview&cp=123'

func PhalanxHandler

func PhalanxHandler(c echo.Context) error

PhalanxHandler ...

func PostToGameHandler

func PostToGameHandler(c echo.Context) error

PostToGameHandler ...

func RedeemCode

func RedeemCode(client httpclient.IHttpClient, ctx context.Context, lobby, email, password, otpSecret, token string) error

RedeemCode ...

func Register

func Register(client httpclient.IHttpClient, ctx context.Context, lobby, email, password, challengeID, lang string) error

Register a new gameforge lobby account

func SendFleetHandler

func SendFleetHandler(c echo.Context) error

SendFleetHandler ... curl 127.0.0.1:1234/bot/planets/123/send-fleet -d 'ships=203,1&ships=204,10&speed=10&galaxy=1&system=1&type=1&position=1&mission=3&metal=1&crystal=2&deuterium=3'

func SendIPMHandler

func SendIPMHandler(c echo.Context) error

SendIPMHandler ...

func SendMessageHandler

func SendMessageHandler(c echo.Context) error

SendMessageHandler ... curl 127.0.0.1:1234/bot/send-message -d 'playerID=123&message="Sup boi!"'

func ServerTimeHandler

func ServerTimeHandler(c echo.Context) error

ServerTimeHandler ...

func ServerURLHandler

func ServerURLHandler(c echo.Context) error

ServerURLHandler ...

func ServerVersionHandler

func ServerVersionHandler(c echo.Context) error

ServerVersionHandler ...

func SetResourceSettingsHandler

func SetResourceSettingsHandler(c echo.Context) error

SetResourceSettingsHandler ... curl 127.0.0.1:1234/bot/planets/123/resource-settings -d 'metalMine=100&crystalMine=100&deuteriumSynthesizer=100&solarPlant=100&fusionReactor=100&solarSatellite=100'

func SetUserAgentHandler

func SetUserAgentHandler(c echo.Context) error

SetUserAgentHandler ... curl 127.0.0.1:1234/bot/set-user-agent -d 'userAgent="New user agent"'

func SkipInterceptor

func SkipInterceptor(opt *Options)

SkipInterceptor option to skip html interceptors

func SkipRetry

func SkipRetry(opt *Options)

SkipRetry option to skip retry

func SolveChallenge

func SolveChallenge(client httpclient.IHttpClient, ctx context.Context, challengeID string, answer int64) error

func StartCaptchaChallenge

func StartCaptchaChallenge(client httpclient.IHttpClient, ctx context.Context, challengeID string) (questionRaw, iconsRaw []byte, err error)

func TasksHandler

func TasksHandler(c echo.Context) error

TasksHandler return how many tasks are queued in the heap.

func TeardownHandler

func TeardownHandler(c echo.Context) error

TeardownHandler ...

func TechsHandler

func TechsHandler(c echo.Context) error

TechsHandler ...

func ValidateAccount

func ValidateAccount(client httpclient.IHttpClient, ctx context.Context, lobby, code string) error

ValidateAccount validate a gameforge account

Types

type APIResp

type APIResp struct {
	Status  string
	Code    int
	Message string
	Result  any
}

APIResp ...

func ErrorResp

func ErrorResp(code int, message string) APIResp

ErrorResp ...

func SuccessResp

func SuccessResp(data any) APIResp

SuccessResp ...

type Account

type Account struct {
	Server struct {
		Language string
		Number   int64
	}
	ID         int64 // player ID
	Name       string
	LastPlayed string
	Blocked    bool
	Details    []struct {
		Type  string
		Title string
		Value any // Can be string or int
	}
	Sitting struct {
		Shared       bool
		EndTime      *string
		CooldownTime *string
	}
}

func GetUserAccounts

func GetUserAccounts(client httpclient.IHttpClient, ctx context.Context, lobby, bearerToken string) ([]Account, error)

type AddAccountRes

type AddAccountRes struct {
	ID     int `json:"id"`
	Server struct {
		Language string `json:"language"`
		Number   int    `json:"number"`
	} `json:"server"`
	AccountGroup string `json:"accountGroup"`
	Error        string `json:"error"`
	BearerToken  string `json:"bearerToken"` // Added by us; not part of ogame response
}

AddAccountRes response from creating a new account

func AddAccount

func AddAccount(client httpclient.IHttpClient, ctx context.Context, lobby, accountGroup, sessionToken string) (*AddAccountRes, error)

func LoginAndAddAccount

func LoginAndAddAccount(client httpclient.IHttpClient, ctx context.Context, lobby, username, password, otpSecret, universe, lang string) (*AddAccountRes, error)

LoginAndAddAccount adds an account to a gameforge lobby

func (AddAccountRes) GetBearerToken

func (r AddAccountRes) GetBearerToken() string

type CaptchaCallback

type CaptchaCallback func(question, icons []byte) (int64, error)

CaptchaCallback ...

func NinjaSolver

func NinjaSolver(apiKey string) CaptchaCallback

NinjaSolver direct integration of ogame.ninja captcha auto solver service

func TelegramSolver

func TelegramSolver(tgBotToken string, tgChatID int64) CaptchaCallback

TelegramSolver ...

type CaptchaChallenge

type CaptchaChallenge struct {
	ID       string
	Question string
	Icons    string
}

CaptchaChallenge ...

type CaptchaRequiredError

type CaptchaRequiredError struct {
	ChallengeID string
}

func NewCaptchaRequiredError

func NewCaptchaRequiredError(challengeID string) *CaptchaRequiredError

func (CaptchaRequiredError) Error

func (e CaptchaRequiredError) Error() string

type Celestial

type Celestial interface {
	ogame.Celestial
	ActivateItem(string) error
	Build(id ogame.ID, nbr int64) error
	BuildBuilding(buildingID ogame.ID) error
	BuildDefense(defenseID ogame.ID, nbr int64) error
	BuildTechnology(technologyID ogame.ID) error
	CancelBuilding() error
	CancelLfBuilding() error
	CancelResearch() error
	ConstructionsBeingBuilt() (ogame.ID, int64, ogame.ID, int64, ogame.ID, int64, ogame.ID, int64)
	EnsureFleet([]ogame.Quantifiable, ogame.Speed, ogame.Coordinate, ogame.MissionID, ogame.Resources, int64, int64) (ogame.Fleet, error)
	GetDefense(...Option) (ogame.DefensesInfos, error)
	GetFacilities(...Option) (ogame.Facilities, error)
	GetItems() ([]ogame.Item, error)
	GetLfBuildings(...Option) (ogame.LfBuildings, error)
	GetLfResearch(...Option) (ogame.LfResearches, error)
	GetProduction() ([]ogame.Quantifiable, int64, error)
	GetResources() (ogame.Resources, error)
	GetResourcesBuildings(...Option) (ogame.ResourcesBuildings, error)
	GetResourcesDetails() (ogame.ResourcesDetails, error)
	GetShips(...Option) (ogame.ShipsInfos, error)
	GetTechs() (ogame.ResourcesBuildings, ogame.Facilities, ogame.ShipsInfos, ogame.DefensesInfos, ogame.Researches, ogame.LfBuildings, error)
	SendFleet([]ogame.Quantifiable, ogame.Speed, ogame.Coordinate, ogame.MissionID, ogame.Resources, int64, int64) (ogame.Fleet, error)
	TearDown(buildingID ogame.ID) error
}

Celestial superset of ogame.Celestial. Add methods that can be called for a planet or moon.

type ChatPostResp

type ChatPostResp struct {
	Status   string `json:"status"`
	ID       int    `json:"id"`
	SenderID int    `json:"senderId"`
	TargetID int    `json:"targetId"`
	Text     string `json:"text"`
	Date     int64  `json:"date"`
	NewToken string `json:"newToken"`
}

ChatPostResp ...

type CheckTargetResponse

type CheckTargetResponse struct {
	Status string `json:"status"`
	Orders struct {
		Num1  bool `json:"1"`
		Num2  bool `json:"2"`
		Num3  bool `json:"3"`
		Num4  bool `json:"4"`
		Num5  bool `json:"5"`
		Num6  bool `json:"6"`
		Num7  bool `json:"7"`
		Num8  bool `json:"8"`
		Num9  bool `json:"9"`
		Num15 bool `json:"15"`
	} `json:"orders"`
	TargetInhabited           bool   `json:"targetInhabited"`
	TargetIsStrong            bool   `json:"targetIsStrong"`
	TargetIsOutlaw            bool   `json:"targetIsOutlaw"`
	TargetIsBuddyOrAllyMember bool   `json:"targetIsBuddyOrAllyMember"`
	TargetPlayerID            int    `json:"targetPlayerId"`
	TargetPlayerName          string `json:"targetPlayerName"`
	TargetPlayerColorClass    string `json:"targetPlayerColorClass"`
	TargetPlayerRankIcon      string `json:"targetPlayerRankIcon"`
	PlayerIsOutlaw            bool   `json:"playerIsOutlaw"`
	TargetPlanet              struct {
		Galaxy   int    `json:"galaxy"`
		System   int    `json:"system"`
		Position int    `json:"position"`
		Type     int    `json:"type"`
		Name     string `json:"name"`
	} `json:"targetPlanet"`
	Errors []struct {
		Message string `json:"message"`
		Error   int    `json:"error"`
	} `json:"errors"`
	TargetOk     bool   `json:"targetOk"`
	Components   []any  `json:"components"`
	NewAjaxToken string `json:"newAjaxToken"`
}

CheckTargetResponse ...

type FleetBuilder

type FleetBuilder struct {
	// contains filtered or unexported fields
}

FleetBuilder ...

func NewFleetBuilder

func NewFleetBuilder(b Wrapper) *FleetBuilder

NewFleetBuilder ...

func (*FleetBuilder) AddShips

func (f *FleetBuilder) AddShips(id ogame.ID, nbr int64) *FleetBuilder

AddShips ...

func (*FleetBuilder) FlightTime

func (f *FleetBuilder) FlightTime() (secs, fuel int64)

FlightTime ...

func (*FleetBuilder) OnError

func (f *FleetBuilder) OnError(clb func(error)) *FleetBuilder

OnError register an error callback

func (*FleetBuilder) OnSuccess

func (f *FleetBuilder) OnSuccess(clb func(ogame.Fleet)) *FleetBuilder

OnSuccess register a success callback

func (*FleetBuilder) SendNow

func (f *FleetBuilder) SendNow() (ogame.Fleet, error)

SendNow send the fleet with defined configurations

func (*FleetBuilder) SetAllCrystal

func (f *FleetBuilder) SetAllCrystal() *FleetBuilder

SetAllCrystal will send all crystal from the origin

func (*FleetBuilder) SetAllDeuterium

func (f *FleetBuilder) SetAllDeuterium() *FleetBuilder

SetAllDeuterium will send all deuterium from the origin

func (*FleetBuilder) SetAllMetal

func (f *FleetBuilder) SetAllMetal() *FleetBuilder

SetAllMetal will send all metal from the origin

func (*FleetBuilder) SetAllResources

func (f *FleetBuilder) SetAllResources() *FleetBuilder

SetAllResources will send all resources from the origin

func (*FleetBuilder) SetAllShips

func (f *FleetBuilder) SetAllShips() *FleetBuilder

SetAllShips ...

func (*FleetBuilder) SetCrystal

func (f *FleetBuilder) SetCrystal(crystal int64) *FleetBuilder

SetCrystal ...

func (*FleetBuilder) SetDestination

func (f *FleetBuilder) SetDestination(v any) *FleetBuilder

SetDestination ...

func (*FleetBuilder) SetDeuterium

func (f *FleetBuilder) SetDeuterium(deuterium int64) *FleetBuilder

SetDeuterium ...

func (*FleetBuilder) SetDuration

func (f *FleetBuilder) SetDuration(holdingTime int64) *FleetBuilder

SetDuration set expedition duration

func (*FleetBuilder) SetMetal

func (f *FleetBuilder) SetMetal(metal int64) *FleetBuilder

SetMetal ...

func (*FleetBuilder) SetMinimumDeuterium

func (f *FleetBuilder) SetMinimumDeuterium(minimumDeuterium int64) *FleetBuilder

SetMinimumDeuterium set minimum deuterium to keep on celestial

func (*FleetBuilder) SetMission

func (f *FleetBuilder) SetMission(mission ogame.MissionID) *FleetBuilder

SetMission ...

func (*FleetBuilder) SetOrigin

func (f *FleetBuilder) SetOrigin(v any) *FleetBuilder

SetOrigin ...

func (*FleetBuilder) SetRecallIn

func (f *FleetBuilder) SetRecallIn(secs int64) *FleetBuilder

SetRecallIn ...

func (*FleetBuilder) SetResources

func (f *FleetBuilder) SetResources(resources ogame.Resources) *FleetBuilder

SetResources ...

func (*FleetBuilder) SetShips

func (f *FleetBuilder) SetShips(ships ogame.ShipsInfos) *FleetBuilder

SetShips ...

func (*FleetBuilder) SetSpeed

func (f *FleetBuilder) SetSpeed(speed ogame.Speed) *FleetBuilder

SetSpeed ...

func (*FleetBuilder) SetTx

func (f *FleetBuilder) SetTx(tx Prioritizable) *FleetBuilder

SetTx ...

func (*FleetBuilder) SetUnionID

func (f *FleetBuilder) SetUnionID(unionID int64) *FleetBuilder

SetUnionID set union id to join

type FleetBuilderFactory

type FleetBuilderFactory struct {
	// contains filtered or unexported fields
}

FleetBuilderFactory ...

func NewFleetBuilderFactory

func NewFleetBuilderFactory(b Wrapper) *FleetBuilderFactory

NewFleetBuilderFactory ...

func (FleetBuilderFactory) NewFleet

func (f FleetBuilderFactory) NewFleet() *FleetBuilder

NewFleet ...

type GFLoginRes

type GFLoginRes struct {
	Token                     string `json:"token"`
	IsPlatformLogin           bool   `json:"isPlatformLogin"`
	IsGameAccountMigrated     bool   `json:"isGameAccountMigrated"`
	PlatformUserID            string `json:"platformUserId"`
	IsGameAccountCreated      bool   `json:"isGameAccountCreated"`
	HasUnmigratedGameAccounts bool   `json:"hasUnmigratedGameAccounts"`
}

func GFLogin

func GFLogin(client httpclient.IHttpClient, ctx context.Context, lobby, username, password, otpSecret, challengeID string) (out *GFLoginRes, err error)

func (GFLoginRes) GetBearerToken

func (r GFLoginRes) GetBearerToken() string

type MessageSuccess

type MessageSuccess struct {
	Buff          string `json:"buff"`
	Status        string `json:"status"`
	Duration      int    `json:"duration"`
	Extendable    bool   `json:"extendable"`
	TotalDuration int    `json:"totalDuration"`
	Tooltip       string `json:"tooltip"`
	Reload        bool   `json:"reload"`
	BuffID        string `json:"buffId"`
	Item          struct {
		Name                    string   `json:"name"`
		Image                   string   `json:"image"`
		ImageLarge              string   `json:"imageLarge"`
		Title                   string   `json:"title"`
		Effect                  string   `json:"effect"`
		Ref                     string   `json:"ref"`
		Rarity                  string   `json:"rarity"`
		Amount                  int      `json:"amount"`
		AmountFree              int      `json:"amount_free"`
		AmountBought            int      `json:"amount_bought"`
		Category                []string `json:"category"`
		Currency                string   `json:"currency"`
		Costs                   string   `json:"costs"`
		IsReduced               bool     `json:"isReduced"`
		Buyable                 bool     `json:"buyable"`
		CanBeActivated          bool     `json:"canBeActivated"`
		CanBeBoughtAndActivated bool     `json:"canBeBoughtAndActivated"`
		IsAnUpgrade             bool     `json:"isAnUpgrade"`
		IsCharacterClassItem    bool     `json:"isCharacterClassItem"`
		HasEnoughCurrency       bool     `json:"hasEnoughCurrency"`
		Cooldown                int      `json:"cooldown"`
		Duration                int      `json:"duration"`
		DurationExtension       any      `json:"durationExtension"`
		TotalTime               int      `json:"totalTime"`
		TimeLeft                int      `json:"timeLeft"`
		Status                  string   `json:"status"`
		Extendable              bool     `json:"extendable"`
		FirstStatus             string   `json:"firstStatus"`
		ToolTip                 string   `json:"toolTip"`
		BuyTitle                string   `json:"buyTitle"`
		ActivationTitle         string   `json:"activationTitle"`
		MoonOnlyItem            bool     `json:"moonOnlyItem"`
	} `json:"item"`
	Message string `json:"message"`
}

type Moon

type Moon struct {
	ogame.Moon
	// contains filtered or unexported fields
}

Moon ogame moon object

func (Moon) ActivateItem

func (m Moon) ActivateItem(ref string) error

ActivateItem activate an item

func (Moon) Build

func (m Moon) Build(id ogame.ID, nbr int64) error

Build builds any ogame objects (building, technology, ship, defence)

func (Moon) BuildBuilding

func (m Moon) BuildBuilding(buildingID ogame.ID) error

BuildBuilding ensure what is being built is a building

func (Moon) BuildDefense

func (m Moon) BuildDefense(defenseID ogame.ID, nbr int64) error

BuildDefense builds a defense unit

func (Moon) BuildTechnology

func (m Moon) BuildTechnology(technologyID ogame.ID) error

BuildTechnology ensure that we're trying to build a technology

func (Moon) CancelBuilding

func (m Moon) CancelBuilding() error

CancelBuilding cancel the construction of a building

func (Moon) CancelLfBuilding

func (p Moon) CancelLfBuilding() error

CancelLfBuilding cancel the construction of a lifeform building

func (Moon) CancelResearch

func (m Moon) CancelResearch() error

CancelResearch cancel the research

func (Moon) ConstructionsBeingBuilt

func (m Moon) ConstructionsBeingBuilt() (ogame.ID, int64, ogame.ID, int64, ogame.ID, int64, ogame.ID, int64)

ConstructionsBeingBuilt returns the building & research being built, and the time remaining (secs)

func (Moon) EnsureFleet

func (m Moon) EnsureFleet(ships []ogame.Quantifiable, speed ogame.Speed, where ogame.Coordinate,
	mission ogame.MissionID, resources ogame.Resources, holdingTime, unionID int64) (ogame.Fleet, error)

EnsureFleet either sends all the requested ships or fail

func (Moon) GetDefense

func (m Moon) GetDefense(options ...Option) (ogame.DefensesInfos, error)

GetDefense gets all the defenses units information

func (Moon) GetFacilities

func (m Moon) GetFacilities(options ...Option) (ogame.Facilities, error)

GetFacilities gets the moon facilities

func (Moon) GetItems

func (m Moon) GetItems() ([]ogame.Item, error)

GetItems get all items information

func (Moon) GetLfBuildings

func (m Moon) GetLfBuildings(options ...Option) (ogame.LfBuildings, error)

GetLfBuildings gets the lifeform buildings levels

func (Moon) GetLfResearch

func (m Moon) GetLfResearch(options ...Option) (ogame.LfResearches, error)

GetLfResearch gets the lifeform techs levels

func (Moon) GetProduction

func (m Moon) GetProduction() ([]ogame.Quantifiable, int64, error)

GetProduction get what is in the production queue. (ships & defense being built)

func (Moon) GetResources

func (m Moon) GetResources() (ogame.Resources, error)

GetResources gets moon resources

func (Moon) GetResourcesBuildings

func (m Moon) GetResourcesBuildings(options ...Option) (ogame.ResourcesBuildings, error)

GetResourcesBuildings gets the resources buildings levels

func (Moon) GetResourcesDetails

func (m Moon) GetResourcesDetails() (ogame.ResourcesDetails, error)

GetResourcesDetails gets resources details

func (Moon) GetShips

func (m Moon) GetShips(options ...Option) (ogame.ShipsInfos, error)

GetShips gets all ships units information

func (Moon) GetTechs

GetTechs gets (ogame.ResourcesBuildings, ogame.Facilities, ogame.ShipsInfos, ogame.DefensesInfos, ogame.Researches)

func (Moon) Phalanx

func (m Moon) Phalanx(coord ogame.Coordinate) ([]ogame.Fleet, error)

Phalanx uses 5000 deuterium to scan a coordinate

func (Moon) SendFleet

func (m Moon) SendFleet(ships []ogame.Quantifiable, speed ogame.Speed, where ogame.Coordinate,
	mission ogame.MissionID, resources ogame.Resources, holdingTime, unionID int64) (ogame.Fleet, error)

SendFleet sends a fleet

func (Moon) TearDown

func (m Moon) TearDown(buildingID ogame.ID) error

TearDown tears down any ogame building

type OGame

type OGame struct {
	sync.Mutex

	Player            ogame.UserInfos
	CachedPreferences ogame.Preferences

	Universe string
	Username string
	// contains filtered or unexported fields
}

OGame is a client for ogame.org. It is safe for concurrent use by multiple goroutines (thread-safe)

func New

func New(universe, username, password, lang string) (*OGame, error)

New creates a new instance of OGame wrapper.

func NewNoLogin

func NewNoLogin(username, password, otpSecret, bearerToken, universe, lang, cookiesFilename string, playerID int64, client *httpclient.Client) (*OGame, error)

NewNoLogin does not auto login.

func NewWithParams

func NewWithParams(params Params) (*OGame, error)

NewWithParams create a new OGame instance with full control over the possible parameters

func (*OGame) Abandon

func (b *OGame) Abandon(v any) error

Abandon a planet

func (*OGame) ActivateItem

func (b *OGame) ActivateItem(ref string, celestialID ogame.CelestialID) error

ActivateItem activate an item

func (*OGame) AddAccount

func (b *OGame) AddAccount(number int, lang string) (*AddAccountRes, error)

AddAccount add a new account (server) to your list of accounts

func (*OGame) Begin

func (b *OGame) Begin() Prioritizable

Begin start a transaction. Once this function is called, "Done" must be called to release the lock.

func (*OGame) BeginNamed

func (b *OGame) BeginNamed(name string) Prioritizable

BeginNamed begins a new transaction with a name. "Done" must be called to release the lock.

func (*OGame) Build

func (b *OGame) Build(celestialID ogame.CelestialID, id ogame.ID, nbr int64) error

Build builds any ogame objects (building, technology, ship, defence)

func (*OGame) BuildBuilding

func (b *OGame) BuildBuilding(celestialID ogame.CelestialID, buildingID ogame.ID) error

BuildBuilding ensure what is being built is a building

func (*OGame) BuildCancelable

func (b *OGame) BuildCancelable(celestialID ogame.CelestialID, id ogame.ID) error

BuildCancelable builds any cancelable ogame objects (building, technology)

func (*OGame) BuildDefense

func (b *OGame) BuildDefense(celestialID ogame.CelestialID, defenseID ogame.ID, nbr int64) error

BuildDefense builds a defense unit

func (*OGame) BuildProduction

func (b *OGame) BuildProduction(celestialID ogame.CelestialID, id ogame.ID, nbr int64) error

BuildProduction builds any line production ogame objects (ship, defence)

func (*OGame) BuildShips

func (b *OGame) BuildShips(celestialID ogame.CelestialID, shipID ogame.ID, nbr int64) error

BuildShips builds a ship unit

func (*OGame) BuildTechnology

func (b *OGame) BuildTechnology(celestialID ogame.CelestialID, technologyID ogame.ID) error

BuildTechnology ensure that we're trying to build a technology

func (*OGame) BuyMarketplace

func (b *OGame) BuyMarketplace(itemID int64, celestialID ogame.CelestialID) error

BuyMarketplace buy an item on the marketplace

func (*OGame) BuyOfferOfTheDay

func (b *OGame) BuyOfferOfTheDay() error

BuyOfferOfTheDay buys the offer of the day.

func (*OGame) BytesDownloaded

func (b *OGame) BytesDownloaded() int64

BytesDownloaded returns the amount of bytes downloaded

func (*OGame) BytesUploaded

func (b *OGame) BytesUploaded() int64

BytesUploaded returns the amount of bytes uploaded

func (*OGame) CalcFlightTime

func (b *OGame) CalcFlightTime(origin, destination ogame.Coordinate, speed float64, ships ogame.ShipsInfos, missionID ogame.MissionID) (secs, fuel int64)

CalcFlightTime calculates the flight time and the fuel consumption

func (*OGame) CancelBuilding

func (b *OGame) CancelBuilding(celestialID ogame.CelestialID) error

CancelBuilding cancel the construction of a building on a specified planet

func (*OGame) CancelFleet

func (b *OGame) CancelFleet(fleetID ogame.FleetID) error

CancelFleet cancel a fleet

func (*OGame) CancelLfBuilding

func (b *OGame) CancelLfBuilding(celestialID ogame.CelestialID) error

CancelLfBuilding cancel the construction of a lifeform building on a specified planet

func (*OGame) CancelResearch

func (b *OGame) CancelResearch(celestialID ogame.CelestialID) error

CancelResearch cancel the research

func (*OGame) CharacterClass

func (b *OGame) CharacterClass() ogame.CharacterClass

CharacterClass returns the bot character class

func (*OGame) CollectAllMarketplaceMessages

func (b *OGame) CollectAllMarketplaceMessages() error

CollectAllMarketplaceMessages collect all marketplace messages

func (*OGame) CollectMarketplaceMessage

func (b *OGame) CollectMarketplaceMessage(msg ogame.MarketplaceMessage) error

CollectMarketplaceMessage collect marketplace message

func (*OGame) ConstructionTime

func (b *OGame) ConstructionTime(id ogame.ID, nbr int64, facilities ogame.Facilities) time.Duration

ConstructionTime get duration to build something

func (*OGame) ConstructionsBeingBuilt

func (b *OGame) ConstructionsBeingBuilt(celestialID ogame.CelestialID) (ogame.ID, int64, ogame.ID, int64, ogame.ID, int64, ogame.ID, int64)

ConstructionsBeingBuilt returns the building & research being built, and the time remaining (secs)

func (*OGame) CreateUnion

func (b *OGame) CreateUnion(fleet ogame.Fleet, users []string) (int64, error)

CreateUnion creates a union

func (*OGame) DeleteAllMessagesFromTab

func (b *OGame) DeleteAllMessagesFromTab(tabID ogame.MessagesTabID) error

DeleteAllMessagesFromTab deletes all messages from a tab in the mail box

func (*OGame) DeleteMessage

func (b *OGame) DeleteMessage(msgID int64) error

DeleteMessage deletes a message from the mail box

func (*OGame) DestroyRockets

func (b *OGame) DestroyRockets(planetID ogame.PlanetID, abm, ipm int64) error

DestroyRockets destroys anti-ballistic & inter-planetary missiles

func (*OGame) Disable

func (b *OGame) Disable()

Disable disables communications with OGame Server

func (*OGame) Distance

func (b *OGame) Distance(origin, destination ogame.Coordinate) int64

Distance return distance between two coordinates

func (*OGame) DoAuction

func (b *OGame) DoAuction(bid map[ogame.CelestialID]ogame.Resources) error

DoAuction ...

func (*OGame) Done

func (b *OGame) Done()

Done ...

func (*OGame) Enable

func (b *OGame) Enable()

Enable enables communications with OGame Server

func (*OGame) EnsureFleet

func (b *OGame) EnsureFleet(celestialID ogame.CelestialID, ships []ogame.Quantifiable, speed ogame.Speed, where ogame.Coordinate,
	mission ogame.MissionID, resources ogame.Resources, holdingTime, unionID int64) (ogame.Fleet, error)

EnsureFleet either sends all the requested ships or fail

func (*OGame) FleetDeutSaveFactor

func (b *OGame) FleetDeutSaveFactor() float64

FleetDeutSaveFactor returns the fleet deut save factor

func (*OGame) FlightTime

func (b *OGame) FlightTime(origin, destination ogame.Coordinate, speed ogame.Speed, ships ogame.ShipsInfos, missionID ogame.MissionID) (secs, fuel int64)

FlightTime calculate flight time and fuel needed

func (*OGame) GalaxyInfos

func (b *OGame) GalaxyInfos(galaxy, system int64, options ...Option) (ogame.SystemInfos, error)

GalaxyInfos get information of all planets and moons of a solar system

func (*OGame) GetActiveItems

func (b *OGame) GetActiveItems(celestialID ogame.CelestialID) ([]ogame.ActiveItem, error)

GetActiveItems ...

func (*OGame) GetAllResources

func (b *OGame) GetAllResources() (map[ogame.CelestialID]ogame.Resources, error)

GetAllResources gets the resources of all planets and moons

func (*OGame) GetAttacks

func (b *OGame) GetAttacks(opts ...Option) ([]ogame.AttackEvent, error)

GetAttacks get enemy fleets attacking you

func (*OGame) GetAuction

func (b *OGame) GetAuction() (ogame.Auction, error)

GetAuction ...

func (*OGame) GetCachedCelestial

func (b *OGame) GetCachedCelestial(v any) Celestial

GetCachedCelestial return celestial from cached value

func (*OGame) GetCachedCelestialByCoord

func (b *OGame) GetCachedCelestialByCoord(coord ogame.Coordinate) Celestial

GetCachedCelestialByCoord return celestial from cached value

func (*OGame) GetCachedCelestialByID

func (b *OGame) GetCachedCelestialByID(celestialID ogame.CelestialID) Celestial

GetCachedCelestialByID return celestial from cached value

func (*OGame) GetCachedCelestials

func (b *OGame) GetCachedCelestials() []Celestial

GetCachedCelestials get all cached celestials

func (*OGame) GetCachedMoons

func (b *OGame) GetCachedMoons() []Moon

GetCachedMoons return moons from cached value

func (*OGame) GetCachedPlanets

func (b *OGame) GetCachedPlanets() []Planet

GetCachedPlanets return planets from cached value

func (*OGame) GetCachedPlayer

func (b *OGame) GetCachedPlayer() ogame.UserInfos

GetCachedPlayer returns cached player infos

func (*OGame) GetCachedPreferences

func (b *OGame) GetCachedPreferences() ogame.Preferences

GetCachedPreferences returns cached preferences

func (*OGame) GetCachedResearch

func (b *OGame) GetCachedResearch() ogame.Researches

GetCachedResearch returns cached researches

func (*OGame) GetCelestial

func (b *OGame) GetCelestial(v any) (Celestial, error)

GetCelestial get the player's planet/moon using the coordinate

func (*OGame) GetCelestials

func (b *OGame) GetCelestials() ([]Celestial, error)

GetCelestials get the player's planets & moons

func (*OGame) GetClient

func (b *OGame) GetClient() *httpclient.Client

GetClient get the http client used by the bot

func (*OGame) GetCombatReportSummaryFor

func (b *OGame) GetCombatReportSummaryFor(coord ogame.Coordinate) (ogame.CombatReportSummary, error)

GetCombatReportSummaryFor gets the latest combat report for a given coordinate

func (*OGame) GetDMCosts

func (b *OGame) GetDMCosts(celestialID ogame.CelestialID) (ogame.DMCosts, error)

GetDMCosts returns fast build with DM information

func (*OGame) GetDefense

func (b *OGame) GetDefense(celestialID ogame.CelestialID, options ...Option) (ogame.DefensesInfos, error)

GetDefense gets all the defenses units information of a planet Fails if planetID is invalid

func (*OGame) GetEmpire

func (b *OGame) GetEmpire(celestialType ogame.CelestialType) ([]ogame.EmpireCelestial, error)

GetEmpire gets all planets/moons information resources/supplies/facilities/ships/researches

func (*OGame) GetEmpireJSON

func (b *OGame) GetEmpireJSON(nbr int64) (any, error)

GetEmpireJSON retrieves JSON from Empire page (Commander only).

func (*OGame) GetEspionageReport

func (b *OGame) GetEspionageReport(msgID int64) (ogame.EspionageReport, error)

GetEspionageReport gets a detailed espionage report

func (*OGame) GetEspionageReportFor

func (b *OGame) GetEspionageReportFor(coord ogame.Coordinate) (ogame.EspionageReport, error)

GetEspionageReportFor gets the latest espionage report for a given coordinate

func (*OGame) GetEspionageReportMessages

func (b *OGame) GetEspionageReportMessages() ([]ogame.EspionageReportSummary, error)

GetEspionageReportMessages gets the summary of each espionage reports

func (*OGame) GetExpeditionMessageAt

func (b *OGame) GetExpeditionMessageAt(t time.Time) (ogame.ExpeditionMessage, error)

GetExpeditionMessageAt gets the expedition message for time t

func (*OGame) GetExpeditionMessages

func (b *OGame) GetExpeditionMessages() ([]ogame.ExpeditionMessage, error)

GetExpeditionMessages gets the expedition messages

func (*OGame) GetExtractor

func (b *OGame) GetExtractor() extractor.Extractor

GetExtractor gets extractor object

func (*OGame) GetFacilities

func (b *OGame) GetFacilities(celestialID ogame.CelestialID, options ...Option) (ogame.Facilities, error)

GetFacilities gets all facilities information of a planet

func (*OGame) GetFleets

func (b *OGame) GetFleets(opts ...Option) ([]ogame.Fleet, ogame.Slots)

GetFleets get the player's own fleets activities

func (*OGame) GetFleetsFromEventList

func (b *OGame) GetFleetsFromEventList() []ogame.Fleet

GetFleetsFromEventList get the player's own fleets activities

func (*OGame) GetItems

func (b *OGame) GetItems(celestialID ogame.CelestialID) ([]ogame.Item, error)

GetItems get all items information

func (*OGame) GetLanguage

func (b *OGame) GetLanguage() string

GetLanguage get ogame server language

func (*OGame) GetLfBuildings

func (b *OGame) GetLfBuildings(celestialID ogame.CelestialID, opts ...Option) (ogame.LfBuildings, error)

GetLfBuildings ...

func (*OGame) GetLfResearch

func (b *OGame) GetLfResearch(celestialID ogame.CelestialID, opts ...Option) (ogame.LfResearches, error)

GetLfResearch ...

func (*OGame) GetLoginClient

func (b *OGame) GetLoginClient() *httpclient.Client

GetLoginClient get the http client used by the bot for login operations

func (*OGame) GetMoon

func (b *OGame) GetMoon(v any) (Moon, error)

GetMoon gets infos for moonID

func (*OGame) GetMoons

func (b *OGame) GetMoons() []Moon

GetMoons returns the user moons

func (*OGame) GetNbSystems

func (b *OGame) GetNbSystems() int64

GetNbSystems gets the number of systems

func (*OGame) GetPageContent

func (b *OGame) GetPageContent(vals url.Values) ([]byte, error)

GetPageContent gets the html for a specific ogame page

func (*OGame) GetPlanet

func (b *OGame) GetPlanet(v any) (Planet, error)

GetPlanet gets infos for planetID Fails if planetID is invalid

func (*OGame) GetPlanets

func (b *OGame) GetPlanets() []Planet

GetPlanets returns the user planets

func (*OGame) GetProduction

func (b *OGame) GetProduction(celestialID ogame.CelestialID) ([]ogame.Quantifiable, int64, error)

GetProduction get what is in the production queue. (ships & defense being built)

func (*OGame) GetPublicIP

func (b *OGame) GetPublicIP() (string, error)

GetPublicIP get the public IP used by the bot

func (*OGame) GetResearch

func (b *OGame) GetResearch() ogame.Researches

GetResearch gets the player researches information

func (*OGame) GetResearchSpeed

func (b *OGame) GetResearchSpeed() int64

GetResearchSpeed gets the research speed

func (*OGame) GetResourceSettings

func (b *OGame) GetResourceSettings(planetID ogame.PlanetID, options ...Option) (ogame.ResourceSettings, error)

GetResourceSettings gets the resources settings for specified planetID

func (*OGame) GetResources

func (b *OGame) GetResources(celestialID ogame.CelestialID) (ogame.Resources, error)

GetResources gets user resources

func (*OGame) GetResourcesBuildings

func (b *OGame) GetResourcesBuildings(celestialID ogame.CelestialID, options ...Option) (ogame.ResourcesBuildings, error)

GetResourcesBuildings gets the resources buildings levels

func (*OGame) GetResourcesDetails

func (b *OGame) GetResourcesDetails(celestialID ogame.CelestialID) (ogame.ResourcesDetails, error)

GetResourcesDetails gets user resources

func (*OGame) GetResourcesProductions

func (b *OGame) GetResourcesProductions(planetID ogame.PlanetID) (ogame.Resources, error)

GetResourcesProductions gets the planet resources production

func (*OGame) GetResourcesProductionsLight

func (b *OGame) GetResourcesProductionsLight(resBuildings ogame.ResourcesBuildings, researches ogame.Researches,
	resSettings ogame.ResourceSettings, temp ogame.Temperature) ogame.Resources

GetResourcesProductionsLight gets the planet resources production

func (*OGame) GetServer

func (b *OGame) GetServer() Server

GetServer get ogame server information that the bot is connected to

func (*OGame) GetServerData

func (b *OGame) GetServerData() ServerData

GetServerData get ogame server data information that the bot is connected to

func (*OGame) GetSession

func (b *OGame) GetSession() string

GetSession get ogame session

func (*OGame) GetShips

func (b *OGame) GetShips(celestialID ogame.CelestialID, options ...Option) (ogame.ShipsInfos, error)

GetShips gets all ships units information of a planet

func (*OGame) GetSlots

func (b *OGame) GetSlots() ogame.Slots

GetSlots gets the player current and total slots information

func (*OGame) GetState

func (b *OGame) GetState() (bool, string)

GetState returns the current bot state

func (*OGame) GetTasks

func (b *OGame) GetTasks() taskRunner.TasksOverview

GetTasks return how many tasks are queued in the heap.

func (*OGame) GetTechs

GetTechs gets a celestial supplies/facilities/ships/researches

func (*OGame) GetUniverseName

func (b *OGame) GetUniverseName() string

GetUniverseName get the name of the universe the bot is playing into

func (*OGame) GetUniverseSpeed

func (b *OGame) GetUniverseSpeed() int64

GetUniverseSpeed shortcut to get ogame universe speed

func (*OGame) GetUniverseSpeedFleet

func (b *OGame) GetUniverseSpeedFleet() int64

GetUniverseSpeedFleet shortcut to get ogame universe speed fleet

func (*OGame) GetUserInfos

func (b *OGame) GetUserInfos() ogame.UserInfos

GetUserInfos gets the user information

func (*OGame) GetUsername

func (b *OGame) GetUsername() string

GetUsername get the username that was used to login on ogame server

func (*OGame) HeadersForPage

func (b *OGame) HeadersForPage(url string) (http.Header, error)

HeadersForPage gets the headers for a specific ogame page

func (*OGame) Highscore

func (b *OGame) Highscore(category, typ, page int64) (ogame.Highscore, error)

Highscore ...

func (*OGame) IsConnected

func (b *OGame) IsConnected() bool

IsConnected returns true if the bot is currently connected (communication between the bot and OGame is possible), otherwise false

func (*OGame) IsDonutGalaxy

func (b *OGame) IsDonutGalaxy() bool

IsDonutGalaxy shortcut to get ogame galaxy donut config

func (*OGame) IsDonutSystem

func (b *OGame) IsDonutSystem() bool

IsDonutSystem shortcut to get ogame system donut config

func (*OGame) IsEnabled

func (b *OGame) IsEnabled() bool

IsEnabled returns true if the bot is enabled, otherwise false

func (*OGame) IsLocked

func (b *OGame) IsLocked() bool

IsLocked returns either or not the bot is currently locked

func (*OGame) IsLoggedIn

func (b *OGame) IsLoggedIn() bool

IsLoggedIn returns true if the bot is currently logged-in, otherwise false

func (*OGame) IsPioneers

func (b *OGame) IsPioneers() bool

IsPioneers either or not the bot use lobby-pioneers

func (*OGame) IsUnderAttack

func (b *OGame) IsUnderAttack() (bool, error)

IsUnderAttack returns true if the user is under attack, false otherwise

func (*OGame) IsV7

func (b *OGame) IsV7() bool

IsV7 ...

func (*OGame) IsV8

func (b *OGame) IsV8() bool

IsV8 ...

func (*OGame) IsV9

func (b *OGame) IsV9() bool

IsV9 ...

func (*OGame) IsVacationModeEnabled

func (b *OGame) IsVacationModeEnabled() bool

IsVacationModeEnabled returns either or not the bot is in vacation mode

func (*OGame) JumpGate

func (b *OGame) JumpGate(origin, dest ogame.MoonID, ships ogame.ShipsInfos) (success bool, rechargeCountdown int64, err error)

JumpGate sends ships through a jump gate.

func (*OGame) JumpGateDestinations

func (b *OGame) JumpGateDestinations(origin ogame.MoonID) (moonIDs []ogame.MoonID, rechargeCountdown int64, err error)

JumpGateDestinations returns available destinations for jump gate.

func (*OGame) Location

func (b *OGame) Location() *time.Location

Location returns bot Time zone.

func (*OGame) Login

func (b *OGame) Login() error

Login to ogame server Can fails with BadCredentialsError

func (*OGame) LoginWithBearerToken

func (b *OGame) LoginWithBearerToken(token string) (bool, error)

LoginWithBearerToken to ogame server reusing existing token

func (*OGame) LoginWithExistingCookies

func (b *OGame) LoginWithExistingCookies() (bool, error)

LoginWithExistingCookies to ogame server reusing existing cookies

func (*OGame) Logout

func (b *OGame) Logout()

Logout the bot from ogame server

func (*OGame) OfferBuyMarketplace

func (b *OGame) OfferBuyMarketplace(itemID any, quantity, priceType, price, priceRange int64, celestialID ogame.CelestialID) error

OfferBuyMarketplace buy offer on marketplace

func (*OGame) OfferSellMarketplace

func (b *OGame) OfferSellMarketplace(itemID any, quantity, priceType, price, priceRange int64, celestialID ogame.CelestialID) error

OfferSellMarketplace sell offer on marketplace

func (*OGame) OnStateChange

func (b *OGame) OnStateChange(clb func(locked bool, actor string))

OnStateChange register a callback that is notified when the bot state changes

func (*OGame) Phalanx

func (b *OGame) Phalanx(moonID ogame.MoonID, coord ogame.Coordinate) ([]ogame.Fleet, error)

Phalanx scan a coordinate from a moon to get fleets information IMPORTANT: My account was instantly banned when I scanned an invalid coordinate. IMPORTANT: This function DOES validate that the coordinate is a valid planet in range of phalanx

and that you have enough deuterium.

func (*OGame) PostPageContent

func (b *OGame) PostPageContent(vals, payload url.Values) ([]byte, error)

PostPageContent make a post request to ogame server This is useful when simulating a web browser

func (*OGame) Quiet

func (b *OGame) Quiet(quiet bool)

Quiet mode will not show any informative output

func (*OGame) ReconnectChat

func (b *OGame) ReconnectChat() bool

ReconnectChat ...

func (*OGame) RecruitOfficer

func (b *OGame) RecruitOfficer(typ, days int64) error

RecruitOfficer recruit an officer. Typ 2: Commander, 3: Admiral, 4: Engineer, 5: Geologist, 6: Technocrat Days: 7 or 90

func (*OGame) RegisterAuctioneerCallback

func (b *OGame) RegisterAuctioneerCallback(fn func(packet any))

RegisterAuctioneerCallback register a callback that is called when auctioneer packets are received

func (*OGame) RegisterChatCallback

func (b *OGame) RegisterChatCallback(fn func(msg ogame.ChatMsg))

RegisterChatCallback register a callback that is called when chat messages are received

func (*OGame) RegisterHTMLInterceptor

func (b *OGame) RegisterHTMLInterceptor(fn func(method, url string, params, payload url.Values, pageHTML []byte))

RegisterHTMLInterceptor ...

func (*OGame) RegisterWSCallback

func (b *OGame) RegisterWSCallback(id string, fn func(msg []byte))

RegisterWSCallback ...

func (*OGame) RemoveWSCallback

func (b *OGame) RemoveWSCallback(id string)

RemoveWSCallback ...

func (*OGame) SendFleet

func (b *OGame) SendFleet(celestialID ogame.CelestialID, ships []ogame.Quantifiable, speed ogame.Speed, where ogame.Coordinate,
	mission ogame.MissionID, resources ogame.Resources, holdingTime, unionID int64) (ogame.Fleet, error)

SendFleet sends a fleet

func (*OGame) SendIPM

func (b *OGame) SendIPM(planetID ogame.PlanetID, coord ogame.Coordinate, nbr int64, priority ogame.ID) (int64, error)

SendIPM sends IPM

func (*OGame) SendMessage

func (b *OGame) SendMessage(playerID int64, message string) error

SendMessage sends a message to playerID

func (*OGame) SendMessageAlliance

func (b *OGame) SendMessageAlliance(associationID int64, message string) error

SendMessageAlliance sends a message to associationID

func (*OGame) ServerTime

func (b *OGame) ServerTime() time.Time

ServerTime returns server time Timezone is OGT (OGame Time zone)

func (*OGame) ServerURL

func (b *OGame) ServerURL() string

ServerURL get the ogame server specific url

func (*OGame) ServerVersion

func (b *OGame) ServerVersion() string

ServerVersion returns OGame version

func (*OGame) SetClient

func (b *OGame) SetClient(client *httpclient.Client)

SetClient set the http client used by the bot

func (*OGame) SetGetServerDataWrapper

func (b *OGame) SetGetServerDataWrapper(newWrapper func(func() (ServerData, error)) (ServerData, error))

SetGetServerDataWrapper ...

func (*OGame) SetInitiator

func (b *OGame) SetInitiator(initiator string) Prioritizable

SetInitiator ...

func (*OGame) SetLogger

func (b *OGame) SetLogger(logger *log.Logger)

SetLogger set a custom logger for the bot

func (*OGame) SetLoginWrapper

func (b *OGame) SetLoginWrapper(newWrapper func(func() (bool, error)) error)

SetLoginWrapper ...

func (*OGame) SetOGameCredentials

func (b *OGame) SetOGameCredentials(username, password, otpSecret, bearerToken string)

SetOGameCredentials sets ogame credentials for the bot

func (*OGame) SetProxy

func (b *OGame) SetProxy(proxyAddress, username, password, proxyType string, loginOnly bool, config *tls.Config) error

SetProxy this will change the bot http transport object. proxyType can be "http" or "socks5". An empty proxyAddress will reset the client transport to default value.

func (*OGame) SetResourceSettings

func (b *OGame) SetResourceSettings(planetID ogame.PlanetID, settings ogame.ResourceSettings) error

SetResourceSettings set the resources settings on a planet

func (*OGame) SetUserAgent

func (b *OGame) SetUserAgent(newUserAgent string)

SetUserAgent change the user-agent used by the http client

func (*OGame) SetVacationMode

func (b *OGame) SetVacationMode() error

SetVacationMode puts account in vacation mode

func (*OGame) TearDown

func (b *OGame) TearDown(celestialID ogame.CelestialID, id ogame.ID) error

TearDown tears down any ogame building

func (*OGame) TechnologyDetails

func (b *OGame) TechnologyDetails(celestialID ogame.CelestialID, id ogame.ID) (ogame.TechnologyDetails, error)

TechnologyDetails extract details from ajax window when clicking supplies/facilities/techs/lf...

func (*OGame) Tx

func (b *OGame) Tx(clb func(tx Prioritizable) error) error

Tx locks the bot during the transaction and ensure the lock is released afterward

func (*OGame) UnsafePhalanx

func (b *OGame) UnsafePhalanx(moonID ogame.MoonID, coord ogame.Coordinate) ([]ogame.Fleet, error)

UnsafePhalanx same as Phalanx but does not perform any input validation.

func (*OGame) UseDM

func (b *OGame) UseDM(typ string, celestialID ogame.CelestialID) error

UseDM use dark matter to fast build

func (*OGame) ValidateAccount

func (b *OGame) ValidateAccount(code string) error

ValidateAccount validate a gameforge account

func (*OGame) WithPriority

func (b *OGame) WithPriority(priority taskRunner.Priority) Prioritizable

WithPriority ...

type Option

type Option func(*Options)

Option functions to be passed to public interface to change behaviors

func ChangePlanet

func ChangePlanet(celestialID ogame.CelestialID) Option

ChangePlanet set the cp parameter

type Options

type Options struct {
	DebugGalaxy     bool
	SkipInterceptor bool
	SkipRetry       bool
	ChangePlanet    ogame.CelestialID // cp parameter
}

type Params

type Params struct {
	Username        string
	Password        string
	BearerToken     string // Gameforge auth bearer token
	OTPSecret       string
	Universe        string
	Lang            string
	PlayerID        int64
	AutoLogin       bool
	Proxy           string
	ProxyUsername   string
	ProxyPassword   string
	ProxyType       string
	ProxyLoginOnly  bool
	TLSConfig       *tls.Config
	Lobby           string
	APINewHostname  string
	CookiesFilename string
	Client          *httpclient.Client
	CaptchaCallback CaptchaCallback
}

Params parameters for more fine-grained initialization

type Planet

type Planet struct {
	ogame.Planet

	Moon *Moon
	// contains filtered or unexported fields
}

Planet ogame planet object

func (Planet) ActivateItem

func (p Planet) ActivateItem(ref string) error

ActivateItem activate an item

func (Planet) Build

func (p Planet) Build(id ogame.ID, nbr int64) error

Build builds any ogame objects (building, technology, ship, defence)

func (Planet) BuildBuilding

func (p Planet) BuildBuilding(buildingID ogame.ID) error

BuildBuilding ensure what is being built is a building

func (Planet) BuildCancelable

func (p Planet) BuildCancelable(id ogame.ID) error

BuildCancelable builds any cancelable ogame objects (building, technology)

func (Planet) BuildDefense

func (p Planet) BuildDefense(defenseID ogame.ID, nbr int64) error

BuildDefense builds a defense unit

func (Planet) BuildShips

func (p Planet) BuildShips(shipID ogame.ID, nbr int64) error

BuildShips builds a ship unit

func (Planet) BuildTechnology

func (p Planet) BuildTechnology(technologyID ogame.ID) error

BuildTechnology ensure that we're trying to build a technology

func (Planet) CancelBuilding

func (p Planet) CancelBuilding() error

CancelBuilding cancel the construction of a building

func (Planet) CancelLfBuilding

func (p Planet) CancelLfBuilding() error

CancelLfBuilding cancel the construction of a lifeform building

func (Planet) CancelResearch

func (p Planet) CancelResearch() error

CancelResearch cancel the research

func (Planet) ConstructionsBeingBuilt

func (p Planet) ConstructionsBeingBuilt() (ogame.ID, int64, ogame.ID, int64, ogame.ID, int64, ogame.ID, int64)

ConstructionsBeingBuilt returns the building & research being built, and the time remaining (secs)

func (Planet) EnsureFleet

func (p Planet) EnsureFleet(ships []ogame.Quantifiable, speed ogame.Speed, where ogame.Coordinate,
	mission ogame.MissionID, resources ogame.Resources, holdingTime, unionID int64) (ogame.Fleet, error)

EnsureFleet either sends all the requested ships or fail

func (Planet) FlightTime

func (p Planet) FlightTime(destination ogame.Coordinate, speed ogame.Speed, ships ogame.ShipsInfos, missionID ogame.MissionID) (secs, fuel int64)

FlightTime calculate flight time and fuel needed

func (Planet) GetDefense

func (p Planet) GetDefense(options ...Option) (ogame.DefensesInfos, error)

GetDefense gets all the defenses units information

func (Planet) GetFacilities

func (p Planet) GetFacilities(options ...Option) (ogame.Facilities, error)

GetFacilities gets all facilities information

func (Planet) GetItems

func (p Planet) GetItems() ([]ogame.Item, error)

GetItems get all items information

func (Planet) GetLfBuildings

func (p Planet) GetLfBuildings(options ...Option) (ogame.LfBuildings, error)

GetLfBuildings gets the lifeform buildings levels

func (Planet) GetLfResearch

func (p Planet) GetLfResearch(options ...Option) (ogame.LfResearches, error)

GetLfResearch gets the lifeform techs levels

func (Planet) GetMoon

func (p Planet) GetMoon() *Moon

func (Planet) GetProduction

func (p Planet) GetProduction() ([]ogame.Quantifiable, int64, error)

GetProduction get what is in the production queue. (ships & defense being built)

func (Planet) GetResourceSettings

func (p Planet) GetResourceSettings(options ...Option) (ogame.ResourceSettings, error)

GetResourceSettings gets the resources settings for specified planetID

func (Planet) GetResources

func (p Planet) GetResources() (ogame.Resources, error)

GetResources gets user resources

func (Planet) GetResourcesBuildings

func (p Planet) GetResourcesBuildings(options ...Option) (ogame.ResourcesBuildings, error)

GetResourcesBuildings gets the resources buildings levels

func (Planet) GetResourcesDetails

func (p Planet) GetResourcesDetails() (ogame.ResourcesDetails, error)

GetResourcesDetails gets resources details

func (Planet) GetResourcesProductions

func (p Planet) GetResourcesProductions() (ogame.Resources, error)

GetResourcesProductions gets the resources production

func (Planet) GetShips

func (p Planet) GetShips(options ...Option) (ogame.ShipsInfos, error)

GetShips gets all ships units information

func (Planet) GetTechs

GetTechs gets (ogame.ResourcesBuildings, ogame.Facilities, ogame.ShipsInfos, ogame.DefensesInfos, ogame.Researches)

func (Planet) SendFleet

func (p Planet) SendFleet(ships []ogame.Quantifiable, speed ogame.Speed, where ogame.Coordinate,
	mission ogame.MissionID, resources ogame.Resources, holdingTime, unionID int64) (ogame.Fleet, error)

SendFleet sends a fleet

func (Planet) SendIPM

func (p Planet) SendIPM(planetID ogame.PlanetID, coord ogame.Coordinate, nbr int64, priority ogame.ID) (int64, error)

SendIPM send interplanetary missiles

func (Planet) String

func (p Planet) String() string

String ..

func (Planet) TearDown

func (p Planet) TearDown(buildingID ogame.ID) error

TearDown tears down any ogame building

type Prioritizable

type Prioritizable interface {
	Abandon(any) error
	ActivateItem(string, ogame.CelestialID) error
	Begin() Prioritizable
	BeginNamed(name string) Prioritizable
	BuyMarketplace(itemID int64, celestialID ogame.CelestialID) error
	BuyOfferOfTheDay() error
	CancelFleet(ogame.FleetID) error
	CollectAllMarketplaceMessages() error
	CollectMarketplaceMessage(ogame.MarketplaceMessage) error
	CreateUnion(fleet ogame.Fleet, unionUsers []string) (int64, error)
	DeleteAllMessagesFromTab(tabID ogame.MessagesTabID) error
	DeleteMessage(msgID int64) error
	DoAuction(bid map[ogame.CelestialID]ogame.Resources) error
	Done()
	FlightTime(origin, destination ogame.Coordinate, speed ogame.Speed, ships ogame.ShipsInfos, mission ogame.MissionID) (secs, fuel int64)
	GalaxyInfos(galaxy, system int64, opts ...Option) (ogame.SystemInfos, error)
	GetActiveItems(ogame.CelestialID) ([]ogame.ActiveItem, error)
	GetAllResources() (map[ogame.CelestialID]ogame.Resources, error)
	GetAttacks(...Option) ([]ogame.AttackEvent, error)
	GetAuction() (ogame.Auction, error)
	GetCachedResearch() ogame.Researches
	GetCelestial(any) (Celestial, error)
	GetCelestials() ([]Celestial, error)
	GetCombatReportSummaryFor(ogame.Coordinate) (ogame.CombatReportSummary, error)
	GetDMCosts(ogame.CelestialID) (ogame.DMCosts, error)
	GetEmpire(ogame.CelestialType) ([]ogame.EmpireCelestial, error)
	GetEmpireJSON(nbr int64) (any, error)
	GetEspionageReport(msgID int64) (ogame.EspionageReport, error)
	GetEspionageReportFor(ogame.Coordinate) (ogame.EspionageReport, error)
	GetEspionageReportMessages() ([]ogame.EspionageReportSummary, error)
	GetExpeditionMessageAt(time.Time) (ogame.ExpeditionMessage, error)
	GetExpeditionMessages() ([]ogame.ExpeditionMessage, error)
	GetFleets(...Option) ([]ogame.Fleet, ogame.Slots)
	GetFleetsFromEventList() []ogame.Fleet
	GetItems(ogame.CelestialID) ([]ogame.Item, error)
	GetMoon(any) (Moon, error)
	GetMoons() []Moon
	GetPageContent(url.Values) ([]byte, error)
	GetPlanet(any) (Planet, error)
	GetPlanets() []Planet
	GetResearch() ogame.Researches
	GetSlots() ogame.Slots
	GetUserInfos() ogame.UserInfos
	HeadersForPage(url string) (http.Header, error)
	Highscore(category, typ, page int64) (ogame.Highscore, error)
	IsUnderAttack() (bool, error)
	Login() error
	LoginWithBearerToken(token string) (bool, error)
	LoginWithExistingCookies() (bool, error)
	Logout()
	OfferBuyMarketplace(itemID any, quantity, priceType, price, priceRange int64, celestialID ogame.CelestialID) error
	OfferSellMarketplace(itemID any, quantity, priceType, price, priceRange int64, celestialID ogame.CelestialID) error
	PostPageContent(url.Values, url.Values) ([]byte, error)
	RecruitOfficer(typ, days int64) error
	SendMessage(playerID int64, message string) error
	SendMessageAlliance(associationID int64, message string) error
	ServerTime() time.Time
	SetInitiator(initiator string) Prioritizable
	SetVacationMode() error
	Tx(clb func(tx Prioritizable) error) error
	UseDM(string, ogame.CelestialID) error

	// Planet or Moon functions
	Build(celestialID ogame.CelestialID, id ogame.ID, nbr int64) error
	BuildBuilding(celestialID ogame.CelestialID, buildingID ogame.ID) error
	BuildCancelable(ogame.CelestialID, ogame.ID) error
	BuildDefense(celestialID ogame.CelestialID, defenseID ogame.ID, nbr int64) error
	BuildProduction(celestialID ogame.CelestialID, id ogame.ID, nbr int64) error
	BuildShips(celestialID ogame.CelestialID, shipID ogame.ID, nbr int64) error
	BuildTechnology(celestialID ogame.CelestialID, technologyID ogame.ID) error
	CancelBuilding(ogame.CelestialID) error
	CancelLfBuilding(ogame.CelestialID) error
	CancelResearch(ogame.CelestialID) error
	ConstructionsBeingBuilt(ogame.CelestialID) (buildingID ogame.ID, buildingCountdown int64, researchID ogame.ID, researchCountdown int64, lfBuildingID ogame.ID, lfBuildingCountdown int64, lfResearchID ogame.ID, lfResearchCountdown int64)
	EnsureFleet(celestialID ogame.CelestialID, ships []ogame.Quantifiable, speed ogame.Speed, where ogame.Coordinate, mission ogame.MissionID, resources ogame.Resources, holdingTime, unionID int64) (ogame.Fleet, error)
	GetDefense(ogame.CelestialID, ...Option) (ogame.DefensesInfos, error)
	GetFacilities(ogame.CelestialID, ...Option) (ogame.Facilities, error)
	GetLfBuildings(ogame.CelestialID, ...Option) (ogame.LfBuildings, error)
	GetLfResearch(ogame.CelestialID, ...Option) (ogame.LfResearches, error)
	GetProduction(ogame.CelestialID) ([]ogame.Quantifiable, int64, error)
	GetResources(ogame.CelestialID) (ogame.Resources, error)
	GetResourcesBuildings(ogame.CelestialID, ...Option) (ogame.ResourcesBuildings, error)
	GetResourcesDetails(ogame.CelestialID) (ogame.ResourcesDetails, error)
	GetShips(ogame.CelestialID, ...Option) (ogame.ShipsInfos, error)
	GetTechs(celestialID ogame.CelestialID) (ogame.ResourcesBuildings, ogame.Facilities, ogame.ShipsInfos, ogame.DefensesInfos, ogame.Researches, ogame.LfBuildings, error)
	SendFleet(celestialID ogame.CelestialID, ships []ogame.Quantifiable, speed ogame.Speed, where ogame.Coordinate, mission ogame.MissionID, resources ogame.Resources, holdingTime, unionID int64) (ogame.Fleet, error)
	TearDown(celestialID ogame.CelestialID, id ogame.ID) error
	TechnologyDetails(celestialID ogame.CelestialID, id ogame.ID) (ogame.TechnologyDetails, error)

	// Planet specific functions
	DestroyRockets(ogame.PlanetID, int64, int64) error
	GetResourceSettings(ogame.PlanetID, ...Option) (ogame.ResourceSettings, error)
	GetResourcesProductions(ogame.PlanetID) (ogame.Resources, error)
	GetResourcesProductionsLight(ogame.ResourcesBuildings, ogame.Researches, ogame.ResourceSettings, ogame.Temperature) ogame.Resources
	SendIPM(ogame.PlanetID, ogame.Coordinate, int64, ogame.ID) (int64, error)
	SetResourceSettings(ogame.PlanetID, ogame.ResourceSettings) error

	// Moon specific functions
	JumpGate(origin, dest ogame.MoonID, ships ogame.ShipsInfos) (bool, int64, error)
	JumpGateDestinations(origin ogame.MoonID) ([]ogame.MoonID, int64, error)
	Phalanx(ogame.MoonID, ogame.Coordinate) ([]ogame.Fleet, error)
	UnsafePhalanx(ogame.MoonID, ogame.Coordinate) ([]ogame.Fleet, error)
}

Prioritizable list of all actions that needs to communicate with ogame server. These actions can also be prioritized.

type Prioritize

type Prioritize struct {
	// contains filtered or unexported fields
}

Prioritize ...

func (*Prioritize) Abandon

func (b *Prioritize) Abandon(v any) error

Abandon a planet. Warning: this is irreversible

func (*Prioritize) ActivateItem

func (b *Prioritize) ActivateItem(ref string, celestialID ogame.CelestialID) error

ActivateItem activate an item

func (*Prioritize) Begin

func (b *Prioritize) Begin() Prioritizable

Begin a new transaction. "Done" must be called to release the lock.

func (*Prioritize) BeginNamed

func (b *Prioritize) BeginNamed(name string) Prioritizable

BeginNamed begins a new transaction with a name. "Done" must be called to release the lock.

func (*Prioritize) Build

func (b *Prioritize) Build(celestialID ogame.CelestialID, id ogame.ID, nbr int64) error

Build builds any ogame objects (building, technology, ship, defence)

func (*Prioritize) BuildBuilding

func (b *Prioritize) BuildBuilding(celestialID ogame.CelestialID, buildingID ogame.ID) error

BuildBuilding ensure what is being built is a building

func (*Prioritize) BuildCancelable

func (b *Prioritize) BuildCancelable(celestialID ogame.CelestialID, id ogame.ID) error

BuildCancelable builds any cancelable ogame objects (building, technology)

func (*Prioritize) BuildDefense

func (b *Prioritize) BuildDefense(celestialID ogame.CelestialID, defenseID ogame.ID, nbr int64) error

BuildDefense builds a defense unit

func (*Prioritize) BuildProduction

func (b *Prioritize) BuildProduction(celestialID ogame.CelestialID, id ogame.ID, nbr int64) error

BuildProduction builds any line production ogame objects (ship, defence)

func (*Prioritize) BuildShips

func (b *Prioritize) BuildShips(celestialID ogame.CelestialID, shipID ogame.ID, nbr int64) error

BuildShips builds a ship unit

func (*Prioritize) BuildTechnology

func (b *Prioritize) BuildTechnology(celestialID ogame.CelestialID, technologyID ogame.ID) error

BuildTechnology ensure that we're trying to build a technology

func (*Prioritize) BuyMarketplace

func (b *Prioritize) BuyMarketplace(itemID int64, celestialID ogame.CelestialID) error

BuyMarketplace buy an item on the marketplace

func (*Prioritize) BuyOfferOfTheDay

func (b *Prioritize) BuyOfferOfTheDay() error

BuyOfferOfTheDay buys the offer of the day.

func (*Prioritize) CancelBuilding

func (b *Prioritize) CancelBuilding(celestialID ogame.CelestialID) error

CancelBuilding cancel the construction of a building on a specified planet

func (*Prioritize) CancelFleet

func (b *Prioritize) CancelFleet(fleetID ogame.FleetID) error

CancelFleet cancel a fleet

func (*Prioritize) CancelLfBuilding

func (b *Prioritize) CancelLfBuilding(celestialID ogame.CelestialID) error

CancelLfBuilding cancel the construction of a lifeform building on a specified planet

func (*Prioritize) CancelResearch

func (b *Prioritize) CancelResearch(celestialID ogame.CelestialID) error

CancelResearch cancel the research

func (*Prioritize) CollectAllMarketplaceMessages

func (b *Prioritize) CollectAllMarketplaceMessages() error

CollectAllMarketplaceMessages collect all marketplace messages

func (*Prioritize) CollectMarketplaceMessage

func (b *Prioritize) CollectMarketplaceMessage(msg ogame.MarketplaceMessage) error

CollectMarketplaceMessage collect marketplace message

func (*Prioritize) ConstructionsBeingBuilt

func (b *Prioritize) ConstructionsBeingBuilt(celestialID ogame.CelestialID) (ogame.ID, int64, ogame.ID, int64, ogame.ID, int64, ogame.ID, int64)

ConstructionsBeingBuilt returns the building & research being built, and the time remaining (secs)

func (*Prioritize) CreateUnion

func (b *Prioritize) CreateUnion(fleet ogame.Fleet, users []string) (int64, error)

CreateUnion creates a union

func (*Prioritize) DeleteAllMessagesFromTab

func (b *Prioritize) DeleteAllMessagesFromTab(tabID ogame.MessagesTabID) error

DeleteAllMessagesFromTab ...

func (*Prioritize) DeleteMessage

func (b *Prioritize) DeleteMessage(msgID int64) error

DeleteMessage deletes a message from the mail box

func (*Prioritize) DestroyRockets

func (b *Prioritize) DestroyRockets(planetID ogame.PlanetID, abm, ipm int64) error

DestroyRockets destroys anti-ballistic & inter-planetary missiles

func (*Prioritize) DoAuction

func (b *Prioritize) DoAuction(bid map[ogame.CelestialID]ogame.Resources) error

DoAuction ...

func (*Prioritize) Done

func (b *Prioritize) Done()

Done terminate the transaction, release the lock.

func (*Prioritize) EnsureFleet

func (b *Prioritize) EnsureFleet(celestialID ogame.CelestialID, ships []ogame.Quantifiable, speed ogame.Speed, where ogame.Coordinate,
	mission ogame.MissionID, resources ogame.Resources, holdingTime, unionID int64) (ogame.Fleet, error)

EnsureFleet either sends all the requested ships or fail

func (*Prioritize) FlightTime

func (b *Prioritize) FlightTime(origin, destination ogame.Coordinate, speed ogame.Speed, ships ogame.ShipsInfos, missionID ogame.MissionID) (secs, fuel int64)

FlightTime calculate flight time and fuel needed

func (*Prioritize) GalaxyInfos

func (b *Prioritize) GalaxyInfos(galaxy, system int64, options ...Option) (ogame.SystemInfos, error)

GalaxyInfos get information of all planets and moons of a solar system

func (*Prioritize) GetActiveItems

func (b *Prioritize) GetActiveItems(celestialID ogame.CelestialID) ([]ogame.ActiveItem, error)

GetActiveItems ...

func (*Prioritize) GetAllResources

func (b *Prioritize) GetAllResources() (map[ogame.CelestialID]ogame.Resources, error)

GetAllResources ...

func (*Prioritize) GetAttacks

func (b *Prioritize) GetAttacks(opts ...Option) ([]ogame.AttackEvent, error)

GetAttacks get enemy fleets attacking you

func (*Prioritize) GetAuction

func (b *Prioritize) GetAuction() (ogame.Auction, error)

GetAuction ...

func (*Prioritize) GetCachedResearch

func (b *Prioritize) GetCachedResearch() ogame.Researches

GetCachedResearch gets the player cached researches information

func (*Prioritize) GetCelestial

func (b *Prioritize) GetCelestial(v any) (Celestial, error)

GetCelestial get the player's planet/moon using the coordinate

func (*Prioritize) GetCelestials

func (b *Prioritize) GetCelestials() ([]Celestial, error)

GetCelestials get the player's planets & moons

func (*Prioritize) GetCombatReportSummaryFor

func (b *Prioritize) GetCombatReportSummaryFor(coord ogame.Coordinate) (ogame.CombatReportSummary, error)

GetCombatReportSummaryFor gets the latest combat report for a given coordinate

func (*Prioritize) GetDMCosts

func (b *Prioritize) GetDMCosts(celestialID ogame.CelestialID) (ogame.DMCosts, error)

GetDMCosts returns fast build with DM information

func (*Prioritize) GetDefense

func (b *Prioritize) GetDefense(celestialID ogame.CelestialID, options ...Option) (ogame.DefensesInfos, error)

GetDefense gets all the defenses units information of a planet Fails if planetID is invalid

func (*Prioritize) GetEmpire

func (b *Prioritize) GetEmpire(celestialType ogame.CelestialType) ([]ogame.EmpireCelestial, error)

GetEmpire (Commander only)

func (*Prioritize) GetEmpireJSON

func (b *Prioritize) GetEmpireJSON(nbr int64) (any, error)

GetEmpireJSON retrieves JSON from Empire page (Commander only).

func (*Prioritize) GetEspionageReport

func (b *Prioritize) GetEspionageReport(msgID int64) (ogame.EspionageReport, error)

GetEspionageReport gets a detailed espionage report

func (*Prioritize) GetEspionageReportFor

func (b *Prioritize) GetEspionageReportFor(coord ogame.Coordinate) (ogame.EspionageReport, error)

GetEspionageReportFor gets the latest espionage report for a given coordinate

func (*Prioritize) GetEspionageReportMessages

func (b *Prioritize) GetEspionageReportMessages() ([]ogame.EspionageReportSummary, error)

GetEspionageReportMessages gets the summary of each espionage reports

func (*Prioritize) GetExpeditionMessageAt

func (b *Prioritize) GetExpeditionMessageAt(t time.Time) (ogame.ExpeditionMessage, error)

GetExpeditionMessageAt gets the expedition message for time t

func (*Prioritize) GetExpeditionMessages

func (b *Prioritize) GetExpeditionMessages() ([]ogame.ExpeditionMessage, error)

GetExpeditionMessages gets the expedition messages

func (*Prioritize) GetFacilities

func (b *Prioritize) GetFacilities(celestialID ogame.CelestialID, options ...Option) (ogame.Facilities, error)

GetFacilities gets all facilities information of a planet

func (*Prioritize) GetFleets

func (b *Prioritize) GetFleets(opts ...Option) ([]ogame.Fleet, ogame.Slots)

GetFleets get the player's own fleets activities

func (*Prioritize) GetFleetsFromEventList

func (b *Prioritize) GetFleetsFromEventList() []ogame.Fleet

GetFleetsFromEventList get the player's own fleets activities

func (*Prioritize) GetItems

func (b *Prioritize) GetItems(celestialID ogame.CelestialID) ([]ogame.Item, error)

GetItems get all items information

func (*Prioritize) GetLfBuildings

func (b *Prioritize) GetLfBuildings(celestialID ogame.CelestialID, options ...Option) (ogame.LfBuildings, error)

GetLfBuildings ...

func (*Prioritize) GetLfResearch

func (b *Prioritize) GetLfResearch(celestialID ogame.CelestialID, options ...Option) (ogame.LfResearches, error)

GetLfResearch ...

func (*Prioritize) GetMoon

func (b *Prioritize) GetMoon(v any) (Moon, error)

GetMoon gets infos for moonID

func (*Prioritize) GetMoons

func (b *Prioritize) GetMoons() []Moon

GetMoons returns the user moons

func (*Prioritize) GetPageContent

func (b *Prioritize) GetPageContent(vals url.Values) ([]byte, error)

GetPageContent gets the html for a specific ogame page

func (*Prioritize) GetPlanet

func (b *Prioritize) GetPlanet(v any) (Planet, error)

GetPlanet gets infos for planetID Fails if planetID is invalid

func (*Prioritize) GetPlanets

func (b *Prioritize) GetPlanets() []Planet

GetPlanets returns the user planets

func (*Prioritize) GetProduction

func (b *Prioritize) GetProduction(celestialID ogame.CelestialID) ([]ogame.Quantifiable, int64, error)

GetProduction get what is in the production queue. (ships & defense being built)

func (*Prioritize) GetResearch

func (b *Prioritize) GetResearch() ogame.Researches

GetResearch gets the player researches information

func (*Prioritize) GetResourceSettings

func (b *Prioritize) GetResourceSettings(planetID ogame.PlanetID, options ...Option) (ogame.ResourceSettings, error)

GetResourceSettings gets the resources settings for specified planetID

func (*Prioritize) GetResources

func (b *Prioritize) GetResources(celestialID ogame.CelestialID) (ogame.Resources, error)

GetResources gets user resources

func (*Prioritize) GetResourcesBuildings

func (b *Prioritize) GetResourcesBuildings(celestialID ogame.CelestialID, options ...Option) (ogame.ResourcesBuildings, error)

GetResourcesBuildings gets the resources buildings levels

func (*Prioritize) GetResourcesDetails

func (b *Prioritize) GetResourcesDetails(celestialID ogame.CelestialID) (ogame.ResourcesDetails, error)

GetResourcesDetails gets user resources

func (*Prioritize) GetResourcesProductions

func (b *Prioritize) GetResourcesProductions(planetID ogame.PlanetID) (ogame.Resources, error)

GetResourcesProductions gets the planet resources production

func (*Prioritize) GetResourcesProductionsLight

func (b *Prioritize) GetResourcesProductionsLight(resBuildings ogame.ResourcesBuildings, researches ogame.Researches,
	resSettings ogame.ResourceSettings, temp ogame.Temperature) ogame.Resources

GetResourcesProductionsLight gets the planet resources production

func (*Prioritize) GetShips

func (b *Prioritize) GetShips(celestialID ogame.CelestialID, options ...Option) (ogame.ShipsInfos, error)

GetShips gets all ships units information of a planet

func (*Prioritize) GetSlots

func (b *Prioritize) GetSlots() ogame.Slots

GetSlots gets the player current and total slots information

func (*Prioritize) GetTechs

GetTechs gets a celestial supplies/facilities/ships/researches

func (*Prioritize) GetUserInfos

func (b *Prioritize) GetUserInfos() ogame.UserInfos

GetUserInfos gets the user information

func (*Prioritize) HeadersForPage

func (b *Prioritize) HeadersForPage(url string) (http.Header, error)

HeadersForPage gets the headers for a specific ogame page

func (*Prioritize) Highscore

func (b *Prioritize) Highscore(category, typ, page int64) (ogame.Highscore, error)

Highscore ...

func (*Prioritize) IsUnderAttack

func (b *Prioritize) IsUnderAttack() (bool, error)

IsUnderAttack returns true if the user is under attack, false otherwise

func (*Prioritize) JumpGate

func (b *Prioritize) JumpGate(origin, dest ogame.MoonID, ships ogame.ShipsInfos) (bool, int64, error)

JumpGate sends ships through a jump gate.

func (*Prioritize) JumpGateDestinations

func (b *Prioritize) JumpGateDestinations(origin ogame.MoonID) ([]ogame.MoonID, int64, error)

JumpGateDestinations returns available destinations for jump gate.

func (*Prioritize) Login

func (b *Prioritize) Login() error

Login to ogame server Can fail with BadCredentialsError

func (*Prioritize) LoginWithBearerToken

func (b *Prioritize) LoginWithBearerToken(token string) (bool, error)

LoginWithBearerToken to ogame server reusing existing token Returns either or not the bot logged in using the existing cookies

func (*Prioritize) LoginWithExistingCookies

func (b *Prioritize) LoginWithExistingCookies() (bool, error)

LoginWithExistingCookies to ogame server reusing existing cookies Returns either or not the bot logged in using the existing cookies

func (*Prioritize) Logout

func (b *Prioritize) Logout()

Logout the bot from ogame server

func (*Prioritize) OfferBuyMarketplace

func (b *Prioritize) OfferBuyMarketplace(itemID any, quantity, priceType, price, priceRange int64, celestialID ogame.CelestialID) error

OfferBuyMarketplace ...

func (*Prioritize) OfferSellMarketplace

func (b *Prioritize) OfferSellMarketplace(itemID any, quantity, priceType, price, priceRange int64, celestialID ogame.CelestialID) error

OfferSellMarketplace ...

func (*Prioritize) Phalanx

func (b *Prioritize) Phalanx(moonID ogame.MoonID, coord ogame.Coordinate) ([]ogame.Fleet, error)

Phalanx scan a coordinate from a moon to get fleets information IMPORTANT: My account was instantly banned when I scanned an invalid coordinate. IMPORTANT: This function DOES validate that the coordinate is a valid planet in range of phalanx

and that you have enough deuterium.

func (*Prioritize) PostPageContent

func (b *Prioritize) PostPageContent(vals, payload url.Values) ([]byte, error)

PostPageContent make a post request to ogame server This is useful when simulating a web browser

func (*Prioritize) RecruitOfficer

func (b *Prioritize) RecruitOfficer(typ, days int64) error

RecruitOfficer recruit an officer. Typ 2: Commander, 3: Admiral, 4: Engineer, 5: Geologist, 6: Technocrat Days: 7 or 90

func (*Prioritize) SendFleet

func (b *Prioritize) SendFleet(celestialID ogame.CelestialID, ships []ogame.Quantifiable, speed ogame.Speed, where ogame.Coordinate,
	mission ogame.MissionID, resources ogame.Resources, holdingTime, unionID int64) (ogame.Fleet, error)

SendFleet sends a fleet

func (*Prioritize) SendIPM

func (b *Prioritize) SendIPM(planetID ogame.PlanetID, coord ogame.Coordinate, nbr int64, priority ogame.ID) (int64, error)

SendIPM sends IPM

func (*Prioritize) SendMessage

func (b *Prioritize) SendMessage(playerID int64, message string) error

SendMessage sends a message to playerID

func (*Prioritize) SendMessageAlliance

func (b *Prioritize) SendMessageAlliance(associationID int64, message string) error

SendMessageAlliance sends a message to associationID

func (*Prioritize) ServerTime

func (b *Prioritize) ServerTime() time.Time

ServerTime returns server time Timezone is OGT (OGame Time zone)

func (*Prioritize) SetInitiator

func (b *Prioritize) SetInitiator(initiator string) Prioritizable

SetInitiator ...

func (*Prioritize) SetResourceSettings

func (b *Prioritize) SetResourceSettings(planetID ogame.PlanetID, settings ogame.ResourceSettings) error

SetResourceSettings set the resources settings on a planet

func (*Prioritize) SetTaskDoneCh

func (b *Prioritize) SetTaskDoneCh(ch chan struct{})

func (*Prioritize) SetVacationMode

func (b *Prioritize) SetVacationMode() error

SetVacationMode puts account in vacation mode

func (*Prioritize) TearDown

func (b *Prioritize) TearDown(celestialID ogame.CelestialID, id ogame.ID) error

TearDown tears down any ogame building

func (*Prioritize) TechnologyDetails

func (b *Prioritize) TechnologyDetails(celestialID ogame.CelestialID, id ogame.ID) (ogame.TechnologyDetails, error)

TechnologyDetails extract details from ajax window when clicking supplies/facilities/techs/lf...

func (*Prioritize) Tx

func (b *Prioritize) Tx(clb func(Prioritizable) error) error

Tx locks the bot during the transaction and ensure the lock is released afterward

func (*Prioritize) UnsafePhalanx

func (b *Prioritize) UnsafePhalanx(moonID ogame.MoonID, coord ogame.Coordinate) ([]ogame.Fleet, error)

UnsafePhalanx same as Phalanx but does not perform any input validation.

func (*Prioritize) UseDM

func (b *Prioritize) UseDM(typ string, celestialID ogame.CelestialID) error

UseDM use dark matter to fast build

type RegisterError

type RegisterError struct{ ErrorString string }

func (*RegisterError) Error

func (e *RegisterError) Error() string

type Server

type Server struct {
	Language      string
	Number        int64
	AccountGroup  string
	Name          string
	PlayerCount   int64
	PlayersOnline int64
	Opened        string
	StartDate     string
	EndDate       *string
	ServerClosed  int64
	Prefered      int64
	SignupClosed  int64
	Settings      struct {
		AKS                      int64
		FleetSpeed               int64
		WreckField               int64
		ServerLabel              string
		EconomySpeed             any // can be 8 or "x8"
		PlanetFields             int64
		UniverseSize             int64 // Nb of galaxies
		ServerCategory           string
		EspionageProbeRaids      int64
		PremiumValidationGift    int64
		DebrisFieldFactorShips   int64
		DebrisFieldFactorDefence int64
	}
}

Server ogame information for their servers

func GetServers

func GetServers(lobby string, client httpclient.IHttpClient, ctx context.Context) ([]Server, error)

type ServerData

type ServerData struct {
	Name                          string  `xml:"name"`                          // Europa
	Number                        int64   `xml:"number"`                        // 157
	Language                      string  `xml:"language"`                      // ru
	Timezone                      string  `xml:"timezone"`                      // Europe/Moscow
	TimezoneOffset                string  `xml:"timezoneOffset"`                // +03:00
	Domain                        string  `xml:"domain"`                        // s157-ru.ogame.gameforge.com
	Version                       string  `xml:"version"`                       // 6.8.8-pl2
	Speed                         int64   `xml:"speed"`                         // 6
	SpeedFleetPeaceful            int64   `xml:"speedFleetPeaceful"`            // 1
	SpeedFleetWar                 int64   `xml:"speedFleetWar"`                 // 1
	SpeedFleetHolding             int64   `xml:"speedFleetHolding"`             // 1
	Galaxies                      int64   `xml:"galaxies"`                      // 4
	Systems                       int64   `xml:"systems"`                       // 499
	ACS                           bool    `xml:"acs"`                           // 1
	RapidFire                     bool    `xml:"rapidFire"`                     // 1
	DefToTF                       bool    `xml:"defToTF"`                       // 0
	DebrisFactor                  float64 `xml:"debrisFactor"`                  // 0.5
	DebrisFactorDef               float64 `xml:"debrisFactorDef"`               // 0
	RepairFactor                  float64 `xml:"repairFactor"`                  // 0.7
	NewbieProtectionLimit         int64   `xml:"newbieProtectionLimit"`         // 500000
	NewbieProtectionHigh          int64   `xml:"newbieProtectionHigh"`          // 50000
	TopScore                      float64 `xml:"topScore"`                      // 60259362 / 1.0363090034999E+17
	BonusFields                   int64   `xml:"bonusFields"`                   // 30
	DonutGalaxy                   bool    `xml:"donutGalaxy"`                   // 1
	DonutSystem                   bool    `xml:"donutSystem"`                   // 1
	WfEnabled                     bool    `xml:"wfEnabled"`                     // 1 (WreckField)
	WfMinimumRessLost             int64   `xml:"wfMinimumRessLost"`             // 150000
	WfMinimumLossPercentage       int64   `xml:"wfMinimumLossPercentage"`       // 5
	WfBasicPercentageRepairable   int64   `xml:"wfBasicPercentageRepairable"`   // 45
	GlobalDeuteriumSaveFactor     float64 `xml:"globalDeuteriumSaveFactor"`     // 0.5
	Bashlimit                     int64   `xml:"bashlimit"`                     // 0
	ProbeCargo                    int64   `xml:"probeCargo"`                    // 5
	ResearchDurationDivisor       int64   `xml:"researchDurationDivisor"`       // 2
	DarkMatterNewAcount           int64   `xml:"darkMatterNewAcount"`           // 8000
	CargoHyperspaceTechMultiplier int64   `xml:"cargoHyperspaceTechMultiplier"` // 5
	SpeedFleet                    int64   `xml:"speedFleet"`                    // 6 // Deprecated in 8.1.0
}

ServerData represent api result from https://s157-ru.ogame.gameforge.com/api/serverData.xml

func GetServerData

func GetServerData(client httpclient.IHttpClient, ctx context.Context, serverNumber int64, serverLang string) (ServerData, error)

GetServerData gets the server data from xml api

type Wrapper

type Wrapper interface {
	Prioritizable
	AddAccount(number int, lang string) (*AddAccountRes, error)
	BytesDownloaded() int64
	BytesUploaded() int64
	CharacterClass() ogame.CharacterClass
	ConstructionTime(id ogame.ID, nbr int64, facilities ogame.Facilities) time.Duration
	Disable()
	Distance(origin, destination ogame.Coordinate) int64
	Enable()
	FleetDeutSaveFactor() float64
	GetCachedCelestial(any) Celestial
	GetCachedCelestials() []Celestial
	GetCachedMoons() []Moon
	GetCachedPlanets() []Planet
	GetCachedPlayer() ogame.UserInfos
	GetCachedPreferences() ogame.Preferences
	GetClient() *httpclient.Client
	GetExtractor() extractor.Extractor
	GetLanguage() string
	GetNbSystems() int64
	GetPublicIP() (string, error)
	GetResearchSpeed() int64
	GetServer() Server
	GetServerData() ServerData
	GetSession() string
	GetState() (bool, string)
	GetTasks() taskRunner.TasksOverview
	GetUniverseName() string
	GetUniverseSpeed() int64
	GetUniverseSpeedFleet() int64
	GetUsername() string
	IsConnected() bool
	IsDonutGalaxy() bool
	IsDonutSystem() bool
	IsEnabled() bool
	IsLocked() bool
	IsLoggedIn() bool
	IsPioneers() bool
	IsV7() bool
	IsV9() bool
	IsVacationModeEnabled() bool
	Location() *time.Location
	OnStateChange(clb func(locked bool, actor string))
	Quiet(bool)
	ReconnectChat() bool
	RegisterAuctioneerCallback(func(any))
	RegisterChatCallback(func(ogame.ChatMsg))
	RegisterHTMLInterceptor(func(method, url string, params, payload url.Values, pageHTML []byte))
	RegisterWSCallback(string, func([]byte))
	RemoveWSCallback(string)
	ServerURL() string
	ServerVersion() string
	SetClient(*httpclient.Client)
	SetGetServerDataWrapper(func(func() (ServerData, error)) (ServerData, error))
	SetLoginWrapper(func(func() (bool, error)) error)
	SetOGameCredentials(username, password, otpSecret, bearerToken string)
	SetProxy(proxyAddress, username, password, proxyType string, loginOnly bool, config *tls.Config) error
	SetUserAgent(newUserAgent string)
	ValidateAccount(code string) error
	WithPriority(priority taskRunner.Priority) Prioritizable
}

Wrapper all available functions to control ogame bot

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL