Ejemplo n.º 1
0
 private void GetPvpInfo()
 {
     C2G.PVPGetInfo packet = new C2G.PVPGetInfo();
     if (m_DefenseTeam == null || m_MyPvpInfo != null && m_MyPvpInfo.team_power == m_DefenseTeam.Power)
     {
         packet.defense_team_power = 0;
     }
     else
     {
         packet.defense_team_power = m_DefenseTeam.Power;
     }
     Network.GameServer.JsonAsync <C2G.PVPGetInfo, C2G.PVPGetInfoAck>(packet, OnPVPGetInfo);
 }
Ejemplo n.º 2
0
    //int m_BattleDelay = 0;
    void OnPVPGetInfo(C2G.PVPGetInfo packet, C2G.PVPGetInfoAck ack)
    {
        if (ack.pvp_player_infos == null || ack.pvp_player_infos.Count == 0)
        {
            bNeedDefenseTeamSet         = true;
            ShowPopupSetDefenseTeamTime = Time.realtimeSinceStartup + ShowPopupSetDefenseTeamTimeGap;
            return;
        }

        m_LastOffenseTime = ack.last_offense_at;
        //m_AvailableBattleCount = ack.available_daily_battle_count;
        m_MyPvpInfo   = ack.pvp_player_infos[0];
        m_EnemiesInfo = ack.pvp_player_infos.GetRange(1, ack.pvp_player_infos.Count - 1);

        if (m_Profile == null)
        {
            m_Profile = NGUITools.AddChild(ProfileIndicator, PrefabProfile).GetComponent <PlayerProfile>();
        }
        m_Profile.UpdateProfile(Network.PlayerInfo.leader_creature, Network.PlayerInfo.nickname, Network.PlayerInfo.player_level);

        UpdateInfo();
    }