orm

package
v0.0.0-...-5c5ef0c Latest Latest
Warning

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

Go to latest
Published: May 10, 2026 License: GPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PermissionOverrideAllow = "allow"
	PermissionOverrideDeny  = "deny"
)
View Source
const (
	MSG_TYPE_BANNED  = 100
	MSG_ACTOBSS_WORD = 1000 // litterally no idea wtf this is
	MSG_TYPE_NORMAL  = 1
)
View Source
const (
	ActivityTaskProgressModeSet    = uint32(0)
	ActivityTaskProgressModeAppend = uint32(1)
)
View Source
const (
	CommanderCatteryOpClean = uint32(1)
	CommanderCatteryOpFeed  = uint32(2)
	CommanderCatteryOpPlay  = uint32(3)
)
View Source
const (
	TaskProgressUpdate = uint32(0)
	TaskProgressAppend = uint32(1)
)
View Source
const (
	Dorm3dInstagramOpRead  uint32 = 3
	Dorm3dInstagramOpLike  uint32 = 4
	Dorm3dInstagramOpShare uint32 = 5
	Dorm3dInstagramOpExit  uint32 = 6
)
View Source
const (
	GuildDutyCommander uint32 = 1
	GuildDutyDeputy    uint32 = 2
	GuildDutyOrdinary  uint32 = 4
	GuildDutyRecruit   uint32 = 5
)
View Source
const (
	GuildCapitalLogCategoryIncrease = uint32(1)
	GuildCapitalLogCategoryDecrease = uint32(2)
	GuildCapitalLogCategoryOther    = uint32(3)
)
View Source
const (
	UserRegistrationStatusPending  = "pending"
	UserRegistrationStatusConsumed = "consumed"
	UserRegistrationStatusExpired  = "expired"
)
View Source
const DefaultMetaTacticsSwitchCount uint32 = 3
View Source
const GuildAssaultRecommendationLimit = uint32(9)

Variables

View Source
var (
	ErrDorm3dShipNotFound         = errors.New("dorm3d ship not found")
	ErrDorm3dRoomNotFound         = errors.New("dorm3d room not found")
	ErrDorm3dCollectionInvalid    = errors.New("dorm3d collection invalid")
	ErrDorm3dCollectionShipGroup  = errors.New("dorm3d collection ship group mismatch")
	ErrDorm3dDialogueInvalid      = errors.New("dorm3d dialogue invalid")
	ErrDorm3dCommNotFound         = errors.New("dorm3d comm topic not found")
	ErrDorm3dInvalidCommShip      = errors.New("dorm3d comm topic does not belong to ship")
	ErrDorm3dInvalidCallName      = errors.New("dorm3d call name invalid")
	ErrDorm3dInvalidBackground    = errors.New("dorm3d background not available")
	ErrDorm3dSkinNotAvailable     = errors.New("dorm3d skin not available")
	ErrDorm3dHiddenSkinInvalid    = errors.New("dorm3d hidden skin invalid")
	ErrDorm3dCollectionRoomConfig = errors.New("dorm3d room config invalid")
	ErrDorm3dUnsupportedActType   = errors.New("dorm3d unsupported unlock act type")
	ErrDorm3dUnlockTargetMissing  = errors.New("dorm3d unlock target missing")
)
View Source
var (
	ErrInvalidShipID = errors.New("invalid ship id")
	ErrShipBusy      = errors.New("ship is busy")
)
View Source
var (
	ErrGuildNameExists      = errors.New("guild name already exists")
	ErrCommanderInGuild     = errors.New("commander already in guild")
	ErrCommanderNotInGuild  = errors.New("commander is not in guild")
	ErrGuildPermission      = errors.New("guild permission denied")
	ErrGuildInvalidArgument = errors.New("invalid guild argument")
	ErrGuildInsufficientCap = errors.New("guild capital is insufficient")
)
View Source
var (
	ErrRenameInCooldown = errors.New("renaming is still in cooldown")
	ErrNotProposed      = errors.New("commander hasn't proposed this ship")
)
View Source
var (
	ErrUserAccountExists                = errors.New("user account exists")
	ErrRegistrationChallengeExists      = errors.New("registration challenge exists")
	ErrRegistrationChallengeNotFound    = errors.New("registration challenge not found")
	ErrRegistrationChallengeConsumed    = errors.New("registration challenge consumed")
	ErrRegistrationChallengeExpired     = errors.New("registration challenge expired")
	ErrRegistrationChallengeMismatch    = errors.New("registration challenge mismatch")
	ErrRegistrationChallengePinMismatch = errors.New("registration challenge pin mismatch")
	ErrRegistrationPinExists            = errors.New("registration pin exists")
)
View Source
var ErrCommanderNameExists = errors.New("commander name already exists")
View Source
var ErrFriendRequestNotFound = errors.New("friend request not found")
View Source
var ErrInsufficientIslandInventory = errors.New("insufficient island inventory")
View Source
var ErrInsufficientIslandOverflowInventory = errors.New("insufficient island overflow inventory")
View Source
var ErrInvalidActivityTaskProgressMode = errors.New("invalid activity task progress mode")
View Source
var ErrNoQuickFinishAllowance = errors.New("no quick finish allowance")
View Source
var ErrSkillClassConflict = errors.New("skill class conflict")
View Source
var (
	ErrorNotEnoughQuickFinishers = errors.New("not enough quick finishers")
)

Functions

func AcceptFriendRequest

func AcceptFriendRequest(targetID uint32, requesterID uint32) error

func AcceptGuildJoinRequest

func AcceptGuildJoinRequest(actorCommanderID uint32, applicantCommanderID uint32) (uint32, error)

func AccountUsernameNormalizedExists

func AccountUsernameNormalizedExists(usernameNormalized string, excludeAccountID string) (bool, error)

func ActivateGuildOperation

func ActivateGuildOperation(commanderID uint32, chapterID uint32, consume uint32, durationSeconds uint32, now uint32) error

func AddChapterDrop

func AddChapterDrop(drop *ChapterDrop) error

func AddCommanderFurnitureTx

func AddCommanderFurnitureTx(ctx context.Context, tx pgx.Tx, commanderID uint32, furnitureID uint32, count uint32, getTime uint32) error

func AddCommanderStory

func AddCommanderStory(commanderID uint32, storyID uint32) error

func AddDorm3dInstagramReply

func AddDorm3dInstagramReply(commanderID uint32, shipGroup uint32, postID uint32, chatID uint32, value uint32, now uint32) error

func AddFriendBlacklist

func AddFriendBlacklist(commanderID uint32, targetID uint32) (bool, error)

func AddGuildCapital

func AddGuildCapital(guildID uint32, amount uint32) error

func AddGuildMemberLiveness

func AddGuildMemberLiveness(guildID uint32, commanderID uint32, amount uint32) error

func AddIslandBookCondTx

func AddIslandBookCondTx(ctx context.Context, tx pgx.Tx, commanderID uint32, condType uint32, unlockID uint32) error

func AddIslandCardLabelCount

func AddIslandCardLabelCount(state *IslandCardState, labelID uint32)

func AddIslandCardLabelGiftTx

func AddIslandCardLabelGiftTx(ctx context.Context, tx pgx.Tx, fromCommanderID uint32, toCommanderID uint32, labelID uint32) (bool, error)

func AddIslandCardLikeTx

func AddIslandCardLikeTx(ctx context.Context, tx pgx.Tx, fromCommanderID uint32, toCommanderID uint32) (bool, error)

func AddIslandFollowerTx

func AddIslandFollowerTx(ctx context.Context, tx pgx.Tx, commanderID uint32, shipID uint32, orderIdx uint32) error

func AddIslandInventoryTx

func AddIslandInventoryTx(ctx context.Context, tx pgx.Tx, commanderID uint32, itemID uint32, count uint32) error

func AddIslandOrderActGroupTx

func AddIslandOrderActGroupTx(ctx context.Context, tx pgx.Tx, commanderID uint32, actID uint32, groupID uint32) (bool, error)

func AddIslandOrderFavorClaimTx

func AddIslandOrderFavorClaimTx(ctx context.Context, tx pgx.Tx, commanderID uint32, level uint32) (bool, error)

func AddIslandOrderFavorTx

func AddIslandOrderFavorTx(ctx context.Context, tx pgx.Tx, commanderID uint32, amount uint32) error

func AddIslandRoleDressNum

func AddIslandRoleDressNum(commanderID uint32, dressID uint32, num int32) error

func AddIslandSeasonPTTx

func AddIslandSeasonPTTx(ctx context.Context, tx pgx.Tx, commanderID uint32, pt uint32) error

func AddIslandSeasonRewardClaimTx

func AddIslandSeasonRewardClaimTx(ctx context.Context, tx pgx.Tx, commanderID uint32, targetPT uint32) (bool, error)

func AddIslandShipInvite

func AddIslandShipInvite(commanderID uint32, shipID uint32) error

func AddOwnedShipMetaRepairTx

func AddOwnedShipMetaRepairTx(ctx context.Context, tx pgx.Tx, ownerID uint32, shipID uint32, repairID uint32) error

func ApplyCommanderMoraleRecovery

func ApplyCommanderMoraleRecovery(commanderID uint32, nowUnix uint32) (uint32, error)

func ApplyIslandDelegationClaimTx

func ApplyIslandDelegationClaimTx(ctx context.Context, tx pgx.Tx, commanderID uint32, buildID uint32, areaID uint32, claimType uint32) (uint32, error)

func ApplyRandomFlagShipUpdates

func ApplyRandomFlagShipUpdates(_ any, commanderID uint32, updates []RandomFlagShipUpdate) error

func ApplyRemasterDailyReset

func ApplyRemasterDailyReset(state *RemasterState, now time.Time) bool

func AreFriends

func AreFriends(commanderID uint32, otherID uint32) (bool, error)

func AssignRoleByName

func AssignRoleByName(accountID string, roleName string) error

func BackyardThemeID

func BackyardThemeID(commanderID uint32, pos uint32) string

func BatchGetCommanderIslandSocialStates

func BatchGetCommanderIslandSocialStates(commanderIDs []uint32) (map[uint32]*CommanderIslandSocialState, error)

func CancelEventCollection

func CancelEventCollection(_ any, commanderID, collectionID uint32) error

func ChangeDorm3dShipSkin

func ChangeDorm3dShipSkin(commanderID uint32, shipGroup uint32, skinID uint32) error

func CheckCommanderNameAvailability

func CheckCommanderNameAvailability(name string) error

func ClaimCommanderTrophyProgress

func ClaimCommanderTrophyProgress(commanderID uint32, trophyID uint32, timestamp uint32) error

func ClearCommanderCommonFlag

func ClearCommanderCommonFlag(commanderID uint32, flagID uint32) error

func ClearCommanderHomeCacheExp

func ClearCommanderHomeCacheExp(commanderID uint32) error

func ClearIslandOverflowInventoryTx

func ClearIslandOverflowInventoryTx(ctx context.Context, tx pgx.Tx, commanderID uint32) error

func ClearShoppingStreetState

func ClearShoppingStreetState(commanderID uint32) error

func CommanderCatteryOpBit

func CommanderCatteryOpBit(opType uint32) uint32

func CommanderClearCatteryOpFlag

func CommanderClearCatteryOpFlag(opFlag uint32, opType uint32) uint32

func CommanderExists

func CommanderExists(commanderID uint32) error

func CommanderHasAttire

func CommanderHasAttire(commanderID uint32, attireType uint32, attireID uint32, now time.Time) (bool, error)

func CommanderHasCatteryOpFlag

func CommanderHasCatteryOpFlag(opFlag uint32, opType uint32) bool

func CommanderHasLivingAreaCover

func CommanderHasLivingAreaCover(commanderID uint32, coverID uint32) (bool, error)

func CommanderIDExists

func CommanderIDExists(commanderID uint32) (bool, error)

func CommanderNameExists

func CommanderNameExists(name string) (bool, error)

func CommanderNameExistsExcept

func CommanderNameExistsExcept(name string, commanderID uint32) (bool, error)

func CompensationSummary

func CompensationSummary(compensations []Compensation, now time.Time) (uint32, uint32)

func ConsumeCommanderQuickFinishTx

func ConsumeCommanderQuickFinishTx(ctx context.Context, tx pgx.Tx, commanderID uint32, allowance uint32, now time.Time) (uint32, error)

func ConsumeIslandInventoryCheckedTx

func ConsumeIslandInventoryCheckedTx(ctx context.Context, tx pgx.Tx, commanderID uint32, itemID uint32, count uint32) error

func ConsumeIslandInventoryTx

func ConsumeIslandInventoryTx(ctx context.Context, tx pgx.Tx, commanderID uint32, itemID uint32, count uint32) error

func ConsumeIslandOverflowInventoryCheckedTx

func ConsumeIslandOverflowInventoryCheckedTx(ctx context.Context, tx pgx.Tx, commanderID uint32, itemID uint32, count uint32) error

func ConsumeIslandSpeedupTicketsTx

func ConsumeIslandSpeedupTicketsTx(ctx context.Context, tx pgx.Tx, commanderID uint32, requests []IslandSpeedupTicketConsume) error

func ConsumeOwnedShipEnergyTx

func ConsumeOwnedShipEnergyTx(ctx context.Context, tx pgx.Tx, commanderID uint32, ownedShipID uint32, cost uint32) (uint32, error)

func CountAdminAccounts

func CountAdminAccounts() (int64, error)

func CountEnabledAccountsWithRole

func CountEnabledAccountsWithRole(roleName string, excludeAccountID string) (int64, error)

func CountFriends

func CountFriends(commanderID uint32) (uint32, error)

func CountGuildJoinRequestsByApplicant

func CountGuildJoinRequestsByApplicant(applicantCommanderID uint32) (uint32, error)

func CountGuildMembersByDuty

func CountGuildMembersByDuty(guildID uint32, duty uint32) (uint32, error)

func CreateAccount

func CreateAccount(account *Account) error

func CreateArenaShopState

func CreateArenaShopState(state ArenaShopState) error

func CreateAuditLog

func CreateAuditLog(entry AuditLog) error

func CreateBuffRecord

func CreateBuffRecord(buff *Buff) error

func CreateCommanderAccountRoot

func CreateCommanderAccountRoot(accountID uint32, nickname string, guideIndex uint32, newGuideIndex uint32) error

func CreateCommanderFriendRelationPair

func CreateCommanderFriendRelationPair(commanderID uint32, friendCommanderID uint32) error

func CreateCommanderRoot

func CreateCommanderRoot(commanderID uint32, accountID uint32, name string, guideIndex uint32, newGuideIndex uint32) error

func CreateCommanderSkillClassTx

func CreateCommanderSkillClassTx(ctx context.Context, tx pgx.Tx, entry *CommanderSkillClass) error

func CreateConfigEntryRecord

func CreateConfigEntryRecord(entry *ConfigEntry) error

func CreateDefaultStarterInventory

func CreateDefaultStarterInventory(accountID uint32) error

func CreateDorm3dApartment

func CreateDorm3dApartment(apartment *Dorm3dApartment) error

func CreateEquipmentRecord

func CreateEquipmentRecord(equipment *Equipment) error

func CreateExchangeCode

func CreateExchangeCode(code *ExchangeCode) error

func CreateExchangeCodeRedeem

func CreateExchangeCodeRedeem(codeID uint32, commanderID uint32, redeemedAt time.Time) error

func CreateFleet

func CreateFleet(owner *Commander, id uint32, name string, ships []uint32) error

Creates a fleet for the given commander, with the given ships

func CreateFriendLinkPair

func CreateFriendLinkPair(commanderID uint32, friendID uint32) error

func CreateFriendRelationship

func CreateFriendRelationship(commanderID uint32, friendID uint32, createdAt uint32) error

func CreateFriendRequest

func CreateFriendRequest(requesterID uint32, targetID uint32, content string) (bool, error)

func CreateGlobalSkinRestriction

func CreateGlobalSkinRestriction(restriction *GlobalSkinRestriction) error

func CreateGlobalSkinRestrictionWindow

func CreateGlobalSkinRestrictionWindow(window *GlobalSkinRestrictionWindow) error

func CreateGuild

func CreateGuild(commander *Commander, faction uint32, policy uint32, name string, manifesto string, createCost uint32, baseCapital uint32, techID uint32) (uint32, error)

func CreateGuildCapitalLog

func CreateGuildCapitalLog(guildID uint32, entry GuildCapitalLogEntry) error

func CreateGuildShopGood

func CreateGuildShopGood(good GuildShopGood) error

func CreateGuildShopState

func CreateGuildShopState(state GuildShopState) error

func CreateIslandCollectFragmentStateTx

func CreateIslandCollectFragmentStateTx(ctx context.Context, tx pgx.Tx, islandID uint32, fragmentID uint32, collectorCommanderID uint32, mark uint32) (bool, error)

func CreateIslandWildGatherCollectStateTx

func CreateIslandWildGatherCollectStateTx(ctx context.Context, tx pgx.Tx, islandID uint32, gatherID uint32, collectorCommanderID uint32) (bool, error)

func CreateItemRecord

func CreateItemRecord(item *Item) error

func CreateJuustagramLanguage

func CreateJuustagramLanguage(entry *JuustagramLanguage) error

func CreateJuustagramNpcTemplate

func CreateJuustagramNpcTemplate(template *JuustagramNpcTemplate) error

func CreateJuustagramShipGroupTemplate

func CreateJuustagramShipGroupTemplate(template *JuustagramShipGroupTemplate) error

func CreateJuustagramTemplate

func CreateJuustagramTemplate(template *JuustagramTemplate) error

func CreateLocalAccount

func CreateLocalAccount(entry LocalAccount) error

func CreateMedalShopGood

func CreateMedalShopGood(good MedalShopGood) error

func CreateMedalShopState

func CreateMedalShopState(state MedalShopState) error

func CreateMiniGameShopGood

func CreateMiniGameShopGood(good MiniGameShopGood) error

func CreateMiniGameShopState

func CreateMiniGameShopState(state MiniGameShopState) error

func CreateRarity

func CreateRarity(rarity *Rarity) error

func CreateRequisitionShip

func CreateRequisitionShip(shipID uint32) error

func CreateResourceRecord

func CreateResourceRecord(resource *Resource) error

func CreateShipType

func CreateShipType(shipType *ShipType) error

func CreateShopOffer

func CreateShopOffer(offer *ShopOffer) error

func CreateShoppingStreetGood

func CreateShoppingStreetGood(good ShoppingStreetGood) error

func CreateShoppingStreetState

func CreateShoppingStreetState(state ShoppingStreetState) error

func CreateSkillRecord

func CreateSkillRecord(skill *Skill) error

func CreateSkinRecord

func CreateSkinRecord(skin *Skin) error

func CreateWeaponRecord

func CreateWeaponRecord(weapon *Weapon) error

func CreateWebAuthnCredential

func CreateWebAuthnCredential(record *WebAuthnCredential) error

func CreateYostarusMap

func CreateYostarusMap(arg2 uint32, accountID uint32) error

func CurrentDayResetUnix

func CurrentDayResetUnix(now time.Time) uint32

func CurrentLimitChallengeMonthBucket

func CurrentLimitChallengeMonthBucket(now time.Time) uint32

func CurrentTechnologyDay

func CurrentTechnologyDay(now time.Time) uint32

func CurrentWeeklyResetUnix

func CurrentWeeklyResetUnix(now time.Time) uint32

func DealiasResource

func DealiasResource(resourceId *uint32)

Some resources are aliases, for example id=14 = freeGem <=> id=4 = gem

func DefaultJuustagramOpTime

func DefaultJuustagramOpTime() uint32

func DeleteAccountByID

func DeleteAccountByID(accountID string) error

func DeleteAllFriendRequestsForTarget

func DeleteAllFriendRequestsForTarget(targetID uint32) error

func DeleteArenaShopState

func DeleteArenaShopState(commanderID uint32) error

func DeleteBackyardCustomThemeTemplateTx

func DeleteBackyardCustomThemeTemplateTx(ctx context.Context, tx pgx.Tx, commanderID uint32, pos uint32) error

func DeleteBackyardPublishedThemeVersionsByThemeIDTx

func DeleteBackyardPublishedThemeVersionsByThemeIDTx(ctx context.Context, tx pgx.Tx, themeID string) error

func DeleteBattleSession

func DeleteBattleSession(commanderID uint32) error

func DeleteBuffRecord

func DeleteBuffRecord(id uint32) error

func DeleteChallengeModeStateTx

func DeleteChallengeModeStateTx(ctx context.Context, tx pgx.Tx, commanderID uint32, activityID uint32, mode uint32) error

func DeleteChapterProgress

func DeleteChapterProgress(commanderID uint32, chapterID uint32) error

func DeleteChapterState

func DeleteChapterState(commanderID uint32) error

func DeleteCommander

func DeleteCommander(commanderID uint32) error

func DeleteCommanderAttire

func DeleteCommanderAttire(commanderID uint32, attireType uint32, attireID uint32) error

func DeleteCommanderBuff

func DeleteCommanderBuff(commanderID uint32, buffID uint32) error

func DeleteCommanderDormThemeTx

func DeleteCommanderDormThemeTx(q *gen.Queries, commanderID uint32, slotID uint32) error

func DeleteCommanderFriendRelationPair

func DeleteCommanderFriendRelationPair(commanderID uint32, friendCommanderID uint32) (bool, error)

func DeleteCommanderItem

func DeleteCommanderItem(commanderID uint32, itemID uint32) error

func DeleteCommanderItemTx

func DeleteCommanderItemTx(ctx context.Context, tx pgx.Tx, commanderID uint32, itemID uint32) error

func DeleteCommanderLivingAreaCover

func DeleteCommanderLivingAreaCover(commanderID uint32, coverID uint32) error

func DeleteCommanderLoveLetterState

func DeleteCommanderLoveLetterState(commanderID uint32) error

func DeleteCommanderMeowsTx

func DeleteCommanderMeowsTx(ctx context.Context, tx pgx.Tx, commanderID uint32, meowIDs []uint32) error

func DeleteCommanderMiscItem

func DeleteCommanderMiscItem(commanderID uint32, itemID uint32) error

func DeleteCommanderMiscItemTx

func DeleteCommanderMiscItemTx(ctx context.Context, tx pgx.Tx, commanderID uint32, itemID uint32) error

func DeleteCommanderSkillClassTx

func DeleteCommanderSkillClassTx(ctx context.Context, tx pgx.Tx, commanderID uint32, roomID uint32) error

func DeleteCommanderStory

func DeleteCommanderStory(commanderID uint32, storyID uint32) error

func DeleteCommanderTB

func DeleteCommanderTB(commanderID uint32) (bool, error)

func DeleteCompensationByCommanderAndID

func DeleteCompensationByCommanderAndID(commanderID uint32, compensationID uint32) error

func DeleteConfigEntryByID

func DeleteConfigEntryByID(id uint64) error

func DeleteDorm3dApartment

func DeleteDorm3dApartment(commanderID uint32) error

func DeleteEquipmentRecord

func DeleteEquipmentRecord(id uint32) error

func DeleteExchangeCode

func DeleteExchangeCode(codeID uint32) error

func DeleteExchangeCodeRedeem

func DeleteExchangeCodeRedeem(codeID uint32, commanderID uint32) error

func DeleteFleetByCommanderAndGameID

func DeleteFleetByCommanderAndGameID(commanderID uint32, gameID uint32) error

func DeleteFriendRequest

func DeleteFriendRequest(targetID uint32, requesterID uint32) (bool, error)

func DeleteGlobalSkinRestriction

func DeleteGlobalSkinRestriction(skinID uint32) error

func DeleteGlobalSkinRestrictionWindow

func DeleteGlobalSkinRestrictionWindow(id uint32) error

func DeleteGuildJoinRequest

func DeleteGuildJoinRequest(guildID uint32, applicantCommanderID uint32) (bool, error)

func DeleteGuildShopGood

func DeleteGuildShopGood(commanderID uint32, index uint32) error

func DeleteIslandAgoraThemeTx

func DeleteIslandAgoraThemeTx(ctx context.Context, tx pgx.Tx, commanderID uint32, slotID uint32) error

func DeleteIslandOrderSlotTx

func DeleteIslandOrderSlotTx(ctx context.Context, tx pgx.Tx, commanderID uint32, slotID uint32) error

func DeleteIslandShipInviteTx

func DeleteIslandShipInviteTx(ctx context.Context, tx pgx.Tx, commanderID uint32, shipID uint32) error

func DeleteIslandShipOrderAppointTx

func DeleteIslandShipOrderAppointTx(ctx context.Context, tx pgx.Tx, commanderID uint32, appointID uint32) error

func DeleteIslandSpeedupTargetTx

func DeleteIslandSpeedupTargetTx(ctx context.Context, tx pgx.Tx, commanderID uint32, targetType uint32, targetID uint32) error

func DeleteIslandSpeedupTicketKeysTx

func DeleteIslandSpeedupTicketKeysTx(ctx context.Context, tx pgx.Tx, commanderID uint32, keys []IslandSpeedupTicketKey) error

func DeleteItemRecord

func DeleteItemRecord(id uint32) error

func DeleteJuustagramChatGroup

func DeleteJuustagramChatGroup(commanderID uint32, chatGroupID uint32) error

func DeleteJuustagramGroup

func DeleteJuustagramGroup(commanderID uint32, groupID uint32) error

func DeleteJuustagramLanguage

func DeleteJuustagramLanguage(key string) error

func DeleteJuustagramMessageState

func DeleteJuustagramMessageState(commanderID uint32, messageID uint32) error

func DeleteJuustagramNpcTemplate

func DeleteJuustagramNpcTemplate(id uint32) error

func DeleteJuustagramPlayerDiscuss

func DeleteJuustagramPlayerDiscuss(commanderID uint32, messageID uint32, discussID uint32) error

func DeleteJuustagramReply

func DeleteJuustagramReply(chatGroupRecordID uint32, sequence uint32) error

func DeleteJuustagramShipGroupTemplate

func DeleteJuustagramShipGroupTemplate(shipGroup uint32) error

func DeleteJuustagramTemplate

func DeleteJuustagramTemplate(id uint32) error

func DeleteLike

func DeleteLike(commanderID uint32, groupID uint32) error

func DeleteMedalShopGood

func DeleteMedalShopGood(commanderID uint32, index uint32) error

func DeleteMiniGameShopGood

func DeleteMiniGameShopGood(commanderID uint32, goodsID uint32) error

func DeleteOwnedResource

func DeleteOwnedResource(commanderID uint32, resourceID uint32) error

func DeleteOwnedShipTransformsTx

func DeleteOwnedShipTransformsTx(ctx context.Context, tx pgx.Tx, ownerID uint32, shipID uint32, transformIDs []uint32) error

func DeleteOwnedSkin

func DeleteOwnedSkin(commanderID uint32, skinID uint32) error

func DeletePunishmentByCommanderAndID

func DeletePunishmentByCommanderAndID(commanderID uint32, punishmentID uint32) error

func DeleteRandomFlagShipEntry

func DeleteRandomFlagShipEntry(commanderID uint32, shipID uint32, phantomID uint32) error

func DeleteRarity

func DeleteRarity(id uint32) error

func DeleteRemasterProgress

func DeleteRemasterProgress(commanderID uint32, chapterID uint32, pos uint32) error

func DeleteRequisitionShip

func DeleteRequisitionShip(shipID uint32) error

func DeleteResourceRecord

func DeleteResourceRecord(id uint32) error

func DeleteShipType

func DeleteShipType(id uint32) error

func DeleteShopOffer

func DeleteShopOffer(offerID uint32) error

func DeleteShoppingStreetGood

func DeleteShoppingStreetGood(commanderID uint32, goodsID uint32) error

func DeleteSkillRecord

func DeleteSkillRecord(id uint32) error

func DeleteSkinRecord

func DeleteSkinRecord(id uint32) error

func DeleteWeaponRecord

func DeleteWeaponRecord(id uint32) error

func DeleteWebAuthnCredentialByUserAndCredentialID

func DeleteWebAuthnCredentialByUserAndCredentialID(userID string, credentialID string) (bool, error)

func DeleteWebAuthnCredentialsByUserID

func DeleteWebAuthnCredentialsByUserID(userID string) error

func EnsureAuthzDefaults

func EnsureAuthzDefaults() error

func EnsureCommanderHome

func EnsureCommanderHome(commanderID uint32) (*CommanderHome, []CommanderHomeSlot, error)

func EnsureIslandHandPlantRowsTx

func EnsureIslandHandPlantRowsTx(ctx context.Context, tx pgx.Tx, commanderID uint32, slotIDs []uint32) error

func FireGuildMember

func FireGuildMember(commanderID uint32, targetCommanderID uint32) error

func GetActiveEventCount

func GetActiveEventCount(_ any, commanderID uint32) (int, error)

func GetBusyEventShipIDs

func GetBusyEventShipIDs(_ any, commanderID uint32) (map[uint32]struct{}, error)

func GetCommanderCoresByIDs

func GetCommanderCoresByIDs(commanderIDs []uint32) (map[uint32]*Commander, error)

func GetCommanderDailyQuickFinishUsed

func GetCommanderDailyQuickFinishUsed(commanderID uint32, now time.Time) (uint32, error)

func GetCommanderGuildWaitTime

func GetCommanderGuildWaitTime(commanderID uint32) (uint32, error)

func GetCommanderHome

func GetCommanderHome(commanderID uint32) (*CommanderHome, []CommanderHomeSlot, error)

func GetCommanderHomeFeedExp

func GetCommanderHomeFeedExp(level uint32) uint32

func GetCommanderHomeStyleList

func GetCommanderHomeStyleList(level uint32) []uint32

func GetCommanderIDByIslandInviteCode

func GetCommanderIDByIslandInviteCode(code string) (uint32, error)

func GetCommanderSkillLearnTimeAllowance

func GetCommanderSkillLearnTimeAllowance(commanderID uint32, now time.Time) (uint32, error)

func GetCommanderSocialProfilesByIDs

func GetCommanderSocialProfilesByIDs(commanderIDs []uint32) (map[uint32]CommanderSocialProfile, error)

func GetCommanderUpgradeRates

func GetCommanderUpgradeRates() (sameRate uint32, skillExp uint32, err error)

func GetFriendBlacklist

func GetFriendBlacklist(commanderID uint32) ([]uint32, error)

func GetGuildDataLevelDeputyLimit

func GetGuildDataLevelDeputyLimit(level uint32) (uint32, error)

func GetGuildDataLevelMemberLimit

func GetGuildDataLevelMemberLimit(level uint32) (uint32, error)

func GetGuildForCommander

func GetGuildForCommander(commanderID uint32) (*Guild, *GuildMember, error)

func GetGuildSetUint

func GetGuildSetUint(key string) (uint32, error)

func GetGuildUserDonateTasks

func GetGuildUserDonateTasks(commanderID uint32) ([]uint32, error)

func GetGuildUserTechnologyByGroup

func GetGuildUserTechnologyByGroup(commanderID uint32, techGroup uint32) (uint32, error)

func GetIslandManageTradeForUpdateTx

func GetIslandManageTradeForUpdateTx(ctx context.Context, tx pgx.Tx, commanderID uint32, tradeID uint32) (*protobuf.PB_ISLAND_TRADE, *protobuf.PB_TRADE_PRESELL, uint32, error)

func GetIslandOrderSlotForUpdateTx

func GetIslandOrderSlotForUpdateTx(ctx context.Context, tx pgx.Tx, commanderID uint32, slotID uint32) (*protobuf.PB_ISLAND_ORDER_SLOT, error)

func GetIslandShipOrderAppointForUpdateTx

func GetIslandShipOrderAppointForUpdateTx(ctx context.Context, tx pgx.Tx, commanderID uint32, appointID uint32) (*protobuf.PB_SHIP_ORDER_APPOINT, error)

func GetIslandShipOrderSlotForUpdateTx

func GetIslandShipOrderSlotForUpdateTx(ctx context.Context, tx pgx.Tx, commanderID uint32, slotID uint32) (*protobuf.PB_ISLAND_ORDER_SHIP_SLOT, error)

func GetJuustagramChatGroupRecordID

func GetJuustagramChatGroupRecordID(commanderID uint32, chatGroupID uint32) (uint32, error)

func GetJuustagramLanguage

func GetJuustagramLanguage(key string) (string, error)

func GetLastCommanderStoreupAwardIndex

func GetLastCommanderStoreupAwardIndex(commanderID uint32, storeupID uint32) (uint32, error)

func GetMailboxCounts

func GetMailboxCounts(commanderID uint32) (uint32, uint32, error)

func GetMonthShopPurchaseCountTx

func GetMonthShopPurchaseCountTx(ctx context.Context, tx pgx.Tx, commanderID uint32, goodsID uint32, month uint32) (uint32, error)

func GetShipBaseSkinIDTx

func GetShipBaseSkinIDTx(_ any, templateID uint32) (uint32, error)

func GetShipyardPursueDiscounts

func GetShipyardPursueDiscounts(ur bool) ([]uint32, error)

func GetSkinNameByID

func GetSkinNameByID(skinID uint32) (string, error)

func GetTechnologyCatchupItem

func GetTechnologyCatchupItem(version uint32) (uint32, uint32, error)

func GuildDissolve

func GuildDissolve(commanderID uint32, guildID uint32) error

func GuildImpeach

func GuildImpeach(commanderID uint32, targetCommanderID uint32, now time.Time) error

func GuildQuit

func GuildQuit(commanderID uint32, guildID uint32) error

func HasGuildBossMissionFleet

func HasGuildBossMissionFleet(guildID uint32, operationID uint32) (bool, error)

func HasGuildJoinRequest

func HasGuildJoinRequest(guildID uint32, applicantCommanderID uint32) (bool, error)

func HasIslandCardLabelGift

func HasIslandCardLabelGift(fromCommanderID uint32, toCommanderID uint32) (bool, error)

func HasIslandCardLike

func HasIslandCardLike(fromCommanderID uint32, toCommanderID uint32) (bool, error)

func HasIslandCollectFragmentTx

func HasIslandCollectFragmentTx(ctx context.Context, tx pgx.Tx, islandID uint32, fragmentID uint32) (bool, error)

func HasIslandShipInviteTx

func HasIslandShipInviteTx(ctx context.Context, tx pgx.Tx, commanderID uint32, shipID uint32) (bool, error)

func IncrementGuildMemberRank

func IncrementGuildMemberRank(guildID uint32, rankType uint32, userID uint32, amount uint32) error

func IncrementIslandShipBreakoutTx

func IncrementIslandShipBreakoutTx(ctx context.Context, tx pgx.Tx, commanderID uint32, shipID uint32) error

func IncrementMonthShopPurchaseTx

func IncrementMonthShopPurchaseTx(ctx context.Context, tx pgx.Tx, commanderID uint32, goodsID uint32, month uint32, delta uint32) error

func InitDatabase

func InitDatabase() bool

InitDatabase initializes the Postgres/sqlc store for the current process.

This remains as a compatibility shim for tests and legacy callers. Production startup should prefer internal/db bootstrap directly.

func InsertDebugPacket

func InsertDebugPacket(packetSize int, packetID int, payload []byte) error

