woww: Add battleground related updates

This commit is contained in:
Gtker 2022-10-15 14:26:32 +02:00 committed by Alexis La Goutte
parent aa1ff9f57d
commit 24b4c703c4
1 changed files with 51 additions and 29 deletions

View File

@ -121,7 +121,6 @@ static int hf_woww_amount_of_entries = -1;
static int hf_woww_amount_of_events = -1;
static int hf_woww_amount_of_extra_fields = -1;
static int hf_woww_amount_of_factions = -1;
static int hf_woww_amount_of_flag_carriers = -1;
static int hf_woww_amount_of_friends = -1;
static int hf_woww_amount_of_gossip_items = -1;
static int hf_woww_amount_of_hits = -1;
@ -148,6 +147,7 @@ static int hf_woww_amount_of_spells = -1;
static int hf_woww_amount_of_states = -1;
static int hf_woww_amount_of_strings = -1;
static int hf_woww_amount_of_targets = -1;
static int hf_woww_amount_of_teammates = -1;
static int hf_woww_amount_of_zones = -1;
static int hf_woww_angle = -1;
static int hf_woww_animation_id = -1;
@ -183,8 +183,8 @@ static int hf_woww_bag_guid = -1;
static int hf_woww_bag_index = -1;
static int hf_woww_bag_slot = -1;
static int hf_woww_bag_type_subclass = -1;
static int hf_woww_battle_ground_type_id = -1;
static int hf_woww_battlefield_port_action = -1;
static int hf_woww_battleground_bracket = -1;
static int hf_woww_battleground_end_status = -1;
static int hf_woww_battleground_winner = -1;
static int hf_woww_battlegrounds = -1;
@ -5103,6 +5103,24 @@ static const value_string e_world_result_strings[] = {
{ 0, NULL }
};
typedef enum {
BATTLEGROUND_BRACKET_TENS = 0x0,
BATTLEGROUND_BRACKET_TWENTIES = 0x1,
BATTLEGROUND_BRACKET_THIRTIES = 0x2,
BATTLEGROUND_BRACKET_FOURTIES = 0x3,
BATTLEGROUND_BRACKET_FIFTIES = 0x4,
BATTLEGROUND_BRACKET_SIXTY = 0x5,
} e_battleground_bracket;
static const value_string e_battleground_bracket_strings[] = {
{ BATTLEGROUND_BRACKET_TENS, "Tens" },
{ BATTLEGROUND_BRACKET_TWENTIES, "Twenties" },
{ BATTLEGROUND_BRACKET_THIRTIES, "Thirties" },
{ BATTLEGROUND_BRACKET_FOURTIES, "Fourties" },
{ BATTLEGROUND_BRACKET_FIFTIES, "Fifties" },
{ BATTLEGROUND_BRACKET_SIXTY, "Sixty" },
{ 0, NULL }
};
typedef enum {
STATUS_ID_NONE = 0x0,
STATUS_ID_WAIT_QUEUE = 0x1,
@ -9210,6 +9228,7 @@ add_body_fields(guint32 opcode,
guint32 i = 0;
/* AUTOGENERATED_START_VARIABLES */
guint32 amount_of_auras = 0;
guint32 amount_of_carriers = 0;
guint32 amount_of_characters = 0;
guint32 amount_of_choice_item_rewards = 0;
guint32 amount_of_cooldowns = 0;
@ -9220,7 +9239,6 @@ add_body_fields(guint32 opcode,
guint32 amount_of_events = 0;
guint32 amount_of_extra_fields = 0;
guint32 amount_of_factions = 0;
guint32 amount_of_flag_carriers = 0;
guint32 amount_of_friends = 0;
guint32 amount_of_gossip_items = 0;
guint32 amount_of_hits = 0;
@ -9245,6 +9263,7 @@ add_body_fields(guint32 opcode,
guint32 amount_of_states = 0;
guint32 amount_of_strings = 0;
guint32 amount_of_targets = 0;
guint32 amount_of_teammates = 0;
guint32 amount_of_zones = 0;
guint32 aura_type = 0;
guint32 category = 0;
@ -10067,9 +10086,7 @@ add_body_fields(guint32 opcode,
ptvcursor_add(ptv, hf_woww_requested_rank, 4, ENC_LITTLE_ENDIAN);
break;
case CMSG_LEAVE_BATTLEFIELD:
ptvcursor_add(ptv, hf_woww_unknown_int, 1, ENC_LITTLE_ENDIAN);
ptvcursor_add(ptv, hf_woww_battle_ground_type_id, 1, ENC_LITTLE_ENDIAN);
ptvcursor_add(ptv, hf_woww_unknown_int, 2, ENC_LITTLE_ENDIAN);
ptvcursor_add(ptv, hf_woww_map, 4, ENC_LITTLE_ENDIAN);
break;
case CMSG_LEAVE_CHANNEL:
add_cstring(ptv, &hf_woww_channel_name);
@ -10628,11 +10645,11 @@ add_body_fields(guint32 opcode,
break;
case CMSG_SET_FACTION_ATWAR:
ptvcursor_add(ptv, hf_woww_reputation_list_id, 4, ENC_LITTLE_ENDIAN);
ptvcursor_add(ptv, hf_woww_flags, 1, ENC_LITTLE_ENDIAN);
ptvcursor_add(ptv, hf_woww_faction_flag, 1, ENC_LITTLE_ENDIAN);
break;
case CMSG_SET_FACTION_INACTIVE:
ptvcursor_add(ptv, hf_woww_reputation_list_id, 4, ENC_LITTLE_ENDIAN);
ptvcursor_add(ptv, hf_woww_inactive, 1, ENC_LITTLE_ENDIAN);
ptvcursor_add(ptv, hf_woww_inactive, 1, ENC_NA);
break;
case CMSG_SET_SELECTION:
ptvcursor_add(ptv, hf_woww_target, 8, ENC_LITTLE_ENDIAN);
@ -10828,9 +10845,16 @@ add_body_fields(guint32 opcode,
break;
case MSG_BATTLEGROUND_PLAYER_POSITIONS:
if (WOWW_SERVER_TO_CLIENT) {
ptvcursor_add(ptv, hf_woww_amount_of_carriers, 4, ENC_LITTLE_ENDIAN);
ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_flag_carriers, 4, ENC_LITTLE_ENDIAN, &amount_of_flag_carriers);
for (i = 0; i < amount_of_flag_carriers; ++i) {
ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_teammates, 4, ENC_LITTLE_ENDIAN, &amount_of_teammates);
for (i = 0; i < amount_of_teammates; ++i) {
ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "BattlegroundPlayerPosition");
ptvcursor_add(ptv, hf_woww_player, 8, ENC_LITTLE_ENDIAN);
ptvcursor_add(ptv, hf_woww_position_x, 4, ENC_LITTLE_ENDIAN);
ptvcursor_add(ptv, hf_woww_position_y, 4, ENC_LITTLE_ENDIAN);
ptvcursor_pop_subtree(ptv);
}
ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_carriers, 1, ENC_LITTLE_ENDIAN, &amount_of_carriers);
for (i = 0; i < amount_of_carriers; ++i) {
ptvcursor_add_text_with_subtree(ptv, SUBTREE_UNDEFINED_LENGTH, ett_message, "BattlegroundPlayerPosition");
ptvcursor_add(ptv, hf_woww_player, 8, ENC_LITTLE_ENDIAN);
ptvcursor_add(ptv, hf_woww_position_x, 4, ENC_LITTLE_ENDIAN);
@ -12882,9 +12906,7 @@ add_body_fields(guint32 opcode,
case SMSG_BATTLEFIELD_LIST:
ptvcursor_add(ptv, hf_woww_battlemaster, 8, ENC_LITTLE_ENDIAN);
ptvcursor_add(ptv, hf_woww_map, 4, ENC_LITTLE_ENDIAN);
ptvcursor_add(ptv, hf_woww_unknown_int, 1, ENC_LITTLE_ENDIAN);
ptvcursor_add(ptv, hf_woww_unknown_int, 4, ENC_LITTLE_ENDIAN);
ptvcursor_add(ptv, hf_woww_unknown_int, 1, ENC_LITTLE_ENDIAN);
ptvcursor_add(ptv, hf_woww_battleground_bracket, 1, ENC_LITTLE_ENDIAN);
ptvcursor_add_ret_uint(ptv, hf_woww_number_of_battlegrounds, 4, ENC_LITTLE_ENDIAN, &number_of_battlegrounds);
for (i = 0; i < number_of_battlegrounds; ++i) {
ptvcursor_add(ptv, hf_woww_battlegrounds, 4, ENC_LITTLE_ENDIAN);
@ -13586,7 +13608,7 @@ add_body_fields(guint32 opcode,
ptvcursor_add(ptv, hf_woww_logout_speed, 1, ENC_LITTLE_ENDIAN);
break;
case SMSG_LOG_XPGAIN:
ptvcursor_add(ptv, hf_woww_target_guid, 8, ENC_LITTLE_ENDIAN);
ptvcursor_add(ptv, hf_woww_target, 8, ENC_LITTLE_ENDIAN);
ptvcursor_add(ptv, hf_woww_total_exp, 4, ENC_LITTLE_ENDIAN);
ptvcursor_add_ret_uint(ptv, hf_woww_experience_award_type, 1, ENC_LITTLE_ENDIAN, &exp_type);
if (exp_type == EXPERIENCE_AWARD_TYPE_NON_KILL) {
@ -15548,7 +15570,7 @@ proto_register_woww(void)
},
{ &hf_woww_amount_of_carriers,
{ "Amount Of Carriers", "woww.amount.of.carriers",
FT_UINT32, BASE_HEX_DEC, NULL, 0,
FT_UINT8, BASE_HEX_DEC, NULL, 0,
NULL, HFILL
}
},
@ -15618,12 +15640,6 @@ proto_register_woww(void)
NULL, HFILL
}
},
{ &hf_woww_amount_of_flag_carriers,
{ "Amount Of Flag Carriers", "woww.amount.of.flag.carriers",
FT_UINT32, BASE_HEX_DEC, NULL, 0,
NULL, HFILL
}
},
{ &hf_woww_amount_of_friends,
{ "Amount Of Friends", "woww.amount.of.friends",
FT_UINT8, BASE_HEX_DEC, NULL, 0,
@ -15780,6 +15796,12 @@ proto_register_woww(void)
NULL, HFILL
}
},
{ &hf_woww_amount_of_teammates,
{ "Amount Of Teammates", "woww.amount.of.teammates",
FT_UINT32, BASE_HEX_DEC, NULL, 0,
NULL, HFILL
}
},
{ &hf_woww_amount_of_zones,
{ "Amount Of Zones", "woww.amount.of.zones",
FT_UINT32, BASE_HEX_DEC, NULL, 0,
@ -15990,18 +16012,18 @@ proto_register_woww(void)
NULL, HFILL
}
},
{ &hf_woww_battle_ground_type_id,
{ "Battle Ground Type Id", "woww.battle.ground.type.id",
FT_UINT8, BASE_HEX_DEC, NULL, 0,
NULL, HFILL
}
},
{ &hf_woww_battlefield_port_action,
{ "Battlefield Port Action", "woww.battlefield.port.action",
FT_UINT8, BASE_HEX_DEC, VALS(e_battlefield_port_action_strings), 0,
NULL, HFILL
}
},
{ &hf_woww_battleground_bracket,
{ "Battleground Bracket", "woww.battleground.bracket",
FT_UINT8, BASE_HEX_DEC, VALS(e_battleground_bracket_strings), 0,
NULL, HFILL
}
},
{ &hf_woww_battleground_end_status,
{ "Battleground End Status", "woww.battleground.end.status",
FT_UINT8, BASE_HEX_DEC, VALS(e_battleground_end_status_strings), 0,
@ -16988,7 +17010,7 @@ proto_register_woww(void)
},
{ &hf_woww_flags,
{ "Flags", "woww.flags",
FT_UINT8, BASE_HEX_DEC, NULL, 0,
FT_UINT32, BASE_HEX_DEC, NULL, 0,
NULL, HFILL
}
},