Examples of Clan


Examples of com.wot.shared.Clan

      // TODO Auto-generated catch block
      e2.printStackTrace();
    }
   
    //////////////////////////////////////////////////////////////////
    Clan clan = null;
    //int offset = 0 ;
    int limit = 100;
   
    // Verify that the input is valid.
    if (!FieldVerifier.isValidName(input)) {
      // If the input is not valid, throw an IllegalArgumentException back to
      // the client.
      log.info("arg not good : " + input);
      throw new IllegalArgumentException("Name must be at least 1 characters long");
    }
 
    String serverInfo = getServletContext().getServerInfo();
    String userAgent = getThreadLocalRequest().getHeader("User-Agent");
 
    // Escape data from the client to avoid cross-site script vulnerabilities.
    input = escapeHtml(input);
    userAgent = escapeHtml(userAgent);
    String resultAchievement = "";
   
    try {
      long maxAchievement = 0;
      String maxAchievementuserName = "";
 
      //recup id clan avec son son nom
      /**
       * {
          "status": "ok",
          "status_code": "NO_ERROR",
          "data": {
            "items": [
              {
                "abbreviation": "NVS",
                "created_at": 1328978449.00,
                "name": "NOVA SNAIL",
                "member_count": 57,
                "owner": "hentz44",
                "motto": "Un escargot qui avale un obus a confiance en sa coquille.",
                "clan_emblem_url": "http://cw.worldoftanks.eu/media/clans/emblems/clans_5/500006074/emblem_64x64.png",
                "id": 500006074,
                "clan_color": "#4a426c"
              }
            ],
            "offset": 0,
            "filtered_count": 2
          }
        }
       
       
        ////////////////// NEW /////////////////////
         * {
          "status": "ok",
          "count": 48,
          "data": [
            {
              "members_count": 48,
              "name": "\"БелаÑ� гвардиÑ�\"",
              "created_at": 1335298122,
              "abbreviation": "WG1",
              "clan_id": 24810,
              "owner_id": 5095539
            },
            {
              "members_count": 1,
              "name": "Cheerful coffin",
              "created_at": 1345383267,
              "abbreviation": "WGWWR",
              "clan_id": 35231,
              "owner_id": 5266248
            }
            ]
          }
         *
       */
      URL urlClan = null ;
      input = input.replace(" ", "%20");
      if(lieu.equalsIgnoreCase("boulot")){ //on passe par 1 proxy
        urlClan = new URL(proxy + "http://api.worldoftanks.eu/2.0/clan/list/?application_id=d0a293dc77667c9328783d489c8cef73&search=" +  input);         
      }
      else {
        //NVS : 500006074
        //urlClan = new URL("http://api.worldoftanks.eu/community/clans/500006074/api/1.0/?source_token=WG-WoT_Assistant-1.3.2");
        //http://api.worldoftanks.eu/2.0/clan/list/?application_id=d0a293dc77667c9328783d489c8cef73&search=
        urlClan = new URL("http://api.worldoftanks.eu/2.0/clan/list/?application_id=d0a293dc77667c9328783d489c8cef73&search=" +  input );   
      }
     
      //lecture de la réponse recherche du clan
      HttpURLConnection conn = (HttpURLConnection)urlClan.openConnection();
      conn.setReadTimeout(60000);
      conn.setConnectTimeout(60000);
      //conn.getInputStream();
      BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8"));
     
      //BufferedReader reader = new BufferedReader(new InputStreamReader(urlClan.openStream(), "UTF-8"));
      String line = "";
      String AllLines = "";
 
      while ((line = reader.readLine()) != null) {
        AllLines = AllLines + line;
      }
      log.info(AllLines);
      reader.close();
 
      Gson gson = new Gson();
      //System.out.println("before " + AllLines);
     
      //parsing gson
      clan = gson.fromJson(AllLines, Clan.class );
      //ItemsDataClan  myItemsDataClan = null ;
     

 
    } catch (MalformedURLException e) {
      // ...
      e.printStackTrace();
    } catch (IOException e) {
      // ...
      e.printStackTrace();
    }
 
    //return resultAchievement;
    clan.setWiki(wiki);
    return clan;
  }