func InsertShip

func InsertShip(s *Ship) error

func IsCommanderInAnyFleet

func IsCommanderInAnyFleet(commander *Commander, meowID uint32) bool

func IsCommanderSoundStoryUnlockedTx

func IsCommanderSoundStoryUnlockedTx(q *gen.Queries, commanderID uint32, soundStoryID uint32) (bool, error)

func IsCommanderSurveyCompleted

func IsCommanderSurveyCompleted(commanderID uint32, surveyID uint32) (bool, error)

func IsFriend

func IsFriend(commanderID uint32, friendID uint32) (bool, error)

func IsIslandCollectionCompletedTx

func IsIslandCollectionCompletedTx(ctx context.Context, tx pgx.Tx, commanderID uint32, collectID uint32) (bool, error)

func IsIslandInviteCodeTaken

func IsIslandInviteCodeTaken(code string, excludeCommanderID uint32) (bool, error)

func IsPlayableShipTemplateID

func IsPlayableShipTemplateID(shipID uint32) bool

func IsUniqueViolation

func IsUniqueViolation(err error) bool

func IsValidGuildDuty

func IsValidGuildDuty(duty uint32) bool

func IslandBookCondExistsTx

func IslandBookCondExistsTx(ctx context.Context, tx pgx.Tx, commanderID uint32, condType uint32, unlockID uint32) (bool, error)

func ListAccountRoleNames

func ListAccountRoleNames(accountID string) ([]string, error)

func ListBackyardPublishedThemeIDsByPage

func ListBackyardPublishedThemeIDsByPage(page uint32, num uint32) ([]string, error)

func ListCommanderCommonFlags

func ListCommanderCommonFlags(commanderID uint32) ([]uint32, error)

func ListCommanderFriendIDs

func ListCommanderFriendIDs(commanderID uint32) ([]uint32, error)

func ListCommanderItemBalances

func ListCommanderItemBalances(commanderID uint32, itemIDs []uint32) (map[uint32]uint32, error)

func ListCommanderMedalDisplay

func ListCommanderMedalDisplay(commanderID uint32) ([]uint32, error)

func ListCommanderSoundStoryIDs

func ListCommanderSoundStoryIDs(commanderID uint32) ([]uint32, error)

func ListCommanderStoryIDs

func ListCommanderStoryIDs(commanderID uint32) ([]uint32, error)

func ListGuildCapitalLogsByCategory

func ListGuildCapitalLogsByCategory(guildID uint32, limit uint32) (map[uint32][]GuildCapitalLogEntry, error)

func ListGuildMemberRanks

func ListGuildMemberRanks(guildID uint32, rankType uint32) (map[uint32][]GuildMemberRankEntry, error)

func ListGuildUserTechnologyState

func ListGuildUserTechnologyState(commanderID uint32) ([]uint32, error)

func ListIslandOrderActGroupsTx

func ListIslandOrderActGroupsTx(ctx context.Context, tx pgx.Tx, commanderID uint32) ([]*protobuf.PB_FINISH_ACT_GROUP, error)

func ListIslandOrderFavorClaimsTx

func ListIslandOrderFavorClaimsTx(ctx context.Context, tx pgx.Tx, commanderID uint32) ([]uint32, error)

func ListIslandOrderSlotsTx

func ListIslandOrderSlotsTx(ctx context.Context, tx pgx.Tx, commanderID uint32) ([]*protobuf.PB_ISLAND_ORDER_SLOT, error)

func ListIslandSeasonRewardClaimsTx

func ListIslandSeasonRewardClaimsTx(ctx context.Context, tx pgx.Tx, commanderID uint32) ([]uint32, error)

func ListIslandShipInvites

func ListIslandShipInvites(commanderID uint32) ([]uint32, error)

func ListIslandShipOrderAppointsTx

func ListIslandShipOrderAppointsTx(ctx context.Context, tx pgx.Tx, commanderID uint32) ([]*protobuf.PB_SHIP_ORDER_APPOINT, error)

func ListIslandShipOrderSlotsTx

func ListIslandShipOrderSlotsTx(ctx context.Context, tx pgx.Tx, commanderID uint32) ([]*protobuf.PB_ISLAND_ORDER_SHIP_SLOT, error)

func ListMonthShopPurchaseCounts

func ListMonthShopPurchaseCounts(commanderID uint32, month uint32) (map[uint32]uint32, error)

func ListOwnedShipMetaRepairIDs

func ListOwnedShipMetaRepairIDs(ownerID uint32, shipID uint32) ([]uint32, error)

func ListOwnedShipMetaRepairIDsByShips

func ListOwnedShipMetaRepairIDsByShips(ownerID uint32, shipIDs []uint32) (map[uint32][]uint32, error)

func ListOwnedShipShadowSkins

func ListOwnedShipShadowSkins(commanderID uint32, shipIDs []uint32) (map[uint32][]OwnedShipShadowSkin, error)

func ListRandomFlagShipPhantoms

func ListRandomFlagShipPhantoms(commanderID uint32, shipIDs []uint32) (map[uint32][]uint32, error)

func ListRequisitionShipIDs

func ListRequisitionShipIDs() ([]uint32, error)

func ListSkinNamesByIDs

func ListSkinNamesByIDs(skinIDs []uint32) (map[uint32]string, error)

func LoadEffectivePermissions

func LoadEffectivePermissions(accountID string) (map[string]authz.Capability, error)

func LoadItemUsageExp

func LoadItemUsageExp(itemID uint32) (uint32, error)

func LoadWorldMovePowerSettings

func LoadWorldMovePowerSettings() (uint32, uint32, error)

func LocalArg2Exists

func LocalArg2Exists(value uint32) (bool, error)

func LockAtelierStateTx

func LockAtelierStateTx(ctx context.Context, tx pgx.Tx, commanderID uint32, actID uint32) error

func MarkCommanderIslandDressRead

func MarkCommanderIslandDressRead(commanderID uint32, dressIDs []uint32) error

func MarkCommanderTaskSubmittedTx

func MarkCommanderTaskSubmittedTx(ctx context.Context, tx pgx.Tx, commanderID uint32, taskID uint32, submitTime uint32) (bool, error)

func MarkDorm3dCollection

func MarkDorm3dCollection(commanderID uint32, roomID uint32, collectionID uint32, shipGroup uint32) error

func MarkDorm3dDialogueSeen

func MarkDorm3dDialogueSeen(commanderID uint32, dialogID uint32) error

func MarkIslandCollectionCompletedTx

func MarkIslandCollectionCompletedTx(ctx context.Context, tx pgx.Tx, commanderID uint32, collectID uint32) (bool, error)

func MarkJuustagramChatGroupsRead

func MarkJuustagramChatGroupsRead(commanderID uint32, chatGroupIDs []uint32) error

func MarkLimitChallengePass

func MarkLimitChallengePass(state *LimitChallengeState, challengeID uint32, totalTime uint32)

func MarkRoleIslandDressRead

func MarkRoleIslandDressRead(commanderID uint32, dressIDs []uint32) error

func MaxTechnologyBlueprintVersion

func MaxTechnologyBlueprintVersion() (uint32, error)

func QualifiedTable

func QualifiedTable(name string) string

QualifiedTable returns the DB table name using the active NamingStrategy. When using Postgres with database.schema_name, tables are created under that schema via gorm's TablePrefix (e.g. "belfast.account_roles").

func ReduceIslandSpeedupTargetTx

func ReduceIslandSpeedupTargetTx(ctx context.Context, tx pgx.Tx, commanderID uint32, targetType uint32, targetID uint32, now uint32, reduceBy uint32) (uint32, error)

func RefreshGuildShopGoods

func RefreshGuildShopGoods(commanderID uint32, goods []GuildShopGood, refreshCount uint32, nextRefreshTime uint32) error

func RefreshMedalShopGoods

func RefreshMedalShopGoods(commanderID uint32, goods []MedalShopGood, nextRefreshTime uint32) error

func RefreshMiniGameShopGoods

func RefreshMiniGameShopGoods(commanderID uint32, goods []MiniGameShopGood, nextRefreshTime uint32) error

func RefreshShoppingStreetGoods

func RefreshShoppingStreetGoods(commanderID uint32, goods []ShoppingStreetGood, nextFlashTime uint32, flashCount uint32) error

func RemainingSeconds

func RemainingSeconds(finishTime time.Time, now time.Time) uint32

func RemoveFriendBlacklist

func RemoveFriendBlacklist(commanderID uint32, targetID uint32) (bool, error)

func RemoveIslandFollowerTx

func RemoveIslandFollowerTx(ctx context.Context, tx pgx.Tx, commanderID uint32, shipID uint32) error

func RemoveIslandShipDressByDressTx

func RemoveIslandShipDressByDressTx(ctx context.Context, tx pgx.Tx, commanderID uint32, dressID uint32) (uint32, error)

func RemoveIslandShipDressTx

func RemoveIslandShipDressTx(ctx context.Context, tx pgx.Tx, commanderID uint32, shipID uint32, dressID uint32) (bool, error)

func ReplaceAccountOverrides

func ReplaceAccountOverrides(accountID string, overrides []AccountOverrideEntry) error

func ReplaceAccountRolesByName

func ReplaceAccountRolesByName(accountID string, roleNames []string) error

func ReplaceGuildOperationBossRanks

func ReplaceGuildOperationBossRanks(guildID uint32, operationID uint32, bossID uint32, ranks []GuildOperationBossRank) error

func ReplaceRolePolicyByName

func ReplaceRolePolicyByName(roleName string, capabilities map[string]authz.Capability, updatedBy *string) error

func ReplaceShoppingStreetGoods

func ReplaceShoppingStreetGoods(commanderID uint32, goods []ShoppingStreetGood) error

func ResetIslandHandPlantsTx

func ResetIslandHandPlantsTx(ctx context.Context, tx pgx.Tx, commanderID uint32, slotIDs []uint32) error

func ResetWeeklyRefresh

func ResetWeeklyRefresh(commanderID uint32, refreshAt uint32) error

func RollCommanderTemplateForPool

func RollCommanderTemplateForPool(poolID uint32) (uint32, error)

func SaveActivityFleetGroups

func SaveActivityFleetGroups(commanderID uint32, activityID uint32, groups ActivityFleetGroupList) error

func SaveActivityPermanentState

func SaveActivityPermanentState(state *ActivityPermanentState) error

func SaveAtelierState

func SaveAtelierState(state *AtelierState) error

func SaveAtelierStateTx

func SaveAtelierStateTx(ctx context.Context, tx pgx.Tx, state *AtelierState) error

func SaveCityRebuildState

func SaveCityRebuildState(state *CityRebuildState) error

func SaveCommanderAppreciationState

func SaveCommanderAppreciationState(state *CommanderAppreciationState) error

func SaveCommanderColoringState

func SaveCommanderColoringState(state *CommanderColoringState) error

func SaveCommanderColoringStateTx

func SaveCommanderColoringStateTx(ctx context.Context, tx pgx.Tx, state *CommanderColoringState) error

func SaveCommanderDormState

func SaveCommanderDormState(state *CommanderDormState) error

func SaveCommanderDormStateTx

func SaveCommanderDormStateTx(ctx context.Context, tx pgx.Tx, state *CommanderDormState) error

func SaveCommanderFleetTechState

func SaveCommanderFleetTechState(state *CommanderFleetTechState) error

func SaveCommanderFleetTechStateTx

func SaveCommanderFleetTechStateTx(ctx context.Context, tx pgx.Tx, state *CommanderFleetTechState) error

func SaveCommanderIslandSocialState

func SaveCommanderIslandSocialState(state *CommanderIslandSocialState) error

func SaveCommanderIslandSocialStateTx

func SaveCommanderIslandSocialStateTx(ctx context.Context, tx pgx.Tx, state *CommanderIslandSocialState) error

func SaveCommanderIslandTradeInviteState

func SaveCommanderIslandTradeInviteState(state *CommanderIslandTradeInviteState) error

func SaveCommanderLoveLetterState

func SaveCommanderLoveLetterState(state *CommanderLoveLetterState) error

func SaveCommanderLoveLetterStateTx

func SaveCommanderLoveLetterStateTx(ctx context.Context, tx pgx.Tx, state *CommanderLoveLetterState) error

func SaveCommanderMetaPtProgress

func SaveCommanderMetaPtProgress(state *CommanderMetaPtProgress) error

func SaveCommanderMetaPtProgressTx

func SaveCommanderMetaPtProgressTx(ctx context.Context, tx pgx.Tx, state *CommanderMetaPtProgress) error

func SaveCommanderMetaTacticsSkillStateTx

func SaveCommanderMetaTacticsSkillStateTx(ctx context.Context, tx pgx.Tx, state *CommanderMetaTacticsSkillState) error

func SaveCommanderMetaTacticsStateTx

func SaveCommanderMetaTacticsStateTx(ctx context.Context, tx pgx.Tx, state *CommanderMetaTacticsState) error

func SaveCommanderPacketState

func SaveCommanderPacketState(entry *CommanderPacketState) error

func SaveCommanderPrefabFleet

func SaveCommanderPrefabFleet(entry *CommanderPrefabFleet) error

func SaveCommanderShipSkillTx

func SaveCommanderShipSkillTx(ctx context.Context, tx pgx.Tx, entry *CommanderShipSkill) error

func SaveCommanderTB

func SaveCommanderTB(entry *CommanderTB, info *protobuf.TBINFO, permanent *protobuf.TBPERMANENT) error

func SaveCommanderWorldBossState

func SaveCommanderWorldBossState(state *WorldBossState) error

func SaveDorm3dApartment

func SaveDorm3dApartment(apartment *Dorm3dApartment) error

func SaveDorm3dApartmentTx

func SaveDorm3dApartmentTx(ctx context.Context, tx pgx.Tx, apartment *Dorm3dApartment) error

func SaveEventCollection

func SaveEventCollection(_ any, event *EventCollection) error

func SaveFeastState

func SaveFeastState(state *FeastState) error

func SaveFeastStateTx

func SaveFeastStateTx(ctx context.Context, tx pgx.Tx, state *FeastState) error

func SaveGameRoomStateTx

func SaveGameRoomStateTx(ctx context.Context, tx pgx.Tx, state *GameRoomState) error

func SaveIslandAchievementStateTx

func SaveIslandAchievementStateTx(ctx context.Context, tx pgx.Tx, state *IslandAchievementState) error

func SaveIslandBookStateTx

func SaveIslandBookStateTx(ctx context.Context, tx pgx.Tx, state *IslandBookState) error

func SaveIslandCardStateTx

func SaveIslandCardStateTx(ctx context.Context, tx pgx.Tx, state *IslandCardState) error

func SaveIslandNodeState

func SaveIslandNodeState(commanderID uint32, actID uint32, nodes []IslandNodeState) error

func SaveIslandOrderStateTx

func SaveIslandOrderStateTx(ctx context.Context, tx pgx.Tx, state *IslandOrderState) error

func SaveIslandProsperityStateTx

func SaveIslandProsperityStateTx(ctx context.Context, tx pgx.Tx, state *IslandProsperityState) error

func SaveIslandShipOrderStateTx

func SaveIslandShipOrderStateTx(ctx context.Context, tx pgx.Tx, state *IslandShipOrderState) error

func SaveIslandTaskProgressTx

func SaveIslandTaskProgressTx(ctx context.Context, tx pgx.Tx, state *IslandTaskProgress) error

func SaveJuustagramMessageState

func SaveJuustagramMessageState(state *JuustagramMessageState) error

func SaveLegacyEducateState

func SaveLegacyEducateState(state *LegacyEducateState) error

func SaveLimitChallengeStateTx

func SaveLimitChallengeStateTx(ctx context.Context, tx pgx.Tx, state *LimitChallengeState) error

func SaveMiniGameDataState

func SaveMiniGameDataState(state *MiniGameDataState) error

func SaveMiniGameHubState

func SaveMiniGameHubState(state *MiniGameHubState) error

func SaveMiniGameTelemetryState

func SaveMiniGameTelemetryState(state *MiniGameTelemetryState) error

func SaveNavalAcademyRuntime

func SaveNavalAcademyRuntime(runtime *NavalAcademyRuntime) error

func SaveOwnedSpWeapon

func SaveOwnedSpWeapon(entry *OwnedSpWeapon) error

func SaveRefluxState

func SaveRefluxState(state *RefluxState) error

func SaveRemasterState

func SaveRemasterState(state *RemasterState) error

func SaveSecondaryPasswordState

func SaveSecondaryPasswordState(state *SecondaryPasswordState) error

func SaveTechnologyResearchState

func SaveTechnologyResearchState(state *TechnologyResearchState) error

func SaveTechnologyResearchStateTx

func SaveTechnologyResearchStateTx(ctx context.Context, tx pgx.Tx, state *TechnologyResearchState) error

func SaveWeeklyTaskProgressTx

func SaveWeeklyTaskProgressTx(ctx context.Context, tx pgx.Tx, state *WeeklyTaskProgress) error

func SaveWorldRuntime

func SaveWorldRuntime(runtime *WorldRuntime) error

func SetCommanderAppreciationGalleryFavor

func SetCommanderAppreciationGalleryFavor(commanderID uint32, galleryID uint32, liked bool) error

func SetCommanderAppreciationGalleryUnlock

func SetCommanderAppreciationGalleryUnlock(commanderID uint32, galleryID uint32) error

func SetCommanderAppreciationMusicFavor

func SetCommanderAppreciationMusicFavor(commanderID uint32, musicID uint32, liked bool) error

func SetCommanderCartoonCollectMark

func SetCommanderCartoonCollectMark(commanderID uint32, cartoonID uint32, liked bool) error

func SetCommanderCartoonReadMark

func SetCommanderCartoonReadMark(commanderID uint32, cartoonID uint32) error

func SetCommanderCommonFlag

func SetCommanderCommonFlag(commanderID uint32, flagID uint32) error

func SetCommanderGuildWaitTime

func SetCommanderGuildWaitTime(commanderID uint32, waitTime uint32) error

func SetCommanderMedalDisplay

func SetCommanderMedalDisplay(commanderID uint32, medalIDs []uint32) error

func SetCommanderStoreupAwardIndexTx

func SetCommanderStoreupAwardIndexTx(ctx context.Context, tx pgx.Tx, commanderID uint32, storeupID uint32, lastAwardIndex uint32) error

func SetCommanderSurveyCompleted

func SetCommanderSurveyCompleted(commanderID uint32, surveyID uint32, completedAt time.Time) error

func SetDorm3dCallName

func SetDorm3dCallName(commanderID uint32, shipGroup uint32, name string, now uint32, cooldown uint32) error

func SetDorm3dCurrentCommID

func SetDorm3dCurrentCommID(commanderID uint32, shipGroup uint32, commID uint32) error

func SetGuildAssaultRecommendation

func SetGuildAssaultRecommendation(guildID uint32, commanderID uint32, shipID uint32, recommended bool) error

func SetGuildTechnologyActive

func SetGuildTechnologyActive(guildID uint32, techID uint32) error

func SetGuildUserDonateTasks

func SetGuildUserDonateTasks(commanderID uint32, tasks []uint32) error

func SetIslandProsperity

func SetIslandProsperity(commanderID uint32, prosperity uint32) error

func SetJuustagramChatGroupRead

func SetJuustagramChatGroupRead(commanderID uint32, chatGroupIDs []uint32) error

func SetJuustagramCurrentChatGroup

func SetJuustagramCurrentChatGroup(commanderID uint32, chatGroupID uint32) error

func StartGuildSupply

func StartGuildSupply(guildID uint32, cost uint32, benefitFinishTime uint32) error

func SupportRequisitionMonth

func SupportRequisitionMonth(now time.Time) uint32

func SyncWorldRuntime

func SyncWorldRuntime(runtime *WorldRuntime, now time.Time) (bool, bool, error)

func ToProtoBuildInfo

func ToProtoBuildInfo(payload BuildInfoPayload) *protobuf.BUILDINFO

func ToProtoCommanderBox

func ToProtoCommanderBox(box CommanderBox) *protobuf.COMMANDERBOXINFO

func ToProtoCommanderInfo

func ToProtoCommanderInfo(meow CommanderMeow) *protobuf.COMMANDERINFO

func ToProtoCompensationDropInfoList

func ToProtoCompensationDropInfoList(attachments []CompensationAttachment) []*protobuf.DROPINFO

func ToProtoDropInfoList

func ToProtoDropInfoList(attachments []MailAttachment) []*protobuf.DROPINFO

func ToProtoOwnedShip

func ToProtoOwnedShip(ship OwnedShip, randomFlags []uint32, shadowSkins []OwnedShipShadowSkin) *protobuf.SHIPINFO

func ToProtoOwnedShipList

func ToProtoOwnedShipList(ships []OwnedShip, randomFlags map[uint32][]uint32, shadowSkins map[uint32][]OwnedShipShadowSkin) []*protobuf.SHIPINFO

func ToProtoOwnedSpWeapon

func ToProtoOwnedSpWeapon(entry OwnedSpWeapon) *protobuf.SPWEAPONINFO

func ToProtoOwnedSpWeaponList

func ToProtoOwnedSpWeaponList(entries []OwnedSpWeapon) []*protobuf.SPWEAPONINFO

func ToProtoProposeResponse

func ToProtoProposeResponse(success bool) *protobuf.SC_12033

func ToUint32List

func ToUint32List(values Int64List) []uint32

func TryAdvanceCommanderStoreupAwardIndexTx

func TryAdvanceCommanderStoreupAwardIndexTx(ctx context.Context, tx pgx.Tx, commanderID uint32, storeupID uint32, awardIndex uint32) (bool, error)

TryAdvanceCommanderStoreupAwardIndexTx atomically advances the storeup progress by exactly one tier.

It returns (true, nil) only if the index was advanced from (awardIndex-1) -> awardIndex. This is used to prevent duplicate claims on concurrent requests.

func TryRecordChargeSuccessEventTx

func TryRecordChargeSuccessEventTx(ctx context.Context, tx pgx.Tx, commanderID uint32, payID string) (bool, error)

func TrySubmitCommanderActivityTaskTx

func TrySubmitCommanderActivityTaskTx(ctx context.Context, tx pgx.Tx, commanderID uint32, actID uint32, taskID uint32) (bool, error)

func TrySubmitReadyCommanderActivityTaskTx

func TrySubmitReadyCommanderActivityTaskTx(ctx context.Context, tx pgx.Tx, commanderID uint32, actID uint32, taskID uint32, requiredProgress uint32) (bool, error)

func Uint32FromInt64Checked

func Uint32FromInt64Checked(value int64) (uint32, error)

func UnlockCommanderSoundStoryTx

func UnlockCommanderSoundStoryTx(q *gen.Queries, commanderID uint32, soundStoryID uint32) error

func UpdateAccountDisabledAt

func UpdateAccountDisabledAt(accountID string, disabledAt *time.Time, updatedAt time.Time) error

func UpdateAccountLastLoginAt

func UpdateAccountLastLoginAt(accountID string, loginAt time.Time) error

func UpdateAccountPassword

func UpdateAccountPassword(accountID string, passwordHash string, passwordAlgo string, passwordUpdatedAt time.Time, updatedAt time.Time) error

func UpdateAccountUsername

func UpdateAccountUsername(accountID string, username string, usernameNormalized string, updatedAt time.Time) error

func UpdateAccountWebAuthnUserHandle

func UpdateAccountWebAuthnUserHandle(accountID string, handle []byte, updatedAt int64) error

func UpdateArenaShopState

func UpdateArenaShopState(state ArenaShopState) error

func UpdateBuffRecord

func UpdateBuffRecord(buff *Buff) error

func UpdateCommanderBuffExpiry

func UpdateCommanderBuffExpiry(commanderID uint32, buffID uint32, expiresAt time.Time) error

func UpdateCommanderChildDisplay

func UpdateCommanderChildDisplay(commanderID uint32, childDisplay uint32) error

func UpdateCommanderHome

func UpdateCommanderHome(home *CommanderHome) error

func UpdateCommanderHomeSlot

func UpdateCommanderHomeSlot(slot *CommanderHomeSlot) error

func UpdateCommanderLivingAreaCoverIsNew

func UpdateCommanderLivingAreaCoverIsNew(commanderID uint32, coverID uint32, isNew bool) error

func UpdateCommanderMeowExpTx

func UpdateCommanderMeowExpTx(ctx context.Context, tx pgx.Tx, commanderID uint32, meowID uint32, exp uint32) error

func UpdateCommanderRandomFlagShipEnabled

func UpdateCommanderRandomFlagShipEnabled(commanderID uint32, enabled bool) error

func UpdateCommanderRandomShipMode

func UpdateCommanderRandomShipMode(commanderID uint32, mode uint32) error

func UpdateCommanderTrophyProgress

func UpdateCommanderTrophyProgress(row *CommanderTrophyProgress) error

func UpdateConfigEntryRecord

func UpdateConfigEntryRecord(entry *ConfigEntry) error

func UpdateDorm3dInsBackground

func UpdateDorm3dInsBackground(commanderID uint32, shipGroup uint32, backID uint32) error

func UpdateDorm3dInsCareFlag

func UpdateDorm3dInsCareFlag(commanderID uint32, shipGroup uint32, careFlag uint32) error

func UpdateDorm3dInstagramFlags

func UpdateDorm3dInstagramFlags(commanderID uint32, shipGroup uint32, postIDs []uint32, op uint32, now uint32) error

func UpdateDorm3dSkinHiddenParts

func UpdateDorm3dSkinHiddenParts(commanderID uint32, shipGroup uint32, skinID uint32, hiddenParts []uint32) error

func UpdateDorm3dVisitTime

func UpdateDorm3dVisitTime(commanderID uint32, shipGroup uint32, visitTime uint32) error

func UpdateEquipmentRecord

func UpdateEquipmentRecord(equipment *Equipment) error

func UpdateExchangeCode

func UpdateExchangeCode(code *ExchangeCode) error

func UpdateFleetMeowfficerSlot

func UpdateFleetMeowfficerSlot(commander *Commander, groupID uint32, pos uint32, meowID uint32) error

func UpdateGlobalSkinRestriction

func UpdateGlobalSkinRestriction(restriction *GlobalSkinRestriction) error

func UpdateGlobalSkinRestrictionWindow

func UpdateGlobalSkinRestrictionWindow(window *GlobalSkinRestrictionWindow) error

func UpdateGuildBase

func UpdateGuildBase(commander *Commander, guildID uint32, opType uint32, intValue uint32, strValue string, nameChangeCost uint32) error

func UpdateGuildDuty

func UpdateGuildDuty(commanderID uint32, targetCommanderID uint32, duty uint32) error

func UpdateGuildOperationEventFormation

func UpdateGuildOperationEventFormation(guildID uint32, eventTid uint32, personShip json.RawMessage, formationTime uint32) error

func UpdateGuildOperationEventRefresh

func UpdateGuildOperationEventRefresh(guildID uint32, eventTid uint32, formationTime uint32) error

func UpdateGuildOperationParticipation

func UpdateGuildOperationParticipation(commanderID uint32, now uint32, maxJoinTimes uint32, livenessGain uint32) error

func UpdateGuildShopGood

func UpdateGuildShopGood(good GuildShopGood) error

func UpdateGuildShopState

func UpdateGuildShopState(state GuildShopState) error

func UpdateGuildUserBenefitTime

func UpdateGuildUserBenefitTime(commanderID uint32, benefitTime uint32) error

func UpdateItemRecord

func UpdateItemRecord(item *Item) error

func UpdateJuustagramGroup

func UpdateJuustagramGroup(commanderID uint32, groupID uint32, skinID *uint32, favorite *uint32, curChatGroup *uint32) error

func UpdateJuustagramLanguage

func UpdateJuustagramLanguage(entry *JuustagramLanguage) error

func UpdateJuustagramNpcTemplate

func UpdateJuustagramNpcTemplate(template *JuustagramNpcTemplate) error

func UpdateJuustagramShipGroupTemplate

func UpdateJuustagramShipGroupTemplate(template *JuustagramShipGroupTemplate) error

func UpdateJuustagramTemplate

func UpdateJuustagramTemplate(template *JuustagramTemplate) error

func UpdateLocalAccountPassword

func UpdateLocalAccountPassword(arg2 uint32, password string) error

func UpdateMedalShopGood

func UpdateMedalShopGood(good MedalShopGood) error

func UpdateMedalShopState

func UpdateMedalShopState(state MedalShopState) error

func UpdateMiniGameShopGood

func UpdateMiniGameShopGood(good MiniGameShopGood) error

func UpdateMiniGameShopState

func UpdateMiniGameShopState(state MiniGameShopState) error

func UpdateOwnedSkinExpiry

func UpdateOwnedSkinExpiry(commanderID uint32, skinID uint32, expiresAt *time.Time) error

func UpdateRarity

func UpdateRarity(rarity *Rarity) error

func UpdateResourceRecord

func UpdateResourceRecord(resource *Resource) error

func UpdateShipType

func UpdateShipType(shipType *ShipType) error

func UpdateShopOffer

func UpdateShopOffer(offer *ShopOffer) error

func UpdateShoppingStreetGood

func UpdateShoppingStreetGood(good ShoppingStreetGood) error

func UpdateShoppingStreetState

func UpdateShoppingStreetState(state ShoppingStreetState) error

func UpdateSkillRecord

func UpdateSkillRecord(skill *Skill) error

func UpdateSkinRecord

func UpdateSkinRecord(skin *Skin) error

func UpdateUserRegistrationChallengeStatus

func UpdateUserRegistrationChallengeStatus(id string, status string) error

func UpdateWeaponRecord

func UpdateWeaponRecord(weapon *Weapon) error

func UpdateWebAuthnCredentialUsageByCredentialID

func UpdateWebAuthnCredentialUsageByCredentialID(credentialID string, signCount uint32, lastUsedAt time.Time, backupEligible *bool, backupState *bool) error

func UpsertActivityStoreState

func UpsertActivityStoreState(state *ActivityStoreState) error

func UpsertActivityStoreStateTx

func UpsertActivityStoreStateTx(ctx context.Context, tx pgx.Tx, state *ActivityStoreState) error

func UpsertBackyardCustomThemeTemplateTx

func UpsertBackyardCustomThemeTemplateTx(ctx context.Context, tx pgx.Tx, commanderID uint32, pos uint32, name string, furniturePutList json.RawMessage, iconMd5, imageMd5 string) error

func UpsertBattleSession

func UpsertBattleSession(session *BattleSession) error

func UpsertChallengeModeStateTx

func UpsertChallengeModeStateTx(ctx context.Context, tx pgx.Tx, state *ChallengeModeState) error

func UpsertChapterProgress

func UpsertChapterProgress(progress *ChapterProgress) error

func UpsertChapterState

func UpsertChapterState(state *ChapterState) error

func UpsertCommanderActivityTaskProgressTx

func UpsertCommanderActivityTaskProgressTx(ctx context.Context, tx pgx.Tx, commanderID uint32, actID uint32, taskID uint32, mode uint32, progress uint32) error

func UpsertCommanderAttire

func UpsertCommanderAttire(entry CommanderAttire) error

func UpsertCommanderBoxTx

func UpsertCommanderBoxTx(ctx context.Context, tx pgx.Tx, box CommanderBox) error

func UpsertCommanderBuff

func UpsertCommanderBuff(commanderID uint32, buffID uint32, expiresAt time.Time) error

func UpsertCommanderDormFloorLayoutTx

func UpsertCommanderDormFloorLayoutTx(q *gen.Queries, commanderID uint32, floor uint32, furniturePutList json.RawMessage) error

func UpsertCommanderDormThemeTx

func UpsertCommanderDormThemeTx(q *gen.Queries, commanderID uint32, slotID uint32, name string, furniturePutList json.RawMessage) error

func UpsertCommanderLivingAreaCover

func UpsertCommanderLivingAreaCover(entry CommanderLivingAreaCover) error

func UpsertCommanderMetaTacticsTaskProgressTx

func UpsertCommanderMetaTacticsTaskProgressTx(ctx context.Context, tx pgx.Tx, entry *CommanderMetaTacticsTaskProgress) error

func UpsertCommanderMiscItem

func UpsertCommanderMiscItem(commanderID uint32, itemID uint32, data uint32) error

func UpsertCommanderShipyardBlueprintTx

func UpsertCommanderShipyardBlueprintTx(ctx context.Context, tx pgx.Tx, entry *CommanderShipyardBlueprint) error

func UpsertCommanderShipyardStateTx

func UpsertCommanderShipyardStateTx(ctx context.Context, tx pgx.Tx, state *CommanderShipyardState) error

func UpsertCommanderTaskProgressTx

func UpsertCommanderTaskProgressTx(ctx context.Context, tx pgx.Tx, commanderID uint32, taskID uint32, mode uint32, progress uint32, targetNum uint32, now uint32) error

func UpsertConfigEntry

func UpsertConfigEntry(category string, key string, data json.RawMessage) error

func UpsertDeviceAuthMap

func UpsertDeviceAuthMap(deviceID string, arg2 uint32, accountID uint32) error

func UpsertEducateShopState

func UpsertEducateShopState(state *EducateShopState) error

func UpsertEducateShopStateTx

func UpsertEducateShopStateTx(ctx context.Context, tx pgx.Tx, state *EducateShopState) error

func UpsertExerciseFleet

func UpsertExerciseFleet(commanderID uint32, vanguardShipIDs []uint32, mainShipIDs []uint32) error

func UpsertGameRoomScoreTx

func UpsertGameRoomScoreTx(ctx context.Context, tx pgx.Tx, commanderID uint32, roomID uint32, score uint32) error

func UpsertGuildAssaultFleetSlots

func UpsertGuildAssaultFleetSlots(guildID uint32, commanderID uint32, slots []GuildAssaultFleetSlot, now uint32) error

func UpsertGuildBossMissionFleets

func UpsertGuildBossMissionFleets(guildID uint32, operationID uint32, fleets []GuildBossMissionFleet) error

func UpsertGuildJoinRequest

func UpsertGuildJoinRequest(guildID uint32, applicantCommanderID uint32, content string, requestedAt time.Time) error

func UpsertGuildOperationBossState

func UpsertGuildOperationBossState(state GuildOperationBossState) error

func UpsertGuildOperationPerf

func UpsertGuildOperationPerf(guildID uint32, eventTid uint32, index uint32) error

func UpsertGuildOperationPerfsMonotonic

func UpsertGuildOperationPerfsMonotonic(guildID uint32, perfs []GuildOperationPerf) error

func UpsertGuildUserTechnologyState

func UpsertGuildUserTechnologyState(commanderID uint32, techGroup uint32, techID uint32) error

func UpsertGuildWeeklyTaskState

func UpsertGuildWeeklyTaskState(guildID uint32, taskID uint32, progress uint32, monday0Clock uint32) error

func UpsertIslandAgoraPlacementTx

func UpsertIslandAgoraPlacementTx(ctx context.Context, tx pgx.Tx, commanderID uint32, placedData []byte) error

func UpsertIslandAgoraThemeTx

func UpsertIslandAgoraThemeTx(ctx context.Context, tx pgx.Tx, commanderID uint32, slotID uint32, name string, placedData []byte) error

