mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-21 23:22:34 +01:00
style: run gofmt across entire codebase
330 non-vendor files had minor formatting inconsistencies (comment alignment, whitespace). No logic changes.
This commit is contained in:
@@ -174,34 +174,51 @@ func (m *mockCharacterRepo) LoadColumn(_ uint32, column string) ([]byte, error)
|
||||
}
|
||||
return m.columns[column], nil
|
||||
}
|
||||
func (m *mockCharacterRepo) SaveColumn(_ uint32, column string, data []byte) error { m.columns[column] = data; return m.saveErr }
|
||||
func (m *mockCharacterRepo) GetName(_ uint32) (string, error) { return "TestChar", nil }
|
||||
func (m *mockCharacterRepo) GetUserID(_ uint32) (uint32, error) { return 1, nil }
|
||||
func (m *mockCharacterRepo) UpdateLastLogin(_ uint32, _ int64) error { return nil }
|
||||
func (m *mockCharacterRepo) UpdateTimePlayed(_ uint32, _ int) error { return nil }
|
||||
func (m *mockCharacterRepo) GetCharIDsByUserID(_ uint32) ([]uint32, error) { return nil, nil }
|
||||
func (m *mockCharacterRepo) SaveBool(_ uint32, col string, v bool) error { m.bools[col] = v; return nil }
|
||||
func (m *mockCharacterRepo) SaveString(_ uint32, col string, v string) error { m.strings[col] = v; return nil }
|
||||
func (m *mockCharacterRepo) ReadBool(_ uint32, col string) (bool, error) { return m.bools[col], nil }
|
||||
func (m *mockCharacterRepo) ReadString(_ uint32, col string) (string, error) { return m.strings[col], nil }
|
||||
func (m *mockCharacterRepo) SaveColumn(_ uint32, column string, data []byte) error {
|
||||
m.columns[column] = data
|
||||
return m.saveErr
|
||||
}
|
||||
func (m *mockCharacterRepo) GetName(_ uint32) (string, error) { return "TestChar", nil }
|
||||
func (m *mockCharacterRepo) GetUserID(_ uint32) (uint32, error) { return 1, nil }
|
||||
func (m *mockCharacterRepo) UpdateLastLogin(_ uint32, _ int64) error { return nil }
|
||||
func (m *mockCharacterRepo) UpdateTimePlayed(_ uint32, _ int) error { return nil }
|
||||
func (m *mockCharacterRepo) GetCharIDsByUserID(_ uint32) ([]uint32, error) { return nil, nil }
|
||||
func (m *mockCharacterRepo) SaveBool(_ uint32, col string, v bool) error {
|
||||
m.bools[col] = v
|
||||
return nil
|
||||
}
|
||||
func (m *mockCharacterRepo) SaveString(_ uint32, col string, v string) error {
|
||||
m.strings[col] = v
|
||||
return nil
|
||||
}
|
||||
func (m *mockCharacterRepo) ReadBool(_ uint32, col string) (bool, error) { return m.bools[col], nil }
|
||||
func (m *mockCharacterRepo) ReadString(_ uint32, col string) (string, error) {
|
||||
return m.strings[col], nil
|
||||
}
|
||||
func (m *mockCharacterRepo) LoadColumnWithDefault(_ uint32, col string, def []byte) ([]byte, error) {
|
||||
if d, ok := m.columns[col]; ok {
|
||||
return d, nil
|
||||
}
|
||||
return def, nil
|
||||
}
|
||||
func (m *mockCharacterRepo) SetDeleted(_ uint32) error { return nil }
|
||||
func (m *mockCharacterRepo) UpdateDailyCafe(_ uint32, _ time.Time, _, _ uint32) error { return nil }
|
||||
func (m *mockCharacterRepo) ResetDailyQuests(_ uint32) error { return nil }
|
||||
func (m *mockCharacterRepo) ReadEtcPoints(_ uint32) (uint32, uint32, uint32, error) { return 0, 0, 0, nil }
|
||||
func (m *mockCharacterRepo) ResetCafeTime(_ uint32, _ time.Time) error { return nil }
|
||||
func (m *mockCharacterRepo) UpdateGuildPostChecked(_ uint32) error { return nil }
|
||||
func (m *mockCharacterRepo) ReadGuildPostChecked(_ uint32) (time.Time, error) { return time.Time{}, nil }
|
||||
func (m *mockCharacterRepo) SaveMercenary(_ uint32, _ []byte, _ uint32) error { return nil }
|
||||
func (m *mockCharacterRepo) UpdateGCPAndPact(_ uint32, _ uint32, _ uint32) error { return nil }
|
||||
func (m *mockCharacterRepo) FindByRastaID(_ int) (uint32, string, error) { return 0, "", nil }
|
||||
func (m *mockCharacterRepo) SaveCharacterData(_ uint32, _ []byte, _, _ uint16, _ bool, _ uint8, _ uint16) error { return nil }
|
||||
func (m *mockCharacterRepo) SaveHouseData(_ uint32, _ []byte, _, _, _, _, _ []byte) error { return nil }
|
||||
func (m *mockCharacterRepo) SetDeleted(_ uint32) error { return nil }
|
||||
func (m *mockCharacterRepo) UpdateDailyCafe(_ uint32, _ time.Time, _, _ uint32) error { return nil }
|
||||
func (m *mockCharacterRepo) ResetDailyQuests(_ uint32) error { return nil }
|
||||
func (m *mockCharacterRepo) ReadEtcPoints(_ uint32) (uint32, uint32, uint32, error) {
|
||||
return 0, 0, 0, nil
|
||||
}
|
||||
func (m *mockCharacterRepo) ResetCafeTime(_ uint32, _ time.Time) error { return nil }
|
||||
func (m *mockCharacterRepo) UpdateGuildPostChecked(_ uint32) error { return nil }
|
||||
func (m *mockCharacterRepo) ReadGuildPostChecked(_ uint32) (time.Time, error) {
|
||||
return time.Time{}, nil
|
||||
}
|
||||
func (m *mockCharacterRepo) SaveMercenary(_ uint32, _ []byte, _ uint32) error { return nil }
|
||||
func (m *mockCharacterRepo) UpdateGCPAndPact(_ uint32, _ uint32, _ uint32) error { return nil }
|
||||
func (m *mockCharacterRepo) FindByRastaID(_ int) (uint32, string, error) { return 0, "", nil }
|
||||
func (m *mockCharacterRepo) SaveCharacterData(_ uint32, _ []byte, _, _ uint16, _ bool, _ uint8, _ uint16) error {
|
||||
return nil
|
||||
}
|
||||
func (m *mockCharacterRepo) SaveHouseData(_ uint32, _ []byte, _, _, _, _, _ []byte) error { return nil }
|
||||
func (m *mockCharacterRepo) LoadSaveData(_ uint32) (uint32, []byte, bool, string, error) {
|
||||
return m.loadSaveDataID, m.loadSaveDataData, m.loadSaveDataNew, m.loadSaveDataName, m.loadSaveDataErr
|
||||
}
|
||||
@@ -209,10 +226,10 @@ func (m *mockCharacterRepo) LoadSaveData(_ uint32) (uint32, []byte, bool, string
|
||||
// --- mockGoocooRepo ---
|
||||
|
||||
type mockGoocooRepo struct {
|
||||
slots map[uint32][]byte
|
||||
ensureCalled bool
|
||||
clearCalled []uint32
|
||||
savedSlots map[uint32][]byte
|
||||
slots map[uint32][]byte
|
||||
ensureCalled bool
|
||||
clearCalled []uint32
|
||||
savedSlots map[uint32][]byte
|
||||
}
|
||||
|
||||
func newMockGoocooRepo() *mockGoocooRepo {
|
||||
@@ -265,77 +282,87 @@ func (m *mockGuildRepoForMail) GetMembers(_ uint32, _ bool) ([]*GuildMember, err
|
||||
}
|
||||
|
||||
// Stub out all other GuildRepo methods.
|
||||
func (m *mockGuildRepoForMail) GetByID(_ uint32) (*Guild, error) { return nil, errNotFound }
|
||||
func (m *mockGuildRepoForMail) ListAll() ([]*Guild, error) { return nil, nil }
|
||||
func (m *mockGuildRepoForMail) GetByID(_ uint32) (*Guild, error) { return nil, errNotFound }
|
||||
func (m *mockGuildRepoForMail) ListAll() ([]*Guild, error) { return nil, nil }
|
||||
func (m *mockGuildRepoForMail) Create(_ uint32, _ string) (int32, error) { return 0, nil }
|
||||
func (m *mockGuildRepoForMail) Save(_ *Guild) error { return nil }
|
||||
func (m *mockGuildRepoForMail) Disband(_ uint32) error { return nil }
|
||||
func (m *mockGuildRepoForMail) RemoveCharacter(_ uint32) error { return nil }
|
||||
func (m *mockGuildRepoForMail) AcceptApplication(_, _ uint32) error { return nil }
|
||||
func (m *mockGuildRepoForMail) Save(_ *Guild) error { return nil }
|
||||
func (m *mockGuildRepoForMail) Disband(_ uint32) error { return nil }
|
||||
func (m *mockGuildRepoForMail) RemoveCharacter(_ uint32) error { return nil }
|
||||
func (m *mockGuildRepoForMail) AcceptApplication(_, _ uint32) error { return nil }
|
||||
func (m *mockGuildRepoForMail) CreateApplication(_, _, _ uint32, _ GuildApplicationType) error {
|
||||
return nil
|
||||
}
|
||||
func (m *mockGuildRepoForMail) CreateApplicationWithMail(_, _, _ uint32, _ GuildApplicationType, _, _ uint32, _, _ string) error {
|
||||
return nil
|
||||
}
|
||||
func (m *mockGuildRepoForMail) CancelInvitation(_, _ uint32) error { return nil }
|
||||
func (m *mockGuildRepoForMail) RejectApplication(_, _ uint32) error { return nil }
|
||||
func (m *mockGuildRepoForMail) ArrangeCharacters(_ []uint32) error { return nil }
|
||||
func (m *mockGuildRepoForMail) CancelInvitation(_, _ uint32) error { return nil }
|
||||
func (m *mockGuildRepoForMail) RejectApplication(_, _ uint32) error { return nil }
|
||||
func (m *mockGuildRepoForMail) ArrangeCharacters(_ []uint32) error { return nil }
|
||||
func (m *mockGuildRepoForMail) GetApplication(_, _ uint32, _ GuildApplicationType) (*GuildApplication, error) {
|
||||
return nil, nil
|
||||
}
|
||||
func (m *mockGuildRepoForMail) HasApplication(_, _ uint32) (bool, error) { return false, nil }
|
||||
func (m *mockGuildRepoForMail) GetItemBox(_ uint32) ([]byte, error) { return nil, nil }
|
||||
func (m *mockGuildRepoForMail) SaveItemBox(_ uint32, _ []byte) error { return nil }
|
||||
func (m *mockGuildRepoForMail) GetCharacterMembership(_ uint32) (*GuildMember, error) { return nil, nil }
|
||||
func (m *mockGuildRepoForMail) SaveMember(_ *GuildMember) error { return nil }
|
||||
func (m *mockGuildRepoForMail) SetRecruiting(_ uint32, _ bool) error { return nil }
|
||||
func (m *mockGuildRepoForMail) SetPugiOutfits(_ uint32, _ uint32) error { return nil }
|
||||
func (m *mockGuildRepoForMail) SetRecruiter(_ uint32, _ bool) error { return nil }
|
||||
func (m *mockGuildRepoForMail) AddMemberDailyRP(_ uint32, _ uint16) error { return nil }
|
||||
func (m *mockGuildRepoForMail) HasApplication(_, _ uint32) (bool, error) { return false, nil }
|
||||
func (m *mockGuildRepoForMail) GetItemBox(_ uint32) ([]byte, error) { return nil, nil }
|
||||
func (m *mockGuildRepoForMail) SaveItemBox(_ uint32, _ []byte) error { return nil }
|
||||
func (m *mockGuildRepoForMail) GetCharacterMembership(_ uint32) (*GuildMember, error) {
|
||||
return nil, nil
|
||||
}
|
||||
func (m *mockGuildRepoForMail) SaveMember(_ *GuildMember) error { return nil }
|
||||
func (m *mockGuildRepoForMail) SetRecruiting(_ uint32, _ bool) error { return nil }
|
||||
func (m *mockGuildRepoForMail) SetPugiOutfits(_ uint32, _ uint32) error { return nil }
|
||||
func (m *mockGuildRepoForMail) SetRecruiter(_ uint32, _ bool) error { return nil }
|
||||
func (m *mockGuildRepoForMail) AddMemberDailyRP(_ uint32, _ uint16) error { return nil }
|
||||
func (m *mockGuildRepoForMail) ExchangeEventRP(_ uint32, _ uint16) (uint32, error) { return 0, nil }
|
||||
func (m *mockGuildRepoForMail) AddRankRP(_ uint32, _ uint16) error { return nil }
|
||||
func (m *mockGuildRepoForMail) AddEventRP(_ uint32, _ uint16) error { return nil }
|
||||
func (m *mockGuildRepoForMail) GetRoomRP(_ uint32) (uint16, error) { return 0, nil }
|
||||
func (m *mockGuildRepoForMail) SetRoomRP(_ uint32, _ uint16) error { return nil }
|
||||
func (m *mockGuildRepoForMail) AddRoomRP(_ uint32, _ uint16) error { return nil }
|
||||
func (m *mockGuildRepoForMail) SetRoomExpiry(_ uint32, _ time.Time) error { return nil }
|
||||
func (m *mockGuildRepoForMail) ListPosts(_ uint32, _ int) ([]*MessageBoardPost, error) { return nil, nil }
|
||||
func (m *mockGuildRepoForMail) CreatePost(_, _, _ uint32, _ int, _, _ string, _ int) error { return nil }
|
||||
func (m *mockGuildRepoForMail) DeletePost(_ uint32) error { return nil }
|
||||
func (m *mockGuildRepoForMail) UpdatePost(_ uint32, _, _ string) error { return nil }
|
||||
func (m *mockGuildRepoForMail) UpdatePostStamp(_, _ uint32) error { return nil }
|
||||
func (m *mockGuildRepoForMail) GetPostLikedBy(_ uint32) (string, error) { return "", nil }
|
||||
func (m *mockGuildRepoForMail) SetPostLikedBy(_ uint32, _ string) error { return nil }
|
||||
func (m *mockGuildRepoForMail) CountNewPosts(_ uint32, _ time.Time) (int, error) { return 0, nil }
|
||||
func (m *mockGuildRepoForMail) GetAllianceByID(_ uint32) (*GuildAlliance, error) { return nil, nil }
|
||||
func (m *mockGuildRepoForMail) ListAlliances() ([]*GuildAlliance, error) { return nil, nil }
|
||||
func (m *mockGuildRepoForMail) CreateAlliance(_ string, _ uint32) error { return nil }
|
||||
func (m *mockGuildRepoForMail) DeleteAlliance(_ uint32) error { return nil }
|
||||
func (m *mockGuildRepoForMail) RemoveGuildFromAlliance(_, _, _, _ uint32) error { return nil }
|
||||
func (m *mockGuildRepoForMail) AddRankRP(_ uint32, _ uint16) error { return nil }
|
||||
func (m *mockGuildRepoForMail) AddEventRP(_ uint32, _ uint16) error { return nil }
|
||||
func (m *mockGuildRepoForMail) GetRoomRP(_ uint32) (uint16, error) { return 0, nil }
|
||||
func (m *mockGuildRepoForMail) SetRoomRP(_ uint32, _ uint16) error { return nil }
|
||||
func (m *mockGuildRepoForMail) AddRoomRP(_ uint32, _ uint16) error { return nil }
|
||||
func (m *mockGuildRepoForMail) SetRoomExpiry(_ uint32, _ time.Time) error { return nil }
|
||||
func (m *mockGuildRepoForMail) ListPosts(_ uint32, _ int) ([]*MessageBoardPost, error) {
|
||||
return nil, nil
|
||||
}
|
||||
func (m *mockGuildRepoForMail) CreatePost(_, _, _ uint32, _ int, _, _ string, _ int) error {
|
||||
return nil
|
||||
}
|
||||
func (m *mockGuildRepoForMail) DeletePost(_ uint32) error { return nil }
|
||||
func (m *mockGuildRepoForMail) UpdatePost(_ uint32, _, _ string) error { return nil }
|
||||
func (m *mockGuildRepoForMail) UpdatePostStamp(_, _ uint32) error { return nil }
|
||||
func (m *mockGuildRepoForMail) GetPostLikedBy(_ uint32) (string, error) { return "", nil }
|
||||
func (m *mockGuildRepoForMail) SetPostLikedBy(_ uint32, _ string) error { return nil }
|
||||
func (m *mockGuildRepoForMail) CountNewPosts(_ uint32, _ time.Time) (int, error) { return 0, nil }
|
||||
func (m *mockGuildRepoForMail) GetAllianceByID(_ uint32) (*GuildAlliance, error) { return nil, nil }
|
||||
func (m *mockGuildRepoForMail) ListAlliances() ([]*GuildAlliance, error) { return nil, nil }
|
||||
func (m *mockGuildRepoForMail) CreateAlliance(_ string, _ uint32) error { return nil }
|
||||
func (m *mockGuildRepoForMail) DeleteAlliance(_ uint32) error { return nil }
|
||||
func (m *mockGuildRepoForMail) RemoveGuildFromAlliance(_, _, _, _ uint32) error { return nil }
|
||||
func (m *mockGuildRepoForMail) ListAdventures(_ uint32) ([]*GuildAdventure, error) { return nil, nil }
|
||||
func (m *mockGuildRepoForMail) CreateAdventure(_, _ uint32, _, _ int64) error { return nil }
|
||||
func (m *mockGuildRepoForMail) CreateAdventureWithCharge(_, _, _ uint32, _, _ int64) error { return nil }
|
||||
func (m *mockGuildRepoForMail) CollectAdventure(_ uint32, _ uint32) error { return nil }
|
||||
func (m *mockGuildRepoForMail) ChargeAdventure(_ uint32, _ uint32) error { return nil }
|
||||
func (m *mockGuildRepoForMail) GetPendingHunt(_ uint32) (*TreasureHunt, error) { return nil, nil }
|
||||
func (m *mockGuildRepoForMail) ListGuildHunts(_, _ uint32) ([]*TreasureHunt, error) { return nil, nil }
|
||||
func (m *mockGuildRepoForMail) CreateHunt(_, _, _, _ uint32, _ []byte, _ string) error { return nil }
|
||||
func (m *mockGuildRepoForMail) AcquireHunt(_ uint32) error { return nil }
|
||||
func (m *mockGuildRepoForMail) RegisterHuntReport(_, _ uint32) error { return nil }
|
||||
func (m *mockGuildRepoForMail) CollectHunt(_ uint32) error { return nil }
|
||||
func (m *mockGuildRepoForMail) ClaimHuntReward(_, _ uint32) error { return nil }
|
||||
func (m *mockGuildRepoForMail) ListMeals(_ uint32) ([]*GuildMeal, error) { return nil, nil }
|
||||
func (m *mockGuildRepoForMail) CreateMeal(_, _, _ uint32, _ time.Time) (uint32, error) { return 0, nil }
|
||||
func (m *mockGuildRepoForMail) UpdateMeal(_, _, _ uint32, _ time.Time) error { return nil }
|
||||
func (m *mockGuildRepoForMail) ClaimHuntBox(_ uint32, _ time.Time) error { return nil }
|
||||
func (m *mockGuildRepoForMail) ListGuildKills(_, _ uint32) ([]*GuildKill, error) { return nil, nil }
|
||||
func (m *mockGuildRepoForMail) CountGuildKills(_, _ uint32) (int, error) { return 0, nil }
|
||||
func (m *mockGuildRepoForMail) ClearTreasureHunt(_ uint32) error { return nil }
|
||||
func (m *mockGuildRepoForMail) CreateAdventure(_, _ uint32, _, _ int64) error { return nil }
|
||||
func (m *mockGuildRepoForMail) CreateAdventureWithCharge(_, _, _ uint32, _, _ int64) error {
|
||||
return nil
|
||||
}
|
||||
func (m *mockGuildRepoForMail) CollectAdventure(_ uint32, _ uint32) error { return nil }
|
||||
func (m *mockGuildRepoForMail) ChargeAdventure(_ uint32, _ uint32) error { return nil }
|
||||
func (m *mockGuildRepoForMail) GetPendingHunt(_ uint32) (*TreasureHunt, error) { return nil, nil }
|
||||
func (m *mockGuildRepoForMail) ListGuildHunts(_, _ uint32) ([]*TreasureHunt, error) { return nil, nil }
|
||||
func (m *mockGuildRepoForMail) CreateHunt(_, _, _, _ uint32, _ []byte, _ string) error { return nil }
|
||||
func (m *mockGuildRepoForMail) AcquireHunt(_ uint32) error { return nil }
|
||||
func (m *mockGuildRepoForMail) RegisterHuntReport(_, _ uint32) error { return nil }
|
||||
func (m *mockGuildRepoForMail) CollectHunt(_ uint32) error { return nil }
|
||||
func (m *mockGuildRepoForMail) ClaimHuntReward(_, _ uint32) error { return nil }
|
||||
func (m *mockGuildRepoForMail) ListMeals(_ uint32) ([]*GuildMeal, error) { return nil, nil }
|
||||
func (m *mockGuildRepoForMail) CreateMeal(_, _, _ uint32, _ time.Time) (uint32, error) { return 0, nil }
|
||||
func (m *mockGuildRepoForMail) UpdateMeal(_, _, _ uint32, _ time.Time) error { return nil }
|
||||
func (m *mockGuildRepoForMail) ClaimHuntBox(_ uint32, _ time.Time) error { return nil }
|
||||
func (m *mockGuildRepoForMail) ListGuildKills(_, _ uint32) ([]*GuildKill, error) { return nil, nil }
|
||||
func (m *mockGuildRepoForMail) CountGuildKills(_, _ uint32) (int, error) { return 0, nil }
|
||||
func (m *mockGuildRepoForMail) ClearTreasureHunt(_ uint32) error { return nil }
|
||||
func (m *mockGuildRepoForMail) InsertKillLog(_ uint32, _ int, _ uint8, _ time.Time) error { return nil }
|
||||
func (m *mockGuildRepoForMail) ListInvitedCharacters(_ uint32) ([]*ScoutedCharacter, error) { return nil, nil }
|
||||
func (m *mockGuildRepoForMail) RolloverDailyRP(_ uint32, _ time.Time) error { return nil }
|
||||
func (m *mockGuildRepoForMail) AddWeeklyBonusUsers(_ uint32, _ uint8) error { return nil }
|
||||
func (m *mockGuildRepoForMail) ListInvitedCharacters(_ uint32) ([]*ScoutedCharacter, error) {
|
||||
return nil, nil
|
||||
}
|
||||
func (m *mockGuildRepoForMail) RolloverDailyRP(_ uint32, _ time.Time) error { return nil }
|
||||
func (m *mockGuildRepoForMail) AddWeeklyBonusUsers(_ uint32, _ uint8) error { return nil }
|
||||
|
||||
// --- mockGuildRepoOps (enhanced guild repo for ops/scout/board tests) ---
|
||||
|
||||
@@ -371,7 +398,7 @@ type mockGuildRepoOps struct {
|
||||
|
||||
// Alliance
|
||||
alliance *GuildAlliance
|
||||
getAllianceErr error
|
||||
getAllianceErr error
|
||||
createAllianceErr error
|
||||
deleteAllianceErr error
|
||||
removeAllyErr error
|
||||
@@ -386,29 +413,29 @@ type mockGuildRepoOps struct {
|
||||
updateMealErr error
|
||||
|
||||
// Adventure
|
||||
adventures []*GuildAdventure
|
||||
listAdvErr error
|
||||
createAdvErr error
|
||||
collectAdvID uint32
|
||||
chargeAdvID uint32
|
||||
chargeAdvAmount uint32
|
||||
adventures []*GuildAdventure
|
||||
listAdvErr error
|
||||
createAdvErr error
|
||||
collectAdvID uint32
|
||||
chargeAdvID uint32
|
||||
chargeAdvAmount uint32
|
||||
|
||||
// Treasure hunt
|
||||
pendingHunt *TreasureHunt
|
||||
guildHunts []*TreasureHunt
|
||||
listHuntsErr error
|
||||
acquireHuntID uint32
|
||||
reportHuntID uint32
|
||||
collectHuntID uint32
|
||||
claimHuntID uint32
|
||||
createHuntErr error
|
||||
pendingHunt *TreasureHunt
|
||||
guildHunts []*TreasureHunt
|
||||
listHuntsErr error
|
||||
acquireHuntID uint32
|
||||
reportHuntID uint32
|
||||
collectHuntID uint32
|
||||
claimHuntID uint32
|
||||
createHuntErr error
|
||||
|
||||
// Hunt data
|
||||
guildKills []*GuildKill
|
||||
listKillsErr error
|
||||
countKills int
|
||||
countKillsErr error
|
||||
claimBoxCalled bool
|
||||
guildKills []*GuildKill
|
||||
listKillsErr error
|
||||
countKills int
|
||||
countKillsErr error
|
||||
claimBoxCalled bool
|
||||
|
||||
// Data
|
||||
membership *GuildMember
|
||||
@@ -623,46 +650,56 @@ func (m *mockUserRepoForItems) SetItemBox(_ uint32, data []byte) error {
|
||||
}
|
||||
|
||||
// Stub all other UserRepo methods.
|
||||
func (m *mockUserRepoForItems) GetGachaPoints(_ uint32) (uint32, uint32, uint32, error) { return 0, 0, 0, nil }
|
||||
func (m *mockUserRepoForItems) GetTrialCoins(_ uint32) (uint16, error) { return 0, nil }
|
||||
func (m *mockUserRepoForItems) DeductTrialCoins(_ uint32, _ uint32) error { return nil }
|
||||
func (m *mockUserRepoForItems) DeductPremiumCoins(_ uint32, _ uint32) error { return nil }
|
||||
func (m *mockUserRepoForItems) AddPremiumCoins(_ uint32, _ uint32) error { return nil }
|
||||
func (m *mockUserRepoForItems) AddTrialCoins(_ uint32, _ uint32) error { return nil }
|
||||
func (m *mockUserRepoForItems) DeductFrontierPoints(_ uint32, _ uint32) error { return nil }
|
||||
func (m *mockUserRepoForItems) AddFrontierPoints(_ uint32, _ uint32) error { return nil }
|
||||
func (m *mockUserRepoForItems) AdjustFrontierPointsDeduct(_ uint32, _ int) (uint32, error) { return 0, nil }
|
||||
func (m *mockUserRepoForItems) AdjustFrontierPointsCredit(_ uint32, _ int) (uint32, error) { return 0, nil }
|
||||
func (m *mockUserRepoForItems) AddFrontierPointsFromGacha(_ uint32, _ uint32, _ uint8) error { return nil }
|
||||
func (m *mockUserRepoForItems) GetRights(_ uint32) (uint32, error) { return 0, nil }
|
||||
func (m *mockUserRepoForItems) SetRights(_ uint32, _ uint32) error { return nil }
|
||||
func (m *mockUserRepoForItems) IsOp(_ uint32) (bool, error) { return false, nil }
|
||||
func (m *mockUserRepoForItems) SetLastCharacter(_ uint32, _ uint32) error { return nil }
|
||||
func (m *mockUserRepoForItems) GetTimer(_ uint32) (bool, error) { return false, nil }
|
||||
func (m *mockUserRepoForItems) SetTimer(_ uint32, _ bool) error { return nil }
|
||||
func (m *mockUserRepoForItems) CountByPSNID(_ string) (int, error) { return 0, nil }
|
||||
func (m *mockUserRepoForItems) SetPSNID(_ uint32, _ string) error { return nil }
|
||||
func (m *mockUserRepoForItems) GetDiscordToken(_ uint32) (string, error) { return "", nil }
|
||||
func (m *mockUserRepoForItems) SetDiscordToken(_ uint32, _ string) error { return nil }
|
||||
func (m *mockUserRepoForItems) LinkDiscord(_ string, _ string) (string, error) { return "", nil }
|
||||
func (m *mockUserRepoForItems) SetPasswordByDiscordID(_ string, _ []byte) error { return nil }
|
||||
func (m *mockUserRepoForItems) GetByIDAndUsername(_ uint32) (uint32, string, error) { return 0, "", nil }
|
||||
func (m *mockUserRepoForItems) BanUser(_ uint32, _ *time.Time) error { return nil }
|
||||
func (m *mockUserRepoForItems) GetGachaPoints(_ uint32) (uint32, uint32, uint32, error) {
|
||||
return 0, 0, 0, nil
|
||||
}
|
||||
func (m *mockUserRepoForItems) GetTrialCoins(_ uint32) (uint16, error) { return 0, nil }
|
||||
func (m *mockUserRepoForItems) DeductTrialCoins(_ uint32, _ uint32) error { return nil }
|
||||
func (m *mockUserRepoForItems) DeductPremiumCoins(_ uint32, _ uint32) error { return nil }
|
||||
func (m *mockUserRepoForItems) AddPremiumCoins(_ uint32, _ uint32) error { return nil }
|
||||
func (m *mockUserRepoForItems) AddTrialCoins(_ uint32, _ uint32) error { return nil }
|
||||
func (m *mockUserRepoForItems) DeductFrontierPoints(_ uint32, _ uint32) error { return nil }
|
||||
func (m *mockUserRepoForItems) AddFrontierPoints(_ uint32, _ uint32) error { return nil }
|
||||
func (m *mockUserRepoForItems) AdjustFrontierPointsDeduct(_ uint32, _ int) (uint32, error) {
|
||||
return 0, nil
|
||||
}
|
||||
func (m *mockUserRepoForItems) AdjustFrontierPointsCredit(_ uint32, _ int) (uint32, error) {
|
||||
return 0, nil
|
||||
}
|
||||
func (m *mockUserRepoForItems) AddFrontierPointsFromGacha(_ uint32, _ uint32, _ uint8) error {
|
||||
return nil
|
||||
}
|
||||
func (m *mockUserRepoForItems) GetRights(_ uint32) (uint32, error) { return 0, nil }
|
||||
func (m *mockUserRepoForItems) SetRights(_ uint32, _ uint32) error { return nil }
|
||||
func (m *mockUserRepoForItems) IsOp(_ uint32) (bool, error) { return false, nil }
|
||||
func (m *mockUserRepoForItems) SetLastCharacter(_ uint32, _ uint32) error { return nil }
|
||||
func (m *mockUserRepoForItems) GetTimer(_ uint32) (bool, error) { return false, nil }
|
||||
func (m *mockUserRepoForItems) SetTimer(_ uint32, _ bool) error { return nil }
|
||||
func (m *mockUserRepoForItems) CountByPSNID(_ string) (int, error) { return 0, nil }
|
||||
func (m *mockUserRepoForItems) SetPSNID(_ uint32, _ string) error { return nil }
|
||||
func (m *mockUserRepoForItems) GetDiscordToken(_ uint32) (string, error) { return "", nil }
|
||||
func (m *mockUserRepoForItems) SetDiscordToken(_ uint32, _ string) error { return nil }
|
||||
func (m *mockUserRepoForItems) LinkDiscord(_ string, _ string) (string, error) { return "", nil }
|
||||
func (m *mockUserRepoForItems) SetPasswordByDiscordID(_ string, _ []byte) error { return nil }
|
||||
func (m *mockUserRepoForItems) GetByIDAndUsername(_ uint32) (uint32, string, error) {
|
||||
return 0, "", nil
|
||||
}
|
||||
func (m *mockUserRepoForItems) BanUser(_ uint32, _ *time.Time) error { return nil }
|
||||
|
||||
// --- mockStampRepoForItems ---
|
||||
|
||||
type mockStampRepoForItems struct {
|
||||
checkedTime time.Time
|
||||
checkedErr error
|
||||
totals [2]uint16 // total, redeemed
|
||||
totalsErr error
|
||||
initCalled bool
|
||||
checkedTime time.Time
|
||||
checkedErr error
|
||||
totals [2]uint16 // total, redeemed
|
||||
totalsErr error
|
||||
initCalled bool
|
||||
incrementCalled bool
|
||||
setCalled bool
|
||||
exchangeResult [2]uint16
|
||||
exchangeErr error
|
||||
yearlyResult [2]uint16
|
||||
yearlyErr error
|
||||
setCalled bool
|
||||
exchangeResult [2]uint16
|
||||
exchangeErr error
|
||||
yearlyResult [2]uint16
|
||||
yearlyErr error
|
||||
|
||||
// Monthly item fields
|
||||
monthlyClaimed time.Time
|
||||
@@ -736,27 +773,33 @@ func (m *mockHouseRepoForItems) SetWarehouseItemData(_ uint32, index uint8, data
|
||||
return m.setErr
|
||||
}
|
||||
|
||||
func (m *mockHouseRepoForItems) InitializeWarehouse(_ uint32) error { return nil }
|
||||
func (m *mockHouseRepoForItems) InitializeWarehouse(_ uint32) error { return nil }
|
||||
|
||||
// Stub all other HouseRepo methods.
|
||||
func (m *mockHouseRepoForItems) UpdateInterior(_ uint32, _ []byte) error { return nil }
|
||||
func (m *mockHouseRepoForItems) GetHouseByCharID(_ uint32) (HouseData, error) { return HouseData{}, nil }
|
||||
func (m *mockHouseRepoForItems) SearchHousesByName(_ string) ([]HouseData, error) { return nil, nil }
|
||||
func (m *mockHouseRepoForItems) UpdateHouseState(_ uint32, _ uint8, _ string) error { return nil }
|
||||
func (m *mockHouseRepoForItems) GetHouseAccess(_ uint32) (uint8, string, error) { return 0, "", nil }
|
||||
func (m *mockHouseRepoForItems) UpdateInterior(_ uint32, _ []byte) error { return nil }
|
||||
func (m *mockHouseRepoForItems) GetHouseByCharID(_ uint32) (HouseData, error) {
|
||||
return HouseData{}, nil
|
||||
}
|
||||
func (m *mockHouseRepoForItems) SearchHousesByName(_ string) ([]HouseData, error) { return nil, nil }
|
||||
func (m *mockHouseRepoForItems) UpdateHouseState(_ uint32, _ uint8, _ string) error { return nil }
|
||||
func (m *mockHouseRepoForItems) GetHouseAccess(_ uint32) (uint8, string, error) { return 0, "", nil }
|
||||
func (m *mockHouseRepoForItems) GetHouseContents(_ uint32) ([]byte, []byte, []byte, []byte, []byte, []byte, []byte, error) {
|
||||
return nil, nil, nil, nil, nil, nil, nil, nil
|
||||
}
|
||||
func (m *mockHouseRepoForItems) GetMission(_ uint32) ([]byte, error) { return nil, nil }
|
||||
func (m *mockHouseRepoForItems) UpdateMission(_ uint32, _ []byte) error { return nil }
|
||||
func (m *mockHouseRepoForItems) GetMission(_ uint32) ([]byte, error) { return nil, nil }
|
||||
func (m *mockHouseRepoForItems) UpdateMission(_ uint32, _ []byte) error { return nil }
|
||||
func (m *mockHouseRepoForItems) GetWarehouseNames(_ uint32) ([10]string, [10]string, error) {
|
||||
return [10]string{}, [10]string{}, nil
|
||||
}
|
||||
func (m *mockHouseRepoForItems) RenameWarehouseBox(_ uint32, _ uint8, _ uint8, _ string) error { return nil }
|
||||
func (m *mockHouseRepoForItems) GetWarehouseEquipData(_ uint32, _ uint8) ([]byte, error) { return nil, nil }
|
||||
func (m *mockHouseRepoForItems) SetWarehouseEquipData(_ uint32, _ uint8, _ []byte) error { return nil }
|
||||
func (m *mockHouseRepoForItems) GetTitles(_ uint32) ([]Title, error) { return nil, nil }
|
||||
func (m *mockHouseRepoForItems) AcquireTitle(_ uint16, _ uint32) error { return nil }
|
||||
func (m *mockHouseRepoForItems) RenameWarehouseBox(_ uint32, _ uint8, _ uint8, _ string) error {
|
||||
return nil
|
||||
}
|
||||
func (m *mockHouseRepoForItems) GetWarehouseEquipData(_ uint32, _ uint8) ([]byte, error) {
|
||||
return nil, nil
|
||||
}
|
||||
func (m *mockHouseRepoForItems) SetWarehouseEquipData(_ uint32, _ uint8, _ []byte) error { return nil }
|
||||
func (m *mockHouseRepoForItems) GetTitles(_ uint32) ([]Title, error) { return nil, nil }
|
||||
func (m *mockHouseRepoForItems) AcquireTitle(_ uint16, _ uint32) error { return nil }
|
||||
|
||||
// --- mockSessionRepo ---
|
||||
|
||||
@@ -766,11 +809,13 @@ type mockSessionRepo struct {
|
||||
clearErr error
|
||||
updateErr error
|
||||
|
||||
boundToken string
|
||||
boundToken string
|
||||
clearedToken string
|
||||
}
|
||||
|
||||
func (m *mockSessionRepo) ValidateLoginToken(_ string, _ uint32, _ uint32) error { return m.validateErr }
|
||||
func (m *mockSessionRepo) ValidateLoginToken(_ string, _ uint32, _ uint32) error {
|
||||
return m.validateErr
|
||||
}
|
||||
func (m *mockSessionRepo) BindSession(token string, _ uint16, _ uint32) error {
|
||||
m.boundToken = token
|
||||
return m.bindErr
|
||||
@@ -816,10 +861,10 @@ type mockGachaRepo struct {
|
||||
deletedBox bool
|
||||
|
||||
// Shop
|
||||
gachas []Gacha
|
||||
listShopErr error
|
||||
shopType int
|
||||
allEntries []GachaEntry
|
||||
gachas []Gacha
|
||||
listShopErr error
|
||||
shopType int
|
||||
allEntries []GachaEntry
|
||||
allEntriesErr error
|
||||
weightDivisor float64
|
||||
|
||||
@@ -873,8 +918,8 @@ func (m *mockGachaRepo) DeleteBoxEntries(_ uint32, _ uint32) error {
|
||||
m.deletedBox = true
|
||||
return nil
|
||||
}
|
||||
func (m *mockGachaRepo) ListShop() ([]Gacha, error) { return m.gachas, m.listShopErr }
|
||||
func (m *mockGachaRepo) GetShopType(_ uint32) (int, error) { return m.shopType, nil }
|
||||
func (m *mockGachaRepo) ListShop() ([]Gacha, error) { return m.gachas, m.listShopErr }
|
||||
func (m *mockGachaRepo) GetShopType(_ uint32) (int, error) { return m.shopType, nil }
|
||||
func (m *mockGachaRepo) GetAllEntries(_ uint32) ([]GachaEntry, error) {
|
||||
return m.allEntries, m.allEntriesErr
|
||||
}
|
||||
@@ -917,11 +962,11 @@ type mockUserRepoGacha struct {
|
||||
mockUserRepoForItems
|
||||
|
||||
gachaFP, gachaGP, gachaGT uint32
|
||||
trialCoins uint16
|
||||
deductTrialErr error
|
||||
deductPremiumErr error
|
||||
deductFPErr error
|
||||
addFPFromGachaErr error
|
||||
trialCoins uint16
|
||||
deductTrialErr error
|
||||
deductPremiumErr error
|
||||
deductFPErr error
|
||||
addFPFromGachaErr error
|
||||
|
||||
fpDeductBalance uint32
|
||||
fpDeductErr error
|
||||
@@ -952,4 +997,4 @@ func (m *mockUserRepoGacha) AdjustFrontierPointsCredit(_ uint32, _ int) (uint32,
|
||||
return m.fpCreditBalance, m.fpCreditErr
|
||||
}
|
||||
func (m *mockUserRepoGacha) SetLastCharacter(_ uint32, _ uint32) error { return m.setLastCharErr }
|
||||
func (m *mockUserRepoGacha) GetRights(_ uint32) (uint32, error) { return m.rights, m.rightsErr }
|
||||
func (m *mockUserRepoGacha) GetRights(_ uint32) (uint32, error) { return m.rights, m.rightsErr }
|
||||
|
||||
Reference in New Issue
Block a user