View Full Code Here

Examples of com.wot.shared.Clan

  @Override
  public CommunityClan getAllMembersClan(String idClan) {
    CommunityClan communityClan = null;
   
    DaoCommunityClan2 daoCommunityClan = null;
    Clan desClan =null;
    // Verify that the input is valid.
    if (!FieldVerifier.isValidName(idClan)) {
      // If the input is not valid, throw an IllegalArgumentException back to
      // the client.
      throw new IllegalArgumentException("Name must be at least 4 characters long");
View Full Code Here

Examples of com.wot.shared.Clan

      // TODO Auto-generated catch block
      e2.printStackTrace();
    }
   
    //////////////////////////////////////////////////////////////////
    Clan clan = null;
    //int offset = 0 ;
    int limit = 100;
   
    // Verify that the input is valid.
    if (!FieldVerifier.isValidName(input)) {
      // If the input is not valid, throw an IllegalArgumentException back to
      // the client.
      log.info("arg not good : " + input);
      throw new IllegalArgumentException("Name must be at least 1 characters long");
    }
 
    String serverInfo = getServletContext().getServerInfo();
    String userAgent = getThreadLocalRequest().getHeader("User-Agent");
 
    // Escape data from the client to avoid cross-site script vulnerabilities.
    input = escapeHtml(input);
    userAgent = escapeHtml(userAgent);
    String resultAchievement = "";
   
    try {
      long maxAchievement = 0;
      String maxAchievementuserName = "";
 
      //recup id clan avec son son nom
      /**
       * {
          "status": "ok",
          "status_code": "NO_ERROR",
          "data": {
            "items": [
              {
                "abbreviation": "NVS",
                "created_at": 1328978449.00,
                "name": "NOVA SNAIL",
                "member_count": 57,
                "owner": "hentz44",
                "motto": "Un escargot qui avale un obus a confiance en sa coquille.",
                "clan_emblem_url": "http://cw.worldoftanks.eu/media/clans/emblems/clans_5/500006074/emblem_64x64.png",
                "id": 500006074,
                "clan_color": "#4a426c"
              }
            ],
            "offset": 0,
            "filtered_count": 2
          }
        }
       
       
        ////////////////// NEW /////////////////////
         * {
          "status": "ok",
          "count": 48,
          "data": [
            {
              "members_count": 48,
              "name": "\"�‘�µ�»�°Ñ� �³�²�°Ñ€�´�¸Ñ�\"",
              "created_at": 1335298122,
              "abbreviation": "WG1",
              "clan_id": 24810,
              "owner_id": 5095539
            },
            {
              "members_count": 1,
              "name": "Cheerful coffin",
              "created_at": 1345383267,
              "abbreviation": "WGWWR",
              "clan_id": 35231,
              "owner_id": 5266248
            }
            ]
          }
         *
       */
      URL urlClan = null ;
      input = input.replace(" ", "%20");
      if(lieu.equalsIgnoreCase("boulot")){ //on passe par 1 proxy
        urlClan = new URL("https://pedro-proxy.appspot.com/api.worldoftanks.eu/2.0/clan/list/?application_id=d0a293dc77667c9328783d489c8cef73&search=" +  input + "&offset="+ offset+ "&limit=" + limit);         
      }
      else {
        //NVS : 500006074
        //urlClan = new URL("http://api.worldoftanks.eu/community/clans/500006074/api/1.0/?source_token=WG-WoT_Assistant-1.3.2");
        //http://api.worldoftanks.eu/2.0/clan/list/?application_id=d0a293dc77667c9328783d489c8cef73&search=
        urlClan = new URL("http://api.worldoftanks.eu/2.0/clan/list/?application_id=d0a293dc77667c9328783d489c8cef73&search=" +  input );   
      }
     
      //lecture de la réponse recherche du clan
      HttpURLConnection conn = (HttpURLConnection)urlClan.openConnection();
      conn.setReadTimeout(60000);
      conn.setConnectTimeout(60000);
      //conn.getInputStream();
      BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8"));
     
      //BufferedReader reader = new BufferedReader(new InputStreamReader(urlClan.openStream(), "UTF-8"));
      String line = "";
      String AllLines = "";
 
      while ((line = reader.readLine()) != null) {
        AllLines = AllLines + line;
      }
      log.info(AllLines);
      reader.close();
 
      Gson gson = new Gson();
      //System.out.println("before " + AllLines);
     
      //parsing gson
      clan = gson.fromJson(AllLines, Clan.class );
      //ItemsDataClan  myItemsDataClan = null ;
     
      //translate the motto
      //https://www.googleapis.com/language/translate/v2/detect?{parameters}
      URL urlTranslate = null ;
      String key = "AIzaSyBVwNDYZ1d3ERToxoZSFhW7jQrOeEvJVMM";
     
      // Set your Windows Azure Marketplace client info - See http://msdn.microsoft.com/en-us/library/hh454950.aspx
       
        String translatedText = "";
        //String idClient = "a41ecfea-8da4-41a9-8f66-be116476de4b";
        //String secretClient = "LgIs7oBcmBUSZ0964xZxdqkZDMWSSSzvGHUZf1sUEMs";
       
        String idClient = "wotachievement";
        String secretClient = "/upbsAfsZzh82dNC1ehpW8u8CVNR9afujtIko9ZW22E=";
       
        //Translate.setClientId(idClient/* Enter your Windows Azure Client Id here */);
        //Translate.setClientSecret(secretClient/* Enter your Windows Azure Client Secret here */);

        //Detect.setClientId(idClient);
          //Detect.setClientSecret(secretClient);
         
      int nbTrad = 0;
//      for (ItemsDataClan myItemsDataClan : clan.getItems()) {
//        translatedText = "Pas de traduction, Seules les 5 premieres lignes sont traduites";
//        String motto = myItemsDataClan.getMotto();
//        //detect lang motto
//        try {
//          Language detectedLanguage = null;
//         
//            detectedLanguage = Detect.execute(motto);
//           
//            if (detectedLanguage != null && !detectedLanguage.getName(Language.FRENCH).equalsIgnoreCase("Français") && nbTrad < 6  ) {
//              translatedText = Translate.execute(motto, detectedLanguage, Language.FRENCH);
//              myItemsDataClan.setMotto(motto + " (" + detectedLanguage.name() +") " + "--> traduction : " + translatedText);
//              nbTrad++;
//            }
//         
//        } catch (Exception e) {
//        // TODO Auto-generated catch block
//        System.out.println(e.getMessage());
//        }
//      }
 
    } catch (MalformedURLException e) {
      // ...
      e.printStackTrace();
    } catch (IOException e) {
      // ...
      e.printStackTrace();
    }
 
    //return resultAchievement;
    clan.setWiki(wiki);
    return clan;
  }