func UpsertIslandCardState

func UpsertIslandCardState(state *IslandCardState) error

func UpsertIslandCollectFragmentSignState

func UpsertIslandCollectFragmentSignState(state *IslandCollectFragmentSignState) error

func UpsertIslandCommanderDressProfile

func UpsertIslandCommanderDressProfile(profile *IslandCommanderDressProfile) error

func UpsertIslandCommanderDressState

func UpsertIslandCommanderDressState(entry *IslandCommanderDressState) error

func UpsertIslandDelegation

func UpsertIslandDelegation(slot *IslandDelegation) error

func UpsertIslandDelegationTx

func UpsertIslandDelegationTx(ctx context.Context, tx pgx.Tx, slot *IslandDelegation) error

func UpsertIslandFishingStateTx

func UpsertIslandFishingStateTx(ctx context.Context, tx pgx.Tx, state *IslandFishingState) error

func UpsertIslandHandPlantTx

func UpsertIslandHandPlantTx(ctx context.Context, tx pgx.Tx, value *IslandHandPlant) error

func UpsertIslandManageTradeTx

func UpsertIslandManageTradeTx(ctx context.Context, tx pgx.Tx, commanderID uint32, trade *protobuf.PB_ISLAND_TRADE, presell *protobuf.PB_TRADE_PRESELL, totalSales uint32) error

func UpsertIslandNPCFeedbackState

func UpsertIslandNPCFeedbackState(state *IslandNPCFeedbackState) error

func UpsertIslandOrderSlotTx

func UpsertIslandOrderSlotTx(ctx context.Context, tx pgx.Tx, commanderID uint32, slot *protobuf.PB_ISLAND_ORDER_SLOT) error

func UpsertIslandOverflowInventory

func UpsertIslandOverflowInventory(commanderID uint32, itemID uint32, count uint32) error

func UpsertIslandRoleDressState

func UpsertIslandRoleDressState(state *IslandRoleDressState) error

func UpsertIslandRuntimeShipOrderSlotTx

func UpsertIslandRuntimeShipOrderSlotTx(ctx context.Context, tx pgx.Tx, slot *IslandShipOrderSlot) error

func UpsertIslandShip

func UpsertIslandShip(ship *IslandShip) error

func UpsertIslandShipDressTx

func UpsertIslandShipDressTx(ctx context.Context, tx pgx.Tx, commanderID uint32, shipID uint32, dressID uint32) error

func UpsertIslandShipOrderAppointTx

func UpsertIslandShipOrderAppointTx(ctx context.Context, tx pgx.Tx, commanderID uint32, appoint *protobuf.PB_SHIP_ORDER_APPOINT) error

func UpsertIslandShipOrderSlot

func UpsertIslandShipOrderSlot(slot *IslandShipOrderSlot) error

func UpsertIslandShipOrderSlotDataTx

func UpsertIslandShipOrderSlotDataTx(ctx context.Context, tx pgx.Tx, commanderID uint32, slot *protobuf.PB_ISLAND_ORDER_SHIP_SLOT) error

func UpsertIslandShipOrderSlotTx

func UpsertIslandShipOrderSlotTx(ctx context.Context, tx pgx.Tx, slot *IslandShipOrderSlot) error

func UpsertIslandShipSkinState

func UpsertIslandShipSkinState(state *IslandShipSkinState) error

func UpsertIslandShipTx

func UpsertIslandShipTx(ctx context.Context, tx pgx.Tx, ship *IslandShip) error

func UpsertIslandShopState

func UpsertIslandShopState(state *IslandShopState) error

func UpsertIslandShopStateTx

func UpsertIslandShopStateTx(ctx context.Context, tx pgx.Tx, state *IslandShopState) error

func UpsertIslandSignInState

func UpsertIslandSignInState(state *IslandSignInState) error

func UpsertIslandSlotCollectStateTx

func UpsertIslandSlotCollectStateTx(ctx context.Context, tx pgx.Tx, state *IslandSlotCollectState) error

func UpsertIslandSnapshot

func UpsertIslandSnapshot(snapshot *IslandSnapshot) error

func UpsertIslandSnapshotTx

func UpsertIslandSnapshotTx(ctx context.Context, tx pgx.Tx, snapshot *IslandSnapshot) error

func UpsertIslandSpeedupTarget

func UpsertIslandSpeedupTarget(commanderID uint32, targetType uint32, targetID uint32, endTime uint32) error

func UpsertIslandSpeedupTargetTx

func UpsertIslandSpeedupTargetTx(ctx context.Context, tx pgx.Tx, commanderID uint32, targetType uint32, targetID uint32, endTime uint32) error

func UpsertIslandSpeedupTicket

func UpsertIslandSpeedupTicket(commanderID uint32, speedID uint32, endTime uint32, count uint32) error

func UpsertIslandTechnologyState

func UpsertIslandTechnologyState(state *IslandTechnologyState) error

func UpsertIslandTreasureState

func UpsertIslandTreasureState(state *IslandTreasureState) error

func UpsertIslandTreasureStateTx

func UpsertIslandTreasureStateTx(ctx context.Context, tx pgx.Tx, state *IslandTreasureState) error

func UpsertIslandWildGatherSignState

func UpsertIslandWildGatherSignState(state *IslandWildGatherSignState) error

func UpsertJuustagramPlayerDiscuss

func UpsertJuustagramPlayerDiscuss(entry *JuustagramPlayerDiscuss) error

func UpsertNewServerShopState

func UpsertNewServerShopState(state *NewServerShopState) error

func UpsertNewServerShopStateTx

func UpsertNewServerShopStateTx(ctx context.Context, tx pgx.Tx, state *NewServerShopState) error

func UpsertOwnedShipEquipmentTx

func UpsertOwnedShipEquipmentTx(ctx context.Context, tx pgx.Tx, entry *OwnedShipEquipment) error

func UpsertOwnedShipShadowSkin

func UpsertOwnedShipShadowSkin(_ any, commanderID uint32, shipID uint32, shadowID uint32, skinID uint32) error

func UpsertOwnedShipStrengthTx

func UpsertOwnedShipStrengthTx(ctx context.Context, tx pgx.Tx, entry *OwnedShipStrength) error

func UpsertOwnedShipTransformTx

func UpsertOwnedShipTransformTx(ctx context.Context, tx pgx.Tx, entry *OwnedShipTransform) error

func UpsertOwnedSpWeaponTx

func UpsertOwnedSpWeaponTx(ctx context.Context, tx pgx.Tx, entry *OwnedSpWeapon) error

func UpsertRandomFlagShipEntry

func UpsertRandomFlagShipEntry(entry RandomFlagShip) error

func UpsertRemasterProgress

func UpsertRemasterProgress(entry *RemasterProgress) error

func UpsertSubmarineState

func UpsertSubmarineState(state *SubmarineExpeditionState) error

func UpsertSurveyState

func UpsertSurveyState(state *SurveyState) error

func ValidateJuustagramChatGroupIDs

func ValidateJuustagramChatGroupIDs(groupIDs []uint32) error

func ValidateOwnedShipTemplateID

func ValidateOwnedShipTemplateID(shipID uint32) error

func ValidateShipID

func ValidateShipID(shipID uint32) error

func WebAuthnCredentialExists

func WebAuthnCredentialExists(credentialID string) (bool, error)

func WebAuthnCredentialExistsForUser

func WebAuthnCredentialExistsForUser(userID string, credentialID string) (bool, error)

func WithIslandTaskProgressTx

func WithIslandTaskProgressTx(commanderID uint32, now time.Time, fn func(state *IslandTaskProgress) error) error

func WithPGXTx

func WithPGXTx(ctx context.Context, fn func(tx pgx.Tx) error) error

func WithTx

func WithTx(ctx context.Context, fn func(q *gen.Queries) error) error

func WithWeeklyTaskProgressTx

func WithWeeklyTaskProgressTx(commanderID uint32, fn func(state *WeeklyTaskProgress) error) error

Types

type Account

type Account struct {
	ID string `gorm:"primary_key;size:36"`

	Username           *string `gorm:"size:64"`
	UsernameNormalized *string `gorm:"size:64;uniqueIndex"`
	CommanderID        *uint32 `gorm:"uniqueIndex"`

	PasswordHash      string    `gorm:"not_null"`
	PasswordAlgo      string    `gorm:"size:32;not_null"`
	PasswordUpdatedAt time.Time `gorm:"type:timestamp;not_null"`

	IsAdmin     bool       `gorm:"default:false;not_null"`
	DisabledAt  *time.Time `gorm:"type:timestamp"`
	LastLoginAt *time.Time `gorm:"type:timestamp"`

	WebAuthnUserHandle []byte `gorm:"uniqueIndex"`

	CreatedAt time.Time `gorm:"autoCreateTime"`
	UpdatedAt time.Time `gorm:"autoUpdateTime"`
}

Account is the single authenticated principal for the REST API.

It can represent: - A staff/admin account (Username set, IsAdmin true/false) - A player-bound account (CommanderID set) - Both (rare, but supported)

func ConsumeUserRegistrationChallenge

func ConsumeUserRegistrationChallenge(commanderID uint32, pin string, now time.Time) (*Account, error)

func ConsumeUserRegistrationChallengeByID

func ConsumeUserRegistrationChallengeByID(id string, pin string, now time.Time) (*Account, error)

func ConsumeUserRegistrationChallengeByIDWithContext

func ConsumeUserRegistrationChallengeByIDWithContext(ctx context.Context, id string, pin string, now time.Time) (*Account, error)

func ConsumeUserRegistrationChallengeWithContext

func ConsumeUserRegistrationChallengeWithContext(ctx context.Context, commanderID uint32, pin string, now time.Time) (*Account, error)

func GetAccountByCommanderID

func GetAccountByCommanderID(commanderID uint32) (*Account, error)

func GetAccountByID

func GetAccountByID(accountID string) (*Account, error)

func GetAccountByUsernameNormalized

func GetAccountByUsernameNormalized(usernameNormalized string) (*Account, error)

func GetAccountByWebAuthnUserHandle

func GetAccountByWebAuthnUserHandle(handle []byte) (*Account, error)

func ListAdminAccounts

func ListAdminAccounts(offset int, limit int) ([]Account, int64, error)

type AccountOverrideEntry

type AccountOverrideEntry struct {
	Key        string
	Mode       string
	Capability authz.Capability
}

func ListAccountOverrides

func ListAccountOverrides(accountID string) ([]AccountOverrideEntry, error)

type AccountPermissionOverride

type AccountPermissionOverride struct {
	AccountID    string `gorm:"primaryKey;size:36"`
	PermissionID string `gorm:"primaryKey;size:36"`

	Mode string `gorm:"size:8;not_null"`

	CanReadSelf  bool `gorm:"default:false;not_null"`
	CanReadAny   bool `gorm:"default:false;not_null"`
	CanWriteSelf bool `gorm:"default:false;not_null"`
	CanWriteAny  bool `gorm:"default:false;not_null"`

	UpdatedAt time.Time `gorm:"autoUpdateTime"`
}

type AccountRole

type AccountRole struct {
	AccountID string    `gorm:"primaryKey;size:36"`
	RoleID    string    `gorm:"primaryKey;size:36"`
	CreatedAt time.Time `gorm:"autoCreateTime"`
}

type ActivityFleet

type ActivityFleet struct {
	CommanderID uint32                 `gorm:"primaryKey"`
	ActivityID  uint32                 `gorm:"primaryKey"`
	GroupList   ActivityFleetGroupList `gorm:"type:text;not_null;default:'[]'"`
}

type ActivityFleetCommander

type ActivityFleetCommander struct {
	Pos uint32 `json:"pos"`
	ID  uint32 `json:"id"`
}

type ActivityFleetGroup

type ActivityFleetGroup struct {
	ID         uint32                   `json:"id"`
	ShipList   []uint32                 `json:"ship_list"`
	Commanders []ActivityFleetCommander `json:"commanders"`
}

type ActivityFleetGroupList

type ActivityFleetGroupList []ActivityFleetGroup

func LoadActivityFleetGroups

func LoadActivityFleetGroups(commanderID uint32, activityID uint32) (ActivityFleetGroupList, bool, error)

func (*ActivityFleetGroupList) Scan

func (list *ActivityFleetGroupList) Scan(value any) error

func (ActivityFleetGroupList) Value

func (list ActivityFleetGroupList) Value() (driver.Value, error)

type ActivityPermanentState

type ActivityPermanentState struct {
	CommanderID         uint32    `gorm:"primary_key"`
	CurrentActivityID   uint32    `gorm:"not_null;default:0"`
	FinishedActivityIDs Int64List `gorm:"type:text;not_null;default:'[]'"`
}

func GetOrCreateActivityPermanentState

func GetOrCreateActivityPermanentState(commanderID uint32) (*ActivityPermanentState, error)

func (*ActivityPermanentState) AddFinished

func (state *ActivityPermanentState) AddFinished(activityID uint32)

func (*ActivityPermanentState) FinishedList

func (state *ActivityPermanentState) FinishedList() []uint32

func (*ActivityPermanentState) HasFinished

func (state *ActivityPermanentState) HasFinished(activityID uint32) bool

type ActivityStoreState

type ActivityStoreState struct {
	CommanderID uint32
	ActivityID  uint32
	Data1       uint32
	StrData1    string
}

func GetActivityStoreState

func GetActivityStoreState(commanderID uint32, activityID uint32) (*ActivityStoreState, error)

func (ActivityStoreState) TableName

func (ActivityStoreState) TableName() string

type ArenaShopState

type ArenaShopState struct {
	CommanderID     uint32 `gorm:"primary_key"`
	FlashCount      uint32 `gorm:"not_null"`
	LastRefreshTime uint32 `gorm:"not_null"`
	NextFlashTime   uint32 `gorm:"not_null"`
}

func GetArenaShopState

func GetArenaShopState(commanderID uint32) (*ArenaShopState, error)

type AtelierBuffSlotState

type AtelierBuffSlotState struct {
	Pos     uint32 `json:"pos"`
	ItemID  uint32 `json:"item_id"`
	ItemNum uint32 `json:"item_num"`
}

type AtelierState

type AtelierState struct {
	CommanderID uint32                          `json:"commander_id"`
	ActID       uint32                          `json:"act_id"`
	Items       map[uint32]uint32               `json:"items"`
	RecipeUses  map[uint32]uint32               `json:"recipe_uses"`
	Slots       map[uint32]AtelierBuffSlotState `json:"slots"`
}

func GetOrCreateAtelierState

func GetOrCreateAtelierState(commanderID uint32, actID uint32) (*AtelierState, error)

func GetOrCreateAtelierStateTx

func GetOrCreateAtelierStateTx(ctx context.Context, tx pgx.Tx, commanderID uint32, actID uint32) (*AtelierState, error)

type AuditLog

type AuditLog struct {
	ID string `gorm:"primary_key;size:36"`

	ActorAccountID   *string `gorm:"size:36;index"`
	ActorCommanderID *uint32 `gorm:"index"`

	Method     string `gorm:"size:8;not_null;index"`
	Path       string `gorm:"size:255;not_null;index"`
	StatusCode int    `gorm:"not_null;index"`

	PermissionKey *string `gorm:"size:128;index"`
	PermissionOp  *string `gorm:"size:16;index"`
	Action        string  `gorm:"size:96;index"`

	Metadata  []byte    `gorm:"type:json"`
	CreatedAt time.Time `gorm:"autoCreateTime"`
}

type AuthChallenge

type AuthChallenge struct {
	ID        string    `gorm:"primary_key;size:36"`
	UserID    *string   `gorm:"size:36;index"`
	Type      string    `gorm:"size:64;not_null;index"`
	Challenge string    `gorm:"size:512;not_null;index"`
	ExpiresAt time.Time `gorm:"type:timestamp;not_null"`
	CreatedAt time.Time `gorm:"autoCreateTime"`
	Metadata  []byte    `gorm:"type:json"`
}

type BackyardCustomThemeTemplate

type BackyardCustomThemeTemplate struct {
	CommanderID      uint32          `json:"commander_id"`
	Pos              uint32          `json:"pos"`
	Name             string          `json:"name"`
	FurniturePutList json.RawMessage `json:"furniture_put_list"`
	IconImageMd5     string          `json:"icon_image_md5"`
	ImageMd5         string          `json:"image_md5"`
	UploadTime       uint32          `json:"upload_time"`
}

BackyardCustomThemeTemplate stores the per-commander editable template (pos 1..N). UploadTime==0 means not published.

func GetBackyardCustomThemeTemplate

func GetBackyardCustomThemeTemplate(commanderID uint32, pos uint32) (*BackyardCustomThemeTemplate, error)

func ListBackyardCustomThemeTemplates

func ListBackyardCustomThemeTemplates(commanderID uint32) ([]BackyardCustomThemeTemplate, error)

type BackyardPublishedThemeVersion

type BackyardPublishedThemeVersion struct {
	ThemeID          string          `json:"theme_id"`
	UploadTime       uint32          `json:"upload_time"`
	OwnerID          uint32          `json:"owner_id"`
	Pos              uint32          `json:"pos"`
	Name             string          `json:"name"`
	FurniturePutList json.RawMessage `json:"furniture_put_list"`
	IconImageMd5     string          `json:"icon_image_md5"`
	ImageMd5         string          `json:"image_md5"`
	LikeCount        uint32          `json:"like_count"`
	FavCount         uint32          `json:"fav_count"`
}

BackyardPublishedThemeVersion stores an uploaded version of a theme. ThemeID is the stable id (player.id .. pos), UploadTime disambiguates versions.

func CreateBackyardPublishedThemeVersionTx

func CreateBackyardPublishedThemeVersionTx(ctx context.Context, tx pgx.Tx, commanderID uint32, pos uint32, name string, furniturePutList json.RawMessage, iconMd5, imageMd5 string) (BackyardPublishedThemeVersion, error)

func LatestBackyardPublishedThemeVersion

func LatestBackyardPublishedThemeVersion(themeID string) (*BackyardPublishedThemeVersion, error)

func ListLatestBackyardPublishedThemeVersions

func ListLatestBackyardPublishedThemeVersions() ([]BackyardPublishedThemeVersion, error)

type BackyardThemeCollection

type BackyardThemeCollection struct {
	CommanderID uint32 `json:"commander_id"`
	ThemeID     string `json:"theme_id"`
	UploadTime  uint32 `json:"upload_time"`
}

type BackyardThemeInform

type BackyardThemeInform struct {
	ID         uint64 `json:"id"`
	ReporterID uint32 `json:"reporter_id"`
	TargetID   uint32 `json:"target_id"`
	TargetName string `json:"target_name"`
	ThemeID    string `json:"theme_id"`
	ThemeName  string `json:"theme_name"`
	Reason     uint32 `json:"reason"`
	CreatedAt  uint32 `json:"created_at"`
}

type BackyardThemeLike

type BackyardThemeLike struct {
	CommanderID uint32 `json:"commander_id"`
	ThemeID     string `json:"theme_id"`
	UploadTime  uint32 `json:"upload_time"`
}

type BattleSession

type BattleSession struct {
	CommanderID uint32    `gorm:"primaryKey;autoIncrement:false"`
	System      uint32    `gorm:"not_null"`
	StageID     uint32    `gorm:"not_null"`
	Key         uint32    `gorm:"not_null"`
	ShipIDs     Int64List `gorm:"type:text;not_null"`
	CreatedAt   time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP;not_null"`
	UpdatedAt   time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP;not_null"`
}

func GetBattleSession

func GetBattleSession(commanderID uint32) (*BattleSession, error)

type Buff

type Buff struct {
	ID          uint32 `gorm:"primary_key" json:"id"`
	Name        string `gorm:"size:256;not_null" json:"name"`
	Description string `gorm:"type:text;not_null" json:"desc"`
	MaxTime     int    `gorm:"default:0;not_null" json:"max_time"`
	BenefitType string `gorm:"size:50;not_null" json:"benefit_type"`
}

func GetBuffByID

func GetBuffByID(id uint32) (*Buff, error)

func ListBuffsPage

func ListBuffsPage(offset int, limit int) ([]Buff, int64, error)

type Build

type Build struct {
	ID         uint32    `gorm:"primary_key"`
	BuilderID  uint32    `gorm:"not_null"`
	ShipID     uint32    `gorm:"not_null"`
	PoolID     uint32    `gorm:"not_null"`
	FinishesAt time.Time `gorm:"not_null"`

	Ship      Ship      `gorm:"foreignKey:ShipID;references:TemplateID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
	Commander Commander `gorm:"foreignKey:BuilderID;references:CommanderID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
}

func GetBuildByID

func GetBuildByID(buildID uint32) (*Build, error)

func OrderedBuilds

func OrderedBuilds(builds []Build) []Build

func (*Build) Consume

func (b *Build) Consume(shipId uint32, commander *Commander) (*OwnedShip, error)

Removes the build from the database and adds the ship to the commander

func (*Build) Create

func (b *Build) Create() error

Inserts or updates a build in the database (based on the primary key)

func (*Build) Delete

func (b *Build) Delete() error

Deletes a build from the database

func (*Build) QuickFinish

func (b *Build) QuickFinish(commander *Commander) error

QuickFinishes a build, checks if the passed commander has enough quick finishers

func (*Build) Retrieve

func (b *Build) Retrieve(greedy bool) error

Gets a build from the database by its primary key If greedy is true, it will also load the relations

func (*Build) Update

func (b *Build) Update() error

Updates a build in the database

type BuildInfoPayload

type BuildInfoPayload struct {
	Build      *Build
	PoolID     uint32
	BuildTime  uint32
	FinishTime time.Time
}

type ChallengeCommanderSlot

type ChallengeCommanderSlot struct {
	Pos         uint32 `json:"pos"`
	CommanderID uint32 `json:"commander_id"`
}

type ChallengeModeState

type ChallengeModeState struct {
	CommanderID  uint32
	ActivityID   uint32
	Mode         uint32
	SeasonID     uint32
	Level        uint32
	CurrentScore uint32
	Issl         uint32

	RegularGroupID   uint32
	SubmarineGroupID uint32

	RegularShipIDs      []uint32
	SubmarineShipIDs    []uint32
	RegularCommanders   []ChallengeCommanderSlot
	SubmarineCommanders []ChallengeCommanderSlot
}

func GetChallengeModeStateForUpdateTx

func GetChallengeModeStateForUpdateTx(ctx context.Context, tx pgx.Tx, commanderID uint32, activityID uint32, mode uint32) (*ChallengeModeState, error)

func ListChallengeModeStates

func ListChallengeModeStates(commanderID uint32, activityID uint32) ([]ChallengeModeState, error)

func (ChallengeModeState) TableName

func (ChallengeModeState) TableName() string

type ChapterDrop

type ChapterDrop struct {
	CommanderID uint32 `gorm:"primaryKey;autoIncrement:false"`
	ChapterID   uint32 `gorm:"primaryKey;autoIncrement:false"`
	ShipID      uint32 `gorm:"primaryKey;autoIncrement:false"`
}

ChapterDrop tracks unique ship drops for a commander in a given chapter. Rows are inserted as ships are obtained; duplicates are ignored.

func GetChapterDrops

func GetChapterDrops(commanderID uint32, chapterID uint32) ([]ChapterDrop, error)

type ChapterProgress

type ChapterProgress struct {
	CommanderID      uint32 `gorm:"primaryKey;autoIncrement:false"`
	ChapterID        uint32 `gorm:"primaryKey;autoIncrement:false"`
	Progress         uint32 `gorm:"not_null"`
	KillBossCount    uint32 `gorm:"not_null"`
	KillEnemyCount   uint32 `gorm:"not_null"`
	TakeBoxCount     uint32 `gorm:"not_null"`
	DefeatCount      uint32 `gorm:"not_null"`
	TodayDefeatCount uint32 `gorm:"not_null"`
	PassCount        uint32 `gorm:"not_null"`
	UpdatedAt        uint32 `gorm:"not_null"`
}

func GetChapterProgress

func GetChapterProgress(commanderID uint32, chapterID uint32) (*ChapterProgress, error)

func ListChapterProgress

func ListChapterProgress(commanderID uint32) ([]ChapterProgress, error)

type ChapterProgressListResult

type ChapterProgressListResult struct {
	Progress []ChapterProgress
	Total    int64
}

func ListChapterProgressPage

func ListChapterProgressPage(commanderID uint32, offset int, limit int) (ChapterProgressListResult, error)

func SearchChapterProgress

func SearchChapterProgress(commanderID uint32, chapterID *uint32, updatedSince *uint32, offset int, limit int) (ChapterProgressListResult, error)

type ChapterState

type ChapterState struct {
	CommanderID uint32 `gorm:"primary_key"`
	ChapterID   uint32 `gorm:"not_null;index"`
	State       []byte `gorm:"not_null"`
	UpdatedAt   uint32 `gorm:"not_null"`
}

func GetChapterState

func GetChapterState(commanderID uint32) (*ChapterState, error)

func ListChapterStates

func ListChapterStates(commanderID uint32) ([]ChapterState, error)

type ChapterStateListResult

type ChapterStateListResult struct {
	States []ChapterState
	Total  int64
}

func SearchChapterStates

func SearchChapterStates(commanderID uint32, chapterID *uint32, updatedSince *uint32, offset int, limit int) (ChapterStateListResult, error)

type CityRebuildRecruit

type CityRebuildRecruit struct {
	ID        uint32 `json:"id"`
	StartTime uint32 `json:"start_time"`
}

type CityRebuildState

type CityRebuildState struct {
	CommanderID uint32 `json:"commander_id"`
	ActID       uint32 `json:"act_id"`

	Pt       uint32               `json:"pt"`
	Builds   []uint32             `json:"builds"`
	Roles    []uint32             `json:"roles"`
	Recruits []CityRebuildRecruit `json:"recruits"`
	Buffs    map[uint32]uint32    `json:"buffs"`

	MaxLevel   uint32 `json:"max_level"`
	CurLevel   uint32 `json:"cur_level"`
	MaxDisplay uint32 `json:"max_display"`

	AdjustTime     uint32 `json:"adjust_time"`
	AdjustLeftHP   uint32 `json:"adjust_left_hp"`
	AdjustMaxLevel uint32 `json:"adjust_max_level"`

	SummaryPt    uint32 `json:"summary_pt"`
	SummaryReady bool   `json:"summary_ready"`
}

func GetOrCreateCityRebuildState

func GetOrCreateCityRebuildState(commanderID uint32, actID uint32) (*CityRebuildState, error)

type ColoringAwardState

type ColoringAwardState struct {
	PageID uint32              `json:"page_id"`
	Drops  []ColoringDropState `json:"drops"`
}

type ColoringCellState

type ColoringCellState struct {
	PageID uint32 `json:"page_id"`
	Row    uint32 `json:"row"`
	Column uint32 `json:"column"`
	Color  uint32 `json:"color"`
}

type ColoringDropState

type ColoringDropState struct {
	Type   uint32 `json:"type"`
	ID     uint32 `json:"id"`
	Number uint32 `json:"number"`
}

type Commander

type Commander struct {
	CommanderID             uint32     `gorm:"primary_key"`
	AccountID               uint32     `gorm:"not_null"`
	Level                   int        `gorm:"default:1;not_null"`
	Exp                     int        `gorm:"default:0;not_null"`
	Name                    string     `gorm:"size:30;not_null;uniqueIndex"`
	LastLogin               time.Time  `gorm:"type:timestamp;default:CURRENT_TIMESTAMP;not_null"`
	GuideIndex              uint32     `gorm:"default:0;not_null"`
	NewGuideIndex           uint32     `gorm:"default:0;not_null"`
	NameChangeCooldown      time.Time  `gorm:"type:timestamp;default:'1970-01-01 00:00:00';not_null"`
	RoomID                  uint32     `gorm:"default:0;not_null"`
	ExchangeCount           uint32     `gorm:"default:0;not_null"` // Number of times the commander has built ships, can be exchanged for UR ships
	DrawCount1              uint32     `gorm:"default:0;not_null"`
	DrawCount10             uint32     `gorm:"default:0;not_null"`
	SupportRequisitionCount uint32     `gorm:"default:0;not_null"`
	SupportRequisitionMonth uint32     `gorm:"default:0;not_null"`
	CollectAttackCount      uint32     `gorm:"default:0;not_null"`
	AccPayLv                uint32     `gorm:"default:0;not_null"`
	LivingAreaCoverID       uint32     `gorm:"default:0;not_null"`
	SelectedIconFrameID     uint32     `gorm:"default:0;not_null"`
	SelectedChatFrameID     uint32     `gorm:"default:0;not_null"`
	SelectedBattleUIID      uint32     `gorm:"default:0;not_null"`
	DisplayIconID           uint32     `gorm:"default:0;not_null"`
	DisplaySkinID           uint32     `gorm:"default:0;not_null"`
	DisplayIconThemeID      uint32     `gorm:"default:0;not_null"`
	Manifesto               string     `gorm:"size:200;default:'';not_null"`
	DormName                string     `gorm:"size:50;default:'';not_null"`
	RandomShipMode          uint32     `gorm:"default:0;not_null"`
	ChildDisplay            uint32     `gorm:"default:1004;not_null"`
	MailStoreroomLv         uint32     `gorm:"default:1;not_null"`
	RandomFlagShipEnabled   bool       `gorm:"default:false;not_null"`
	DeletedAt               *time.Time `gorm:"index"`

	Punishments      []Punishment        `gorm:"foreignKey:PunishedID;references:CommanderID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
	Ships            []OwnedShip         `gorm:"foreignKey:OwnerID;references:CommanderID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
	Items            []CommanderItem     `gorm:"foreignKey:CommanderID;references:CommanderID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
	MiscItems        []CommanderMiscItem `gorm:"foreignKey:CommanderID;references:CommanderID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
	OwnedResources   []OwnedResource     `gorm:"foreignKey:CommanderID;references:CommanderID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
	Builds           []Build             `gorm:"foreignKey:BuilderID;references:CommanderID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
	Mails            []Mail              `gorm:"foreignKey:ReceiverID;references:CommanderID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
	Compensations    []Compensation      `gorm:"-:migration"`
	OwnedSkins       []OwnedSkin         `gorm:"foreignKey:CommanderID;references:CommanderID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
	OwnedEquipments  []OwnedEquipment    `gorm:"foreignKey:CommanderID;references:CommanderID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
	OwnedSpWeapons   []OwnedSpWeapon     `gorm:"foreignKey:OwnerID;references:CommanderID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
	Secretaries      []*OwnedShip        `gorm:"-"`
	Fleets           []Fleet             `gorm:"foreignKey:CommanderID;references:CommanderID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
	EventCollections []EventCollection   `gorm:"foreignKey:CommanderID;references:CommanderID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`

	// These maps will be populated by the Load() method
	OwnedShipsMap     map[uint32]*OwnedShip         `gorm:"-"`
	OwnedResourcesMap map[uint32]*OwnedResource     `gorm:"-"`
	CommanderItemsMap map[uint32]*CommanderItem     `gorm:"-"`
	MiscItemsMap      map[uint32]*CommanderMiscItem `gorm:"-"`
	BuildsMap         map[uint32]*Build             `gorm:"-"`
	OwnedSkinsMap     map[uint32]*OwnedSkin         `gorm:"-"`
	OwnedEquipmentMap map[uint32]*OwnedEquipment    `gorm:"-"`
	OwnedSpWeaponsMap map[uint32]*OwnedSpWeapon     `gorm:"-"`
	MailsMap          map[uint32]*Mail              `gorm:"-"`
	CompensationsMap  map[uint32]*Compensation      `gorm:"-"`
	FleetsMap         map[uint32]*Fleet             `gorm:"-"`
}

func GetCommanderByAccountID

func GetCommanderByAccountID(accountID uint32) (*Commander, error)

func GetCommanderCoreByID

func GetCommanderCoreByID(commanderID uint32) (*Commander, error)

func LoadCommanderSocialDisplay

func LoadCommanderSocialDisplay(commanderID uint32) (*Commander, error)

func LoadCommanderWithDetails

func LoadCommanderWithDetails(id uint32) (Commander, error)

func (*Commander) AddItem

func (c *Commander) AddItem(itemId uint32, amount uint32) error

func (*Commander) AddItemTx

func (c *Commander) AddItemTx(ctx context.Context, tx pgx.Tx, itemId uint32, amount uint32) error

func (*Commander) AddOwnedEquipmentTx

func (c *Commander) AddOwnedEquipmentTx(ctx context.Context, tx pgx.Tx, equipmentID uint32, count uint32) error

func (*Commander) AddResource

func (c *Commander) AddResource(resourceId uint32, amount uint32) error

func (*Commander) AddResourceTx

func (c *Commander) AddResourceTx(ctx context.Context, tx pgx.Tx, resourceId uint32, amount uint32) error

func (*Commander) AddShip

func (c *Commander) AddShip(shipId uint32) (*OwnedShip, error)

func (*Commander) AddShipTx

func (c *Commander) AddShipTx(ctx context.Context, tx pgx.Tx, shipId uint32) (*OwnedShip, error)

func (*Commander) BumpLastLogin

func (c *Commander) BumpLastLogin() error

Bump last login

func (*Commander) CleanMailbox

func (c *Commander) CleanMailbox() error

func (*Commander) Commit

func (c *Commander) Commit() error

Commit saves the commander's data to the database (ships, items, resources, etc)

func (*Commander) ConsumeItem

func (c *Commander) ConsumeItem(itemId uint32, count uint32) error

func (*Commander) ConsumeItemTx

func (c *Commander) ConsumeItemTx(ctx context.Context, tx pgx.Tx, itemId uint32, count uint32) error

func (*Commander) ConsumeResource

func (c *Commander) ConsumeResource(resourceId uint32, count uint32) error

func (*Commander) ConsumeResourceTx

func (c *Commander) ConsumeResourceTx(ctx context.Context, tx pgx.Tx, resourceId uint32, count uint32) error

func (*Commander) CreateBuild

func (c *Commander) CreateBuild(poolId uint32, runningBuilds *int) (*Build, uint32, error)

func (*Commander) DestroyShips

func (c *Commander) DestroyShips(shipIds []uint32) error

func (*Commander) EnsureSupportRequisitionMonth

func (c *Commander) EnsureSupportRequisitionMonth(now time.Time) bool

func (*Commander) EquipmentBagCount

func (c *Commander) EquipmentBagCount() uint32

func (*Commander) GetBuildRange

func (c *Commander) GetBuildRange(minPos, maxPos uint32) ([]Build, error)

Get a range of builds (special weird query, probably to save battery on phones)

func (*Commander) GetItem

func (c *Commander) GetItem(itemId uint32) (CommanderItem, error)

func (*Commander) GetItemCount

func (c *Commander) GetItemCount(itemId uint32) uint32

GetItemCount returns the amount of items the commander has, returns 0 if the item is not found

func (*Commander) GetOwnedEquipment

func (c *Commander) GetOwnedEquipment(equipmentID uint32) *OwnedEquipment

func (*Commander) GetResource

func (c *Commander) GetResource(resourceId uint32) (OwnedResource, error)

func (*Commander) GetResourceCount

func (c *Commander) GetResourceCount(resourceId uint32) uint32

