// Send by client on clicking in accept or refuse of invitation windows for join game(NEED TEST)
void WorldSession::HandleWGEntryInviteResponse(WorldPacket &recv_data)
{
    OutdoorPvPWG *pvpWG = (OutdoorPvPWG*)sOutdoorPvPMgr->GetOutdoorPvPToZoneId(4197);
    if(!pvpWG || !_player)
        return;

    uint32 BattleId;
    uint8 Accepted;



    recv_data >> BattleId >> Accepted;
    sLog->outError("HandleBattlefieldInviteResponse: BattleID:%u Accepted:%u",BattleId,Accepted);

    // If player accept invitation
    if(Accepted)
    {
        if (_player->GetSession())
            _player->GetSession()->SendWGEntered(pvpWG->GetBattleId());
    }
    else
    {
        if(_player->GetZoneId() == 4197)
            pvpWG->KickPlayerFromWG(_player, false);
    }

    _player->WGBattleBox = false;
    _player->WGBattleBoxTimer = 0;
}
// Join Battle button for Wintergrasp from battlegrounds section("H") (%50 Working).
// TO DO: Packet sending is not working. We must fix packet sending...
void WorldSession::HandleWGJoinBattle(WorldPacket &recv_data)
{
    OutdoorPvPWG *pvpWG = (OutdoorPvPWG*)sOutdoorPvPMgr->GetOutdoorPvPToZoneId(4197);
    if(!pvpWG || !_player)
        return;
    
    WorldPacket data(SMSG_BATTLEFIELD_MGR_QUEUE_INVITE, 5);

    data << uint32(pvpWG->GetBattleId());
    data << uint8(1); //warmup ? used ?

    //Sending packet to player
    if(_player->GetSession())
        _player->GetSession()->SendPacket(&data);
}