Skip to content

Commit

Permalink
crystal raiders update, markethistories "too much data" fix
Browse files Browse the repository at this point in the history
  • Loading branch information
phendryx committed Jan 8, 2024
1 parent c03277c commit fc9be9b
Show file tree
Hide file tree
Showing 7 changed files with 425 additions and 383 deletions.
2 changes: 1 addition & 1 deletion client/albion_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
const CacheSize = 8192

type marketHistoryInfo struct {
albionId uint32
albionId int32
timescale lib.Timescale
quality uint8
}
Expand Down
11 changes: 11 additions & 0 deletions client/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -560,4 +560,15 @@ const (
evNewDynamicCompound
evLegendaryItemDestroyed
evAttunementInfo
evTerritoryClaimRaidedRawEnergyCrystalResult
evCarryPowerCrystalExpiryWarning
evPowerCrystalExpired
evTerritoryRaidStart
evTerritoryRaidCancel
evTerritoryRaidFinished
evTerritoryRaidResult
evTerritoryMonolithActiveRaidStatus
evTerritoryMonolithActiveRaidCancelled
evMonolithEnergyStorageUpdate
evMonolithNextScheduledOpenWorldAttackUpdate
)
15 changes: 13 additions & 2 deletions client/eventtype_string.go

Large diffs are not rendered by default.

16 changes: 14 additions & 2 deletions client/operation_auction_get_item_average_stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

type operationAuctionGetItemAverageStats struct {
ItemID uint32 `mapstructure:"1"`
ItemID int32 `mapstructure:"1"`
Quality uint8 `mapstructure:"2"`
Timescale lib.Timescale `mapstructure:"3"`
Enchantment uint32 `mapstructure:"4"`
Expand All @@ -17,8 +17,20 @@ type operationAuctionGetItemAverageStats struct {

func (op operationAuctionGetItemAverageStats) Process(state *albionState) {
var index = op.MessageID % CacheSize

// It seems all items with id 129-256 come through as a negative integer. Example, goose eggs
// comes through as -121. (-121)+256=135. As of today (2024-01-07), the itemId in the ao-bin-dumps repo
// is 135. This occurs for all items we can search the market for with english text from id 128-256.
// Anything 128 and below or 256 and greater seem to work just fine. - phendryx 2024-01-07
var itemId = op.ItemID
if (itemId < 0 && itemId > -129) {
itemId = itemId + 256
} else {
itemId = op.ItemID
}

mhInfo := marketHistoryInfo{
albionId: op.ItemID,
albionId: itemId,
timescale: op.Timescale,
quality: op.Quality,
}
Expand Down
8 changes: 6 additions & 2 deletions client/operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ const (
opGetAttackInfo
opGetTerritorySeasonPoints
opGetAttackSchedule
opScheduleAttack
opGetMatches
opGetMatchDetails
opJoinMatch
Expand Down Expand Up @@ -463,7 +462,6 @@ const (
opGetPvpChallengeData
opClaimPvpChallengeWeeklyReward
opGetPersonalMightStats
opGetGvgSeasonGuildParticipationTime
opAuctionGetLoadoutOffers
opAuctionBuyLoadoutOffer
opAccountDeletionRequest
Expand Down Expand Up @@ -505,4 +503,10 @@ const (
opUseFindTrackSpellFromItemPrepare
opInteractWithTrackStart
opInteractWithTrackCancel
opTerritoryRaidStart
opTerritoryRaidCancel
opTerritoryClaimRaidedRawEnergyCrystalResult
opGvGSeasonPlayerGuildParticipationDetails
opDailyMightBonus
opClaimDailyMightBonus
)
Loading

0 comments on commit fc9be9b

Please sign in to comment.