GetResourceCount returns the amount of resources the commander has, returns 0 if the resource is not found

func (*Commander) GetSecretaries

func (c *Commander) GetSecretaries() []*OwnedShip

func (*Commander) GiveSkin

func (c *Commander) GiveSkin(skinId uint32) error

func (*Commander) GiveSkinTx

func (c *Commander) GiveSkinTx(ctx context.Context, tx pgx.Tx, skinId uint32) error

func (*Commander) GiveSkinWithExpiry

func (c *Commander) GiveSkinWithExpiry(skinId uint32, expiresAt *time.Time) error

func (*Commander) HasEnoughCube

func (c *Commander) HasEnoughCube(n uint32) bool

func (*Commander) HasEnoughGold

func (c *Commander) HasEnoughGold(n uint32) bool

func (*Commander) HasEnoughItem

func (c *Commander) HasEnoughItem(itemId uint32, n uint32) bool

func (*Commander) HasEnoughResource

func (c *Commander) HasEnoughResource(resourceId uint32, n uint32) bool

func (*Commander) IncrementDrawCount

func (c *Commander) IncrementDrawCount(count uint32) error

func (*Commander) IncrementExchangeCount

func (c *Commander) IncrementExchangeCount(n uint32) error

Add n exchange count to the commander, n represents the number of built ships, caps at 400

func (*Commander) IncrementReserveUsage

func (c *Commander) IncrementReserveUsage(count uint32) error

func (*Commander) Like

func (c *Commander) Like(groupId uint32) error

Likes a ship, inserts a row into the likes table with the ship's group_id

func (*Commander) Load

func (c *Commander) Load() error

Load loads the commander's data from the database (ships, items, resources, etc)

func (*Commander) ProposeShip

func (c *Commander) ProposeShip(shipId uint32) (bool, error)

func (*Commander) Punish

func (c *Commander) Punish(liftTimestamp *time.Time, permanent bool) error

func (*Commander) RebuildOwnedEquipmentMap

func (c *Commander) RebuildOwnedEquipmentMap()

func (*Commander) RebuildOwnedSpWeaponMap

func (c *Commander) RebuildOwnedSpWeaponMap()

func (*Commander) RemoveOwnedEquipmentTx

func (c *Commander) RemoveOwnedEquipmentTx(ctx context.Context, tx pgx.Tx, equipmentID uint32, count uint32) error

func (*Commander) RemoveOwnedSpWeaponTx

func (c *Commander) RemoveOwnedSpWeaponTx(ctx context.Context, tx pgx.Tx, spweaponID uint32) error

func (*Commander) RemoveSecretaries

func (c *Commander) RemoveSecretaries() error

RemoveSecretaries removes all secretaries from the commander

func (*Commander) RetireShips

func (c *Commander) RetireShips(shipIds *[]uint32) error

Retire a list of ships, return the amount of medals gained, and an error if any Data from : https://azurlane.koumakan.jp/wiki/Building#Retire

func (*Commander) RevokeActivePunishment

func (c *Commander) RevokeActivePunishment() error

func (*Commander) SaveTx

func (c *Commander) SaveTx(ctx context.Context, tx pgx.Tx) error

func (*Commander) SendMail

func (c *Commander) SendMail(mail *Mail) error

func (*Commander) SendMailTx

func (c *Commander) SendMailTx(ctx context.Context, tx pgx.Tx, mail *Mail) error

func (*Commander) SetItem

func (c *Commander) SetItem(itemId uint32, amount uint32) error

func (*Commander) SetOwnedEquipmentTx

func (c *Commander) SetOwnedEquipmentTx(ctx context.Context, tx pgx.Tx, equipmentID uint32, count uint32) error

func (*Commander) SetResource

func (c *Commander) SetResource(resourceId uint32, amount uint32) error

func (*Commander) UpdateRoom

func (c *Commander) UpdateRoom(roomID uint32) error

UpdateRoom changes the commander's room id

func (*Commander) UpdateSecretaries

func (c *Commander) UpdateSecretaries(updates []SecretaryUpdate) error

UpdateSecretaries changes the commander's secretaries (dirty implementation, but it works)

type CommanderAbilityGroup

type CommanderAbilityGroup struct {
	ID          uint32   `json:"id"`
	AbilityList []uint32 `json:"ability_list"`
}

func ListCommanderAbilityGroups

func ListCommanderAbilityGroups() ([]CommanderAbilityGroup, error)

type CommanderAbilityTemplate

type CommanderAbilityTemplate struct {
	ID      uint32 `json:"id"`
	GroupID uint32 `json:"group_id"`
	Cost    uint32 `json:"cost"`
	Worth   uint32 `json:"worth"`
	Next    uint32 `json:"next"`
}

func GetCommanderAbilityTemplate

func GetCommanderAbilityTemplate(abilityID uint32) (*CommanderAbilityTemplate, error)

type CommanderActivityTask

type CommanderActivityTask struct {
	CommanderID uint32
	ActID       uint32
	TaskID      uint32
	Progress    uint32
	Submitted   bool
}

func GetCommanderActivityTask

func GetCommanderActivityTask(commanderID uint32, actID uint32, taskID uint32) (*CommanderActivityTask, error)

func ListCommanderActivityTasks

func ListCommanderActivityTasks(commanderID uint32) ([]CommanderActivityTask, error)

type CommanderAppreciationState

type CommanderAppreciationState struct {
	CommanderID        uint32
	MusicNo            uint32
	MusicMode          uint32
	CartoonReadMark    Int64List
	CartoonCollectMark Int64List
	GalleryUnlocks     Int64List
	GalleryFavorIds    Int64List
	MusicFavorIds      Int64List
}

CommanderAppreciationState stores commander-scoped Appreciation bitsets. These bitsets are surfaced in SC_11003 so the client can rebuild local lists.

func GetOrCreateCommanderAppreciationState

func GetOrCreateCommanderAppreciationState(commanderID uint32) (*CommanderAppreciationState, error)

type CommanderAttire

type CommanderAttire struct {
	CommanderID uint32     `gorm:"primaryKey;autoIncrement:false"`
	Type        uint32     `gorm:"primaryKey;autoIncrement:false"`
	AttireID    uint32     `gorm:"primaryKey;autoIncrement:false"`
	ExpiresAt   *time.Time `gorm:"type:timestamp"`
	IsNew       bool       `gorm:"default:false;not_null"`
}

func GetCommanderAttireEntry

func GetCommanderAttireEntry(commanderID uint32, attireType uint32, attireID uint32) (*CommanderAttire, error)

func ListCommanderAttires

func ListCommanderAttires(commanderID uint32) ([]CommanderAttire, error)

func ListCommanderAttiresByType

func ListCommanderAttiresByType(commanderID uint32, attireType uint32) ([]CommanderAttire, error)

type CommanderBox

type CommanderBox struct {
	CommanderID uint32
	BoxID       uint32
	PoolID      uint32
	BeginTime   uint32
	FinishTime  uint32
}

func ApplyCommanderQuickFinishTx

func ApplyCommanderQuickFinishTx(ctx context.Context, tx pgx.Tx, boxes []CommanderBox, now uint32, itemCount uint32) ([]CommanderBox, error)

func EnsureCommanderBoxes

func EnsureCommanderBoxes(commanderID uint32) ([]CommanderBox, error)

func GetCommanderBox

func GetCommanderBox(commanderID uint32, boxID uint32) (*CommanderBox, error)

func ListCommanderBoxes

func ListCommanderBoxes(commanderID uint32) ([]CommanderBox, error)

func (CommanderBox) TableName

func (CommanderBox) TableName() string

type CommanderBuff

type CommanderBuff struct {
	CommanderID uint32    `gorm:"primaryKey;autoIncrement:false"`
	BuffID      uint32    `gorm:"primaryKey;autoIncrement:false"`
	ExpiresAt   time.Time `gorm:"not_null;index:idx_commander_buff_expires_at"`
}

func GetCommanderBuff

func GetCommanderBuff(commanderID uint32, buffID uint32) (*CommanderBuff, error)

func ListCommanderActiveBuffs

func ListCommanderActiveBuffs(commanderID uint32, now time.Time) ([]CommanderBuff, error)

func ListCommanderBuffs

func ListCommanderBuffs(commanderID uint32) ([]CommanderBuff, error)

type CommanderChargeSuccessEvent

type CommanderChargeSuccessEvent struct {
	CommanderID uint32
	PayID       string
}

func (CommanderChargeSuccessEvent) TableName

func (CommanderChargeSuccessEvent) TableName() string

type CommanderColoringState

type CommanderColoringState struct {
	CommanderID uint32
	ActivityID  uint32
	StartTime   uint32
	Cells       []ColoringCellState
	Awards      []ColoringAwardState
	CreatedAt   time.Time
	UpdatedAt   time.Time
}

func GetCommanderColoringState

func GetCommanderColoringState(commanderID uint32, activityID uint32) (*CommanderColoringState, error)

func GetOrCreateCommanderColoringState

func GetOrCreateCommanderColoringState(commanderID uint32, activityID uint32, startTime uint32) (*CommanderColoringState, error)

type CommanderCommonFlag

type CommanderCommonFlag struct {
	CommanderID uint32
	FlagID      uint32
}

type CommanderCreateMaterialConfig

type CommanderCreateMaterialConfig struct {
	ID      uint32 `json:"id"`
	UseItem uint32 `json:"use_item"`
	Number1 uint32 `json:"number_1"`
}

func GetCommanderCreateMaterialConfig

func GetCommanderCreateMaterialConfig(poolID uint32) (*CommanderCreateMaterialConfig, error)

type CommanderDataTemplateConfig

type CommanderDataTemplateConfig struct {
	ID        uint32 `json:"id"`
	GroupType uint32 `json:"group_type"`
	Rarity    uint32 `json:"rarity"`
	Exp       uint32 `json:"exp"`
	ExpCost   uint32 `json:"exp_cost"`
}

func GetCommanderDataTemplateConfig

func GetCommanderDataTemplateConfig(templateID uint32) (*CommanderDataTemplateConfig, error)

func ListCommanderDataTemplateConfigs

func ListCommanderDataTemplateConfigs() ([]CommanderDataTemplateConfig, error)

type CommanderDormFloorLayout

type CommanderDormFloorLayout struct {
	CommanderID      uint32          `gorm:"primaryKey"`
	Floor            uint32          `gorm:"primaryKey"`
	FurniturePutList json.RawMessage `gorm:"type:json;not_null"`
}

func ListCommanderDormFloorLayouts

func ListCommanderDormFloorLayouts(commanderID uint32) ([]CommanderDormFloorLayout, error)

type CommanderDormState

type CommanderDormState struct {
	CommanderID            uint32 `gorm:"primaryKey"`
	Level                  uint32 `gorm:"not_null;default:1"`
	Food                   uint32 `gorm:"not_null;default:0"`
	FoodMaxIncreaseCount   uint32 `gorm:"not_null;default:0"`
	FoodMaxIncrease        uint32 `gorm:"not_null;default:0"`
	FloorNum               uint32 `gorm:"not_null;default:1"`
	ExpPos                 uint32 `gorm:"not_null;default:2"`
	NextTimestamp          uint32 `gorm:"not_null;default:0"`
	LoadExp                uint32 `gorm:"not_null;default:0"`
	LoadFood               uint32 `gorm:"not_null;default:0"`
	LoadTime               uint32 `gorm:"not_null;default:0"`
	UpdatedAtUnixTimestamp uint32 `gorm:"not_null;default:0"`
}

CommanderDormState stores persistent backyard/dorm state surfaced in SC_19001. Keep this minimal; deltas (SC_19009/SC_19010) are handled separately.

func GetOrCreateCommanderDormState

func GetOrCreateCommanderDormState(commanderID uint32) (*CommanderDormState, error)

func GetOrCreateCommanderDormStateTx

func GetOrCreateCommanderDormStateTx(ctx context.Context, q *gen.Queries, commanderID uint32) (*CommanderDormState, error)

type CommanderDormTheme

type CommanderDormTheme struct {
	CommanderID      uint32          `gorm:"primaryKey"`
	ThemeSlotID      uint32          `gorm:"primaryKey"`
	Name             string          `gorm:"size:50;default:'';not_null"`
	FurniturePutList json.RawMessage `gorm:"type:json;not_null"`
}

func GetCommanderDormTheme

func GetCommanderDormTheme(commanderID uint32, slotID uint32) (*CommanderDormTheme, error)

func ListCommanderDormThemes

func ListCommanderDormThemes(commanderID uint32) ([]CommanderDormTheme, error)

type CommanderFleetTechState

type CommanderFleetTechState struct {
	CommanderID   uint32                  `json:"commander_id"`
	Groups        []FleetTechGroupState   `json:"groups"`
	AttrOverrides []FleetTechAttrOverride `json:"attr_overrides"`
}

func GetCommanderFleetTechState

func GetCommanderFleetTechState(commanderID uint32) (*CommanderFleetTechState, error)

func GetCommanderFleetTechStateTx

func GetCommanderFleetTechStateTx(ctx context.Context, tx pgx.Tx, commanderID uint32) (*CommanderFleetTechState, error)

func GetOrCreateCommanderFleetTechState

func GetOrCreateCommanderFleetTechState(commanderID uint32) (*CommanderFleetTechState, error)

func GetOrCreateCommanderFleetTechStateTx

func GetOrCreateCommanderFleetTechStateTx(ctx context.Context, tx pgx.Tx, commanderID uint32) (*CommanderFleetTechState, error)

func (*CommanderFleetTechState) GetGroup

func (state *CommanderFleetTechState) GetGroup(groupID uint32) (*FleetTechGroupState, bool)

func (*CommanderFleetTechState) SetAttrOverrides

func (state *CommanderFleetTechState) SetAttrOverrides(overrides []FleetTechAttrOverride)

func (*CommanderFleetTechState) UpsertGroup

func (state *CommanderFleetTechState) UpsertGroup(groupID uint32) *FleetTechGroupState

type CommanderFriendRelation

type CommanderFriendRelation struct {
	CommanderID       uint32 `gorm:"primaryKey"`
	FriendCommanderID uint32 `gorm:"primaryKey"`
}

func (CommanderFriendRelation) TableName

func (CommanderFriendRelation) TableName() string

type CommanderFurniture

type CommanderFurniture struct {
	CommanderID uint32 `gorm:"not_null;primaryKey"`
	FurnitureID uint32 `gorm:"not_null;primaryKey"`
	Count       uint32 `gorm:"not_null"`
	GetTime     uint32 `gorm:"not_null"`
}

func ListCommanderFurniture

func ListCommanderFurniture(commanderID uint32) ([]CommanderFurniture, error)

type CommanderGameSet

type CommanderGameSet struct {
	RenameCooldownSeconds       uint32
	AbilityResetCooldownSeconds uint32
	SkillResetCosts             []uint32
}

func LoadCommanderGameSet

func LoadCommanderGameSet() (*CommanderGameSet, error)

type CommanderHome

type CommanderHome struct {
	CommanderID uint32
	Level       uint32
	Exp         uint32
	Clean       uint32
	SceneOpen   bool
}

type CommanderHomeSlot

type CommanderHomeSlot struct {
	CommanderID         uint32
	SlotID              uint32
	OpFlag              uint32
	ExpTime             uint32
	AssignedCommanderID uint32
	Style               uint32
	CacheExp            uint32
}

type CommanderIslandSocialState

type CommanderIslandSocialState struct {
	CommanderID          uint32
	InviteCode           string
	InviteCodeRefreshDay uint32
	WhiteList            []uint32
	BlackList            []uint32
	InvitedCommanderIDs  []uint32
	GiftCount            uint32
	GiftTimestamp        uint32
	GiftVisitors         []uint32
	UpdatedAt            time.Time
}

func GetCommanderIslandSocialState

func GetCommanderIslandSocialState(commanderID uint32) (*CommanderIslandSocialState, error)

func GetCommanderIslandSocialStateForUpdateTx

func GetCommanderIslandSocialStateForUpdateTx(ctx context.Context, tx pgx.Tx, commanderID uint32) (*CommanderIslandSocialState, error)

func GetOrCreateCommanderIslandSocialState

func GetOrCreateCommanderIslandSocialState(commanderID uint32) (*CommanderIslandSocialState, error)

type CommanderIslandTradeInviteState

type CommanderIslandTradeInviteState struct {
	CommanderID         uint32
	InvitedCommanderIDs []uint32
	UpdatedAt           time.Time
}

func GetCommanderIslandTradeInviteState

func GetCommanderIslandTradeInviteState(commanderID uint32) (*CommanderIslandTradeInviteState, error)

func GetOrCreateCommanderIslandTradeInviteState

func GetOrCreateCommanderIslandTradeInviteState(commanderID uint32) (*CommanderIslandTradeInviteState, error)

type CommanderItem

type CommanderItem struct {
	CommanderID uint32 `gorm:"not_null;primaryKey"`
	ItemID      uint32 `gorm:"not_null;primaryKey"`
	Count       uint32 `gorm:"not_null"`

	Commander Commander `gorm:"foreignKey:CommanderID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
	Item      Item      `gorm:"foreignKey:ItemID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
}

type CommanderLivingAreaCover

type CommanderLivingAreaCover struct {
	CommanderID uint32    `gorm:"primaryKey;autoIncrement:false"`
	CoverID     uint32    `gorm:"primaryKey;autoIncrement:false"`
	UnlockedAt  time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP;not_null"`
	IsNew       bool      `gorm:"default:false;not_null"`
}

func GetCommanderLivingAreaCoverEntry

func GetCommanderLivingAreaCoverEntry(commanderID uint32, coverID uint32) (*CommanderLivingAreaCover, error)

func ListCommanderLivingAreaCovers

func ListCommanderLivingAreaCovers(commanderID uint32) ([]CommanderLivingAreaCover, error)

type CommanderLoveLetterState

type CommanderLoveLetterState struct {
	CommanderID    uint32
	Medals         []LoveLetterMedalState
	ManualLetters  []LoveLetterLetterState
	ConvertedItems []LoveLetterConvertedItem
	RewardedIDs    []uint32
	LetterContents map[uint32]string
	CreatedAt      time.Time
	UpdatedAt      time.Time
}

func GetCommanderLoveLetterState

func GetCommanderLoveLetterState(commanderID uint32) (*CommanderLoveLetterState, error)

func GetOrCreateCommanderLoveLetterState

func GetOrCreateCommanderLoveLetterState(commanderID uint32) (*CommanderLoveLetterState, error)

type CommanderMedalDisplay

type CommanderMedalDisplay struct {
	CommanderID uint32 `gorm:"primaryKey;autoIncrement:false"`
	Position    uint32 `gorm:"primaryKey;autoIncrement:false"`
	MedalID     uint32 `gorm:"not null"`
}

CommanderMedalDisplay persists a commander's ordered medal/trophy display list. Ordering is stable via Position (0-based).

type CommanderMeow

type CommanderMeow struct {
	ID          uint32
	CommanderID uint32
	TemplateID  uint32
	Level       uint32
	Exp         uint32
	IsLocked    uint32
	UsedPt      uint32
	CreatedAt   time.Time
}

func CreateCommanderMeowTx

func CreateCommanderMeowTx(ctx context.Context, tx pgx.Tx, commanderID uint32, templateID uint32) (*CommanderMeow, error)

func GetCommanderMeow

func GetCommanderMeow(commanderID uint32, meowID uint32) (*CommanderMeow, error)

func ListCommanderMeows

func ListCommanderMeows(commanderID uint32) ([]CommanderMeow, error)

func (CommanderMeow) TableName

func (CommanderMeow) TableName() string

type CommanderMetaPtProgress

type CommanderMetaPtProgress struct {
	CommanderID uint32
	GroupID     uint32
	Pt          uint32
	FetchList   []uint32
}

func GetCommanderMetaPtProgress

func GetCommanderMetaPtProgress(commanderID uint32, groupID uint32) (*CommanderMetaPtProgress, error)

func GetOrCreateCommanderMetaPtProgress

func GetOrCreateCommanderMetaPtProgress(commanderID uint32, groupID uint32) (*CommanderMetaPtProgress, error)

func GetOrCreateCommanderMetaPtProgressTx

func GetOrCreateCommanderMetaPtProgressTx(ctx context.Context, tx pgx.Tx, commanderID uint32, groupID uint32) (*CommanderMetaPtProgress, error)

func ListCommanderMetaPtProgress

func ListCommanderMetaPtProgress(commanderID uint32) ([]CommanderMetaPtProgress, error)

func (CommanderMetaPtProgress) TableName

func (CommanderMetaPtProgress) TableName() string

type CommanderMetaTacticsSkillState

type CommanderMetaTacticsSkillState struct {
	CommanderID uint32
	ShipID      uint32
	SkillID     uint32
	SkillPos    uint32
	Level       uint32
	Exp         uint32
}

func GetOrCreateCommanderMetaTacticsSkillStateTx

func GetOrCreateCommanderMetaTacticsSkillStateTx(ctx context.Context, tx pgx.Tx, commanderID uint32, shipID uint32, skillID uint32, skillPos uint32) (*CommanderMetaTacticsSkillState, error)

func ListCommanderMetaTacticsSkillStates

func ListCommanderMetaTacticsSkillStates(commanderID uint32, shipID uint32) ([]CommanderMetaTacticsSkillState, error)

type CommanderMetaTacticsState

type CommanderMetaTacticsState struct {
	CommanderID    uint32
	ShipID         uint32
	CurrentSkillID uint32
	DailyExp       uint32
	DoubleExp      uint32
	SwitchCnt      uint32
}

func GetCommanderMetaTacticsState

func GetCommanderMetaTacticsState(commanderID uint32, shipID uint32) (*CommanderMetaTacticsState, error)

func GetOrCreateCommanderMetaTacticsStateTx

func GetOrCreateCommanderMetaTacticsStateTx(ctx context.Context, tx pgx.Tx, commanderID uint32, shipID uint32) (*CommanderMetaTacticsState, error)

type CommanderMetaTacticsTaskProgress

type CommanderMetaTacticsTaskProgress struct {
	CommanderID uint32
	ShipID      uint32
	SkillID     uint32
	TaskID      uint32
	FinishCnt   uint32
}

func ListCommanderMetaTacticsTaskProgress

func ListCommanderMetaTacticsTaskProgress(commanderID uint32, shipID uint32) ([]CommanderMetaTacticsTaskProgress, error)

type CommanderMiniGameScore

type CommanderMiniGameScore struct {
	CommanderID uint32
	Name        string
	Score       uint32
	TimeData    uint32
	DisplayIcon uint32
	DisplaySkin uint32
	IconFrame   uint32
	ChatFrame   uint32
	IconTheme   uint32
}

func ListCommanderMiniGameScores

func ListCommanderMiniGameScores(gameID uint32) ([]CommanderMiniGameScore, error)

type CommanderMiscItem

type CommanderMiscItem struct {
	CommanderID uint32 `gorm:"not_null;primaryKey"`
	ItemID      uint32 `gorm:"not_null;primaryKey"`
	Data        uint32 `gorm:"not_null;primaryKey"`

	Commander Commander `gorm:"foreignKey:CommanderID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
	Item      Item      `gorm:"foreignKey:ItemID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
}

type CommanderPacketState

type CommanderPacketState struct {
	OwnerCommanderID  uint32
	CommanderID       uint32
	Level             uint32
	Name              string
	IsLocked          bool
	UsedPt            uint32
	AbilityIDs        []uint32
	AbilityOriginIDs  []uint32
	PendingAbilityIDs []uint32
	AbilityResetAt    time.Time
	RenameCooldownAt  time.Time

	CreatedAt time.Time
	UpdatedAt time.Time
}

func GetCommanderPacketState

func GetCommanderPacketState(ownerCommanderID uint32, commanderID uint32) (*CommanderPacketState, error)

func GetOrCreateCommanderPacketState

func GetOrCreateCommanderPacketState(ownerCommanderID uint32, commanderID uint32) (*CommanderPacketState, error)

func (CommanderPacketState) TableName

func (CommanderPacketState) TableName() string

type CommanderPrefabFleet

type CommanderPrefabFleet struct {
	OwnerCommanderID uint32
	PrefabID         uint32
	Name             string
	RenameCooldownAt time.Time
	CommanderSlots   []CommanderPrefabSlot

	CreatedAt time.Time
	UpdatedAt time.Time
}

func GetCommanderPrefabFleet

func GetCommanderPrefabFleet(ownerCommanderID uint32, prefabID uint32) (*CommanderPrefabFleet, error)

func (CommanderPrefabFleet) TableName

func (CommanderPrefabFleet) TableName() string

type CommanderPrefabSlot

type CommanderPrefabSlot struct {
	Pos         uint32 `json:"pos"`
	CommanderID uint32 `json:"commander_id"`
}

type CommanderQuickFinishCounts

type CommanderQuickFinishCounts struct {
	ItemCnt   uint32
	FinishCnt uint32
	AffectCnt uint32
}

func ComputeCommanderQuickFinishCounts

func ComputeCommanderQuickFinishCounts(boxes []CommanderBox, now uint32, availableItems uint32) CommanderQuickFinishCounts

type CommanderShipSkill

type CommanderShipSkill struct {
	CommanderID uint32
	ShipID      uint32
	SkillPos    uint32
	SkillID     uint32
	Level       uint32
	Exp         uint32
}

func GetCommanderShipSkill

func GetCommanderShipSkill(commanderID uint32, shipID uint32, skillPos uint32) (*CommanderShipSkill, error)

func GetOrCreateCommanderShipSkillTx

func GetOrCreateCommanderShipSkillTx(ctx context.Context, tx pgx.Tx, commanderID uint32, shipID uint32, skillPos uint32, skillID uint32) (*CommanderShipSkill, error)

type CommanderShipyardBlueprint

type CommanderShipyardBlueprint struct {
	CommanderID    uint32
	BlueprintID    uint32
	ShipID         uint32
	StartTime      uint32
	BluePrintLevel uint32
	Exp            uint32
	StartDuration  uint32
}

func GetCommanderShipyardBlueprintTx

func GetCommanderShipyardBlueprintTx(ctx context.Context, tx pgx.Tx, commanderID uint32, blueprintID uint32) (*CommanderShipyardBlueprint, error)

func ListCommanderShipyardBlueprints

func ListCommanderShipyardBlueprints(commanderID uint32) ([]CommanderShipyardBlueprint, error)

func (CommanderShipyardBlueprint) TableName

func (CommanderShipyardBlueprint) TableName() string

type CommanderShipyardState

type CommanderShipyardState struct {
	CommanderID              uint32
	ColdTime                 uint32
	DailyCatchupStrengthen   uint32
	DailyCatchupStrengthenUR uint32
}

func GetCommanderShipyardState

func GetCommanderShipyardState(commanderID uint32) (*CommanderShipyardState, error)

func GetOrCreateCommanderShipyardStateTx

func GetOrCreateCommanderShipyardStateTx(ctx context.Context, tx pgx.Tx, commanderID uint32) (*CommanderShipyardState, error)

func (CommanderShipyardState) TableName

func (CommanderShipyardState) TableName() string

type CommanderSkillClass

type CommanderSkillClass struct {
	CommanderID uint32
	RoomID      uint32
	ShipID      uint32
	SkillPos    uint32
	SkillID     uint32
	StartTime   uint32
	FinishTime  uint32
	Exp         uint32
}

func GetCommanderSkillClassByRoomTx

func GetCommanderSkillClassByRoomTx(ctx context.Context, tx pgx.Tx, commanderID uint32, roomID uint32) (*CommanderSkillClass, error)

func ListCommanderSkillClasses

func ListCommanderSkillClasses(commanderID uint32) ([]CommanderSkillClass, error)

type CommanderSocialProfile

type CommanderSocialProfile struct {
	CommanderID         uint32
	Name                string
	Level               uint32
	Manifesto           string
	LastLoginUnix       uint32
	DisplayIconID       uint32
	DisplaySkinID       uint32
	SelectedIconFrameID uint32
	SelectedChatFrameID uint32
	DisplayIconThemeID  uint32
	ShipCount           uint32
	CollectionCount     uint32
	CollectAttackCount  uint32
	PvpAttackCount      uint32
	PvpWinCount         uint32
}

func GetCommanderSocialProfile

func GetCommanderSocialProfile(commanderID uint32) (CommanderSocialProfile, error)

func GetCommanderSocialProfileByID

func GetCommanderSocialProfileByID(commanderID uint32) (*CommanderSocialProfile, error)

func GetCommanderSocialProfileByName

func GetCommanderSocialProfileByName(name string) (*CommanderSocialProfile, error)

func ListCommanderSocialProfilesForRecommendations

func ListCommanderSocialProfilesForRecommendations(excludeCommanderID uint32, limit int) ([]CommanderSocialProfile, error)

func ListFriendProfiles

func ListFriendProfiles(commanderID uint32) ([]CommanderSocialProfile, error)

type CommanderSoundStory

type CommanderSoundStory struct {
	CommanderID  uint32    `gorm:"primaryKey;autoIncrement:false"`
	SoundStoryID uint32    `gorm:"primaryKey;autoIncrement:false"`
	CreatedAt    time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP;not_null"`
}

type CommanderStoreupAwardProgress

type CommanderStoreupAwardProgress struct {
	CommanderID    uint32 `gorm:"primaryKey;autoIncrement:false"`
	StoreupID      uint32 `gorm:"primaryKey;autoIncrement:false"`
	LastAwardIndex uint32 `gorm:"not null;default:0"`
}

CommanderStoreupAwardProgress tracks which collection (storeup) award tiers a commander has claimed. LastAwardIndex is a 1-based index into storeup_data_template.award_display/level.

func GetCommanderStoreupAwardProgress

func GetCommanderStoreupAwardProgress(commanderID uint32, storeupID uint32) (*CommanderStoreupAwardProgress, error)

func ListCommanderStoreupAwardProgress

func ListCommanderStoreupAwardProgress(commanderID uint32) ([]CommanderStoreupAwardProgress, error)

type CommanderStory

type CommanderStory struct {
	CommanderID uint32    `gorm:"primaryKey;autoIncrement:false"`
	StoryID     uint32    `gorm:"primaryKey;autoIncrement:false"`
	CreatedAt   time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP;not_null"`
}

type CommanderSurvey

type CommanderSurvey struct {
	CommanderID uint32    `gorm:"primaryKey;autoIncrement:false"`
	SurveyID    uint32    `gorm:"primaryKey;autoIncrement:false"`
	CompletedAt time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP;not_null"`
}

type CommanderTB

type CommanderTB struct {
	CommanderID uint32 `gorm:"primary_key"`
	State       []byte `gorm:"not_null"`
	Permanent   []byte `gorm:"not_null"`
}

func GetCommanderTB

func GetCommanderTB(commanderID uint32) (*CommanderTB, error)

func NewCommanderTB

func NewCommanderTB(commanderID uint32, info *protobuf.TBINFO, permanent *protobuf.TBPERMANENT) (*CommanderTB, error)

func (*CommanderTB) Decode

func (entry *CommanderTB) Decode() (*protobuf.TBINFO, *protobuf.TBPERMANENT, error)

func (*CommanderTB) Encode

func (entry *CommanderTB) Encode(info *protobuf.TBINFO, permanent *protobuf.TBPERMANENT) error

type CommanderTacticsQuickFinish

type CommanderTacticsQuickFinish struct {
	CommanderID uint32
	UsedCount   uint32
	ResetDay    uint32
}

type CommanderTask

type CommanderTask struct {
	CommanderID uint32 `gorm:"primaryKey;autoIncrement:false"`
	TaskID      uint32 `gorm:"primaryKey;autoIncrement:false"`
	Progress    uint32 `gorm:"not null;default:0"`
	AcceptTime  uint32 `gorm:"not null;default:0"`
	SubmitTime  uint32 `gorm:"not null;default:0"`
}

func GetCommanderTaskTx

func GetCommanderTaskTx(ctx context.Context, tx pgx.Tx, commanderID uint32, taskID uint32) (*CommanderTask, error)

func ListCommanderTasks

func ListCommanderTasks(commanderID uint32) ([]CommanderTask, error)

func (CommanderTask) TableName

func (CommanderTask) TableName() string

type CommanderTrophyProgress

type CommanderTrophyProgress struct {
	CommanderID uint32 `gorm:"primaryKey;autoIncrement:false"`
	TrophyID    uint32 `gorm:"primaryKey;autoIncrement:false"`
	Progress    uint32 `gorm:"not null;default:0"`
	Timestamp   uint32 `gorm:"not null;default:0"`
}

CommanderTrophyProgress tracks a commander's trophy/medal progress and claim timestamp. Timestamp == 0 means unclaimed.

func GetCommanderTrophyProgress

func GetCommanderTrophyProgress(commanderID uint32, trophyID uint32) (*CommanderTrophyProgress, error)

func GetOrCreateCommanderTrophyProgress

func GetOrCreateCommanderTrophyProgress(commanderID uint32, trophyID uint32, progress uint32) (*CommanderTrophyProgress, bool, error)

func ListCommanderTrophyProgress

func ListCommanderTrophyProgress(commanderID uint32) ([]CommanderTrophyProgress, error)

type Compensation

type Compensation struct {
	ID          uint32    `gorm:"primary_key"`
	CommanderID uint32    `gorm:"not_null"`
	Title       string    `gorm:"type:varchar(100);not_null"`
	Text        string    `gorm:"type:varchar(2000);not_null"`
	SendTime    time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP;not_null"`
	ExpiresAt   time.Time `gorm:"type:timestamp;not_null"`
	AttachFlag  bool      `gorm:"not_null;default:false"`
	CreatedAt   time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP;not_null"`

	Attachments []CompensationAttachment `gorm:"foreignkey:CompensationID;references:ID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
}

func GetCompensationByCommanderAndID

func GetCompensationByCommanderAndID(commanderID uint32, compensationID uint32) (*Compensation, error)

func LoadCommanderCompensations

func LoadCommanderCompensations(commanderID uint32) ([]Compensation, error)

func (*Compensation) CollectAttachments

func (c *Compensation) CollectAttachments(commander *Commander) ([]CompensationAttachment, error)

func (*Compensation) Create

func (c *Compensation) Create() error

func (*Compensation) Delete

func (c *Compensation) Delete() error

func (*Compensation) IsExpired

func (c *Compensation) IsExpired(now time.Time) bool

func (*Compensation) Update

func (c *Compensation) Update() error

type CompensationAttachment

type CompensationAttachment struct {
	ID             uint32 `gorm:"primary_key"`
	CompensationID uint32 `gorm:"not_null"`
	Type           uint32 `gorm:"not_null"`
	ItemID         uint32 `gorm:"not_null"`
	Quantity       uint32 `gorm:"not_null"`
}

type ComposeDataTemplateEntry

type ComposeDataTemplateEntry struct {
	ID          uint32 `json:"id"`
	EquipID     uint32 `json:"equip_id"`
	MaterialID  uint32 `json:"material_id"`
	MaterialNum uint32 `json:"material_num"`
	GoldNum     uint32 `json:"gold_num"`
}

func GetComposeDataTemplateEntry

func GetComposeDataTemplateEntry(id uint32) (*ComposeDataTemplateEntry, error)

type ConfigEntry

type ConfigEntry struct {
	ID       uint64          `json:"id"`
	Category string          `json:"category"`
	Key      string          `json:"key"`
	Data     json.RawMessage `json:"data"`
}

func GetConfigEntry

func GetConfigEntry(category string, key string) (*ConfigEntry, error)

func GetConfigEntryByID

func GetConfigEntryByID(id uint64) (*ConfigEntry, error)

func ListConfigEntries

func ListConfigEntries(category string) ([]ConfigEntry, error)

func ListConfigEntriesFiltered

func ListConfigEntriesFiltered(category string, key string) ([]ConfigEntry, error)

type Debug

type Debug struct {
	FrameID    uint      `gorm:"primary_key"`
	PacketSize int       `gorm:"not_null"`
	PacketID   int       `gorm:"not_null"`
	Data       []byte    `gorm:"not_null"`
	LoggedAt   time.Time `gorm:"default:CURRENT_TIMESTAMP"`

	DebugName DebugName `gorm:"foreignKey:PacketID"`
}

type DebugName

type DebugName struct {
	ID   int    `gorm:"primary_key"`
	Name string `gorm:"default:'Unknown'"`

	Debug []Debug `gorm:"foreignKey:PacketID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
}

