Beispiel #1
0
    public void OnClickSaveDefenseTeam()
    {
        if (m_CurrentTeam.Creatures.Count == 0)
        {
            Tooltip.Instance.ShowMessageKey("PVPTeamCountZero");
            return;
        }

        if (CheckSkill() == false)
        {
            return;
        }

        if (m_CurrentTeam.LeaderCreature == null && m_CurrentTeam.Creatures.Any(c => c.creature.TeamSkill != null))
        {
            OnLeaderSkill();
            return;
        }

        if (is_regist == true)
        {
            C2G.PVPRegistDefense packet = new C2G.PVPRegistDefense();
            packet.leader_creature = Network.PlayerInfo.leader_creature;
            packet.team_power      = m_CurrentTeam.Power;
            packet.team_data       = m_CurrentTeam.CreateSaveData();
            packet.message         = Localization.Get("PVPMessageDefault");
            Network.GameServer.JsonAsync <C2G.PVPRegistDefense, C2G.PVPRegistDefenseAck>(packet, OnPvpRegistDefense);
        }
        else
        {
            TeamData defense_team = TeamDataManager.Instance.GetTeam(pe_Team.PVP_Defense);
            if (defense_team == null || defense_team.IsEqual(m_CurrentTeam) == false)
            {
                C2G.PvpUpdateDefense packet = new C2G.PvpUpdateDefense();
                packet.leader_creature = Network.PlayerInfo.leader_creature;
                packet.team_power      = m_CurrentTeam.Power;
                packet.team_data       = m_CurrentTeam.CreateSaveData();
                Network.GameServer.JsonAsync <C2G.PvpUpdateDefense, C2G.PVPRegistDefenseAck>(packet, OnPvpUpdateDefense);
            }
            else
            {
                PvpDefenseTeamUpdated();
            }
        }
    }
Beispiel #2
0
 void OnPvpRegistDefense(C2G.PVPRegistDefense packet, C2G.PVPRegistDefenseAck ack)
 {
     OnPvpDefense();
 }