5.7 KiB
5.7 KiB
Protocol Notes
Opcode Decoder Map (Client)
Source: hs-client/Assembly-CSharp/ConnectAPI.cs.
116→PongPacketDecoder169→Deadend167→DeadendUtil123→DebugConsoleCommand124→DebugConsoleResponse14→AllOptions5→DebugMessage17→EntityChoices13→EntitiesChosen16→GameSetup19→PowerHistory15→UserUI9→TurnTimer10→NAckOption12→GameCanceled23→ServerResult24→SpectatorNotify289→Disconnected202→DeckList207→Collection215→GetDeckContentsResponse216→DBAction217→DeckCreated218→DeckDeleted219→DeckRenamed212→ProfileNotices224→BoosterList226→BoosterContent208→GamesInfo231→ProfileDeckLimit262→ArcaneDustBalance278→GoldBalance233→ProfileProgress270→PlayerRecords271→RewardProgress232→MedalInfo241→ClientOptions246→DraftBeginning247→DraftRetired248→DraftChoicesAndContents249→DraftChosen288→DraftRewardsAcked251→DraftError252→Achieves285→ValidateAchieveResponse282→CancelQuestResponse264→GuardianVars260→CardValues258→BoughtSoldCard269→MassDisenchantResponse265→BattlePayStatusResponse295→ThirdPartyPurchaseStatusResponse272→PurchaseMethod275→CancelPurchaseResponse256→PurchaseResponse238→BattlePayConfigResponse280→PurchaseWithGoldResponse283→HeroXP254→NoOpPacketDecoder286→PlayQueue330→CheckAccountLicensesResponse331→CheckGameLicensesResponse236→CardBacks292→SetCardBackResponse296→SetProgressResponse299→TriggerEventResponse300→NotSoMassiveLoginReply304→AssetsVersionResponse306→AdventureProgressResponse307→UpdateLoginComplete311→AccountLicenseAchieveResponse315→SubscribeResponse316→TavernBrawlInfo317→TavernBrawlPlayerRecordResponse318→FavoriteHeroesResponse320→SetFavoriteHeroResponse324→DebugCommandResponse325→AccountLicensesInfoResponse326→GenericResponse328→ClientRequestResponse322→GetAssetResponse
Opcode Encoder Map (Client → Server)
Game server outbound (QueueGamePacket):
22→SpectatorHandshake168→Handshake1→GetGameState115→Ping11→Concede3→ChooseEntities2→ChooseOption15→UserUI(emote + mouse)25→InviteToSpectate26→RemoveSpectators123→DebugConsoleCommand
Debug console outbound (QueueDebugPacket):
124→DebugConsoleResponse
Util server outbound (ClientRequestManager/UtilOutbound):
319→SetFavoriteHero279→PurchaseWithGold312→StartThirdPartyPurchase293→SubmitThirdPartyReceipt294→GetThirdPartyPurchaseStatus250→GetPurchaseMethod273→DoPurchase274→CancelPurchase237→GetBattlePayConfig255→GetBattlePayStatus268→MassDisenchantRequest235→DraftBegin242→DraftRetire287→DraftAckRewards244→DraftGetPicksAndContents245→DraftMakePick201→GetAccountInfo327→GenericRequestList205→UpdateLogin214→GetDeckContents209→CreateDeck210→DeleteDeck211→RenameDeck332→DeckSetTemplateSource222→DeckSetData213→AckNotice225→OpenBooster230→SetProgress298→TriggerLaunchDayEvent303→GetAssetsVersion308→AckWingProgress309→AcknowledgeBanner310→SetAdventureOptions223→AckCardSeen240→GetOptions239→SetOptions253→GetAchieves284→ValidateAchieve281→CancelQuest243→AckAchieveProgress297→CheckAccountLicenseAchieve305→GetAdventureProgress257→BuySellCard267→CheckAccountLicenses276→CheckGameLicenses291→SetCardBack321→GetAssetRequest329→Unsubscribe322→DebugCommandRequest
Learnings
- Client maintains deferred response maps for async requests in
Network.cs. - Opcode map is a key compatibility anchor for the Go gateway.
Protobuf Definitions (Source)
The repo does not contain the protobuf class definitions for most message
types. They live in the client assemblies that were not decompiled here.
To generate Go structs, extract .proto from the client install:
PegasusGame.dll(game server packets)PegasusUtil.dll(utility/account/collection packets)SpectatorProto.dll(spectator packets)BobNetProto.dll(misc/legacy)PegasusShared.dll(shared types:CardDef,BnetId, enums)
Suggested mapping (verify by decompiling those DLLs):
PegasusGame:GameSetup,PowerHistory,EntityChoices,EntitiesChosen,UserUI,TurnTimer,NAckOption,GameCanceled,ServerResult,Disconnected,Handshake,GetGameState,Ping,Concede,ChooseEntities,ChooseOption.SpectatorProto:SpectatorHandshake,SpectatorNotify,InviteToSpectate,RemoveSpectators.PegasusUtil: everything in the decoder/encoder maps that relates to collection, login, decks, purchases, achievements, and assets (most of theUtilOutboundmessages).BobNetProto:Deadend,DeadendUtil(verify).