type DeviceAuthMap

type DeviceAuthMap struct {
	DeviceID  string    `gorm:"primary_key;size:128"`
	Arg2      uint32    `gorm:"not_null"`
	AccountID uint32    `gorm:"not_null"`
	UpdatedAt time.Time `gorm:"autoUpdateTime"`
}

func GetDeviceAuthMapByDeviceID

func GetDeviceAuthMapByDeviceID(deviceID string) (*DeviceAuthMap, error)

type Dorm3dActInfo

type Dorm3dActInfo struct {
	ShipGroup uint32
	Type      uint32
	ActID     uint32
	Time      uint32
}

func ApplyDorm3dTriggerEvents

func ApplyDorm3dTriggerEvents(commanderID uint32, events []Dorm3dEventInfo, now uint32) ([]Dorm3dActInfo, error)

type Dorm3dApartment

type Dorm3dApartment struct {
	CommanderID        uint32             `gorm:"primary_key" json:"commander_id"`
	DailyVigorMax      uint32             `gorm:"not_null;default:0" json:"daily_vigor_max"`
	Gifts              Dorm3dGiftList     `gorm:"type:text;not_null;default:'[]'" json:"gifts"`
	Ships              Dorm3dShipList     `gorm:"type:text;not_null;default:'[]'" json:"ships"`
	GiftDaily          Dorm3dGiftShopList `gorm:"type:text;not_null;default:'[]'" json:"gift_daily"`
	GiftPermanent      Dorm3dGiftShopList `gorm:"type:text;not_null;default:'[]'" json:"gift_permanent"`
	FurnitureDaily     Dorm3dGiftShopList `gorm:"type:text;not_null;default:'[]'" json:"furniture_daily"`
	FurniturePermanent Dorm3dGiftShopList `gorm:"type:text;not_null;default:'[]'" json:"furniture_permanent"`
	Rooms              Dorm3dRoomList     `gorm:"type:text;not_null;default:'[]'" json:"rooms"`
	Ins                Dorm3dInsList      `gorm:"type:text;not_null;default:'[]'" json:"ins"`
}

func GetDorm3dApartment

func GetDorm3dApartment(commanderID uint32) (*Dorm3dApartment, error)

func GetDorm3dApartmentTx

func GetDorm3dApartmentTx(ctx context.Context, tx pgx.Tx, commanderID uint32) (*Dorm3dApartment, error)

func GetOrCreateDorm3dApartment

func GetOrCreateDorm3dApartment(commanderID uint32) (*Dorm3dApartment, error)

func GetOrCreateDorm3dApartmentTx

func GetOrCreateDorm3dApartmentTx(ctx context.Context, tx pgx.Tx, commanderID uint32) (*Dorm3dApartment, error)

func ListDorm3dApartments

func ListDorm3dApartments(offset int, limit int) ([]Dorm3dApartment, int64, error)

func NewDorm3dApartment

func NewDorm3dApartment(commanderID uint32) Dorm3dApartment

func (*Dorm3dApartment) AddRoom

func (apartment *Dorm3dApartment) AddRoom(room Dorm3dRoom) bool

func (*Dorm3dApartment) EnsureDefaults

func (apartment *Dorm3dApartment) EnsureDefaults()

func (*Dorm3dApartment) FindGift

func (apartment *Dorm3dApartment) FindGift(giftID uint32) *Dorm3dGift

func (*Dorm3dApartment) FindShip

func (apartment *Dorm3dApartment) FindShip(shipGroup uint32) *Dorm3dShip

func (*Dorm3dApartment) RoomByID

func (apartment *Dorm3dApartment) RoomByID(roomID uint32) *Dorm3dRoom

type Dorm3dCommInfo

type Dorm3dCommInfo struct {
	ID        uint32           `json:"id"`
	Time      uint32           `json:"time"`
	ReadFlag  uint32           `json:"read_flag"`
	ReplyList []Dorm3dKeyValue `json:"reply_list"`
}

type Dorm3dEventInfo

type Dorm3dEventInfo struct {
	EventType uint32
	Value     uint32
	ShipGroup uint32
}

type Dorm3dFriendCircleInfo

type Dorm3dFriendCircleInfo struct {
	ID        uint32              `json:"id"`
	Time      uint32              `json:"time"`
	ReadFlag  uint32              `json:"read_flag"`
	GoodFlag  uint32              `json:"good_flag"`
	ReplyList []Dorm3dReplyFriend `json:"reply_list"`
	ExitTime  uint32              `json:"exit_time"`
}

type Dorm3dFurniture

type Dorm3dFurniture struct {
	FurnitureID uint32 `json:"furniture_id"`
	SlotID      uint32 `json:"slot_id"`
}

type Dorm3dGift

type Dorm3dGift struct {
	GiftID     uint32 `json:"gift_id"`
	Number     uint32 `json:"number"`
	UsedNumber uint32 `json:"used_number"`
}

type Dorm3dGiftList

type Dorm3dGiftList []Dorm3dGift

func (*Dorm3dGiftList) Scan

func (list *Dorm3dGiftList) Scan(value any) error

func (Dorm3dGiftList) Value

func (list Dorm3dGiftList) Value() (driver.Value, error)

type Dorm3dGiftShop

type Dorm3dGiftShop struct {
	GiftID uint32 `json:"gift_id"`
	Count  uint32 `json:"count"`
}

type Dorm3dGiftShopList

type Dorm3dGiftShopList []Dorm3dGiftShop

func (*Dorm3dGiftShopList) Scan

func (list *Dorm3dGiftShopList) Scan(value any) error

func (Dorm3dGiftShopList) Value

func (list Dorm3dGiftShopList) Value() (driver.Value, error)

type Dorm3dIns

type Dorm3dIns struct {
	ShipGroup  uint32                   `json:"ship_group"`
	CareFlag   uint32                   `json:"care_flag"`
	CurBack    uint32                   `json:"cur_back"`
	CurCommId  uint32                   `json:"cur_comm_id"`
	CommList   []Dorm3dCommInfo         `json:"comm_list"`
	PhoneList  []Dorm3dPhoneInfo        `json:"phone_list"`
	FriendList []Dorm3dFriendCircleInfo `json:"friend_list"`
}

type Dorm3dInsList

type Dorm3dInsList []Dorm3dIns

func (*Dorm3dInsList) Scan

func (list *Dorm3dInsList) Scan(value any) error

func (Dorm3dInsList) Value

func (list Dorm3dInsList) Value() (driver.Value, error)

type Dorm3dKeyValue

type Dorm3dKeyValue struct {
	Key   uint32 `json:"key"`
	Value uint32 `json:"value"`
}

type Dorm3dPhoneInfo

type Dorm3dPhoneInfo struct {
	ID       uint32 `json:"id"`
	Time     uint32 `json:"time"`
	ReadFlag uint32 `json:"read_flag"`
}

type Dorm3dReplyFriend

type Dorm3dReplyFriend struct {
	Key   uint32 `json:"key"`
	Value uint32 `json:"value"`
	Time  uint32 `json:"time"`
}

type Dorm3dRoom

type Dorm3dRoom struct {
	ID          uint32            `json:"id"`
	Furnitures  []Dorm3dFurniture `json:"furnitures"`
	Collections []uint32          `json:"collections"`
	Ships       []uint32          `json:"ships"`
}

type Dorm3dRoomList

type Dorm3dRoomList []Dorm3dRoom

func (*Dorm3dRoomList) Scan

func (list *Dorm3dRoomList) Scan(value any) error

func (Dorm3dRoomList) Value

func (list Dorm3dRoomList) Value() (driver.Value, error)

type Dorm3dShip

type Dorm3dShip struct {
	ShipGroup      uint32                 `json:"ship_group"`
	FavorLv        uint32                 `json:"favor_lv"`
	FavorExp       uint32                 `json:"favor_exp"`
	RegularTrigger []uint32               `json:"regular_trigger"`
	DailyFavor     uint32                 `json:"daily_favor"`
	Dialogues      []uint32               `json:"dialogues"`
	Skins          []uint32               `json:"skins"`
	CurSkin        uint32                 `json:"cur_skin"`
	Name           string                 `json:"name"`
	NameCd         uint32                 `json:"name_cd"`
	VisitTime      uint32                 `json:"visit_time"`
	HiddenInfo     []Dorm3dSkinHiddenInfo `json:"hidden_info"`
}

type Dorm3dShipList

type Dorm3dShipList []Dorm3dShip

func (*Dorm3dShipList) Scan

func (list *Dorm3dShipList) Scan(value any) error

func (Dorm3dShipList) Value

func (list Dorm3dShipList) Value() (driver.Value, error)

type Dorm3dSkinHiddenInfo

type Dorm3dSkinHiddenInfo struct {
	SkinID      uint32   `json:"skin_id"`
	HiddenParts []uint32 `json:"hidden_parts"`
}

type EducateShopGoodsState

type EducateShopGoodsState struct {
	ID  uint32 `json:"id"`
	Num uint32 `json:"num"`
}

type EducateShopState

type EducateShopState struct {
	CommanderID uint32
	ShopID      uint32
	RefreshKey  uint32
	Goods       []EducateShopGoodsState
}

func GetEducateShopStateTx

func GetEducateShopStateTx(ctx context.Context, tx pgx.Tx, commanderID uint32, shopID uint32) (*EducateShopState, error)

func ListEducateShopStates

func ListEducateShopStates(commanderID uint32) ([]EducateShopState, error)

func (EducateShopState) TableName

func (EducateShopState) TableName() string

type EquipCodeLike

type EquipCodeLike struct {
	ID uint64 `gorm:"primaryKey"`

	CommanderID uint32 `gorm:"not_null;index;uniqueIndex:idx_equip_code_like_dedupe"`
	ShipGroupID uint32 `gorm:"not_null;uniqueIndex:idx_equip_code_like_dedupe"`
	ShareID     uint32 `gorm:"not_null;index;uniqueIndex:idx_equip_code_like_dedupe"`
	LikeDay     uint32 `gorm:"not_null;uniqueIndex:idx_equip_code_like_dedupe"`
	CreatedAt   time.Time
}

type EquipCodeReport

type EquipCodeReport struct {
	ID uint64 `gorm:"primaryKey"`

	CommanderID uint32 `gorm:"not_null;index;uniqueIndex:idx_equip_code_report_dedupe"`
	ShareID     uint32 `gorm:"not_null;index;uniqueIndex:idx_equip_code_report_dedupe"`
	ReportDay   uint32 `gorm:"not_null;uniqueIndex:idx_equip_code_report_dedupe"`

	ShipGroupID uint32 `gorm:"not_null"`
	ReportType  uint32 `gorm:"not_null"`
	CreatedAt   time.Time
}

type EquipCodeShare

type EquipCodeShare struct {
	ID uint64 `gorm:"primaryKey"`

	CommanderID uint32 `gorm:"not_null;index;uniqueIndex:idx_equip_code_share_dedupe"`
	ShipGroupID uint32 `gorm:"not_null;uniqueIndex:idx_equip_code_share_dedupe"`
	ShareDay    uint32 `gorm:"not_null;uniqueIndex:idx_equip_code_share_dedupe"`
	CreatedAt   time.Time
}

EquipCodeShare tracks per-commander sharing activity for equipment codes. It is used for enforcing daily share limits.

type EquipUpgradeData

type EquipUpgradeData struct {
	ID           uint32
	UpgradeFrom  uint32
	TargetID     uint32
	CoinConsume  uint32
	MaterialCost []EquipUpgradeMaterial
}

func GetEquipUpgradeDataTx

func GetEquipUpgradeDataTx(upgradeID uint32) (*EquipUpgradeData, error)

type EquipUpgradeMaterial

type EquipUpgradeMaterial struct {
	ItemID uint32
	Count  uint32
}

type Equipment

type Equipment struct {
	ID                uint32          `gorm:"primary_key" json:"id"`
	Base              *uint32         `gorm:"type:int" json:"base"`
	DestroyGold       uint32          `gorm:"not_null" json:"destory_gold"`
	DestroyItem       json.RawMessage `gorm:"type:json" json:"destory_item"`
	EquipLimit        int             `gorm:"not_null" json:"equip_limit"`
	Group             uint32          `gorm:"not_null" json:"group"`
	Important         uint32          `gorm:"not_null" json:"important"`
	Level             uint32          `gorm:"not_null" json:"level"`
	Next              int             `gorm:"not_null" json:"next"`
	Prev              int             `gorm:"not_null" json:"prev"`
	RestoreGold       uint32          `gorm:"not_null" json:"restore_gold"`
	RestoreItem       json.RawMessage `gorm:"type:json" json:"restore_item"`
	ShipTypeForbidden json.RawMessage `gorm:"type:json" json:"ship_type_forbidden"`
	TransUseGold      uint32          `gorm:"not_null" json:"trans_use_gold"`
	TransUseItem      json.RawMessage `gorm:"type:json" json:"trans_use_item"`
	Type              uint32          `gorm:"not_null" json:"type"`
	UpgradeFormulaID  json.RawMessage `gorm:"type:json" json:"upgrade_formula_id"`
}

func GetEquipmentByID

func GetEquipmentByID(id uint32) (*Equipment, error)

func ListEquipmentPage

func ListEquipmentPage(offset int, limit int) ([]Equipment, int64, error)

type EscortState

type EscortState struct {
	ID             uint64          `gorm:"primary_key"`
	AccountID      uint32          `gorm:"not_null;index:idx_escort_account_line,unique"`
	LineID         uint32          `gorm:"not_null;index:idx_escort_account_line,unique"`
	AwardTimestamp uint32          `gorm:"not_null;default:0"`
	FlashTimestamp uint32          `gorm:"not_null;default:0"`
	MapPositions   json.RawMessage `gorm:"type:json"`
	CreatedAt      time.Time       `gorm:"type:timestamp;default:CURRENT_TIMESTAMP;not_null"`
	UpdatedAt      time.Time       `gorm:"type:timestamp;default:CURRENT_TIMESTAMP;not_null"`
}

type EventCollection

type EventCollection struct {
	CommanderID  uint32    `gorm:"primaryKey"`
	CollectionID uint32    `gorm:"primaryKey"`
	StartTime    uint32    `gorm:"not_null;default:0"`
	FinishTime   uint32    `gorm:"not_null;default:0"`
	ShipIDs      Int64List `gorm:"type:text;not_null;default:'[]'"`
}

EventCollection stores the active collection/commission event state for a commander. A row exists while the event is active (or finished-but-unclaimed).

func GetEventCollection

func GetEventCollection(_ any, commanderID, collectionID uint32) (*EventCollection, error)

func GetOrCreateActiveEvent

func GetOrCreateActiveEvent(_ any, commanderID uint32, collectionID uint32) (*EventCollection, error)

func ListActiveEventCollections

func ListActiveEventCollections(commanderID uint32) ([]EventCollection, error)

type ExchangeCode

type ExchangeCode struct {
	ID        uint32          `gorm:"primary_key"`
	Code      string          `gorm:"size:64;not_null;uniqueIndex"`
	Platform  string          `gorm:"size:32"`
	Quota     int             `gorm:"not_null;default:-1"`
	Rewards   json.RawMessage `gorm:"type:json;not_null"`
	CreatedAt time.Time       `gorm:"type:timestamp;default:CURRENT_TIMESTAMP;not_null"`
	UpdatedAt time.Time       `gorm:"type:timestamp;default:CURRENT_TIMESTAMP;not_null"`
}

func GetExchangeCode

func GetExchangeCode(codeID uint32) (*ExchangeCode, error)

func ListExchangeCodes

func ListExchangeCodes(offset int, limit int) ([]ExchangeCode, int64, error)

type ExchangeCodeRedeem

type ExchangeCodeRedeem struct {
	ExchangeCodeID uint32    `gorm:"primaryKey"`
	CommanderID    uint32    `gorm:"primaryKey"`
	RedeemedAt     time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP;not_null"`
}

func ListExchangeCodeRedeems

func ListExchangeCodeRedeems(codeID uint32, offset int, limit int) ([]ExchangeCodeRedeem, int64, error)

type ExerciseFleet

type ExerciseFleet struct {
	CommanderID     uint32    `gorm:"primary_key"`
	VanguardShipIDs Int64List `gorm:"column=vanguard_ship_ids;type:json;not_null"`
	MainShipIDs     Int64List `gorm:"column=main_ship_ids;type:json;not_null"`
}

func GetExerciseFleet

func GetExerciseFleet(commanderID uint32) (*ExerciseFleet, error)

type FeastPartyRole

type FeastPartyRole struct {
	Tid          uint32 `json:"tid"`
	Bubble       uint32 `json:"bubble"`
	SpeechBubble uint32 `json:"speech_bubble"`
}

type FeastSpecialRole

type FeastSpecialRole struct {
	Tid   uint32 `json:"tid"`
	State uint32 `json:"state"`
	Gift  uint32 `json:"gift"`
}

type FeastState

type FeastState struct {
	CommanderID  uint32
	ActID        uint32
	RefreshTime  uint32
	PartyRoles   []FeastPartyRole
	SpecialRoles []FeastSpecialRole
}

func GetFeastState

func GetFeastState(commanderID uint32, actID uint32) (*FeastState, error)

func GetOrCreateFeastState

func GetOrCreateFeastState(commanderID uint32, actID uint32) (*FeastState, error)

type Fleet

type Fleet struct {
	ID             uint32    `gorm:"primary_key"` // uniquely identifies the fleet
	GameID         uint32    `gorm:"not_null"`    // uniquely identifies for each commander
	CommanderID    uint32    `gorm:"not_null"`    // owner of the fleet
	Name           string    `gorm:"size:32;not_null;varchar(32)"`
	ShipList       Int64List `gorm:"type:json;not_null"`
	MeowfficerList Int64List `gorm:"type:json;not_null"`
}

func (*Fleet) AddMeowfficer

func (f *Fleet) AddMeowfficer(shipID uint32) error

func (*Fleet) RemoveMeowfficer

func (f *Fleet) RemoveMeowfficer(shipID uint32) error

func (*Fleet) RenameFleet

func (f *Fleet) RenameFleet(name string) error

func (*Fleet) UpdateShipList

func (f *Fleet) UpdateShipList(owner *Commander, ships []uint32) error

Updates the ship list of the fleet

type FleetTechAttrOverride

type FleetTechAttrOverride struct {
	ShipType uint32 `json:"ship_type"`
	AttrType uint32 `json:"attr_type"`
	SetValue uint32 `json:"set_value"`
}

type FleetTechGroupState

type FleetTechGroupState struct {
	GroupID         uint32 `json:"group_id"`
	EffectTechID    uint32 `json:"effect_tech_id"`
	StudyTechID     uint32 `json:"study_tech_id"`
	StudyFinishTime uint32 `json:"study_finish_time"`
	RewardedTechID  uint32 `json:"rewarded_tech_id"`
}

type FriendDirectMessage

type FriendDirectMessage struct {
	ID         uint64 `json:"id"`
	SenderID   uint32 `json:"sender_id"`
	ReceiverID uint32 `json:"receiver_id"`
	Content    string `json:"content"`
	CreatedAt  uint32 `json:"created_at"`
}

func CreateFriendDirectMessage

func CreateFriendDirectMessage(senderID uint32, receiverID uint32, content string, createdAt uint32) (*FriendDirectMessage, error)
type FriendLink struct {
	CommanderID uint32
	FriendID    uint32
	CreatedAt   time.Time
}

type FriendRelationship

type FriendRelationship struct {
	CommanderID uint32 `json:"commander_id"`
	FriendID    uint32 `json:"friend_id"`
	CreatedAt   uint32 `json:"created_at"`
}

type FriendRequest

type FriendRequest struct {
	RequesterID uint32
	TargetID    uint32
	Content     string
	CreatedAt   time.Time
}

func ListFriendRequestsForTarget

func ListFriendRequestsForTarget(targetID uint32) ([]FriendRequest, error)

type GameRoomScore

type GameRoomScore struct {
	CommanderID uint32
	RoomID      uint32
	MaxScore    uint32
}

func ListGameRoomScores

func ListGameRoomScores(commanderID uint32) ([]GameRoomScore, error)

func (GameRoomScore) TableName

func (GameRoomScore) TableName() string

type GameRoomState

type GameRoomState struct {
	CommanderID       uint32
	WeekStartUnix     uint32
	WeeklyClaimed     bool
	PayCoinCount      uint32
	FirstEnterClaimed bool
	MonthKey          uint32
	MonthlyTicket     uint32
}

func LoadGameRoomState

func LoadGameRoomState(commanderID uint32, now time.Time) (*GameRoomState, error)

func LoadGameRoomStateForUpdateTx

func LoadGameRoomStateForUpdateTx(ctx context.Context, tx pgx.Tx, commanderID uint32, now time.Time) (*GameRoomState, error)

func (GameRoomState) TableName

func (GameRoomState) TableName() string

type GlobalSkinRestriction

type GlobalSkinRestriction struct {
	SkinID uint32 `gorm:"primaryKey"`
	Type   uint32 `gorm:"not_null"`
}

GlobalSkinRestriction defines global hide/show restrictions for skins.

func GetGlobalSkinRestrictionBySkinID

func GetGlobalSkinRestrictionBySkinID(skinID uint32) (*GlobalSkinRestriction, error)

func ListGlobalSkinRestrictions

func ListGlobalSkinRestrictions() ([]GlobalSkinRestriction, error)

func ListGlobalSkinRestrictionsPage

func ListGlobalSkinRestrictionsPage(offset int, limit int) ([]GlobalSkinRestriction, int64, error)

type GlobalSkinRestrictionWindow

type GlobalSkinRestrictionWindow struct {
	ID        uint32 `gorm:"primaryKey"`
	SkinID    uint32 `gorm:"not_null"`
	Type      uint32 `gorm:"not_null"`
	StartTime uint32 `gorm:"not_null"`
	StopTime  uint32 `gorm:"not_null"`
}

GlobalSkinRestrictionWindow defines time-based overrides for skin shop availability.

func GetGlobalSkinRestrictionWindowByID

func GetGlobalSkinRestrictionWindowByID(id uint32) (*GlobalSkinRestrictionWindow, error)

func ListGlobalSkinRestrictionWindows

func ListGlobalSkinRestrictionWindows() ([]GlobalSkinRestrictionWindow, error)

func ListGlobalSkinRestrictionWindowsPage

func ListGlobalSkinRestrictionWindowsPage(offset int, limit int) ([]GlobalSkinRestrictionWindow, int64, error)

type Guild

type Guild struct {
	ID              uint32
	Policy          uint32
	Faction         uint32
	Name            string
	Level           uint32
	Announce        string
	Manifesto       string
	Exp             uint32
	MemberCount     uint32
	ChangeFactionCD uint32
	KickLeaderCD    uint32
	Capital         uint32
	TechID          uint32
}

func GetGuildByID

func GetGuildByID(guildID uint32) (*Guild, error)

type GuildAssaultFleetSlot

type GuildAssaultFleetSlot struct {
	GuildID     uint32
	CommanderID uint32
	Pos         uint32
	ShipID      uint32
	LastTime    uint32
}

func ListGuildAssaultFleetSlotsByCommander

func ListGuildAssaultFleetSlotsByCommander(guildID uint32, commanderID uint32) ([]GuildAssaultFleetSlot, error)

func ListGuildAssaultFleetSlotsByGuild

func ListGuildAssaultFleetSlotsByGuild(guildID uint32) ([]GuildAssaultFleetSlot, error)

type GuildAssaultRecommendation

type GuildAssaultRecommendation struct {
	GuildID     uint32
	CommanderID uint32
	ShipID      uint32
}

func ListGuildAssaultRecommendations

func ListGuildAssaultRecommendations(guildID uint32) ([]GuildAssaultRecommendation, error)

type GuildBossMissionCommander

type GuildBossMissionCommander struct {
	Pos uint32 `json:"pos"`
	ID  uint32 `json:"id"`
}

type GuildBossMissionFleet

type GuildBossMissionFleet struct {
	GuildID     uint32
	OperationID uint32
	FleetID     uint32
	Ships       []GuildBossMissionShip
	Commanders  []GuildBossMissionCommander
}

func ListGuildBossMissionFleets

func ListGuildBossMissionFleets(guildID uint32, operationID uint32) ([]GuildBossMissionFleet, error)

type GuildBossMissionShip

type GuildBossMissionShip struct {
	UserID uint32 `json:"user_id"`
	ShipID uint32 `json:"ship_id"`
}

type GuildCapitalLogEntry

type GuildCapitalLogEntry struct {
	Category    uint32
	MemberID    uint32
	Name        string
	EventType   uint32
	EventTarget []uint32
	Time        uint32
}

type GuildChatMessage

type GuildChatMessage struct {
	ID       uint32    `gorm:"primary_key"`
	GuildID  uint32    `gorm:"not_null;index:idx_guild_chat_time,priority:1"`
	SenderID uint32    `gorm:"not_null"`
	SentAt   time.Time `gorm:"not_null;default:CURRENT_TIMESTAMP;index:idx_guild_chat_time,priority:2,sort:desc"`
	Content  string    `gorm:"not_null;type:varchar(512)"`

	Sender Commander `gorm:"foreignkey:SenderID;references:CommanderID"`
}

func CreateGuildChatMessage

func CreateGuildChatMessage(guildID uint32, senderID uint32, content string, sentAt time.Time) (*GuildChatMessage, error)

func ListGuildChatMessages

func ListGuildChatMessages(guildID uint32, limit int) ([]GuildChatMessage, error)

type GuildDirectoryEntry

type GuildDirectoryEntry struct {
	Guild    Guild
	Leader   CommanderSocialProfile
	TechSeat uint32
}

func ListGuildDirectoryRefresh

func ListGuildDirectoryRefresh(limit uint32) ([]GuildDirectoryEntry, error)

func SearchGuildDirectoryByID

func SearchGuildDirectoryByID(guildID uint32) ([]GuildDirectoryEntry, error)

func SearchGuildDirectoryByName

func SearchGuildDirectoryByName(keyword string) ([]GuildDirectoryEntry, error)

type GuildJoinRequest

type GuildJoinRequest struct {
	GuildID     uint32
	Applicant   CommanderSocialProfile
	Content     string
	RequestedAt time.Time
}

func ListGuildJoinRequests

func ListGuildJoinRequests(guildID uint32) ([]GuildJoinRequest, error)

type GuildMember

type GuildMember struct {
	GuildID        uint32
	CommanderID    uint32
	Duty           uint32
	Liveness       uint32
	PreOnlineTime  uint32
	JoinTime       uint32
	CommanderName  string
	CommanderLevel uint32
	Manifesto      string
	LastLogin      time.Time
	DisplayIconID  uint32
	DisplaySkinID  uint32
	IconFrameID    uint32
	ChatFrameID    uint32
	IconThemeID    uint32
}

func GetCommanderGuildMembership

func GetCommanderGuildMembership(commanderID uint32) (*GuildMember, error)

func ListGuildMembers

func ListGuildMembers(guildID uint32) ([]GuildMember, error)

type GuildMemberRankEntry

type GuildMemberRankEntry struct {
	UserID uint32
	Count  uint32
}

type GuildOfficeState

type GuildOfficeState struct {
	BenefitFinishTime     uint32
	LastBenefitFinishTime uint32
	TechCancelCnt         uint32
}

func GetGuildOfficeState

func GetGuildOfficeState(guildID uint32) (*GuildOfficeState, error)

type GuildOperationBossRank

type GuildOperationBossRank struct {
	UserID uint32
	Damage uint32
}

func ListGuildOperationBossRanks

func ListGuildOperationBossRanks(guildID uint32, operationID uint32, bossID uint32) ([]GuildOperationBossRank, error)

type GuildOperationBossState

type GuildOperationBossState struct {
	GuildID     uint32
	OperationID uint32
	BossID      uint32
	Damage      uint32
	HP          uint32
}

func GetGuildOperationBossState

func GetGuildOperationBossState(guildID uint32, operationID uint32) (*GuildOperationBossState, error)

type GuildOperationEvent

type GuildOperationEvent struct {
	EventTid      uint32
	Position      uint32
	StartTime     uint32
	CompleteTime  uint32
	Efficiency    uint32
	Completed     bool
	ShipInEvent   json.RawMessage
	AttrAccList   json.RawMessage
	AttrCountList json.RawMessage
	EventNodes    json.RawMessage
	PersonShip    json.RawMessage
	FormationTime uint32
}

func GetGuildOperationEvent

func GetGuildOperationEvent(guildID uint32, eventTid uint32) (*GuildOperationEvent, error)

type GuildOperationPerf

type GuildOperationPerf struct {
	EventTid uint32
	Index    uint32
}

type GuildOperationState

type GuildOperationState struct {
	GuildID       uint32
	ChapterID     uint32
	StartTime     uint32
	EndTime       uint32
	Events        []GuildOperationEvent
	Perfs         []GuildOperationPerf
	JoinTimes     uint32
	IsParticipant uint32
}

func GetGuildOperationState

func GetGuildOperationState(guildID uint32) (*GuildOperationState, error)

func GetGuildOperationStateForCommander

func GetGuildOperationStateForCommander(commanderID uint32) (*GuildOperationState, error)

type GuildReport

type GuildReport struct {
	ID        uint32
	GuildID   uint32
	EventID   uint32
	EventType uint32
	Score     uint32
	Status    uint32
	Claimed   bool
	DropType  uint32
	DropID    uint32
	DropCount uint32
	Nodes     []GuildReportNode
}

func ClaimGuildReports

func ClaimGuildReports(guildID uint32, reportIDs []uint32) ([]GuildReport, error)

func ClaimGuildReportsTx

func ClaimGuildReportsTx(ctx context.Context, tx pgx.Tx, guildID uint32, reportIDs []uint32) ([]GuildReport, error)

func ListGuildReportsSince

func ListGuildReportsSince(guildID uint32, index uint32) ([]GuildReport, error)

type GuildReportNode

type GuildReportNode struct {
	NodeID uint32
	Status uint32
}

type GuildReportRank

type GuildReportRank struct {
	UserID uint32
	Damage uint32
}

func ListGuildReportRanks

func ListGuildReportRanks(guildID uint32, reportID uint32) ([]GuildReportRank, error)

type GuildShopGood

type GuildShopGood struct {
	CommanderID uint32 `gorm:"primary_key"`
	Index       uint32 `gorm:"primary_key"`
	GoodsID     uint32 `gorm:"not_null"`
	Count       uint32 `gorm:"not_null"`
}

func LoadGuildShopGoods

func LoadGuildShopGoods(commanderID uint32) ([]GuildShopGood, error)

type GuildShopState

type GuildShopState struct {
	CommanderID     uint32 `gorm:"primary_key"`
	RefreshCount    uint32 `gorm:"not_null"`
	NextRefreshTime uint32 `gorm:"not_null"`
}

func GetGuildShopState

func GetGuildShopState(commanderID uint32) (*GuildShopState, error)

type GuildUserInfo

type GuildUserInfo struct {
	CommanderID    uint32
	GuildID        uint32
	DonateCount    uint32
	DonateTasks    []uint32
	BenefitTime    uint32
	WeeklyTaskFlag uint32
	ExtraDonate    uint32
	ExtraOperation uint32
}

func GetGuildUserInfo

func GetGuildUserInfo(commanderID uint32) (*GuildUserInfo, error)

type GuildWeeklyTaskState

type GuildWeeklyTaskState struct {
	GuildID       uint32
	TaskID        uint32
	Progress      uint32
	Monday0Clock  uint32
	UpdatedAtUnix uint32
}

func GetGuildWeeklyTaskState

func GetGuildWeeklyTaskState(guildID uint32) (*GuildWeeklyTaskState, error)

type Int64List

type Int64List []int64

func ToInt64List

func ToInt64List(values []uint32) Int64List

func (*Int64List) Scan

func (list *Int64List) Scan(value any) error

func (Int64List) Value

func (list Int64List) Value() (driver.Value, error)

type IslandAchievementProgressEntry

type IslandAchievementProgressEntry struct {
	EventType uint32 `json:"event_type"`
	EventArg  uint32 `json:"event_arg"`
	Value     uint32 `json:"value"`
}

type IslandAchievementState

type IslandAchievementState struct {
	CommanderID     uint32
	ProgressEntries []IslandAchievementProgressEntry
	FinishList      []uint32
}

func GetIslandAchievementState

func GetIslandAchievementState(commanderID uint32) (*IslandAchievementState, error)

func GetIslandAchievementStateForUpdateTx

func GetIslandAchievementStateForUpdateTx(ctx context.Context, tx pgx.Tx, commanderID uint32) (*IslandAchievementState, error)

func NewIslandAchievementState

func NewIslandAchievementState(commanderID uint32) *IslandAchievementState

func (*IslandAchievementState) HasFinished

func (state *IslandAchievementState) HasFinished(achievementID uint32) bool

func (*IslandAchievementState) ProgressValue

func (state *IslandAchievementState) ProgressValue(eventType uint32, eventArg uint32) (uint32, bool)

func (*IslandAchievementState) SetProgress

func (state *IslandAchievementState) SetProgress(eventType uint32, eventArg uint32, value uint32)

func (IslandAchievementState) TableName

func (IslandAchievementState) TableName() string

type IslandAgoraPlacement

type IslandAgoraPlacement struct {
	CommanderID uint32 `json:"commander_id"`
	PlacedData  []byte `json:"placed_data"`
}

func GetIslandAgoraPlacement

func GetIslandAgoraPlacement(commanderID uint32) (*IslandAgoraPlacement, error)

func (IslandAgoraPlacement) TableName

func (IslandAgoraPlacement) TableName() string

type IslandAgoraTheme

type IslandAgoraTheme struct {
	CommanderID uint32 `json:"commander_id"`
	ThemeSlotID uint32 `json:"theme_slot_id"`
	Name        string `json:"name"`
	PlacedData  []byte `json:"placed_data"`
}

func ListIslandAgoraThemes