View Full Code Here

Examples of com.wot.shared.Clan

  @Override
  public CommunityClan getAllMembersClan(String idClan) {
    CommunityClan communityClan = null;
   
    DaoCommunityClan2 daoCommunityClan = null;
    Clan desClan =null;
    // Verify that the input is valid.
    if (!FieldVerifier.isValidName(idClan)) {
      // If the input is not valid, throw an IllegalArgumentException back to
      // the client.
      throw new IllegalArgumentException("Name must be at least 4 characters long");
View Full Code Here

Examples of lineage2.gameserver.model.pledge.Clan

  {
    if ((id != COMMAND_IDS[0]) && (id != COMMAND_IDS[1]) && (id != COMMAND_IDS[2]))
    {
      return false;
    }
    Clan clan = activeChar.getClan();
    if (clan == null)
    {
      activeChar.sendPacket(Msg.NOT_JOINED_IN_ANY_CLAN);
      return false;
    }
    SystemMessage sm;
    List<Clan> data = new ArrayList<>();
    if (id == 88)
    {
      activeChar.sendPacket(Msg._ATTACK_LIST_);
      data = clan.getEnemyClans();
    }
    else if (id == 89)
    {
      activeChar.sendPacket(Msg._UNDER_ATTACK_LIST_);
      data = clan.getAttackerClans();
    }
    else
    {
      activeChar.sendPacket(Msg._WAR_LIST_);
      for (Clan c : clan.getEnemyClans())
      {
        if (clan.getAttackerClans().contains(c))
        {
          data.add(c);
        }
      }
    }
View Full Code Here

Examples of lineage2.gameserver.model.pledge.Clan

    }
    else
    {
      _name = player.getName();

      Clan clan = player.getClan();
      Alliance alliance = clan == null ? null : clan.getAlliance();
      //
      clan_id = clan == null ? 0 : clan.getClanId();
      clan_crest_id = clan == null ? 0 : clan.getCrestId();
      large_clan_crest_id = clan == null ? 0 : clan.getCrestLargeId();
      //
      ally_id = alliance == null ? 0 : alliance.getAllyId();
      ally_crest_id = alliance == null ? 0 : alliance.getAllyCrestId();

      cw_level = 0;
View Full Code Here

Examples of lineage2.gameserver.model.pledge.Clan

    }
    if ((_powerGrade < Clan.RANK_FIRST) || (_powerGrade > Clan.RANK_LAST))
    {
      return;
    }
    Clan clan = activeChar.getClan();
    if (clan == null)
    {
      return;
    }
    if ((activeChar.getClanPrivileges() & Clan.CP_CL_MANAGE_RANKS) == Clan.CP_CL_MANAGE_RANKS)
    {
      UnitMember member = activeChar.getClan().getAnyMember(_name);
      if (member != null)
      {
        if (Clan.isAcademy(member.getPledgeType()))
        {
          activeChar.sendMessage("You cannot change academy member grade.");
          return;
        }
        if (_powerGrade > 5)
        {
          member.setPowerGrade(clan.getAffiliationRank(member.getPledgeType()));
        }
        else
        {
          member.setPowerGrade(_powerGrade);
        }
View Full Code Here

Examples of lineage2.gameserver.model.pledge.Clan

    if (ally == null)
    {
      return;
    }
    int clancount = 0;
    Clan leaderclan = player.getAlliance().getLeader();
    clancount = ClanTable.getInstance().getAlliance(leaderclan.getAllyId()).getMembers().length;
    int[] online = new int[clancount + 1];
    int[] count = new int[clancount + 1];
    Clan[] clans = player.getAlliance().getMembers();
    for (int i = 0; i < clancount; i++)
    {
      online[i + 1] = clans[i].getOnlineMembers(0).size();
      count[i + 1] = clans[i].getAllSize();
      online[0] += online[i + 1];
      count[0] += count[i + 1];
    }
    List<L2GameServerPacket> packets = new ArrayList<>(7 + (5 * clancount));
    packets.add(Msg._ALLIANCE_INFORMATION_);
    packets.add(new SystemMessage(SystemMessage.ALLIANCE_NAME_S1).addString(player.getClan().getAlliance().getAllyName()));
    packets.add(new SystemMessage(SystemMessage.CONNECTION_S1_TOTAL_S2).addNumber(online[0]).addNumber(count[0]));
    packets.add(new SystemMessage(SystemMessage.ALLIANCE_LEADER_S2_OF_S1).addString(leaderclan.getName()).addString(leaderclan.getLeaderName()));
    packets.add(new SystemMessage(SystemMessage.AFFILIATED_CLANS_TOTAL_S1_CLAN_S).addNumber(clancount));
    packets.add(Msg._CLAN_INFORMATION_);
    for (int i = 0; i < clancount; i++)
    {
      packets.add(new SystemMessage(SystemMessage.CLAN_NAME_S1).addString(clans[i].getName()));
View Full Code Here

Examples of lineage2.gameserver.model.pledge.Clan

  public void stopEvent(boolean step)
  {
    spawnAction(COMBAT_FLAGS, false);
    updateParticles(false, ATTACKERS, DEFENDERS);
    broadcastTo(new SystemMessage2(SystemMsg.THE_FORTRESS_BATTLE_OF_S1_HAS_FINISHED).addResidenceName(getResidence()), ATTACKERS, DEFENDERS);
    Clan ownerClan = getResidence().getOwner();
    if (ownerClan != null)
    {
      if (_oldOwner != ownerClan)
      {
        ownerClan.broadcastToOnlineMembers(PlaySound.SIEGE_VICTORY);
        ownerClan.incReputation(1700, false, toString());
        broadcastTo(new SystemMessage2(SystemMsg.S1_IS_VICTORIOUS_IN_THE_FORTRESS_BATTLE_OF_S2).addString(ownerClan.getName()).addResidenceName(getResidence()), ATTACKERS, DEFENDERS);
        getResidence().getOwnDate().setTimeInMillis(System.currentTimeMillis());
        getResidence().startCycleTask();
        spawnEnvoy();
      }
    }
View Full Code Here

Examples of lineage2.gameserver.model.pledge.Clan

   * Method notifyClanMembers.
   * @param activeChar Player
   */
  private static void notifyClanMembers(Player activeChar)
  {
    Clan clan = activeChar.getClan();
    SubUnit subUnit = activeChar.getSubUnit();
    if ((clan == null) || (subUnit == null))
    {
      return;
    }
    UnitMember member = subUnit.getUnitMember(activeChar.getObjectId());
    if (member == null)
    {
      return;
    }
    member.setPlayerInstance(activeChar, false);
    int sponsor = activeChar.getSponsor();
    int apprentice = activeChar.getApprentice();
    L2GameServerPacket msg = new SystemMessage2(SystemMsg.CLAN_MEMBER_S1_HAS_LOGGED_INTO_GAME).addName(activeChar);
    PledgeShowMemberListUpdate memberUpdate = new PledgeShowMemberListUpdate(activeChar);
    for (Player clanMember : clan.getOnlineMembers(activeChar.getObjectId()))
    {
      clanMember.sendPacket(memberUpdate);
      if (clanMember.getObjectId() == sponsor)
      {
        clanMember.sendPacket(new SystemMessage2(SystemMsg.YOUR_APPRENTICE_C1_HAS_LOGGED_OUT).addName(activeChar));
      }
      else if (clanMember.getObjectId() == apprentice)
      {
        clanMember.sendPacket(new SystemMessage2(SystemMsg.YOUR_SPONSOR_C1_HAS_LOGGED_IN).addName(activeChar));
      }
      else
      {
        clanMember.sendPacket(msg);
      }
    }
    activeChar.getClan().startNotifyClanEnterWorld(activeChar);
    if (!activeChar.isClanLeader())
    {
      return;
    }
    ClanHall clanHall = clan.getHasHideout() > 0 ? ResidenceHolder.getInstance().getResidence(ClanHall.class, clan.getHasHideout()) : null;
    if ((clanHall == null) || (clanHall.getAuctionLength() != 0))
    {
      return;
    }
    if (clanHall.getSiegeEvent().getClass() != ClanHallAuctionEvent.class)
    {
      return;
    }
    if (clan.getWarehouse().getCountOf(ItemTemplate.ITEM_ID_ADENA) < clanHall.getRentalFee())
    {
      activeChar.sendPacket(new SystemMessage2(SystemMsg.PAYMENT_FOR_YOUR_CLAN_HALL_HAS_NOT_BEEN_MADE_PLEASE_ME_PAYMENT_TO_YOUR_CLAN_WAREHOUSE_BY_S1_TOMORROW).addLong(clanHall.getRentalFee()));
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.