Documentation ¶
Index ¶
- type Building
- type BuildingInfo
- type Ennoblement
- type OpponentsDefeated
- type Player
- type PlayerSnapshot
- type Server
- type ServerConfig
- type ServerConfigAlly
- type ServerConfigBuild
- type ServerConfigBuildings
- type ServerConfigCommands
- type ServerConfigCoord
- type ServerConfigGame
- type ServerConfigMisc
- type ServerConfigNewbie
- type ServerConfigNight
- type ServerConfigSitter
- type ServerConfigSleep
- type ServerConfigSnob
- type ServerConfigWin
- type Tribe
- type TribeChange
- type TribeSnapshot
- type Unit
- type UnitInfo
- type Version
- type Village
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildingInfo ¶
type BuildingInfo struct { Main Building Barracks Building Stable Building Garage Building Watchtower Building Snob Building Smith Building Place Building Statue Building Market Building Wood Building Stone Building Iron Building Farm Building Storage Building Hide Building Wall Building }
func NewBuildingInfo ¶
func NewBuildingInfo(info domain.BuildingInfo) BuildingInfo
func (BuildingInfo) ToDomain ¶
func (b BuildingInfo) ToDomain() domain.BuildingInfo
type Ennoblement ¶
type Ennoblement struct { bun.BaseModel `bun:"table:ennoblements,alias:ennoblement"` ID int64 `bun:"id,pk,autoincrement,identity"` ServerKey string `bun:"server_key,nullzero,type:varchar(100)"` VillageID int64 `bun:"village_id,nullzero,notnull"` Village Village `bun:"village,rel:belongs-to,join:village_id=id,join:server_key=server_key"` NewOwnerID int64 `bun:"new_owner_id,nullzero"` NewOwner Player `bun:"new_owner,rel:belongs-to,join:new_owner_id=id,join:server_key=server_key"` NewTribeID int64 `bun:"new_tribe_id,nullzero"` NewTribe Tribe `bun:"new_tribe,rel:belongs-to,join:new_tribe_id=id,join:server_key=server_key"` OldOwnerID int64 `bun:"old_owner_id,nullzero"` OldOwner Player `bun:"old_owner,rel:belongs-to,join:old_owner_id=id,join:server_key=server_key"` OldTribeID int64 `bun:"old_tribe_id,nullzero"` OldTribe Tribe `bun:"old_tribe,rel:belongs-to,join:old_tribe_id=id,join:server_key=server_key"` Points int64 `bun:"points,default:0"` CreatedAt time.Time `bun:"created_at,nullzero,notnull,default:current_timestamp"` }
func NewEnnoblement ¶
func NewEnnoblement(p domain.CreateEnnoblementParams) Ennoblement
func (Ennoblement) ToDomain ¶
func (e Ennoblement) ToDomain() domain.Ennoblement
func (Ennoblement) ToDomainWithRelations ¶ added in v0.2.0
func (e Ennoblement) ToDomainWithRelations() domain.EnnoblementWithRelations
type OpponentsDefeated ¶
type OpponentsDefeated struct { RankAtt int64 `bun:"rank_att,default:0"` ScoreAtt int64 `bun:"score_att,default:0"` RankDef int64 `bun:"rank_def,default:0"` ScoreDef int64 `bun:"score_def,default:0"` RankSup int64 `bun:"rank_sup,default:0"` ScoreSup int64 `bun:"score_sup,default:0"` RankTotal int64 `bun:"rank_total,default:0"` ScoreTotal int64 `bun:"score_total,default:0"` }
type Player ¶
type Player struct { bun.BaseModel `bun:"table:players,alias:player"` ID int64 `bun:"id,nullzero,pk"` ServerKey string `bun:"server_key,nullzero,pk,type:varchar(100)"` Server Server `bun:"server,rel:belongs-to,join:server_key=key"` Name string `bun:"name,nullzero,notnull,type:varchar(150)"` NumVillages int64 `bun:"num_villages,default:0"` Points int64 `bun:"points,default:0"` Rank int64 `bun:"rank,default:0"` TribeID int64 `bun:"tribe_id,nullzero"` Tribe Tribe `bun:"tribe,rel:belongs-to,join:tribe_id=id,join:server_key=server_key"` ProfileURL string `bun:"profile_url,nullzero,type:varchar(150)"` BestRank int64 `bun:"best_rank,default:999999"` BestRankAt time.Time `bun:"best_rank_at,nullzero,notnull,default:current_timestamp"` MostPoints int64 `bun:"most_points,default:0"` MostPointsAt time.Time `bun:"most_points_at,nullzero,notnull,default:current_timestamp"` MostVillages int64 `bun:"most_villages,default:0"` MostVillagesAt time.Time `bun:"most_villages_at,nullzero,notnull,default:current_timestamp"` LastActivityAt time.Time `bun:"last_activity_at,nullzero,notnull,default:current_timestamp"` CreatedAt time.Time `bun:"created_at,nullzero,notnull,default:current_timestamp"` DeletedAt time.Time `bun:"deleted_at,nullzero"` OpponentsDefeated }
func NewPlayer ¶
func NewPlayer(p domain.CreatePlayerParams) Player
func (Player) ToDomainWithRelations ¶ added in v0.2.0
func (p Player) ToDomainWithRelations() domain.PlayerWithRelations
func (Player) ToMeta ¶ added in v0.2.0
func (p Player) ToMeta() domain.PlayerMeta
func (Player) ToMetaWithRelations ¶ added in v0.2.0
func (p Player) ToMetaWithRelations() domain.PlayerMetaWithRelations
type PlayerSnapshot ¶ added in v0.3.0
type PlayerSnapshot struct { bun.BaseModel `bun:"table:player_snapshots,alias:ps"` ID int64 `bun:"id,pk,autoincrement,identity"` PlayerID int64 `bun:"player_id,notnull,nullzero,unique:player_snapshots_player_id_server_key_date_key"` NumVillages int64 `bun:"num_villages,default:0"` Points int64 `bun:"points,default:0"` Rank int64 `bun:"rank,default:0"` TribeID int64 `bun:"tribe_id,nullzero"` Tribe Tribe `bun:"tribe,rel:belongs-to,join:tribe_id=id,join:server_key=server_key"` ServerKey string `bun:"server_key,notnull,nullzero,type:varchar(100),unique:player_snapshots_player_id_server_key_date_key"` Date time.Time `bun:"date,notnull,nullzero,type:date,unique:player_snapshots_player_id_server_key_date_key"` CreatedAt time.Time `bun:"created_at,nullzero,notnull,default:current_timestamp"` OpponentsDefeated }
func NewPlayerSnapshot ¶ added in v0.3.0
func NewPlayerSnapshot(p domain.CreatePlayerSnapshotParams) PlayerSnapshot
func (PlayerSnapshot) ToDomain ¶ added in v0.3.0
func (p PlayerSnapshot) ToDomain() domain.PlayerSnapshot
func (PlayerSnapshot) ToDomainWithRelations ¶ added in v0.7.0
func (p PlayerSnapshot) ToDomainWithRelations() domain.PlayerSnapshotWithRelations
type Server ¶
type Server struct { bun.BaseModel `bun:"table:servers,alias:server"` Key string `bun:"key,nullzero,pk,type:varchar(100)"` URL string `bun:"url,notnull,nullzero,type:varchar(255)"` Open bool `bun:"open,default:false"` Special bool `bun:"special,default:false"` NumPlayers int64 `bun:"num_players,default:0"` NumTribes int64 `bun:"num_tribes,default:0"` NumVillages int64 `bun:"num_villages,default:0"` NumPlayerVillages int64 `bun:"num_player_villages,default:0"` NumBarbarianVillages int64 `bun:"num_barbarian_villages,default:0"` NumBonusVillages int64 `bun:"num_bonus_villages,default:0"` Config ServerConfig `bun:"config"` BuildingInfo BuildingInfo `bun:"building_info"` UnitInfo UnitInfo `bun:"unit_info"` CreatedAt time.Time `bun:"created_at,nullzero,notnull,default:current_timestamp"` PlayerDataUpdatedAt time.Time `bun:"player_data_updated_at,nullzero"` PlayerSnapshotsCreatedAt time.Time `bun:"player_snapshots_created_at,nullzero"` TribeDataUpdatedAt time.Time `bun:"tribe_data_updated_at,nullzero"` TribeSnapshotsCreatedAt time.Time `bun:"tribe_snapshots_created_at,nullzero"` VillageDataUpdatedAt time.Time `bun:"village_data_updated_at,nullzero"` EnnoblementDataUpdatedAt time.Time `bun:"ennoblement_data_updated_at,nullzero"` VersionCode string `bun:"version_code,nullzero,notnull,type:varchar(6)"` }
func (Server) ToMeta ¶ added in v0.8.3
func (s Server) ToMeta() domain.ServerMeta
type ServerConfig ¶
type ServerConfig struct { Speed float64 UnitSpeed float64 Moral int16 Build ServerConfigBuild Misc ServerConfigMisc Commands ServerConfigCommands Newbie ServerConfigNewbie Game ServerConfigGame Buildings ServerConfigBuildings Snob ServerConfigSnob Ally ServerConfigAlly Coord ServerConfigCoord Sitter ServerConfigSitter Sleep ServerConfigSleep Night ServerConfigNight Win ServerConfigWin }
func NewServerConfig ¶
func NewServerConfig(cfg domain.ServerConfig) ServerConfig
func (ServerConfig) ToDomain ¶
func (s ServerConfig) ToDomain() domain.ServerConfig
type ServerConfigAlly ¶
type ServerConfigAlly struct { NoHarm int8 NoOtherSupport int8 NoOtherSupportType int8 AllytimeSupport int32 NoLeave int8 NoJoin int8 Limit int16 FixedAllies int8 PointsMemberCount int32 WarsMemberRequirement int16 WarsPointsRequirement int32 WarsAutoacceptDays int16 Levels int8 XpRequirements string }
type ServerConfigBuild ¶
type ServerConfigBuild struct {
Destroy int8
}
type ServerConfigBuildings ¶
type ServerConfigBuildings struct { CustomMain int8 CustomFarm int8 CustomStorage int8 CustomPlace int8 CustomBarracks int8 CustomChurch int8 CustomSmith int8 CustomWood int8 CustomStone int8 CustomIron int8 CustomMarket int8 CustomStable int8 CustomWall int8 CustomGarage int8 CustomHide int8 CustomSnob int8 CustomStatue int8 CustomWatchtower int8 }
type ServerConfigCommands ¶
type ServerConfigCoord ¶
type ServerConfigGame ¶
type ServerConfigGame struct { BuildtimeFormula int8 Knight int8 KnightNewItems int8 Archer int8 Tech int8 FarmLimit int32 Church int8 Watchtower int8 Stronghold int8 FakeLimit float64 BarbarianRise float64 BarbarianShrink int8 BarbarianMaxPoints int32 Scavenging int8 Hauls int8 HaulsBase int32 HaulsMax int32 BaseProduction int32 Event int16 SuppressEvents int8 }
type ServerConfigMisc ¶
type ServerConfigNewbie ¶
type ServerConfigNight ¶
type ServerConfigSitter ¶
type ServerConfigSitter struct {
Allow int8
}
type ServerConfigSleep ¶
type ServerConfigSnob ¶
type ServerConfigWin ¶
type ServerConfigWin struct {
Check int16
}
type Tribe ¶
type Tribe struct { bun.BaseModel `bun:"table:tribes,alias:tribe"` ID int64 `bun:"id,nullzero,pk"` ServerKey string `bun:"server_key,nullzero,pk,type:varchar(100)"` Name string `bun:"name,nullzero,notnull,type:varchar(255)"` Tag string `bun:"tag,nullzero,notnull,type:varchar(10)"` NumMembers int64 `bun:"num_members,default:0"` NumVillages int64 `bun:"num_villages,default:0"` Points int64 `bun:"points,default:0"` AllPoints int64 `bun:"all_points,default:0"` Rank int64 `bun:"rank,default:0"` Dominance float64 `bun:"dominance,default:0"` ProfileURL string `bun:"profile_url,nullzero,type:varchar(150)"` BestRank int64 `bun:"best_rank,default:999999"` BestRankAt time.Time `bun:"best_rank_at,nullzero,notnull,default:current_timestamp"` MostPoints int64 `bun:"most_points,default:0"` MostPointsAt time.Time `bun:"most_points_at,nullzero,notnull,default:current_timestamp"` MostVillages int64 `bun:"most_villages,default:0"` MostVillagesAt time.Time `bun:"most_villages_at,nullzero,notnull,default:current_timestamp"` CreatedAt time.Time `bun:"created_at,nullzero,notnull,default:current_timestamp"` DeletedAt time.Time `bun:"deleted_at,nullzero"` OpponentsDefeated }
func NewTribe ¶
func NewTribe(p domain.CreateTribeParams) Tribe
type TribeChange ¶ added in v0.4.0
type TribeChange struct { bun.BaseModel `bun:"table:tribe_changes,alias:tc"` ID int64 `bun:"id,pk,autoincrement,identity"` PlayerID int64 `bun:"player_id,notnull,nullzero"` Player Player `bun:"player,rel:belongs-to,join:player_id=id,join:server_key=server_key"` NewTribeID int64 `bun:"new_tribe_id,nullzero"` NewTribe Tribe `bun:"new_tribe,rel:belongs-to,join:new_tribe_id=id,join:server_key=server_key"` OldTribeID int64 `bun:"old_tribe_id,nullzero"` OldTribe Tribe `bun:"old_tribe,rel:belongs-to,join:old_tribe_id=id,join:server_key=server_key"` ServerKey string `bun:"server_key,notnull,nullzero,type:varchar(100)"` CreatedAt time.Time `bun:"created_at,nullzero,notnull,default:current_timestamp"` }
func NewTribeChange ¶ added in v0.4.0
func NewTribeChange(p domain.CreateTribeChangeParams) TribeChange
func (TribeChange) ToDomain ¶ added in v0.4.0
func (t TribeChange) ToDomain() domain.TribeChange
func (TribeChange) ToDomainWithRelations ¶ added in v0.7.5
func (t TribeChange) ToDomainWithRelations() domain.TribeChangeWithRelations
type TribeSnapshot ¶ added in v0.3.0
type TribeSnapshot struct { bun.BaseModel `bun:"table:tribe_snapshots,alias:ts"` ID int64 `bun:"id,pk,autoincrement,identity"` TribeID int64 `bun:"tribe_id,notnull,nullzero,unique:tribe_snapshots_tribe_id_server_key_date_key"` ServerKey string `bun:"server_key,notnull,nullzero,type:varchar(100),unique:tribe_snapshots_tribe_id_server_key_date_key"` NumMembers int64 `bun:"num_members,default:0"` NumVillages int64 `bun:"num_villages,default:0"` Points int64 `bun:"points,default:0"` AllPoints int64 `bun:"all_points,default:0"` Rank int64 `bun:"rank,default:0"` Dominance float64 `bun:"dominance,default:0"` Date time.Time `bun:"date,notnull,nullzero,type:date,unique:tribe_snapshots_tribe_id_server_key_date_key"` CreatedAt time.Time `bun:"created_at,nullzero,notnull,default:current_timestamp"` OpponentsDefeated }
func NewTribeSnapshot ¶ added in v0.3.0
func NewTribeSnapshot(p domain.CreateTribeSnapshotParams) TribeSnapshot
func (TribeSnapshot) ToDomain ¶ added in v0.3.0
func (ps TribeSnapshot) ToDomain() domain.TribeSnapshot
type UnitInfo ¶
type UnitInfo struct { Spear Unit Sword Unit Axe Unit Archer Unit Spy Unit Light Unit Marcher Unit Heavy Unit Ram Unit Catapult Unit Knight Unit Snob Unit Militia Unit }
func NewUnitInfo ¶
type Version ¶
type Village ¶
type Village struct { bun.BaseModel `bun:"table:villages,alias:village"` ID int64 `bun:"id,nullzero,pk"` ServerKey string `bun:"server_key,nullzero,pk,type:varchar(100)"` Name string `bun:"name,nullzero,notnull,type:varchar(150)"` Points int64 `bun:"points,default:0"` X int64 `bun:"x,default:0"` Y int64 `bun:"y,default:0"` Continent string `bun:"continent,type:varchar(5)"` Bonus int64 `bun:"bonus,default:0"` PlayerID int64 `bun:"player_id,nullzero"` Player Player `bun:"player,rel:belongs-to,join:player_id=id,join:server_key=server_key"` ProfileURL string `bun:"profile_url,nullzero,type:varchar(150)"` CreatedAt time.Time `bun:"created_at,nullzero,notnull,default:current_timestamp"` }
func NewVillage ¶
func NewVillage(p domain.CreateVillageParams) Village
func (Village) ToDomainWithRelations ¶ added in v0.2.0
func (v Village) ToDomainWithRelations() domain.VillageWithRelations
func (Village) ToMeta ¶ added in v0.2.0
func (v Village) ToMeta() domain.VillageMeta
Click to show internal directories.
Click to hide internal directories.