func ListIslandAgoraThemes(commanderID uint32) ([]IslandAgoraTheme, error)

type IslandBookCollectEntry

type IslandBookCollectEntry struct {
	ID       uint32                   `json:"id"`
	Base     uint32                   `json:"base"`
	LvList   []IslandBookCollectLevel `json:"lv_list"`
	StarList []IslandBookCollectLevel `json:"star_list"`
}

type IslandBookCollectLevel

type IslandBookCollectLevel struct {
	Lv    uint32 `json:"lv"`
	Value uint32 `json:"value"`
}

type IslandBookCond

type IslandBookCond struct {
	CommanderID uint32 `json:"commander_id"`
	Type        uint32 `json:"type"`
	UnlockID    uint32 `json:"unlock_id"`
}

func ListIslandBookConds

func ListIslandBookConds(commanderID uint32) ([]IslandBookCond, error)

func (IslandBookCond) TableName

func (IslandBookCond) TableName() string

type IslandBookState

type IslandBookState struct {
	CommanderID  uint32
	BookList     []uint32
	BookAwards   []uint32
	BookCollects []IslandBookCollectEntry
}

func GetIslandBookState

func GetIslandBookState(commanderID uint32) (*IslandBookState, error)

func GetIslandBookStateForUpdateTx

func GetIslandBookStateForUpdateTx(ctx context.Context, tx pgx.Tx, commanderID uint32) (*IslandBookState, error)

func NewIslandBookState

func NewIslandBookState(commanderID uint32) *IslandBookState

func (IslandBookState) TableName

func (IslandBookState) TableName() string

type IslandCapState

type IslandCapState struct {
	DressID uint32 `json:"dress_id"`
	CapID   uint32 `json:"cap_id"`
}

type IslandCardLabelCount

type IslandCardLabelCount struct {
	ID  uint32 `json:"id"`
	Num uint32 `json:"num"`
}

type IslandCardState

type IslandCardState struct {
	CommanderID       uint32
	Picture           string
	VisitWord         string
	SocialFlag        uint32
	LabelViewFlag     uint32
	LabelCounts       []IslandCardLabelCount
	AchieveDisplayIDs []uint32
	VisitNum          uint32
	GoodNum           uint32
	ShipNum           uint32
	BookNum           uint32
	AchievementTotal  uint32
}

func GetIslandCardState

func GetIslandCardState(commanderID uint32) (*IslandCardState, error)

func GetIslandCardStateForUpdateTx

func GetIslandCardStateForUpdateTx(ctx context.Context, tx pgx.Tx, commanderID uint32) (*IslandCardState, error)

func NewIslandCardState

func NewIslandCardState(commanderID uint32) *IslandCardState

func (IslandCardState) TableName

func (IslandCardState) TableName() string

type IslandCollectFragmentSignState

type IslandCollectFragmentSignState struct {
	IslandID          uint32
	FragmentID        uint32
	SignerCommanderID uint32
	Mark              uint32
	UpdatedAt         time.Time
}

type IslandCollectFragmentState

type IslandCollectFragmentState struct {
	IslandID             uint32
	FragmentID           uint32
	CollectorCommanderID uint32
	Mark                 uint32
	CollectedAt          time.Time
}

type IslandCollectionCompleteState

type IslandCollectionCompleteState struct {
	CommanderID uint32
	CollectID   uint32
	CompletedAt time.Time
}

type IslandCommanderDressProfile

type IslandCommanderDressProfile struct {
	CommanderID uint32
	IslandID    uint32
	CurDress    []IslandCurDress
	CapList     []IslandCapState
}

func GetIslandCommanderDressProfile

func GetIslandCommanderDressProfile(commanderID uint32) (*IslandCommanderDressProfile, error)

type IslandCommanderDressState

type IslandCommanderDressState struct {
	CommanderID uint32
	DressID     uint32
	State       uint32
	Color       uint32
	ColorList   []uint32
}

func GetIslandCommanderDressState

func GetIslandCommanderDressState(commanderID uint32, dressID uint32) (*IslandCommanderDressState, error)

func ListIslandCommanderDressStates

func ListIslandCommanderDressStates(commanderID uint32) ([]IslandCommanderDressState, error)

func (IslandCommanderDressState) TableName

func (IslandCommanderDressState) TableName() string

type IslandCurDress

type IslandCurDress struct {
	Type uint32 `json:"type"`
	ID   uint32 `json:"id"`
}

type IslandDelegation

type IslandDelegation struct {
	CommanderID   uint32 `gorm:"primaryKey;column:commander_id"`
	BuildID       uint32 `gorm:"primaryKey;column:build_id"`
	AreaID        uint32 `gorm:"primaryKey;column:area_id"`
	ShipID        uint32 `gorm:"column:ship_id"`
	HasRole       bool   `gorm:"column:has_role"`
	RewardReady   bool   `gorm:"column:reward_ready"`
	FormulaID     uint32 `gorm:"column:formula_id"`
	MaxTimes      uint32 `gorm:"column:max_times"`
	MainNum       uint32 `gorm:"column:main_num"`
	OtherNum      uint32 `gorm:"column:other_num"`
	ExtraMainNum  uint32 `gorm:"column:extra_main_num"`
	ExtraOtherNum uint32 `gorm:"column:extra_other_num"`
	GetTimes      uint32 `gorm:"column:get_times"`
	StartTime     uint32 `gorm:"column:start_time"`
	CostTimeList  []uint32
	SpeedTime     uint32 `gorm:"column:speed_time"`
	TimesExtra    []uint32
	RecoverTime   uint32 `gorm:"column:recover_time"`
	AddExp        uint32 `gorm:"column:add_exp"`
	ReturnNum     uint32 `gorm:"column:return_num"`
	PTAward       uint32 `gorm:"column:pt_award"`
}

func GetIslandDelegation

func GetIslandDelegation(commanderID uint32, buildID uint32, areaID uint32) (*IslandDelegation, error)

func GetIslandDelegationByAreaForUpdateTx

func GetIslandDelegationByAreaForUpdateTx(ctx context.Context, tx pgx.Tx, commanderID uint32, areaID uint32) (*IslandDelegation, error)

func GetIslandDelegationForUpdateTx

func GetIslandDelegationForUpdateTx(ctx context.Context, tx pgx.Tx, commanderID uint32, buildID uint32, areaID uint32) (*IslandDelegation, error)

func (IslandDelegation) TableName

func (IslandDelegation) TableName() string

type IslandFishWeightState

type IslandFishWeightState struct {
	FishID    uint32 `json:"fish_id"`
	MinWeight uint32 `json:"min_weight"`
	MaxWeight uint32 `json:"max_weight"`
	GoldState uint32 `json:"gold_state"`
}

type IslandFishingState

type IslandFishingState struct {
	CommanderID uint32
	BaitID      uint32
	FishRod     uint32
	FishWeights []IslandFishWeightState
}

func GetIslandFishingState

func GetIslandFishingState(commanderID uint32) (*IslandFishingState, error)

func GetIslandFishingStateForUpdateTx

func GetIslandFishingStateForUpdateTx(ctx context.Context, tx pgx.Tx, commanderID uint32) (*IslandFishingState, error)

func (IslandFishingState) TableName

func (IslandFishingState) TableName() string

type IslandFollower

type IslandFollower struct {
	CommanderID uint32 `gorm:"primaryKey;column:commander_id"`
	ShipID      uint32 `gorm:"primaryKey;column:ship_id"`
	OrderIdx    uint32 `gorm:"column:order_idx"`
}

func ListIslandFollowers

func ListIslandFollowers(commanderID uint32) ([]IslandFollower, error)

func ListIslandFollowersForUpdateTx

func ListIslandFollowersForUpdateTx(ctx context.Context, tx pgx.Tx, commanderID uint32) ([]IslandFollower, error)

func (IslandFollower) TableName

func (IslandFollower) TableName() string

type IslandHandPlant

type IslandHandPlant struct {
	CommanderID uint32 `gorm:"primaryKey;column:commander_id"`
	BuildID     uint32 `gorm:"column:build_id"`
	SlotID      uint32 `gorm:"primaryKey;column:slot_id"`
	State       uint32 `gorm:"column:state"`
	FormulaID   uint32 `gorm:"column:formula_id"`
	StartTime   uint32 `gorm:"column:start_time"`
	EndTime     uint32 `gorm:"column:end_time"`
}

func ListIslandHandPlantsByBuild

func ListIslandHandPlantsByBuild(commanderID uint32, buildID uint32) ([]IslandHandPlant, error)

func ListIslandHandPlantsBySlotIDsForUpdateTx

func ListIslandHandPlantsBySlotIDsForUpdateTx(ctx context.Context, tx pgx.Tx, commanderID uint32, slotIDs []uint32) ([]IslandHandPlant, error)

func ListIslandHandPlantsBySlotIDsTx

func ListIslandHandPlantsBySlotIDsTx(ctx context.Context, tx pgx.Tx, commanderID uint32, slotIDs []uint32) ([]IslandHandPlant, error)

func (IslandHandPlant) TableName

func (IslandHandPlant) TableName() string

type IslandInventory

type IslandInventory struct {
	CommanderID uint32 `gorm:"primaryKey;column:commander_id"`
	ItemID      uint32 `gorm:"primaryKey;column:item_id"`
	Count       uint32 `gorm:"column:count"`
}

func GetIslandInventoryItem

func GetIslandInventoryItem(commanderID uint32, itemID uint32) (*IslandInventory, error)

func ListIslandInventoryItems

func ListIslandInventoryItems(commanderID uint32) ([]IslandInventory, error)

func (IslandInventory) TableName

func (IslandInventory) TableName() string

type IslandManageTrade

type IslandManageTrade struct {
	CommanderID uint32 `gorm:"primaryKey;column:commander_id"`
	TradeID     uint32 `gorm:"primaryKey;column:trade_id"`
	TradeData   []byte `gorm:"column:trade_data"`
	PresellData []byte `gorm:"column:presell_data"`
	TotalSales  uint32 `gorm:"column:total_sales"`
}

func (IslandManageTrade) TableName

func (IslandManageTrade) TableName() string

type IslandNPCFeedbackState

type IslandNPCFeedbackState struct {
	CommanderID   uint32
	DayStartUnix  uint32
	ClaimedNPCIDs []uint32
}

func GetIslandNPCFeedbackState

func GetIslandNPCFeedbackState(commanderID uint32) (*IslandNPCFeedbackState, error)

type IslandNodeState

type IslandNodeState struct {
	ID      uint32 `json:"id"`
	EventID uint32 `json:"event_id"`
	IsNew   uint32 `json:"is_new"`
}

func GetOrCreateIslandNodeState

func GetOrCreateIslandNodeState(commanderID uint32, actID uint32) ([]IslandNodeState, error)

type IslandOrderState

type IslandOrderState struct {
	CommanderID        uint32
	Favor              uint32
	DailySelect        uint32
	DailySlotNum       uint32
	TimeSlotNum        uint32
	UrgencyFinishCount uint32
	ShipRefresh        uint32
}

func GetIslandOrderState

func GetIslandOrderState(commanderID uint32) (*IslandOrderState, error)

func GetIslandOrderStateForUpdateTx

func GetIslandOrderStateForUpdateTx(ctx context.Context, tx pgx.Tx, commanderID uint32) (*IslandOrderState, error)

type IslandOverflowInventory

type IslandOverflowInventory struct {
	CommanderID uint32 `gorm:"primaryKey;column:commander_id"`
	ItemID      uint32 `gorm:"primaryKey;column:item_id"`
	Count       uint32 `gorm:"column:count"`
}

func ListIslandOverflowInventoryForUpdateTx

func ListIslandOverflowInventoryForUpdateTx(ctx context.Context, tx pgx.Tx, commanderID uint32) ([]IslandOverflowInventory, error)

func (IslandOverflowInventory) TableName

func (IslandOverflowInventory) TableName() string

type IslandProsperityState

type IslandProsperityState struct {
	CommanderID   uint32
	Prosperity    uint32
	ClaimedLevels []uint32
}

func GetIslandProsperityStateForUpdateTx

func GetIslandProsperityStateForUpdateTx(ctx context.Context, tx pgx.Tx, commanderID uint32) (*IslandProsperityState, error)

type IslandRoleDressState

type IslandRoleDressState struct {
	CommanderID uint32
	DressID     uint32
	Num         uint32
	Read        uint32
	Time        uint32
	UpdatedAt   time.Time
}

func GetIslandRoleDressState

func GetIslandRoleDressState(commanderID uint32, dressID uint32) (*IslandRoleDressState, error)

func ListIslandRoleDressStates

func ListIslandRoleDressStates(commanderID uint32) ([]IslandRoleDressState, error)

type IslandSeason

type IslandSeason struct {
	CommanderID uint32 `gorm:"primaryKey;column:commander_id"`
	PT          uint32 `gorm:"column:pt"`
}

func GetIslandSeason

func GetIslandSeason(commanderID uint32) (*IslandSeason, error)

func (IslandSeason) TableName

func (IslandSeason) TableName() string

type IslandShip

type IslandShip struct {
	CommanderID  uint32 `gorm:"primaryKey;column:commander_id"`
	ShipID       uint32 `gorm:"primaryKey;column:ship_id"`
	Level        uint32 `gorm:"column:level"`
	Exp          uint32 `gorm:"column:exp"`
	BreakLv      uint32 `gorm:"column:break_lv"`
	SkillLv      uint32 `gorm:"column:skill_lv"`
	Power        uint32 `gorm:"column:power"`
	RecoverTime  uint32 `gorm:"column:recover_time"`
	UpLimitState uint32 `gorm:"column:up_limit_state"`
	CurSkinID    uint32 `gorm:"column:cur_skin_id"`
	ExtraAttrs   []IslandShipAttr
	Buffs        []IslandShipBuff
	CanFollow    bool `gorm:"column:can_follow"`
}

func GetIslandShip

func GetIslandShip(commanderID uint32, shipID uint32) (*IslandShip, error)

func GetIslandShipForUpdateTx

func GetIslandShipForUpdateTx(ctx context.Context, tx pgx.Tx, commanderID uint32, shipID uint32) (*IslandShip, error)

func ListIslandShips

func ListIslandShips(commanderID uint32) ([]IslandShip, error)

func (IslandShip) TableName

func (IslandShip) TableName() string

type IslandShipAttr

type IslandShipAttr struct {
	ID    uint32 `json:"id"`
	Value uint32 `json:"value"`
}

type IslandShipBuff

type IslandShipBuff struct {
	ID        uint32 `json:"id"`
	StartTime uint32 `json:"start_time"`
}

type IslandShipDressState

type IslandShipDressState struct {
	CommanderID uint32
	ShipID      uint32
	DressID     uint32
}

func ListIslandShipDressStates

func ListIslandShipDressStates(commanderID uint32) ([]IslandShipDressState, error)

type IslandShipOrderAppoint

type IslandShipOrderAppoint struct {
	ID       uint32     `json:"id"`
	ViewTime uint32     `json:"view_time"`
	Cost     [][]uint32 `json:"cost"`
	Reward   [][]uint32 `json:"reward"`
}

type IslandShipOrderCost

type IslandShipOrderCost struct {
	ID    uint32 `json:"id"`
	Num   uint32 `json:"num"`
	State uint32 `json:"state"`
}

type IslandShipOrderSlot

type IslandShipOrderSlot struct {
	CommanderID uint32
	SlotID      uint32
	ShipSlotID  uint32
	State       uint32
	LoadTime    uint32
	GetTime     uint32
	EndTime     uint32
	FinishNum   uint32
	AutoTime    uint32
	CostList    []IslandShipOrderCost
}

func GetIslandRuntimeShipOrderSlotForUpdateTx

func GetIslandRuntimeShipOrderSlotForUpdateTx(ctx context.Context, tx pgx.Tx, commanderID uint32, shipSlotID uint32) (*IslandShipOrderSlot, error)

func LoadIslandShipOrderSlotTx

func LoadIslandShipOrderSlotTx(ctx context.Context, tx pgx.Tx, commanderID uint32, slotID uint32) (*IslandShipOrderSlot, error)

func (IslandShipOrderSlot) TableName

func (IslandShipOrderSlot) TableName() string

type IslandShipOrderState

type IslandShipOrderState struct {
	CommanderID uint32
	RefreshAt   uint32
	AppointList []IslandShipOrderAppoint
}

func LoadIslandShipOrderStateForUpdateTx

func LoadIslandShipOrderStateForUpdateTx(ctx context.Context, tx pgx.Tx, commanderID uint32) (*IslandShipOrderState, error)

func (IslandShipOrderState) TableName

func (IslandShipOrderState) TableName() string

type IslandShipSkinState

type IslandShipSkinState struct {
	CommanderID uint32
	ShipID      uint32
	SkinID      uint32
	ColorID     uint32
	ColorList   []uint32
}

func GetIslandShipSkinState

func GetIslandShipSkinState(commanderID uint32, shipID uint32, skinID uint32) (*IslandShipSkinState, error)

func ListIslandShipSkinStates

func ListIslandShipSkinStates(commanderID uint32) ([]IslandShipSkinState, error)

type IslandShopGoodsState

type IslandShopGoodsState struct {
	ID  uint32 `json:"id"`
	Num uint32 `json:"num"`
}

type IslandShopState

type IslandShopState struct {
	CommanderID  uint32
	ShopID       uint32
	ExistTime    uint32
	RefreshTime  uint32
	RefreshCount uint32
	Goods        []IslandShopGoodsState
}

func GetIslandShopState

func GetIslandShopState(commanderID uint32, shopID uint32) (*IslandShopState, error)

func ListIslandShopStates

func ListIslandShopStates(commanderID uint32) ([]IslandShopState, error)

func (IslandShopState) TableName

func (IslandShopState) TableName() string

type IslandSignInState

type IslandSignInState struct {
	CommanderID        uint32
	DayStartUnix       uint32
	SignedIn           bool
	ExternalClaimCount uint32
	ClaimedSlots       []string
}

func GetIslandSignInState

func GetIslandSignInState(commanderID uint32) (*IslandSignInState, error)

func (IslandSignInState) TableName

func (IslandSignInState) TableName() string

type IslandSlotCollectState

type IslandSlotCollectState struct {
	CommanderID     uint32
	BuildID         uint32
	AreaID          uint32
	SlotType        uint32
	NextRefreshTime uint32
	CollectedCount  uint32
	Consumed        bool
	UpdatedAt       time.Time
}

func GetIslandSlotCollectStateTx

func GetIslandSlotCollectStateTx(ctx context.Context, tx pgx.Tx, commanderID uint32, buildID uint32, areaID uint32, slotType uint32) (*IslandSlotCollectState, error)

type IslandSnapshot

type IslandSnapshot struct {
	CommanderID    uint32
	Name           string
	Level          uint32
	Exp            uint32
	StorageLevel   uint32
	Prosperity     uint32
	AgoraLevel     uint32
	MapID          uint32
	PositionX      float32
	PositionY      float32
	PositionZ      float32
	RotationX      float32
	RotationY      float32
	RotationZ      float32
	OpenFlag       uint32
	InviteCode     string
	DailyTimestamp uint32
	FollowShips    []uint32
}

func GetIslandSnapshot

func GetIslandSnapshot(commanderID uint32) (*IslandSnapshot, error)

func GetIslandSnapshotForUpdateTx

func GetIslandSnapshotForUpdateTx(ctx context.Context, tx pgx.Tx, commanderID uint32) (*IslandSnapshot, error)

func (IslandSnapshot) TableName

func (IslandSnapshot) TableName() string

type IslandSpeedupTarget

type IslandSpeedupTarget struct {
	CommanderID uint32 `gorm:"primaryKey;column:commander_id"`
	TargetType  uint32 `gorm:"primaryKey;column:target_type"`
	TargetID    uint32 `gorm:"primaryKey;column:target_id"`
	EndTime     uint32 `gorm:"column:end_time"`
}

func (IslandSpeedupTarget) TableName

func (IslandSpeedupTarget) TableName() string

type IslandSpeedupTicket

type IslandSpeedupTicket struct {
	CommanderID uint32 `gorm:"primaryKey;column:commander_id"`
	SpeedID     uint32 `gorm:"primaryKey;column:speed_id"`
	EndTime     uint32 `gorm:"primaryKey;column:end_time"`
	Count       uint32 `gorm:"column:count"`
}

func ListIslandSpeedupTickets

func ListIslandSpeedupTickets(commanderID uint32) ([]IslandSpeedupTicket, error)

func (IslandSpeedupTicket) TableName

func (IslandSpeedupTicket) TableName() string

type IslandSpeedupTicketConsume

type IslandSpeedupTicketConsume struct {
	SpeedID uint32
	EndTime uint32
	Count   uint32
}

type IslandSpeedupTicketKey

type IslandSpeedupTicketKey struct {
	SpeedID uint32
	EndTime uint32
}

type IslandTaskEntry

type IslandTaskEntry struct {
	TaskID      uint32                    `json:"task_id"`
	Timestamp   uint32                    `json:"timestamp"`
	ProcessList []IslandTaskTargetProcess `json:"process_list,omitempty"`
}

type IslandTaskProgress

type IslandTaskProgress struct {
	CommanderID        uint32
	WeekStartUnix      uint32
	LastRefreshDayUnix uint32
	WeekDailyTaskNum   uint32
	TraceTaskID        uint32
	TraceDailyTaskID   uint32
	ActiveTasks        []IslandTaskEntry
	FinishedTaskIDs    []uint32
	FutureTaskWindows  []IslandTaskEntry
	RandomTaskWindows  []IslandTaskEntry
}

func LoadIslandTaskProgress

func LoadIslandTaskProgress(commanderID uint32, now time.Time) (*IslandTaskProgress, error)

func LoadIslandTaskProgressForUpdateTx

func LoadIslandTaskProgressForUpdateTx(ctx context.Context, tx pgx.Tx, commanderID uint32, now time.Time) (*IslandTaskProgress, error)

func (IslandTaskProgress) TableName

func (IslandTaskProgress) TableName() string

type IslandTaskTargetProcess

type IslandTaskTargetProcess struct {
	TargetID    uint32 `json:"target_id"`
	TargetCount uint32 `json:"target_count"`
}

type IslandTechnologyState

type IslandTechnologyState struct {
	CommanderID     uint32
	UnlockedTechIDs []uint32
	AbilityIDs      []uint32
	FinishCounts    map[uint32]uint32
}

func GetIslandTechnologyState

func GetIslandTechnologyState(commanderID uint32) (*IslandTechnologyState, error)

func NewIslandTechnologyState

func NewIslandTechnologyState(commanderID uint32) *IslandTechnologyState

func (IslandTechnologyState) TableName

func (IslandTechnologyState) TableName() string

type IslandTreasurePriceState

type IslandTreasurePriceState struct {
	Timestamp uint32 `json:"timestamp"`
	Price     uint32 `json:"price"`
}

type IslandTreasureSellState

type IslandTreasureSellState struct {
	IslandID uint32 `json:"island_id"`
	Num      uint32 `json:"num"`
}

type IslandTreasureState

type IslandTreasureState struct {
	CommanderID uint32
	WeekBuyNum  uint32
	SellList    []IslandTreasureSellState
	PriceList   []IslandTreasurePriceState
}

func GetIslandTreasureState

func GetIslandTreasureState(commanderID uint32) (*IslandTreasureState, error)

func GetIslandTreasureStateForUpdateTx

func GetIslandTreasureStateForUpdateTx(ctx context.Context, tx pgx.Tx, commanderID uint32) (*IslandTreasureState, error)

func NewIslandTreasureState

func NewIslandTreasureState(commanderID uint32) *IslandTreasureState

func (*IslandTreasureState) AddSellCount

func (s *IslandTreasureState) AddSellCount(islandID uint32, delta uint32)

func (*IslandTreasureState) SellCount

func (s *IslandTreasureState) SellCount(islandID uint32) uint32

func (IslandTreasureState) TableName

func (IslandTreasureState) TableName() string

func (*IslandTreasureState) UpsertPrice

func (s *IslandTreasureState) UpsertPrice(timestamp uint32, price uint32)

type IslandWildGatherCollectState

type IslandWildGatherCollectState struct {
	IslandID             uint32
	GatherID             uint32
	CollectorCommanderID uint32
	CollectedAt          time.Time
}

type IslandWildGatherSignState

type IslandWildGatherSignState struct {
	IslandID          uint32
	GatherID          uint32
	SignerCommanderID uint32
	Mark              uint32
	UpdatedAt         time.Time
}

func ListIslandWildGatherSignStates

func ListIslandWildGatherSignStates(islandID uint32, gatherID uint32) ([]IslandWildGatherSignState, error)

type Item

type Item struct {
	ID          uint32 `gorm:"primary_key" json:"id"`
	Name        string `gorm:"size:256;not_null" json:"name"`
	Rarity      int    `gorm:"not_null" json:"rarity"`
	ShopID      int    `gorm:"not_null;default:-2" json:"shop_id,omitempty"`
	Type        int    `gorm:"not_null" json:"type"`
	VirtualType int    `gorm:"not_null" json:"virtual_type"`
}

func GetItemByID

func GetItemByID(id uint32) (*Item, error)

func ListAllItems

func ListAllItems() ([]Item, error)

func ListItemsPage

func ListItemsPage(offset int, limit int) ([]Item, int64, error)

type ItemDataStatisticsConfig

type ItemDataStatisticsConfig struct {
	ID       uint32          `json:"id"`
	Type     uint32          `json:"type"`
	UsageArg json.RawMessage `json:"usage_arg"`
}

func GetItemDataStatisticsConfig

func GetItemDataStatisticsConfig(itemID uint32) (*ItemDataStatisticsConfig, error)

type ItemListResult

type ItemListResult struct {
	Items []Item
	Total int64
}

func ListItems

func ListItems(_ any, params ItemQueryParams) (ItemListResult, error)

type ItemQueryParams

type ItemQueryParams struct {
	Offset int
	Limit  int
}

type JuustagramChatGroup

type JuustagramChatGroup struct {
	ID            uint32 `gorm:"primary_key"`
	CommanderID   uint32 `gorm:"not_null;index:idx_juus_chat_group_commander,unique"`
	GroupRecordID uint32 `gorm:"not_null;index"`
	ChatGroupID   uint32 `gorm:"not_null;index:idx_juus_chat_group_commander,unique"`
	OpTime        uint32 `gorm:"not_null;default:0"`
	ReadFlag      uint32 `gorm:"not_null;default:0"`

	ReplyList []JuustagramReply `gorm:"foreignKey:ChatGroupRecordID;references:ID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
}

func AddJuustagramChatReply

func AddJuustagramChatReply(commanderID uint32, chatGroupID uint32, chatID uint32, value uint32, now uint32) (*JuustagramChatGroup, error)

func CreateJuustagramChatGroup

func CreateJuustagramChatGroup(commanderID uint32, groupID uint32, chatGroupID uint32, opTime uint32) (*JuustagramChatGroup, error)

func GetJuustagramChatGroup

func GetJuustagramChatGroup(commanderID uint32, chatGroupID uint32) (*JuustagramChatGroup, error)

type JuustagramGroup

type JuustagramGroup struct {
	ID           uint32 `gorm:"primary_key"`
	CommanderID  uint32 `gorm:"not_null;index:idx_juus_group_commander,unique"`
	GroupID      uint32 `gorm:"not_null;index:idx_juus_group_commander,unique"`
	SkinID       uint32 `gorm:"not_null;default:0"`
	Favorite     uint32 `gorm:"not_null;default:0"`
	CurChatGroup uint32 `gorm:"not_null;default:0"`

	ChatGroups []JuustagramChatGroup `gorm:"foreignKey:GroupRecordID;references:ID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
}

func CreateJuustagramGroup

func CreateJuustagramGroup(commanderID uint32, groupID uint32, chatGroupID uint32) (*JuustagramGroup, error)

func EnsureJuustagramGroupExists

func EnsureJuustagramGroupExists(commanderID uint32, groupID uint32, chatGroupID uint32) (*JuustagramGroup, error)

func GetJuustagramGroup

func GetJuustagramGroup(commanderID uint32, groupID uint32) (*JuustagramGroup, error)

func GetJuustagramGroupByRecordID

func GetJuustagramGroupByRecordID(commanderID uint32, groupRecordID uint32) (*JuustagramGroup, error)

func GetJuustagramGroups

func GetJuustagramGroups(commanderID uint32) ([]JuustagramGroup, error)

func ListJuustagramGroups

func ListJuustagramGroups(commanderID uint32, offset int, limit int) ([]JuustagramGroup, int64, error)

type JuustagramLanguage

type JuustagramLanguage struct {
	Key   string `gorm:"primary_key" json:"key"`
	Value string `gorm:"not_null" json:"value"`
}

func ListJuustagramLanguageByPrefix

func ListJuustagramLanguageByPrefix(prefix string) ([]JuustagramLanguage, error)

type JuustagramMessageState

type JuustagramMessageState struct {
	ID          uint32 `gorm:"primary_key" json:"id"`
	CommanderID uint32 `gorm:"not_null;index:idx_juus_message_state,unique" json:"commander_id"`
	MessageID   uint32 `gorm:"not_null;index:idx_juus_message_state,unique" json:"message_id"`
	IsRead      uint32 `gorm:"not_null;default:0" json:"is_read"`
	IsGood      uint32 `gorm:"not_null;default:0" json:"is_good"`
	GoodCount   uint32 `gorm:"not_null;default:0" json:"good"`
	UpdatedAt   uint32 `gorm:"not_null;default:0" json:"updated_at"`
}

func GetJuustagramMessageState

func GetJuustagramMessageState(commanderID uint32, messageID uint32) (*JuustagramMessageState, error)

func GetOrCreateJuustagramMessageState

func GetOrCreateJuustagramMessageState(commanderID uint32, messageID uint32, now uint32) (*JuustagramMessageState, error)

func ListJuustagramMessageStatesByCommander

func ListJuustagramMessageStatesByCommander(commanderID uint32) ([]JuustagramMessageState, error)

type JuustagramNpcTemplate

type JuustagramNpcTemplate struct {
	ID              uint32               `gorm:"primary_key" json:"id"`
	ShipGroup       uint32               `gorm:"not_null;index" json:"ship_group"`
	MessagePersist  string               `gorm:"not_null" json:"message_persist"`
	NpcReplyPersist JuustagramReplyList  `gorm:"type:text;not_null;default:'[]'" json:"npc_reply_persist"`
	TimePersist     JuustagramTimeConfig `gorm:"type:text;not_null;default:'[]'" json:"time_persist"`
}

func GetJuustagramNpcTemplate

func GetJuustagramNpcTemplate(id uint32) (*JuustagramNpcTemplate, error)

func ListJuustagramNpcTemplates

func ListJuustagramNpcTemplates(offset int, limit int) ([]JuustagramNpcTemplate, int64, error)

func ListJuustagramOpReplies

func ListJuustagramOpReplies(messageID uint32) ([]JuustagramNpcTemplate, error)

type JuustagramPlayerDiscuss

type JuustagramPlayerDiscuss struct {
	ID          uint32 `gorm:"primary_key" json:"id"`
	CommanderID uint32 `gorm:"not_null;index:idx_juus_discuss_state,unique" json:"commander_id"`
	MessageID   uint32 `gorm:"not_null;index:idx_juus_discuss_state,unique" json:"message_id"`
	DiscussID   uint32 `gorm:"not_null;index:idx_juus_discuss_state,unique" json:"discuss_id"`
	OptionIndex uint32 `gorm:"not_null" json:"option_index"`
	NpcReplyID  uint32 `gorm:"not_null;default:0" json:"npc_reply_id"`
	CommentTime uint32 `gorm:"not_null;default:0" json:"comment_time"`
}

func GetJuustagramPlayerDiscuss

func GetJuustagramPlayerDiscuss(commanderID uint32, messageID uint32, discussID uint32) (*JuustagramPlayerDiscuss, error)

func ListJuustagramPlayerDiscuss

func ListJuustagramPlayerDiscuss(commanderID uint32, messageID uint32) ([]JuustagramPlayerDiscuss, error)

type JuustagramReply

type JuustagramReply struct {
	ID                uint32 `gorm:"primary_key"`
	ChatGroupRecordID uint32 `gorm:"not_null;index:idx_juus_reply_order,unique"`
	Sequence          uint32 `gorm:"not_null;index:idx_juus_reply_order,unique"`
	Key               uint32 `gorm:"not_null"`
	Value             uint32 `gorm:"not_null"`
}

type JuustagramReplyList

type JuustagramReplyList []uint32

func (*JuustagramReplyList) Scan

func (list *JuustagramReplyList) Scan(value any) error

func (*JuustagramReplyList) UnmarshalJSON

func (list *JuustagramReplyList) UnmarshalJSON(data []byte) error

func (JuustagramReplyList) Value

func (list JuustagramReplyList) Value() (driver.Value, error)

type JuustagramShipGroupTemplate

type JuustagramShipGroupTemplate struct {
	ShipGroup   uint32 `gorm:"primary_key" json:"ship_group"`
	Name        string `gorm:"not_null" json:"name"`
	Background  string `gorm:"not_null" json:"background"`
	Sculpture   string `gorm:"not_null" json:"sculpture"`
	SculptureII string `gorm:"not_null" json:"sculpture_ii"`
	Nationality uint32 `gorm:"not_null" json:"nationality"`
	Type        uint32 `gorm:"not_null" json:"type"`
}

func GetJuustagramShipGroupTemplate

func GetJuustagramShipGroupTemplate(shipGroup uint32) (*JuustagramShipGroupTemplate, error)

func ListJuustagramShipGroupTemplates

func ListJuustagramShipGroupTemplates(offset int, limit int) ([]JuustagramShipGroupTemplate, int64, error)

type JuustagramTemplate

type JuustagramTemplate struct {
	ID                uint32               `gorm:"primary_key" json:"id"`
	GroupID           uint32               `gorm:"not_null;index" json:"group_id"`
	ShipGroup         uint32               `gorm:"not_null;index" json:"ship_group"`
	Name              string               `gorm:"not_null" json:"name"`
	Sculpture         string               `gorm:"not_null" json:"sculpture"`
	PicturePersist    string               `gorm:"not_null" json:"picture_persist"`
	MessagePersist    string               `gorm:"not_null" json:"message_persist"`
	IsActive          uint32               `gorm:"not_null;default:0" json:"is_active"`
	NpcDiscussPersist JuustagramUint32List `gorm:"type:text;not_null;default:'[]'" json:"npc_discuss_persist"`
	Time              JuustagramTimeConfig `gorm:"type:text;not_null;default:'[]'" json:"time"`
	TimePersist       JuustagramTimeConfig `gorm:"type:text;not_null;default:'[]'" json:"time_persist"`
}

func GetJuustagramTemplate

func GetJuustagramTemplate(id uint32) (*JuustagramTemplate, error)

func ListJuustagramTemplates

func ListJuustagramTemplates(offset int, limit int) ([]JuustagramTemplate, int64, error)

type JuustagramTimeConfig

type JuustagramTimeConfig [][]int

func (*JuustagramTimeConfig) Scan

func (config *JuustagramTimeConfig) Scan(value any) error

