@@ -31,6 +31,22 @@ service GuildService {
3131 rpc SendGuildMessage (SendGuildMessageParams ) returns (SendGuildMessageResponse );
3232
3333 rpc CreateGuild (CreateGuildParams ) returns (CreateGuildResponse );
34+
35+ // Guild bank. The guild service is the only writer of the bank state
36+ // (tabs, items placement, money, per-rank tab rights, withdrawal counters).
37+ // Items themselves live in item_instance and move between a player and the
38+ // bank through the worldserver items API, driven by the gateway.
39+ rpc GetBankState (GetBankStateParams ) returns (GetBankStateResponse );
40+ rpc GetBankTab (GetBankTabParams ) returns (GetBankTabResponse );
41+ rpc BankDepositMoney (BankMoneyParams ) returns (BankMoneyResponse );
42+ rpc BankWithdrawMoney (BankMoneyParams ) returns (BankMoneyResponse );
43+ rpc BankDepositItem (BankDepositItemParams ) returns (BankDepositItemResponse );
44+ rpc BankWithdrawItem (BankWithdrawItemParams ) returns (BankWithdrawItemResponse );
45+ rpc BankMoveItem (BankMoveItemParams ) returns (BankMoveItemResponse );
46+ rpc BankBuyTab (BankBuyTabParams ) returns (BankBuyTabResponse );
47+ rpc BankSetTabInfo (BankSetTabInfoParams ) returns (BankSetTabInfoResponse );
48+ rpc BankSetTabText (BankSetTabTextParams ) returns (BankSetTabTextResponse );
49+ rpc GetBankLog (GetBankLogParams ) returns (GetBankLogResponse );
3450}
3551
3652message GetInfoParams {
@@ -95,6 +111,10 @@ message GetRosterInfoResponse {
95111 uint32 id = 1 ;
96112 uint32 flags = 2 ;
97113 uint32 goldLimit = 3 ;
114+ // Per-bank-tab rights (GUILD_BANK_RIGHT_* bitmask) and item withdrawals
115+ // per day, indexed by tab id. Empty when the guild has no purchased tabs.
116+ repeated uint32 bankTabRights = 4 ;
117+ repeated uint32 bankTabSlotsPerDay = 5 ;
98118 }
99119
100120 message Guild {
@@ -214,6 +234,10 @@ message RankUpdateParams {
214234 string rankName = 5 ;
215235 uint32 rights = 6 ;
216236 uint32 moneyPerDay = 7 ;
237+ // Per-bank-tab rights and item withdrawals per day from CMSG_GUILD_RANK
238+ // (6 entries). Only entries for purchased tabs are persisted.
239+ repeated uint32 bankTabRights = 8 ;
240+ repeated uint32 bankTabSlotsPerDay = 9 ;
217241}
218242
219243message RankUpdateResponse {
@@ -280,3 +304,199 @@ message CreateGuildResponse {
280304
281305 uint64 guildID = 2 ;
282306}
307+
308+ // GuildBankItem describes an item stored in the guild bank, with the
309+ // item_instance fields the client needs to render it in the bank list.
310+ message GuildBankItem {
311+ uint32 slot = 1 ;
312+ uint64 itemGuid = 2 ;
313+ uint32 entry = 3 ;
314+ uint32 count = 4 ;
315+ uint32 flags = 5 ;
316+ uint32 durability = 6 ;
317+ int32 randomPropertyID = 7 ;
318+ // Permanent enchant id (first entry of item_instance.enchantments).
319+ uint32 enchantmentID = 8 ;
320+ // Remaining charges of the first charged spell, absolute value.
321+ uint32 charges = 9 ;
322+ string text = 10 ;
323+ // Gem enchant ids by socket index (0 = empty socket).
324+ repeated uint32 socketEnchantIDs = 11 ;
325+ }
326+
327+ message GetBankStateParams {
328+ string api = 1 ;
329+ uint32 realmID = 2 ;
330+ uint64 guildID = 3 ;
331+ uint64 playerGUID = 4 ;
332+ }
333+
334+ message GetBankStateResponse {
335+ string api = 1 ;
336+
337+ uint64 money = 2 ;
338+ uint32 rankID = 3 ;
339+ uint32 rankRights = 4 ;
340+ // Gold withdrawal limit per day of the member's rank (0xFFFFFFFF = unlimited).
341+ uint32 moneyPerDay = 5 ;
342+ // Gold the member can still withdraw today (0xFFFFFFFF = unlimited).
343+ uint32 remainingMoney = 6 ;
344+
345+ message Tab {
346+ string name = 1 ;
347+ string icon = 2 ;
348+ string text = 3 ;
349+ // Member's rights on this tab (GUILD_BANK_RIGHT_* bitmask).
350+ uint32 rights = 4 ;
351+ // Item withdrawals the member has left today on this tab.
352+ uint32 remainingSlots = 5 ;
353+ }
354+ // Purchased tabs only, index = tab id.
355+ repeated Tab tabs = 7 ;
356+
357+ // Cost of the next purchasable tab in copper, 0 when all tabs are purchased.
358+ uint32 nextTabCost = 8 ;
359+ }
360+
361+ message GetBankTabParams {
362+ string api = 1 ;
363+ uint32 realmID = 2 ;
364+ uint64 guildID = 3 ;
365+ uint64 playerGUID = 4 ;
366+ uint32 tab = 5 ;
367+ }
368+
369+ message GetBankTabResponse {
370+ string api = 1 ;
371+ repeated GuildBankItem items = 2 ;
372+ }
373+
374+ message BankMoneyParams {
375+ string api = 1 ;
376+ uint32 realmID = 2 ;
377+ uint64 guildID = 3 ;
378+ uint64 playerGUID = 4 ;
379+ uint64 amount = 5 ;
380+ }
381+
382+ message BankMoneyResponse {
383+ string api = 1 ;
384+ uint64 newBankMoney = 2 ;
385+ uint32 remainingMoney = 3 ;
386+ }
387+
388+ message BankDepositItemParams {
389+ string api = 1 ;
390+ uint32 realmID = 2 ;
391+ uint64 guildID = 3 ;
392+ uint64 playerGUID = 4 ;
393+ uint32 tab = 5 ;
394+ // 255 = first free slot.
395+ uint32 slot = 6 ;
396+ GuildBankItem item = 7 ;
397+ // Compensation path (failed withdraw): skip the rights check.
398+ bool restore = 8 ;
399+ }
400+
401+ message BankDepositItemResponse {
402+ string api = 1 ;
403+ // Slot the item was placed in.
404+ uint32 slot = 2 ;
405+ }
406+
407+ message BankWithdrawItemParams {
408+ string api = 1 ;
409+ uint32 realmID = 2 ;
410+ uint64 guildID = 3 ;
411+ uint64 playerGUID = 4 ;
412+ uint32 tab = 5 ;
413+ uint32 slot = 6 ;
414+ }
415+
416+ message BankWithdrawItemResponse {
417+ string api = 1 ;
418+ GuildBankItem item = 2 ;
419+ uint32 remainingSlots = 3 ;
420+ }
421+
422+ message BankMoveItemParams {
423+ string api = 1 ;
424+ uint32 realmID = 2 ;
425+ uint64 guildID = 3 ;
426+ uint64 playerGUID = 4 ;
427+ uint32 srcTab = 5 ;
428+ uint32 srcSlot = 6 ;
429+ uint32 dstTab = 7 ;
430+ uint32 dstSlot = 8 ;
431+ // 0 = move/swap the whole stack. Splits are not supported yet.
432+ uint32 splitCount = 9 ;
433+ }
434+
435+ message BankMoveItemResponse {
436+ string api = 1 ;
437+ }
438+
439+ message BankBuyTabParams {
440+ string api = 1 ;
441+ uint32 realmID = 2 ;
442+ uint64 guildID = 3 ;
443+ uint64 playerGUID = 4 ;
444+ uint32 tab = 5 ;
445+ // Cost the gateway already took from the player, re-validated by the service.
446+ uint32 paidCost = 6 ;
447+ }
448+
449+ message BankBuyTabResponse {
450+ string api = 1 ;
451+ }
452+
453+ message BankSetTabInfoParams {
454+ string api = 1 ;
455+ uint32 realmID = 2 ;
456+ uint64 guildID = 3 ;
457+ uint64 playerGUID = 4 ;
458+ uint32 tab = 5 ;
459+ string name = 6 ;
460+ string icon = 7 ;
461+ }
462+
463+ message BankSetTabInfoResponse {
464+ string api = 1 ;
465+ }
466+
467+ message BankSetTabTextParams {
468+ string api = 1 ;
469+ uint32 realmID = 2 ;
470+ uint64 guildID = 3 ;
471+ uint64 playerGUID = 4 ;
472+ uint32 tab = 5 ;
473+ string text = 6 ;
474+ }
475+
476+ message BankSetTabTextResponse {
477+ string api = 1 ;
478+ }
479+
480+ message GetBankLogParams {
481+ string api = 1 ;
482+ uint32 realmID = 2 ;
483+ uint64 guildID = 3 ;
484+ uint64 playerGUID = 4 ;
485+ // 0-5 = item tab log, 6 = money log.
486+ uint32 tab = 5 ;
487+ }
488+
489+ message GetBankLogResponse {
490+ string api = 1 ;
491+
492+ message Entry {
493+ uint32 eventType = 1 ;
494+ uint64 playerGUID = 2 ;
495+ uint32 itemEntry = 3 ;
496+ uint32 count = 4 ;
497+ uint32 destTab = 5 ;
498+ uint64 money = 6 ;
499+ int64 timestamp = 7 ;
500+ }
501+ repeated Entry entries = 2 ;
502+ }
0 commit comments