func (JuustagramTimeConfig) Value

func (config JuustagramTimeConfig) Value() (driver.Value, error)

type JuustagramUint32List

type JuustagramUint32List []uint32

func (*JuustagramUint32List) Scan

func (list *JuustagramUint32List) Scan(value any) error

func (JuustagramUint32List) Value

func (list JuustagramUint32List) Value() (driver.Value, error)

type LegacyEducateState

type LegacyEducateState struct {
	CommanderID   uint32            `json:"commander_id"`
	CallName      string            `json:"call_name"`
	TargetID      uint32            `json:"target_id"`
	FavorLv       uint32            `json:"favor_lv"`
	FavorExp      uint32            `json:"favor_exp"`
	HadAdjustment bool              `json:"had_adjustment"`
	Attrs         map[uint32]uint32 `json:"attrs"`
	TaskProgress  map[uint32]uint32 `json:"task_progress"`
	OptionRecords map[uint32]uint32 `json:"option_records"`
	Resources     map[uint32]int32  `json:"resources"`
	Endings       []uint32          `json:"endings"`
	Qualifieds    []uint32          `json:"qualifieds"`
}

func GetOrCreateLegacyEducateState

func GetOrCreateLegacyEducateState(commanderID uint32) (*LegacyEducateState, error)

type Like

type Like struct {
	GroupID   uint32 `gorm:"primary_key;index:idx_likes_group_id_liker_id"`
	LikerID   uint32 `gorm:"not_null;primary_key;index:idx_likes_group_id_liker_id"`
	CreatedAt time.Time

	Liker Commander `gorm:"foreignkey:LikerID;references:CommanderID"`
}

func ListLikesByCommander

func ListLikesByCommander(commanderID uint32) ([]Like, error)

type LimitChallengeState

type LimitChallengeState struct {
	CommanderID uint32
	MonthBucket uint32
	BestTimes   map[uint32]uint32
	Awarded     map[uint32]bool
	PassIDs     []uint32
}

func LoadLimitChallengeState

func LoadLimitChallengeState(commanderID uint32, now time.Time) (*LimitChallengeState, error)

func LoadLimitChallengeStateForUpdateTx

func LoadLimitChallengeStateForUpdateTx(ctx context.Context, tx pgx.Tx, commanderID uint32, now time.Time) (*LimitChallengeState, error)

func (LimitChallengeState) TableName

func (LimitChallengeState) TableName() string

type LocalAccount

type LocalAccount struct {
	Arg2      uint32    `gorm:"primary_key;not_null;uniqueIndex"`
	Account   string    `gorm:"size:128;not_null;uniqueIndex"`
	Password  string    `gorm:"size:256;not_null"`
	MailBox   string    `gorm:"size:256;not_null"`
	CreatedAt time.Time `gorm:"autoCreateTime"`
	UpdatedAt time.Time `gorm:"autoUpdateTime"`
}

func GetLocalAccountByAccount

func GetLocalAccountByAccount(account string) (*LocalAccount, error)

type LoveLetterConvertedItem

type LoveLetterConvertedItem struct {
	ItemID  uint32 `json:"item_id"`
	GroupID uint32 `json:"group_id"`
	Year    uint32 `json:"year"`
}

type LoveLetterLetterState

type LoveLetterLetterState struct {
	GroupID      uint32   `json:"group_id"`
	LetterIDList []uint32 `json:"letter_id_list"`
}

type LoveLetterMedalState

type LoveLetterMedalState struct {
	GroupID uint32 `json:"group_id"`
	Exp     uint32 `json:"exp"`
	Level   uint32 `json:"level"`
}

type Mail

type Mail struct {
	ID                   uint32    `gorm:"primary_key"`
	ReceiverID           uint32    `gorm:"not_null"`
	Read                 bool      `gorm:"not_null;default:false"`
	Date                 time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP;not_null"`
	Title                string    `gorm:"type:varchar(40);not_null"`
	Body                 string    `gorm:"type:varchar(2000);not_null"`
	AttachmentsCollected bool      `gorm:"not_null;default:false"`
	IsImportant          bool      `gorm:"not_null;default:false"`
	CustomSender         *string   `gorm:"type:varchar(30)"`
	IsArchived           bool      `gorm:"not_null;default:false"`
	CreatedAt            time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP;not_null"`

	Attachments []MailAttachment `gorm:"foreignkey:MailID;references:ID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
	Commander   Commander        `gorm:"foreignkey:ReceiverID;references:CommanderID"`
}

func GetMailByReceiverAndID

func GetMailByReceiverAndID(receiverID uint32, mailID uint32) (*Mail, error)

func (*Mail) CollectAttachments

func (m *Mail) CollectAttachments(commander *Commander) ([]MailAttachment, error)

CollectAttachments returns the attachments and marks the mail as collected.

func (*Mail) Create

func (m *Mail) Create() error

func (*Mail) Delete

func (m *Mail) Delete() error

func (*Mail) SetArchived

func (m *Mail) SetArchived(archived bool) error

TODO: Check whether the Commander has enough space to archive the mail

func (*Mail) SetImportant

func (m *Mail) SetImportant(important bool) error

func (*Mail) SetRead

func (m *Mail) SetRead(read bool) error

func (*Mail) Update

func (m *Mail) Update() error

type MailAttachment

type MailAttachment struct {
	ID       uint32 `gorm:"primary_key"`
	MailID   uint32 `gorm:"not_null"`
	Type     uint32 `gorm:"not_null"`
	ItemID   uint32 `gorm:"not_null"`
	Quantity uint32 `gorm:"not_null"`
}

TODO: Unused yet

type MedalShopGood

type MedalShopGood struct {
	CommanderID uint32 `gorm:"primary_key"`
	Index       uint32 `gorm:"primary_key"`
	GoodsID     uint32 `gorm:"not_null"`
	Count       uint32 `gorm:"not_null"`
}

func LoadMedalShopGoods

func LoadMedalShopGoods(commanderID uint32) ([]MedalShopGood, error)

type MedalShopState

type MedalShopState struct {
	CommanderID     uint32 `gorm:"primary_key"`
	NextRefreshTime uint32 `gorm:"not_null"`
}

func GetMedalShopState

func GetMedalShopState(commanderID uint32) (*MedalShopState, error)

type Message

type Message struct {
	ID       uint32    `gorm:"primary_key"`
	SenderID uint32    `gorm:"not_null"`
	RoomID   uint32    `gorm:"not_null"`
	SentAt   time.Time `gorm:"not_null;default:CURRENT_TIMESTAMP;index:idx_sent_at,sort:desc"`
	Content  string    `gorm:"not_null;type:varchar(512)"`

	Sender Commander `gorm:"foreignkey:SenderID;references:CommanderID"`
}

func GetRoomHistory

func GetRoomHistory(roomID uint32) ([]Message, error)

Returns the last 50 messages from a room

func SendMessage

func SendMessage(roomID uint32, content string, sender *Commander) (*Message, error)

Inserts a message in the database

func (*Message) Create

func (m *Message) Create() error

func (*Message) Delete

func (m *Message) Delete() error

func (*Message) Update

func (m *Message) Update() error

type MetaTacticsSkillSlot

type MetaTacticsSkillSlot struct {
	SkillID uint32
	Pos     uint32
}

func GetMetaTacticsSkillSlotsByShipTemplate

func GetMetaTacticsSkillSlotsByShipTemplate(shipTemplateID uint32) ([]MetaTacticsSkillSlot, error)

type MiniGameConfig

type MiniGameConfig struct {
	ID    uint32 `json:"id"`
	HubID uint32 `json:"hub_id"`
}

func GetMiniGameConfig

func GetMiniGameConfig(gameID uint32) (*MiniGameConfig, error)

type MiniGameDataState

type MiniGameDataState struct {
	CommanderID uint32                `json:"commander_id"`
	GameID      uint32                `json:"game_id"`
	Datas       []uint32              `json:"datas"`
	KVLists     []MiniGameKVListState `json:"kv_lists"`
}

func GetOrCreateMiniGameDataState

func GetOrCreateMiniGameDataState(commanderID uint32, gameID uint32) (*MiniGameDataState, error)

type MiniGameHubConfig

type MiniGameHubConfig struct {
	ID            uint32   `json:"id"`
	ActID         uint32   `json:"act_id"`
	RebornTimes   uint32   `json:"reborn_times"`
	RewardNeed    uint32   `json:"reward_need"`
	RewardTarget  uint32   `json:"reward_target"`
	RewardDisplay []uint32 `json:"reward_display"`
}

func GetMiniGameHubConfig

func GetMiniGameHubConfig(hubID uint32) (*MiniGameHubConfig, error)

type MiniGameHubState

type MiniGameHubState struct {
	CommanderID  uint32                        `json:"commander_id"`
	HubID        uint32                        `json:"hub_id"`
	AvailableCnt uint32                        `json:"available_cnt"`
	UsedCnt      uint32                        `json:"used_cnt"`
	Ultimate     uint32                        `json:"ultimate"`
	MaxScores    map[uint32]MiniGameScoreEntry `json:"max_scores"`
}

func GetOrCreateMiniGameHubState

func GetOrCreateMiniGameHubState(commanderID uint32, config *MiniGameHubConfig) (*MiniGameHubState, error)

type MiniGameKVListState

type MiniGameKVListState struct {
	Key    uint32            `json:"key"`
	Values []MiniGameKVState `json:"values"`
}

type MiniGameKVState

type MiniGameKVState struct {
	Key    uint32 `json:"key"`
	Value  uint32 `json:"value"`
	Value2 uint32 `json:"value2"`
}

type MiniGameScoreEntry

type MiniGameScoreEntry struct {
	Score uint32 `json:"score"`
	Extra uint32 `json:"extra"`
}

type MiniGameShopGood

type MiniGameShopGood struct {
	CommanderID uint32 `gorm:"primary_key"`
	GoodsID     uint32 `gorm:"primary_key"`
	Count       uint32 `gorm:"not_null"`
}

func LoadMiniGameShopGoods

func LoadMiniGameShopGoods(commanderID uint32) ([]MiniGameShopGood, error)

type MiniGameShopState

type MiniGameShopState struct {
	CommanderID     uint32 `gorm:"primary_key"`
	NextRefreshTime uint32 `gorm:"not_null"`
}

func GetMiniGameShopState

func GetMiniGameShopState(commanderID uint32) (*MiniGameShopState, error)

type MiniGameTelemetryState

type MiniGameTelemetryState struct {
	CommanderID uint32            `json:"commander_id"`
	GameTimes   map[uint32]uint32 `json:"game_times"`
}

func GetOrCreateMiniGameTelemetryState

func GetOrCreateMiniGameTelemetryState(commanderID uint32) (*MiniGameTelemetryState, error)

type MonthShopPurchase

type MonthShopPurchase struct {
	CommanderID uint32    `gorm:"primaryKey;autoIncrement:false"`
	GoodsID     uint32    `gorm:"primaryKey;autoIncrement:false"`
	Month       uint32    `gorm:"primaryKey;autoIncrement:false"`
	BuyCount    uint32    `gorm:"not_null"`
	UpdatedAt   time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP;not_null"`
}
type NavalAcademyRuntime struct {
	CommanderID             uint32 `json:"commander_id"`
	OilWellLevel            uint32 `json:"oil_well_level"`
	GoldWellLevel           uint32 `json:"gold_well_level"`
	OilCollectTimestamp     uint32 `json:"oil_collect_timestamp"`
	GoldCollectTimestamp    uint32 `json:"gold_collect_timestamp"`
	OilUpgradeStartTime     uint32 `json:"oil_upgrade_start_time"`
	OilUpgradeCompleteTime  uint32 `json:"oil_upgrade_complete_time"`
	GoldUpgradeStartTime    uint32 `json:"gold_upgrade_start_time"`
	GoldUpgradeCompleteTime uint32 `json:"gold_upgrade_complete_time"`
}

func LoadNavalAcademyRuntime

func LoadNavalAcademyRuntime(commanderID uint32) (*NavalAcademyRuntime, error)

func LoadOrCreateNavalAcademyRuntime

func LoadOrCreateNavalAcademyRuntime(commanderID uint32) (*NavalAcademyRuntime, error)

type NewServerShopGoodsState

type NewServerShopGoodsState struct {
	ID           uint32   `json:"id"`
	Count        uint32   `json:"count"`
	BoughtRecord []uint32 `json:"bought_record"`
}

type NewServerShopState

type NewServerShopState struct {
	CommanderID uint32
	ActivityID  uint32
	Goods       []NewServerShopGoodsState
}

func GetNewServerShopState

func GetNewServerShopState(commanderID uint32, activityID uint32) (*NewServerShopState, error)

func GetNewServerShopStateTx

func GetNewServerShopStateTx(ctx context.Context, tx pgx.Tx, commanderID uint32, activityID uint32) (*NewServerShopState, error)

func (NewServerShopState) TableName

func (NewServerShopState) TableName() string

type Notice

type Notice struct {
	ID         int    `gorm:"primary_key"`
	Version    string `gorm:"default:'1';not_null"`
	BtnTitle   string `gorm:"type:varchar(48);not_null"`
	Title      string `gorm:"type:varchar(48);not_null"`
	TitleImage string `gorm:"type:text;not_null"`
	TimeDesc   string `gorm:"type:varchar(10);not_null"`
	Content    string `gorm:"type:text;not_null"`
	TagType    int    `gorm:"not_null;default:1"`
	Icon       int    `gorm:"not_null;default:1"`
	Track      string `gorm:"type:varchar(10);not_null"`
}

func ListActiveNotices

func ListActiveNotices() ([]Notice, error)

func (*Notice) Create

func (n *Notice) Create() error

Inserts or updates a notice in the database (based on the primary key)

func (*Notice) Delete

func (n *Notice) Delete() error

Deletes a notice from the database

func (*Notice) Retrieve

func (n *Notice) Retrieve(greedy bool) error

Gets a notice from the database by its primary key If greedy is true, it will also load the relations

func (*Notice) Update

func (n *Notice) Update() error

Updates a notice in the database

type NoticeListResult

type NoticeListResult struct {
	Notices []Notice
	Total   int64
}

func ListNotices

func ListNotices(params NoticeQueryParams) (NoticeListResult, error)

type NoticeQueryParams

type NoticeQueryParams struct {
	Offset int
	Limit  int
}

type OwnedEquipment

type OwnedEquipment struct {
	CommanderID uint32 `gorm:"primaryKey;autoIncrement:false" json:"commander_id"`
	EquipmentID uint32 `gorm:"primaryKey;autoIncrement:false" json:"equipment_id"`
	Count       uint32 `gorm:"not_null" json:"count"`

	Equipment Equipment `gorm:"foreignKey:EquipmentID;references:ID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
}

type OwnedResource

type OwnedResource struct {
	CommanderID uint32 `gorm:"primaryKey"`
	ResourceID  uint32 `gorm:"primaryKey"`
	Amount      uint32 `gorm:"not_null;default:0"`

	Commander Commander `gorm:"foreignKey:CommanderID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
	Resource  Resource  `gorm:"foreignKey:ResourceID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
}

type OwnedShip

type OwnedShip struct {
	OwnerID             uint32    `gorm:"type:int;not_null"`
	ShipID              uint32    `gorm:"not_null"`
	ID                  uint32    `gorm:"primary_key"`
	Level               uint32    `gorm:"default:1;not_null"`
	Exp                 uint32    `gorm:"default:0;not_null"`
	SurplusExp          uint32    `gorm:"default:0;not_null"`
	MaxLevel            uint32    `gorm:"default:50;not_null"`
	Intimacy            uint32    `gorm:"default:5000;not_null"`
	IsLocked            bool      `gorm:"default:false;not_null"`
	Propose             bool      `gorm:"default:false;not_null"`
	CommonFlag          bool      `gorm:"default:false;not_null"`
	BlueprintFlag       bool      `gorm:"default:false;not_null"`
	Proficiency         bool      `gorm:"default:false;not_null"`
	ActivityNPC         uint32    `gorm:"default:0;not_null"`
	CustomName          string    `gorm:"size:30;default:'';not_null"`
	ChangeNameTimestamp time.Time `gorm:"type:timestamp;default:'1970-01-01 01:00:00';not_null"`
	CreateTime          time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP;not_null"`
	Energy              uint32    `gorm:"default:150;not_null"`
	// Ship state fields used for dorm/backyard and other contexts.
	// Maps to protobuf.SHIPSTATE.
	State              uint32     `gorm:"default:0;not_null"`
	StateInfo1         uint32     `gorm:"default:0;not_null"`
	StateInfo2         uint32     `gorm:"default:0;not_null"`
	StateInfo3         uint32     `gorm:"default:0;not_null"`
	StateInfo4         uint32     `gorm:"default:0;not_null"`
	SkinID             uint32     `gorm:"default:0;not_null"`
	IsSecretary        bool       `gorm:"default:false;not_null"`
	SecretaryPosition  *uint32    `gorm:"default:999;not_null"`
	SecretaryPhantomID uint32     `gorm:"default:0;not_null"`
	DeletedAt          *time.Time `gorm:"index"`

	Ship       Ship                 `gorm:"foreignKey:ShipID;references:TemplateID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
	Commander  Commander            `gorm:"foreignKey:OwnerID;references:CommanderID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
	Equipments []OwnedShipEquipment `gorm:"foreignKey:ShipID;references:ID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
	Transforms []OwnedShipTransform `gorm:"foreignKey:ShipID;references:ID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
	Strengths  []OwnedShipStrength  `gorm:"foreignKey:ShipID;references:ID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
}

func GetOwnedShipByOwnerAndID

func GetOwnedShipByOwnerAndID(ownerID uint32, ownedID uint32) (*OwnedShip, error)

func (*OwnedShip) Create

func (s *OwnedShip) Create() error

func (*OwnedShip) Delete

func (s *OwnedShip) Delete() error

func (*OwnedShip) ProposeShip

func (s *OwnedShip) ProposeShip() error

func (*OwnedShip) RenameShip

func (s *OwnedShip) RenameShip(newName string) error

func (*OwnedShip) SetFavorite

func (s *OwnedShip) SetFavorite(b uint32) error

func (*OwnedShip) Update

func (s *OwnedShip) Update() error

type OwnedShipEquipment

type OwnedShipEquipment struct {
	OwnerID uint32 `gorm:"primaryKey;autoIncrement:false" json:"owner_id"`
	ShipID  uint32 `gorm:"primaryKey;autoIncrement:false" json:"ship_id"`
	Pos     uint32 `gorm:"primaryKey;autoIncrement:false" json:"pos"`
	EquipID uint32 `gorm:"not_null" json:"equip_id"`
	SkinID  uint32 `gorm:"not_null" json:"skin_id"`

	Equipment Equipment `gorm:"foreignKey:EquipID;references:ID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
}

func GetOwnedShipEquipment

func GetOwnedShipEquipment(ownerID uint32, shipID uint32, pos uint32) (*OwnedShipEquipment, error)

func ListOwnedShipEquipment

func ListOwnedShipEquipment(ownerID uint32, shipID uint32) ([]OwnedShipEquipment, error)

type OwnedShipShadowSkin

type OwnedShipShadowSkin struct {
	CommanderID uint32 `gorm:"primaryKey;autoIncrement:false"`
	ShipID      uint32 `gorm:"primaryKey;autoIncrement:false"`
	ShadowID    uint32 `gorm:"primaryKey;autoIncrement:false"`
	SkinID      uint32 `gorm:"not_null"`
}

type OwnedShipStrength

type OwnedShipStrength struct {
	OwnerID    uint32 `gorm:"primaryKey;autoIncrement:false"`
	ShipID     uint32 `gorm:"primaryKey;autoIncrement:false"`
	StrengthID uint32 `gorm:"primaryKey;autoIncrement:false"`
	Exp        uint32 `gorm:"not_null"`
}

func ListOwnedShipStrengths

func ListOwnedShipStrengths(ownerID uint32, shipID uint32) ([]OwnedShipStrength, error)

type OwnedShipTransform

type OwnedShipTransform struct {
	OwnerID     uint32 `gorm:"primaryKey;autoIncrement:false"`
	ShipID      uint32 `gorm:"primaryKey;autoIncrement:false"`
	TransformID uint32 `gorm:"primaryKey;autoIncrement:false"`
	Level       uint32 `gorm:"not_null"`
}

func ListOwnedShipTransforms

func ListOwnedShipTransforms(ownerID uint32, shipID uint32) ([]OwnedShipTransform, error)

type OwnedSkin

type OwnedSkin struct {
	CommanderID uint32     `gorm:"primaryKey"`
	SkinID      uint32     `gorm:"primaryKey"`
	ExpiresAt   *time.Time `gorm:"not_null"`
}

type OwnedSpWeapon

type OwnedSpWeapon struct {
	OwnerID uint32 `gorm:"type:int;not_null;index"`
	ID      uint32 `gorm:"primary_key"`

	TemplateID uint32 `gorm:"not_null"`

	Attr1     uint32 `gorm:"column:attr_1;default:0;not_null"`
	Attr2     uint32 `gorm:"column:attr_2;default:0;not_null"`
	AttrTemp1 uint32 `gorm:"column:attr_temp_1;default:0;not_null"`
	AttrTemp2 uint32 `gorm:"column:attr_temp_2;default:0;not_null"`
	Effect    uint32 `gorm:"default:0;not_null"`
	Pt        uint32 `gorm:"default:0;not_null"`

	// EquippedShipID is the owned ship id this spweapon is equipped to, or 0.
	EquippedShipID uint32 `gorm:"default:0;not_null"`
}

OwnedSpWeapon represents a special weapon (spweapon) owned by a commander.

The client refers to spweapons by a per-instance uid; we persist that uid as the primary key ID.

func CreateOwnedSpWeapon

func CreateOwnedSpWeapon(ownerID uint32, templateID uint32) (*OwnedSpWeapon, error)

func GetOwnedSpWeapon

func GetOwnedSpWeapon(ownerID uint32, spweaponID uint32) (*OwnedSpWeapon, error)

func ListOwnedSpWeapons

func ListOwnedSpWeapons(ownerID uint32) ([]OwnedSpWeapon, error)

func (OwnedSpWeapon) TableName

func (OwnedSpWeapon) TableName() string

type PendingFriendRequest

type PendingFriendRequest struct {
	Requester CommanderSocialProfile
	Content   string
	CreatedAt time.Time
}

func ListIncomingFriendRequests

func ListIncomingFriendRequests(targetID uint32) ([]PendingFriendRequest, error)

type Permission

type Permission struct {
	ID          string    `gorm:"primary_key;size:36"`
	Key         string    `gorm:"size:128;not_null;uniqueIndex"`
	Description string    `gorm:"size:255;not_null"`
	CreatedAt   time.Time `gorm:"autoCreateTime"`
	UpdatedAt   time.Time `gorm:"autoUpdateTime"`
}

func ListPermissions

func ListPermissions() ([]Permission, error)

type PlayerBanStatus

type PlayerBanStatus struct {
	Banned   bool
	LiftTime *time.Time
}

func GetBanStatus

func GetBanStatus(commanderID uint32) (PlayerBanStatus, error)

type PlayerInform

type PlayerInform struct {
	ID         uint64 `json:"id"`
	ReporterID uint32 `json:"reporter_id"`
	TargetID   uint32 `json:"target_id"`
	Info       string `json:"info"`
	Content    string `json:"content"`
	CreatedAt  uint32 `json:"created_at"`
}

func CreatePlayerInform

func CreatePlayerInform(reporterID uint32, targetID uint32, info string, content string, createdAt uint32) (*PlayerInform, error)

type PlayerListResult

type PlayerListResult struct {
	Commanders []Commander
	Total      int64
}

func ListCommanders

func ListCommanders(params PlayerQueryParams) (PlayerListResult, error)

func SearchCommanders

func SearchCommanders(params PlayerQueryParams) (PlayerListResult, error)

type PlayerQueryParams

type PlayerQueryParams struct {
	Offset       int
	Limit        int
	FilterBanned bool
	FilterOnline bool
	OnlineIDs    []uint32
	MinLevel     int
	Search       string
}

type PlayerSummaryStats

type PlayerSummaryStats struct {
	RegisterDate    uint32
	ChapterID       uint32
	MarryNumber     uint32
	MedalNumber     uint32
	FurnitureNumber uint32
	FurnitureWorth  uint32
	CharacterID     uint32
	FirstLadyID     uint32
	FirstLadyName   string
	FirstLadyTime   uint32
	FirstOnline     uint32
	WorldMaxTask    uint32
	CollectNum      uint32
	Combat          uint32
	ShipNumTotal    uint32
	ShipNum120      uint32
	ShipNum125      uint32
	Love200Num      uint32
	SkinNum         uint32
	SkinShipNum     uint32
}

func GetPlayerSummaryStats

func GetPlayerSummaryStats(commanderID uint32) (*PlayerSummaryStats, error)

type Punishment

type Punishment struct {
	ID            uint32     `gorm:"primary_key"`
	PunishedID    uint32     `gorm:"not_null"`
	LiftTimestamp *time.Time `gorm:"type:timestamp"`
	IsPermanent   bool       `gorm:"default:false;not_null"`

	Punished Commander `gorm:"foreignKey:PunishedID;references:CommanderID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
}

func ActivePunishment

func ActivePunishment(commanderID uint32) (*Punishment, error)

func GetPunishmentByCommanderAndID

func GetPunishmentByCommanderAndID(commanderID uint32, punishmentID uint32) (*Punishment, error)

func ListPermanentPunishmentsByCommanderIDs

func ListPermanentPunishmentsByCommanderIDs(commanderIDs []uint32) ([]Punishment, error)

func ListPunishmentsByCommanderID

func ListPunishmentsByCommanderID(commanderID uint32) ([]Punishment, error)

func (*Punishment) Create

func (p *Punishment) Create() error

Inserts or updates a punishment in the database (based on the primary key)

func (*Punishment) Delete

func (p *Punishment) Delete() error

Deletes a punishment from the database

func (*Punishment) Retrieve

func (p *Punishment) Retrieve(greedy bool) error

Gets a punishment from the database by its primary key If greedy is true, it will also load the relations

func (*Punishment) Update

func (p *Punishment) Update() error

Updates a punishment in the database

type RandomFlagShip

type RandomFlagShip struct {
	CommanderID uint32 `gorm:"primaryKey;autoIncrement:false"`
	ShipID      uint32 `gorm:"primaryKey;autoIncrement:false"`
	PhantomID   uint32 `gorm:"primaryKey;autoIncrement:false"`
	Enabled     bool   `gorm:"default:true;not_null"`
}

func ListRandomFlagShips

func ListRandomFlagShips(commanderID uint32, shipID *uint32) ([]RandomFlagShip, error)

type RandomFlagShipUpdate

type RandomFlagShipUpdate struct {
	ShipID    uint32
	PhantomID uint32
	Flag      uint32
}

type Rarity

type Rarity struct {
	ID   uint32 `gorm:"primary_key"`
	Name string `gorm:"size:12"`
}

func GetRarityByID

func GetRarityByID(id uint32) (*Rarity, error)

func ListRarities

func ListRarities(offset int, limit int) ([]Rarity, int64, error)

type RefluxState

type RefluxState struct {
	CommanderID     uint32    `gorm:"primaryKey;autoIncrement:false"`
	Active          uint32    `gorm:"not_null;default:0"`
	ReturnLv        uint32    `gorm:"not_null;default:0"`
	ReturnTime      uint32    `gorm:"not_null;default:0"`
	ShipNumber      uint32    `gorm:"not_null;default:0"`
	LastOfflineTime uint32    `gorm:"not_null;default:0"`
	Pt              uint32    `gorm:"not_null;default:0"`
	SignCnt         uint32    `gorm:"not_null;default:0"`
	SignLastTime    uint32    `gorm:"not_null;default:0"`
	PtStage         uint32    `gorm:"not_null;default:0"`
	CreatedAt       time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP;not_null"`
	UpdatedAt       time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP;not_null"`
}

func GetOrCreateRefluxState

func GetOrCreateRefluxState(commanderID uint32) (*RefluxState, error)

type RemasterProgress

type RemasterProgress struct {
	ID          uint64    `gorm:"primaryKey"`
	CommanderID uint32    `gorm:"not_null;index;uniqueIndex:idx_remaster_progress"`
	ChapterID   uint32    `gorm:"not_null;index;uniqueIndex:idx_remaster_progress"`
	Pos         uint32    `gorm:"not_null;uniqueIndex:idx_remaster_progress"`
	Count       uint32    `gorm:"not_null;default:0"`
	Received    bool      `gorm:"not_null;default:false"`
	CreatedAt   time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP;not_null"`
	UpdatedAt   time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP;not_null"`
}

func GetRemasterProgress

func GetRemasterProgress(commanderID uint32, chapterID uint32, pos uint32) (*RemasterProgress, error)

func ListRemasterProgress

func ListRemasterProgress(commanderID uint32) ([]RemasterProgress, error)

type RemasterState

type RemasterState struct {
	CommanderID      uint32    `gorm:"primaryKey;autoIncrement:false"`
	TicketCount      uint32    `gorm:"not_null;default:0"`
	ActiveChapterID  uint32    `gorm:"not_null;default:0"`
	DailyCount       uint32    `gorm:"not_null;default:0"`
	LastDailyResetAt time.Time `gorm:"type:timestamp;default:'1970-01-01 00:00:00';not_null"`
	CreatedAt        time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP;not_null"`
	UpdatedAt        time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP;not_null"`
}

func GetOrCreateRemasterState

func GetOrCreateRemasterState(commanderID uint32) (*RemasterState, error)

type RequisitionShip

type RequisitionShip struct {
	ShipID uint32 `gorm:"primary_key" json:"ship_id"`
}

type Resource

type Resource struct {
	ID     uint32 `gorm:"primary_key" json:"id"`
	ItemID uint32 `json:"itemid"`
	Name   string `gorm:"type:varchar(128);not_null" json:"name"`

	// Resource.ItemID is not guaranteed to refer to a row in items.
	// Keep the association for query convenience, but don't enforce it as a DB FK.
	Item Item `gorm:"foreignKey:ItemID;references:ID;constraint:-"`
}

func GetResourceByID

func GetResourceByID(id uint32) (*Resource, error)

func ListAllResources

func ListAllResources() ([]Resource, error)

func ListResourcesPage

func ListResourcesPage(offset int, limit int) ([]Resource, int64, error)

type ResourceListResult

type ResourceListResult struct {
	Resources []Resource
	Total     int64
}

func ListResources

func ListResources(_ any, params ResourceQueryParams) (ResourceListResult, error)

type ResourceQueryParams

type ResourceQueryParams struct {
	Offset int
	Limit  int
}

type Role

type Role struct {
	ID          string    `gorm:"primary_key;size:36"`
	Name        string    `gorm:"size:64;not_null;uniqueIndex"`
	Description string    `gorm:"size:255;not_null"`
	CreatedAt   time.Time `gorm:"autoCreateTime"`
	UpdatedAt   time.Time `gorm:"autoUpdateTime"`
	UpdatedBy   *string   `gorm:"size:36"`
}

func GetRoleByName

func GetRoleByName(roleName string) (*Role, error)

func ListRoles

func ListRoles() ([]Role, error)

type RolePermission

type RolePermission struct {
	RoleID       string `gorm:"primaryKey;size:36"`
	PermissionID string `gorm:"primaryKey;size:36"`

	CanReadSelf  bool `gorm:"default:false;not_null"`
	CanReadAny   bool `gorm:"default:false;not_null"`
	CanWriteSelf bool `gorm:"default:false;not_null"`
	CanWriteAny  bool `gorm:"default:false;not_null"`

	UpdatedAt time.Time `gorm:"autoUpdateTime"`
}

type RolePolicyEntry

type RolePolicyEntry struct {
	Key        string
	Capability authz.Capability
}

func LoadRolePolicyByName

func LoadRolePolicyByName(roleName string) ([]RolePolicyEntry, error)

type SecondaryPasswordState

type SecondaryPasswordState struct {
	CommanderID  uint32    `gorm:"primaryKey;autoIncrement:false"`
	PasswordHash string    `gorm:"type:text;not_null;default:''"`
	Notice       string    `gorm:"type:text;not_null;default:''"`
	SystemList   Int64List `gorm:"type:text;not_null;default:'[]'"`
	State        uint32    `gorm:"not_null;default:0"`
	FailCount    uint32    `gorm:"not_null;default:0"`
	FailCd       uint32    `gorm:"not_null;default:0"`
}

func GetOrCreateSecondaryPasswordState

func GetOrCreateSecondaryPasswordState(commanderID uint32) (*SecondaryPasswordState, error)

type SecretaryUpdate

type SecretaryUpdate struct {
	ShipID    uint32
	PhantomID uint32
}

type Session

type Session struct {
	ID        string `gorm:"primary_key;size:36"`
	AccountID string `gorm:"size:36;not_null;index"`

	CreatedAt  time.Time  `gorm:"autoCreateTime"`
	LastSeenAt time.Time  `gorm:"type:timestamp;not_null"`
	ExpiresAt  time.Time  `gorm:"type:timestamp;not_null"`
	IPAddress  string     `gorm:"size:64"`
	UserAgent  string     `gorm:"size:255"`
	RevokedAt  *time.Time `gorm:"type:timestamp"`

	CSRFToken     string    `gorm:"size:64;not_null"`
	CSRFExpiresAt time.Time `gorm:"type:timestamp;not_null"`
}

type Ship

type Ship struct {
	TemplateID  uint32 `gorm:"primary_key" json:"id"`
	Name        string `gorm:"size:32;not_null" json:"name"`
	EnglishName string `gorm:"size:64;not_null" json:"english_name"`
	RarityID    uint32 `gorm:"not_null" json:"rarity"`
	Star        uint32 `gorm:"not_null" json:"star"`
	Type        uint32 `gorm:"not_null" json:"type"`
	Nationality uint32 `gorm:"not_null" json:"nationality"`
	BuildTime   uint32 `gorm:"not_null" json:"-"`
	PoolID      *uint32
}

func GetRandomPoolShip

func GetRandomPoolShip(poolId uint32) (Ship, error)

Returns a random ship from a pool, based on Azur Lane's rates 7% Super Rare (gold color) 12% Elite (purple color) 51% Rare (blue color) 30% Common (gray color) Azur Lane has sometime some boosted rates for some ships, but we don't care about that for now

func GetRandomRequisitionShipByRarity

func GetRandomRequisitionShipByRarity(rarity uint32) (Ship, error)

func ListShipsPage

func ListShipsPage(params ShipQueryParams) ([]Ship, int64, error)

func (*Ship) Create

func (s *Ship) Create() error

Inserts or updates a ship in the database (based on the primary key)

func (*Ship) Delete

func (s *Ship) Delete() error

Deletes a ship from the database

func (*Ship) Retrieve

func (s *Ship) Retrieve(greedy bool) error

Gets a ship from the database by its primary key If greedy is true, it will also load the relations

func (*Ship) Update

func (s *Ship) Update() error

Updates a ship in the database

type ShipBreakoutConfig

type ShipBreakoutConfig struct {
	ID           uint32     `json:"id"`
	BreakoutID   uint32     `json:"breakout_id"`
	PreID        uint32     `json:"pre_id"`
	Level        uint32     `json:"level"`
	UseGold      uint32     `json:"use_gold"`
	UseItem      [][]uint32 `json:"use_item"`
	UseChar      uint32     `json:"use_char"`
	UseCharNum   uint32     `json:"use_char_num"`
	WeaponIDs    []uint32   `json:"weapon_ids"`
	BreakoutView string     `json:"breakout_view"`
}

func GetShipBreakoutConfig

func GetShipBreakoutConfig(templateID uint32) (*ShipBreakoutConfig, error)

func GetShipBreakoutConfigTx

func GetShipBreakoutConfigTx(_ any, templateID uint32) (*ShipBreakoutConfig, error)

type ShipDataBlueprintConfig

type ShipDataBlueprintConfig struct {
	ID                      uint32     `json:"id"`
	BlueprintVersion        uint32     `json:"blueprint_version"`
	UnlockTaskOpenCondition []uint32   `json:"unlock_task_open_condition"`
	UnlockTask              [][]uint32 `json:"unlock_task"`
	StrengthenEffect        []uint32   `json:"strengthen_effect"`
	FateStrengthen          []uint32   `json:"fate_strengthen"`
	StrengthenItem          uint32     `json:"strengthen_item"`
	GainItemID              []uint32   `json:"gain_item_id"`
	IsPursuing              uint32     `json:"is_pursuing"`
	Price                   uint32     `json:"price"`
}

func GetShipDataBlueprintConfig

func GetShipDataBlueprintConfig(id uint32) (*ShipDataBlueprintConfig, error)

func (*ShipDataBlueprintConfig) ShipTemplateID

func (c *ShipDataBlueprintConfig) ShipTemplateID() uint32

type ShipDataStatisticsConfig

type ShipDataStatisticsConfig struct {
	ID     uint32 `json:"id"`
	SkinID uint32 `json:"skin_id"`
}

func GetShipDataStatisticsConfig

func GetShipDataStatisticsConfig(templateID uint32) (*ShipDataStatisticsConfig, error)

func GetShipDataStatisticsConfigTx

func GetShipDataStatisticsConfigTx(_ any, templateID uint32) (*ShipDataStatisticsConfig, error)

type ShipDataTemplateMetaConfig

type ShipDataTemplateMetaConfig struct {
	ID              uint32   `json:"id"`
	BuffListDisplay []uint32 `json:"buff_list_display"`
}

func GetShipDataTemplateMetaConfig

func GetShipDataTemplateMetaConfig(templateID uint32) (*ShipDataTemplateMetaConfig, error)

type ShipEquipConfig

type ShipEquipConfig struct {
	Equip1 []uint32 `json:"equip_1"`
	Equip2 []uint32 `json:"equip_2"`
	Equip3 []uint32 `json:"equip_3"`
	Equip4 []uint32 `json:"equip_4"`
	Equip5 []uint32 `json:"equip_5"`

	EquipID1 uint32 `json:"equip_id_1"`
	EquipID2 uint32 `json:"equip_id_2"`
	EquipID3 uint32 `json:"equip_id_3"`
}

func GetShipEquipConfig

func GetShipEquipConfig(templateID uint32) (*ShipEquipConfig, error)

func GetShipEquipConfigTx

func GetShipEquipConfigTx(_ any, templateID uint32) (*ShipEquipConfig, error)

func (*ShipEquipConfig) DefaultEquipID

func (c *ShipEquipConfig) DefaultEquipID(pos uint32) uint32

func (*ShipEquipConfig) SlotCount

func (c *ShipEquipConfig) SlotCount() uint32

func (*ShipEquipConfig) SlotTypes

func (c *ShipEquipConfig) SlotTypes(pos uint32) []uint32

type ShipListResult

type ShipListResult struct {
	Ships []Ship
	Total int64
}

func ListShips

func ListShips(_ any, params ShipQueryParams) (ShipListResult, error)

type ShipMetaBreakoutConfig

type ShipMetaBreakoutConfig struct {
	ID         uint32 `json:"id"`
	BreakoutID uint32 `json:"breakout_id"`
	Gold       uint32 `json:"gold"`
	Item1      uint32 `json:"item1"`
	Item1Num   uint32 `json:"item1_num"`
	Item2      uint32 `json:"item2"`
	Item2Num   uint32 `json:"item2_num"`
	Level      uint32 `json:"level"`
	Repair     uint32 `json:"repair"`
}

func GetShipMetaBreakoutConfig

func GetShipMetaBreakoutConfig(templateID uint32) (*ShipMetaBreakoutConfig, error)

type ShipMetaRepairConfig

type ShipMetaRepairConfig struct {
	ID        uint32 `json:"id"`
	ItemID    uint32 `json:"item_id"`
	ItemNum   uint32 `json:"item_num"`
	RepairExp uint32 `json:"repair_exp"`
}

func GetShipMetaRepairConfig

func GetShipMetaRepairConfig(repairID uint32) (*ShipMetaRepairConfig, error)

type ShipMetaSkillTaskConfig

type ShipMetaSkillTaskConfig struct {
	ID               uint32     `json:"id"`
	Level            uint32     `json:"level"`
	NeedExp          uint32     `json:"need_exp"`
	SkillID          uint32     `json:"skill_ID"`
	SkillLevelupTask [][]uint32 `json:"skill_levelup_task"`
	SkillUnlock      [][]uint32 `json:"skill_unlock"`
}

func GetShipMetaSkillTaskConfig

func GetShipMetaSkillTaskConfig(skillID uint32, level uint32) (*ShipMetaSkillTaskConfig, error)

func GetShipMetaSkillTaskConfigByID

func GetShipMetaSkillTaskConfigByID(id uint32) (*ShipMetaSkillTaskConfig, error)

func ListShipMetaSkillTaskConfigsBySkill

func ListShipMetaSkillTaskConfigsBySkill(skillID uint32) ([]ShipMetaSkillTaskConfig, error)

type ShipQueryParams

type ShipQueryParams struct {
	Offset        int
	Limit         int
	RarityID      *uint32
	TypeID        *uint32
	NationalityID *uint32
	Name          string
}

type ShipStrengthenBlueprintConfig

type ShipStrengthenBlueprintConfig struct {
	ID      uint32 `json:"id"`
	LV      uint32 `json:"lv"`
	NeedExp uint32 `json:"need_exp"`
	NeedLV  uint32 `json:"need_lv"`
}

func GetShipStrengthenBlueprintConfig

func GetShipStrengthenBlueprintConfig(id uint32) (*ShipStrengthenBlueprintConfig, error)

type ShipStrengthenConfig

type ShipStrengthenConfig struct {
	ID         uint32   `json:"id"`
	AttrExp    []uint32 `json:"attr_exp"`
	Durability []uint32 `json:"durability"`
	LevelExp   []uint32 `json:"level_exp"`
}

func GetShipStrengthenConfig

func GetShipStrengthenConfig(templateID uint32) (*ShipStrengthenConfig, error)

func GetShipStrengthenConfigTx

func GetShipStrengthenConfigTx(_ any, templateID uint32) (*ShipStrengthenConfig, error)

type ShipStrengthenMetaConfig

type ShipStrengthenMetaConfig struct {
	ID             uint32   `json:"id"`
	ShipID         uint32   `json:"ship_id"`
	Type           uint32   `json:"type"`
	RepairCannon   []uint32 `json:"repair_cannon"`
	RepairTorpedo  []uint32 `json:"repair_torpedo"`
	RepairAir      []uint32 `json:"repair_air"`
	RepairReload   []uint32 `json:"repair_reload"`
	RepairTotalExp uint32   `json:"repair_total_exp"`
}

func GetShipStrengthenMetaConfig

func GetShipStrengthenMetaConfig(metaID uint32) (*ShipStrengthenMetaConfig, error)

type ShipTemplateConfig

type ShipTemplateConfig struct {
	ID           uint32 `json:"id"`
	StrengthenID uint32 `json:"strengthen_id"`
	GroupType    uint32 `json:"group_type"`
	MaxLevel     uint32 `json:"max_level"`
}

func GetShipTemplateConfig

func GetShipTemplateConfig(templateID uint32) (*ShipTemplateConfig, error)

func GetShipTemplateConfigTx

func GetShipTemplateConfigTx(_ any, templateID uint32) (*ShipTemplateConfig, error)

type ShipType

type ShipType struct {
	ID   uint32 `gorm:"primary_key"`
	Name string `gorm:"size:32;not_null"`
}

func GetShipTypeByID

func GetShipTypeByID(id uint32) (*ShipType, error)

func ListShipTypes

func ListShipTypes(offset int, limit int) ([]ShipType, int64, error)

type ShipyardTaskTemplateConfig

type ShipyardTaskTemplateConfig struct {
	ID        uint32 `json:"id"`
	TargetNum uint32 `json:"target_num"`
}

func GetShipyardTaskTemplateConfig

func GetShipyardTaskTemplateConfig(taskID uint32) (*ShipyardTaskTemplateConfig, error)

type ShopOffer

type ShopOffer struct {
	ID             uint32          `gorm:"primary_key" json:"id"`
	Effects        Int64List       `gorm:"type:json;not_null" json:"-"`
	EffectArgs     json.RawMessage `gorm:"type:json" json:"effect_args"`
	Number         int             `gorm:"not_null" json:"num"`
	ResourceNumber int             `gorm:"not_null" json:"resource_num"`
	ResourceID     uint32          `gorm:"not_null" json:"resource_type"`
	Type           uint32          `gorm:"not_null" json:"type"`
	Genre          string          `gorm:"not_null" json:"genre"`
	Discount       int             `gorm:"not_null" json:"discount"`

	Resource Resource `gorm:"foreignkey:ResourceID;references:ID"`
}

func GetShopOffer

func GetShopOffer(offerID uint32) (*ShopOffer, error)

func ListShopOffersByGenre

func ListShopOffersByGenre(genre string) ([]ShopOffer, error)

func ListShopOffersByIDs

func ListShopOffersByIDs(ids []uint32) ([]ShopOffer, error)

func ListShopOffersByIDsAndGenre

func ListShopOffersByIDsAndGenre(ids []uint32, genre string) ([]ShopOffer, error)

type ShopOfferListResult

type ShopOfferListResult struct {
	Offers []ShopOffer
	Total  int64
}

func ListShopOffers

func ListShopOffers(params ShopOfferQueryParams) (ShopOfferListResult, error)

type ShopOfferQueryParams

type ShopOfferQueryParams struct {
	Offset int
	Limit  int
	Genre  string
}

type ShoppingStreetGood

type ShoppingStreetGood struct {
	CommanderID uint32 `gorm:"primary_key"`
	GoodsID     uint32 `gorm:"primary_key"`
	Discount    uint32 `gorm:"not_null"`
	BuyCount    uint32 `gorm:"not_null"`
}

func GetShoppingStreetGood

func GetShoppingStreetGood(commanderID uint32, goodsID uint32) (*ShoppingStreetGood, error)

func LoadShoppingStreetGoods

func LoadShoppingStreetGoods(commanderID uint32) ([]ShoppingStreetGood, error)

type ShoppingStreetState

type ShoppingStreetState struct {
	CommanderID   uint32 `gorm:"primary_key"`
	Level         uint32 `gorm:"not_null"`
	NextFlashTime uint32 `gorm:"not_null"`
	LevelUpTime   uint32 `gorm:"not_null"`
	FlashCount    uint32 `gorm:"not_null"`
}

func GetShoppingStreetState

func GetShoppingStreetState(commanderID uint32) (*ShoppingStreetState, error)

type Skill

type Skill struct {
	ID         uint32          `gorm:"primary_key" json:"id"`
	Name       string          `gorm:"size:128;not_null" json:"name"`
	Desc       string          `gorm:"type:text" json:"desc"`
	CD         uint32          `gorm:"not_null" json:"cd"`
	Painting   json.RawMessage `gorm:"type:json" json:"painting"`
	Picture    string          `gorm:"size:64" json:"picture"`
	AniEffect  json.RawMessage `gorm:"type:json" json:"aniEffect"`
	UIEffect   string          `gorm:"type:text" json:"uiEffect"`
	EffectList json.RawMessage `gorm:"type:json" json:"effect_list"`
}

func GetSkillByID

func GetSkillByID(id uint32) (*Skill, error)

func ListSkillsPage

func ListSkillsPage(offset int, limit int) ([]Skill, int64, error)

type SkillDataTemplateConfig

type SkillDataTemplateConfig struct {
	ID       uint32 `json:"id"`
	MaxLevel uint32 `json:"max_level"`
}

func GetSkillDataTemplateConfig

func GetSkillDataTemplateConfig(skillID uint32) (*SkillDataTemplateConfig, error)

type Skin

type Skin struct {
	ID             uint32          `gorm:"primary_key" json:"id"`
	Name           string          `gorm:"size:128;not_null" json:"name"`
	ShipGroup      int             `gorm:"not_null" json:"ship_group"`
	Desc           string          `gorm:"type:text" json:"desc"`
	BG             string          `gorm:"size:128" json:"bg"`
	BGSp           string          `gorm:"size:128" json:"bg_sp"`
	BGM            string          `gorm:"size:128" json:"bgm"`
	Painting       string          `gorm:"size:64" json:"painting"`
	Prefab         string          `gorm:"size:64" json:"prefab"`
	ChangeSkin     json.RawMessage `gorm:"type:json" json:"change_skin"`
	ShowSkin       string          `gorm:"size:64" json:"show_skin"`
	SkeletonSkin   string          `gorm:"size:64" json:"skeleton_default_skin"`
	ShipL2DID      json.RawMessage `gorm:"type:json" json:"ship_l2d_id"`
	L2DAnimations  json.RawMessage `gorm:"type:json" json:"l2d_animations"`
	L2DDragRate    json.RawMessage `gorm:"type:json" json:"l2d_drag_rate"`
	L2DParaRange   json.RawMessage `gorm:"type:json" json:"l2d_para_range"`
	L2DSE          json.RawMessage `gorm:"type:json" json:"l2d_se"`
	L2DVoiceCalib  json.RawMessage `gorm:"type:json" json:"l2d_voice_calibrate"`
	PartScale      string          `gorm:"size:64" json:"part_scale"`
	MainUIFX       string          `gorm:"size:128" json:"main_UI_FX"`
	SpineOffset    json.RawMessage `gorm:"type:json" json:"spine_offset"`
	SpineProfile   json.RawMessage `gorm:"type:json" json:"spine_offset_profile"`
	Tag            json.RawMessage `gorm:"type:json" json:"tag"`
	Time           json.RawMessage `gorm:"type:json" json:"time"`
	GetShowing     json.RawMessage `gorm:"type:json" json:"get_showing"`
	PurchaseOffset json.RawMessage `gorm:"type:json" json:"purchase_offset"`
	ShopOffset     json.RawMessage `gorm:"type:json" json:"shop_offset"`
	RarityBG       string          `gorm:"size:128" json:"rarity_bg"`
	SpecialEffects json.RawMessage `gorm:"type:json" json:"special_effects"`
	GroupIndex     *int            `gorm:"type:int" json:"group_index"`
	Gyro           *int            `gorm:"type:int" json:"gyro"`
	HandID         *int            `gorm:"type:int" json:"hand_id"`
	Illustrator    *int            `gorm:"type:int" json:"illustrator"`
	Illustrator2   *int            `gorm:"type:int" json:"illustrator2"`
	VoiceActor     *int            `gorm:"type:int" json:"voice_actor"`
	VoiceActor2    *int            `gorm:"type:int" json:"voice_actor_2"`
	DoubleChar     *int            `gorm:"type:int" json:"double_char"`
	LipSmoothing   *int            `gorm:"type:int" json:"lip_smoothing"`
	LipSyncGain    *int            `gorm:"type:int" json:"lip_sync_gain"`
	L2DIgnoreDrag  *int            `gorm:"type:int" json:"l2d_ignore_drag"`
	SkinType       *int            `gorm:"type:int" json:"skin_type"`
	ShopID         *int            `gorm:"type:int" json:"shop_id"`
	ShopTypeID     *int            `gorm:"type:int" json:"shop_type_id"`
	ShopDynamicHX  *int            `gorm:"type:int" json:"shop_dynamic_hx"`
	SpineAction    json.RawMessage `gorm:"type:json" json:"spine_action_offset"`
	SpineUseLive2D *int            `gorm:"type:int" json:"spine_use_live2d"`
	Live2DOffset   json.RawMessage `gorm:"type:json" json:"live2d_offset"`
	Live2DProfile  json.RawMessage `gorm:"type:json" json:"live2d_offset_profile"`
	FXContainer    json.RawMessage `gorm:"type:json" json:"fx_container"`
	BoundBone      json.RawMessage `gorm:"type:json" json:"bound_bone"`
	Smoke          json.RawMessage `gorm:"type:json" json:"smoke"`
}

func GetSkinByID

func GetSkinByID(id uint32) (*Skin, error)

func ListSkinsByShipGroupPage

func ListSkinsByShipGroupPage(shipGroup uint32, offset int, limit int) ([]Skin, int64, error)

func ListSkinsPage

func ListSkinsPage(offset int, limit int) ([]Skin, int64, error)

type SkinListResult

type SkinListResult struct {
	Skins []Skin
	Total int64
}

func ListSkins

func ListSkins(_ any, params SkinQueryParams) (SkinListResult, error)

func ListSkinsByShipGroup

func ListSkinsByShipGroup(_ any, shipGroup uint32, params SkinQueryParams) (SkinListResult, error)

type SkinQueryParams

type SkinQueryParams struct {
	Offset int
	Limit  int
}

type SpWeaponDataStatisticsConfig

type SpWeaponDataStatisticsConfig struct {
	ID           uint32 `json:"id"`
	UpgradeID    uint32 `json:"upgrade_id"`
	Value1Random uint32 `json:"value_1_random"`
	Value2Random uint32 `json:"value_2_random"`
}

func GetSpWeaponDataStatisticsConfigTx

func GetSpWeaponDataStatisticsConfigTx(templateID uint32) (*SpWeaponDataStatisticsConfig, error)

type SpWeaponResetMaterial

type SpWeaponResetMaterial struct {
	ItemID uint32
	Count  uint32
}

type SpWeaponUpgradeConfig

type SpWeaponUpgradeConfig struct {
	ID           uint32
	ResetUseItem []SpWeaponResetMaterial
}

func GetSpWeaponUpgradeConfigTx

func GetSpWeaponUpgradeConfigTx(upgradeID uint32) (*SpWeaponUpgradeConfig, error)

type StringList

type StringList []string

func (*StringList) Scan

func (list *StringList) Scan(value any) error

func (StringList) Value

func (list StringList) Value() (driver.Value, error)

type SubmarineExpeditionState

type SubmarineExpeditionState struct {
	CommanderID        uint32 `gorm:"primary_key"`
	LastRefreshTime    uint32 `gorm:"not_null"`
	WeeklyRefreshCount uint32 `gorm:"not_null"`
	ActiveChapterID    uint32 `gorm:"not_null"`
	OverallProgress    uint32 `gorm:"not_null"`
}

func GetSubmarineState

func GetSubmarineState(commanderID uint32) (*SubmarineExpeditionState, error)

type SupportRarityWeight

type SupportRarityWeight struct {
	Rarity uint32
	Weight uint32
}

type SupportRequisitionConfig

type SupportRequisitionConfig struct {
	Cost          uint32
	RarityWeights []SupportRarityWeight
	MonthlyCap    uint32
}

func LoadSupportRequisitionConfig

func LoadSupportRequisitionConfig() (SupportRequisitionConfig, error)

type SurveyState

type SurveyState struct {
	CommanderID uint32    `gorm:"primaryKey;autoIncrement:false"`
	SurveyID    uint32    `gorm:"not_null;default:0"`
	CompletedAt time.Time `gorm:"type:timestamp;default:'1970-01-01 00:00:00';not_null"`
	CreatedAt   time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP;not_null"`
	UpdatedAt   time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP;not_null"`
}

func GetSurveyState

func GetSurveyState(commanderID uint32) (*SurveyState, error)

type TechnologyDataTemplate

type TechnologyDataTemplate struct {
	ID               uint32     `json:"id"`
	Type             uint32     `json:"type"`
	Time             uint32     `json:"time"`
	Condition        uint32     `json:"condition"`
	BlueprintVersion uint32     `json:"blueprint_version"`
	Consume          [][]uint32 `json:"consume"`
	DropClient       [][]uint32 `json:"drop_client"`
}

func GetTechnologyTemplate

func GetTechnologyTemplate(techID uint32) (*TechnologyDataTemplate, error)

type TechnologyProjectState

type TechnologyProjectState struct {
	TechID     uint32 `json:"tech_id"`
	FinishTime uint32 `json:"finish_time"`
}

type TechnologyQueueState

type TechnologyQueueState struct {
	TechID     uint32 `json:"tech_id"`
	RefreshID  uint32 `json:"refresh_id"`
	FinishTime uint32 `json:"finish_time"`
}

type TechnologyRefreshPoolState

type TechnologyRefreshPoolState struct {
	ID           uint32                   `json:"id"`
	Target       uint32                   `json:"target"`
	Technologies []TechnologyProjectState `json:"technologies"`
}

func BuildTechnologyRefreshPools

func BuildTechnologyRefreshPools(seed uint32) ([]TechnologyRefreshPoolState, error)

type TechnologyResearchState

type TechnologyResearchState struct {
	CommanderID    uint32
	RefreshFlag    uint32
	RefreshDay     uint32
	CatchupVersion uint32
	CatchupTarget  uint32
	RefreshPools   []TechnologyRefreshPoolState
	Queue          []TechnologyQueueState

	CreatedAt time.Time
	UpdatedAt time.Time
}

func GetOrCreateTechnologyResearchState

func GetOrCreateTechnologyResearchState(commanderID uint32) (*TechnologyResearchState, error)

func GetOrCreateTechnologyResearchStateForUpdateTx

func GetOrCreateTechnologyResearchStateForUpdateTx(ctx context.Context, tx pgx.Tx, commanderID uint32) (*TechnologyResearchState, error)

func GetTechnologyResearchState

func GetTechnologyResearchState(commanderID uint32) (*TechnologyResearchState, error)

func GetTechnologyResearchStateForUpdateTx

func GetTechnologyResearchStateForUpdateTx(ctx context.Context, tx pgx.Tx, commanderID uint32) (*TechnologyResearchState, error)

func (TechnologyResearchState) TableName

func (TechnologyResearchState) TableName() string

type TechnologyShadowUnlockConfig

type TechnologyShadowUnlockConfig struct {
	ID        uint32 `json:"id"`
	Type      uint32 `json:"type"`
	TargetNum uint32 `json:"target_num"`
}

func GetTechnologyShadowUnlockConfig

func GetTechnologyShadowUnlockConfig(id uint32) (*TechnologyShadowUnlockConfig, error)

func GetTechnologyShadowUnlockConfigTx

func GetTechnologyShadowUnlockConfigTx(_ any, id uint32) (*TechnologyShadowUnlockConfig, error)

type TransformDataTemplate

type TransformDataTemplate struct {
	ID          uint32       `json:"id"`
	LevelLimit  uint32       `json:"level_limit"`
	StarLimit   uint32       `json:"star_limit"`
	MaxLevel    uint32       `json:"max_level"`
	UseGold     uint32       `json:"use_gold"`
	UseShip     uint32       `json:"use_ship"`
	UseItem     [][][]uint32 `json:"use_item"`
	ShipID      [][]uint32   `json:"ship_id"`
	EditTrans   []uint32     `json:"edit_trans"`
	SkinID      uint32       `json:"skin_id"`
	SkillID     uint32       `json:"skill_id"`
	ConditionID []uint32     `json:"condition_id"`
}

func GetTransformDataTemplate

func GetTransformDataTemplate(id uint32) (*TransformDataTemplate, error)

func (*TransformDataTemplate) UseItemsForLevel

func (t *TransformDataTemplate) UseItemsForLevel(level uint32) [][]uint32

type UserRegistrationChallenge

type UserRegistrationChallenge struct {
	ID           string     `gorm:"primary_key;size:36"`
	CommanderID  uint32     `gorm:"not_null;index"`
	Pin          string     `gorm:"size:6;not_null;index"`
	PasswordHash string     `gorm:"not_null"`
	PasswordAlgo string     `gorm:"size:32;not_null"`
	Status       string     `gorm:"size:16;not_null;index"`
	ExpiresAt    time.Time  `gorm:"type:timestamp;not_null"`
	ConsumedAt   *time.Time `gorm:"type:timestamp"`
	CreatedAt    time.Time  `gorm:"autoCreateTime"`
}

func CreateUserRegistrationChallenge

func CreateUserRegistrationChallenge(commanderID uint32, pin string, passwordHash string, passwordAlgo string, expiresAt time.Time, now time.Time) (*UserRegistrationChallenge, error)

func GetUserRegistrationChallenge

func GetUserRegistrationChallenge(id string) (*UserRegistrationChallenge, error)

type Weapon

type Weapon struct {
	ID                   uint32          `gorm:"primary_key" json:"id"`
	ActionIndex          string          `gorm:"size:32;not_null" json:"action_index"`
	AimType              int             `gorm:"not_null" json:"aim_type"`
	Angle                int             `gorm:"not_null" json:"angle"`
	AttackAttribute      int             `gorm:"not_null" json:"attack_attribute"`
	AttackAttributeRatio int             `gorm:"not_null" json:"attack_attribute_ratio"`
	AutoAftercast        json.RawMessage `gorm:"type:json" json:"auto_aftercast"`
	AxisAngle            int             `gorm:"not_null" json:"axis_angle"`
	BarrageID            json.RawMessage `gorm:"type:json" json:"barrage_ID"`
	BulletID             json.RawMessage `gorm:"type:json" json:"bullet_ID"`
	ChargeParam          json.RawMessage `gorm:"type:json" json:"charge_param"`
	Corrected            int             `gorm:"not_null" json:"corrected"`
	Damage               int             `gorm:"not_null" json:"damage"`
	EffectMove           int             `gorm:"not_null" json:"effect_move"`
	Expose               int             `gorm:"not_null" json:"expose"`
	FireFX               string          `gorm:"size:64" json:"fire_fx"`
	FireFXLoopType       int             `gorm:"not_null" json:"fire_fx_loop_type"`
	FireSFX              string          `gorm:"size:64" json:"fire_sfx"`
	InitialOverHeat      int             `gorm:"not_null" json:"initial_over_heat"`
	MinRange             int             `gorm:"not_null" json:"min_range"`
	OxyType              json.RawMessage `gorm:"type:json" json:"oxy_type"`
	PrecastParam         json.RawMessage `gorm:"type:json" json:"precast_param"`
	Queue                int             `gorm:"not_null" json:"queue"`
	Range                int             `gorm:"not_null" json:"range"`
	RecoverTime          json.RawMessage `gorm:"type:json" json:"recover_time"`
	ReloadMax            int             `gorm:"not_null" json:"reload_max"`
	SearchCondition      json.RawMessage `gorm:"type:json" json:"search_condition"`
	SearchType           int             `gorm:"not_null" json:"search_type"`
	ShakeScreen          int             `gorm:"not_null" json:"shakescreen"`
	SpawnBound           json.RawMessage `gorm:"type:json" json:"spawn_bound"`
	Suppress             int             `gorm:"not_null" json:"suppress"`
	TorpedoAmmo          int             `gorm:"not_null" json:"torpedo_ammo"`
	Type                 int             `gorm:"not_null" json:"type"`
}

func GetWeaponByID

func GetWeaponByID(id uint32) (*Weapon, error)

func ListWeaponsPage

func ListWeaponsPage(offset int, limit int) ([]Weapon, int64, error)

type WebAuthnCredential

type WebAuthnCredential struct {
	ID             string     `gorm:"primary_key;size:36"`
	UserID         string     `gorm:"size:36;not_null;index"`
	CredentialID   string     `gorm:"not_null;uniqueIndex"`
	PublicKey      []byte     `gorm:"not_null"`
	SignCount      uint32     `gorm:"not_null"`
	Transports     StringList `gorm:"type:json"`
	AAGUID         string     `gorm:"size:64"`
	AttestationFmt string     `gorm:"size:64"`
	ResidentKey    bool       `gorm:"default:false;not_null"`
	BackupEligible *bool      `gorm:""`
	BackupState    *bool      `gorm:""`
	CreatedAt      time.Time  `gorm:"autoCreateTime"`
	LastUsedAt     *time.Time `gorm:"type:timestamp"`
	Label          *string    `gorm:"size:128"`
	RPID           string     `gorm:"size:255;not_null"`
}

func ListWebAuthnCredentialsByUserID

func ListWebAuthnCredentialsByUserID(userID string) ([]WebAuthnCredential, error)

type WeeklyTaskEntry

type WeeklyTaskEntry struct {
	ID       uint32 `json:"id"`
	Progress uint32 `json:"progress"`
}

type WeeklyTaskProgress

type WeeklyTaskProgress struct {
	CommanderID   uint32
	WeekStartUnix uint32
	Pt            uint32
	RewardLv      uint32
	Tasks         []WeeklyTaskEntry
}

func LoadWeeklyTaskProgress

func LoadWeeklyTaskProgress(commanderID uint32, now time.Time) (*WeeklyTaskProgress, error)

func LoadWeeklyTaskProgressForUpdateTx

func LoadWeeklyTaskProgressForUpdateTx(ctx context.Context, tx pgx.Tx, commanderID uint32, now time.Time) (*WeeklyTaskProgress, error)

func (WeeklyTaskProgress) TableName

func (WeeklyTaskProgress) TableName() string

type WorldBossBossState

type WorldBossBossState struct {
	ID         uint32 `json:"id"`
	TemplateID uint32 `json:"template_id"`
	Lv         uint32 `json:"lv"`
	Hp         uint32 `json:"hp"`
	Owner      uint32 `json:"owner"`
	LastTime   uint32 `json:"last_time"`
	KillTime   uint32 `json:"kill_time"`
	FightCount uint32 `json:"fight_count"`
	RankCount  uint32 `json:"rank_count"`
}

type WorldBossRankEntry

type WorldBossRankEntry struct {
	CommanderID uint32 `json:"commander_id"`
	Name        string `json:"name"`
	Damage      uint32 `json:"damage"`
}

type WorldBossState

type WorldBossState struct {
	CommanderID          uint32                          `json:"commander_id"`
	FightCount           uint32                          `json:"fight_count"`
	FightCountUpdateTime uint32                          `json:"fight_count_update_time"`
	SelfBoss             *WorldBossBossState             `json:"self_boss,omitempty"`
	SummonPt             uint32                          `json:"summon_pt"`
	SummonPtOld          uint32                          `json:"summon_pt_old"`
	SummonPtDailyAcc     uint32                          `json:"summon_pt_daily_acc"`
	SummonPtOldDailyAcc  uint32                          `json:"summon_pt_old_daily_acc"`
	SummonFree           uint32                          `json:"summon_free"`
	AutoFightFinishTime  uint32                          `json:"auto_fight_finish_time"`
	DefaultBossID        uint32                          `json:"default_boss_id"`
	AutoFightMaxDamage   uint32                          `json:"auto_fight_max_damage"`
	GuildSupport         uint32                          `json:"guild_support"`
	FriendSupport        uint32                          `json:"friend_support"`
	WorldSupport         uint32                          `json:"world_support"`
	SelfBossLv           uint32                          `json:"self_boss_lv"`
	NextBossID           uint32                          `json:"next_boss_id"`
	Rankings             map[string][]WorldBossRankEntry `json:"rankings"`
	RewardClaimed        map[string]bool                 `json:"reward_claimed"`
	AutoBattleStartTime  uint32                          `json:"auto_battle_start_time"`
	AutoBattleBossID     uint32                          `json:"auto_battle_boss_id"`
}

func GetCommanderWorldBossState

func GetCommanderWorldBossState(commanderID uint32) (*WorldBossState, error)

func GetOrCreateCommanderWorldBossState

func GetOrCreateCommanderWorldBossState(commanderID uint32) (*WorldBossState, error)

func ListWorldBossStates

func ListWorldBossStates() ([]*WorldBossState, error)

func (*WorldBossState) GetRankings

func (state *WorldBossState) GetRankings(bossID uint32) []WorldBossRankEntry

func (*WorldBossState) IsRewardClaimed

func (state *WorldBossState) IsRewardClaimed(bossID uint32) bool

func (*WorldBossState) SetRankings

func (state *WorldBossState) SetRankings(bossID uint32, values []WorldBossRankEntry)

func (*WorldBossState) SetRewardClaimed

func (state *WorldBossState) SetRewardClaimed(bossID uint32, claimed bool)

type WorldRuntime

type WorldRuntime struct {
	CommanderID               uint32            `json:"commander_id"`
	Camp                      uint32            `json:"camp"`
	MapID                     uint32            `json:"map_id"`
	EnterMapID                uint32            `json:"enter_map_id"`
	ActionPower               uint32            `json:"action_power"`
	ActionPowerExtra          uint32            `json:"action_power_extra"`
	ActionPowerFetchCount     uint32            `json:"action_power_fetch_count"`
	LastRecoverTimestamp      uint32            `json:"last_recover_timestamp"`
	LastChangeGroupTimestamp  uint32            `json:"last_change_group_timestamp"`
	Progress                  uint32            `json:"progress"`
	TaskFinishCount           uint32            `json:"task_finish_count"`
	StaminaExchangeTimes      uint32            `json:"stamina_exchange_times"`
	Round                     uint32            `json:"round"`
	WeekStartUnix             uint32            `json:"week_start_unix,omitempty"`
	MonthKey                  uint32            `json:"month_key,omitempty"`
	SairenChapter             []uint32          `json:"sairen_chapter,omitempty"`
	MapTemplateByRandomID     map[string]uint32 `json:"map_template_by_random_id,omitempty"`
	FleetShipIDs              []uint32          `json:"fleet_ship_ids,omitempty"`
	CommanderIDs              []uint32          `json:"commander_ids,omitempty"`
	ResetAvailableAtTimestamp uint32            `json:"reset_available_at_timestamp"`
}

func LoadOrCreateWorldRuntime

func LoadOrCreateWorldRuntime(commanderID uint32) (*WorldRuntime, error)

func LoadWorldRuntime

func LoadWorldRuntime(commanderID uint32) (*WorldRuntime, error)

func (*WorldRuntime) MapTemplate

func (runtime *WorldRuntime) MapTemplate(randomID uint32) uint32

func (*WorldRuntime) SetMapTemplate

func (runtime *WorldRuntime) SetMapTemplate(randomID uint32, templateID uint32)

type YostarusMap

type YostarusMap struct {
	Arg2      uint32 `gorm:"primary_key"`
	AccountID uint32 `gorm:"not_null;uniqueIndex;auto_increment"`
}

Implementation of dumb auth When logging-in, the client sends a packet with the field arg2, which seems to be unique and tied to an account id.

func GetYostarusMapByArg2

func GetYostarusMapByArg2(arg2 uint32) (*YostarusMap, error)

Source Files

Jump to

Keyboard shortcuts

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