Examples of ShowBoard


Examples of lineage2.gameserver.network.serverpackets.ShowBoard

      String page = st.nextToken();
      html = HtmCache.getInstance().getNotNull("scripts/services/community/bbs_memo_edit.htm", player);
      html = html.replace("%page%", page);
      html = html.replace("%memo_id%", "0");
      html = html.replace("%TREE%", " > Create a record?");
      player.sendPacket(new ShowBoard(html, "1001", player));
      List<String> args = new ArrayList<>();
      args.add("0");
      args.add("0");
      args.add("0");
      args.add("0");
      args.add("0");
      args.add("0");
      args.add("");
      args.add("0");
      args.add("");
      args.add("0");
      args.add("");
      args.add("");
      args.add("");
      args.add("1970-01-01 00:00:00 ");
      args.add("1970-01-01 00:00:00 ");
      args.add("0");
      args.add("0");
      args.add("");
      player.sendPacket(new ShowBoard(args));
      return;
    }
    else if ("mmread".equals(cmd))
    {
      int memoId = Integer.parseInt(st.nextToken());
      String page = st.nextToken();
      Connection con = null;
      PreparedStatement statement = null;
      ResultSet rset = null;
      try
      {
        con = DatabaseFactory.getInstance().getConnection();
        statement = con.prepareStatement("SELECT * FROM `bbs_memo` WHERE `account_name` = ? and memo_id = ?");
        statement.setString(1, player.getAccountName());
        statement.setInt(2, memoId);
        rset = statement.executeQuery();
        if (rset.next())
        {
          String post = HtmCache.getInstance().getNotNull("scripts/services/community/bbs_memo_read.htm", player);
          post = post.replace("%title%", rset.getString("title"));
          post = post.replace("%char_name%", rset.getString("char_name"));
          post = post.replace("%post_date%", String.format("%1$tY-%1$tm-%1$te %1$tH:%1tM:%1$tS", new Date(rset.getInt("post_date") * 1000L)));
          post = post.replace("%memo%", rset.getString("memo").replace("\n", "<br1>"));
          post = post.replace("%page%", page);
          post = post.replace("%memo_id%", String.valueOf(memoId));
          ShowBoard.separateAndSend(post, player);
          return;
        }
      }
      catch (Exception e)
      {
      }
      finally
      {
        DbUtils.closeQuietly(con, statement, rset);
      }
      onBypassCommand(player, "_bbsmemo");
      return;
    }
    else if ("mmdele".equals(cmd))
    {
      int memoId = Integer.parseInt(st.nextToken());
      Connection con = null;
      PreparedStatement statement = null;
      try
      {
        con = DatabaseFactory.getInstance().getConnection();
        statement = con.prepareStatement("DELETE FROM `bbs_memo` WHERE `account_name` = ? and memo_id = ?");
        statement.setString(1, player.getAccountName());
        statement.setInt(2, memoId);
        statement.execute();
      }
      catch (Exception e)
      {
      }
      finally
      {
        DbUtils.closeQuietly(con, statement);
      }
      onBypassCommand(player, "_mmlist_1");
      return;
    }
    else if ("mmmodi".equals(cmd))
    {
      int memoId = Integer.parseInt(st.nextToken());
      String page = st.nextToken();
      Connection con = null;
      PreparedStatement statement = null;
      ResultSet rset = null;
      try
      {
        con = DatabaseFactory.getInstance().getConnection();
        statement = con.prepareStatement("SELECT * FROM `bbs_memo` WHERE `account_name` = ? and memo_id = ?");
        statement.setString(1, player.getAccountName());
        statement.setInt(2, memoId);
        rset = statement.executeQuery();
        if (rset.next())
        {
          html = HtmCache.getInstance().getNotNull("scripts/services/community/bbs_memo_edit.htm", player);
          html = html.replace("%page%", page);
          html = html.replace("%memo_id%", String.valueOf(memoId));
          html = html.replace("%TREE%", "&nbsp;>&nbsp;<a action=\"bypass _mmread_" + memoId + "_" + page + "\">Note: " + rset.getString("title") + "</a>&nbsp;>&nbsp;Editing");
          player.sendPacket(new ShowBoard(html, "1001", player));
          List<String> args = new ArrayList<>();
          args.add("0");
          args.add("0");
          args.add(String.valueOf(memoId));
          args.add("0");
          args.add("0");
          args.add("0");
          args.add(player.getName());
          args.add("0");
          args.add(player.getAccountName());
          args.add("0");
          args.add(rset.getString("title"));
          args.add(rset.getString("title"));
          args.add(rset.getString("memo"));
          args.add(String.format("%1$tY-%1$tm-%1$te %1$tH:%1tM:%1$tS", new Date(rset.getInt("post_date") * 1000L)));
          args.add(String.format("%1$tY-%1$tm-%1$te %1$tH:%1tM:%1$tS", new Date(rset.getInt("post_date") * 1000L)));
          args.add("0");
          args.add("0");
          args.add("");
          player.sendPacket(new ShowBoard(args));
          return;
        }
      }
      catch (Exception e)
      {
View Full Code Here

Examples of lineage2.gameserver.network.serverpackets.ShowBoard

      args.add("");
      args.add("");
      args.add("0");
      args.add("0");
      args.add("");
      player.sendPacket(new ShowBoard(html, "1001", player));
      player.sendPacket(new ShowBoard(args));
    }
    else if ("mailwritepledgeform".equals(cmd))
    {
      Clan clan = player.getClan();
      if ((clan == null) || (clan.getLevel() < 2) || !player.isClanLeader())
      {
        onBypassCommand(player, "_clbbsclan_" + player.getClanId());
        return;
      }
      String html = HtmCache.getInstance().getNotNull(Config.BBS_HOME_DIR + "bbs_pledge_mail_write.htm", player);
      html = html.replace("%PLEDGE_ID%", String.valueOf(clan.getClanId()));
      html = html.replace("%pledge_id%", String.valueOf(clan.getClanId()));
      html = html.replace("%pledge_name%", clan.getName());
      ShowBoard.separateAndSend(html, player);
    }
    else if ("announcepledgewriteform".equals(cmd))
    {
      Clan clan = player.getClan();
      if ((clan == null) || (clan.getLevel() < 2) || !player.isClanLeader())
      {
        onBypassCommand(player, "_clbbsclan_" + player.getClanId());
        return;
      }
      HashMap<Integer, String> tpls = Util.parseTemplate(HtmCache.getInstance().getNotNull(Config.BBS_HOME_DIR + "bbs_clanannounce.htm", player));
      String html = tpls.get(0);
      html = html.replace("%PLEDGE_ID%", String.valueOf(clan.getClanId()));
      html = html.replace("%ACTION_ANN%", "");
      html = html.replace("%ACTION_FREE%", "");
      Connection con = null;
      PreparedStatement statement = null;
      ResultSet rset = null;
      String notice = "";
      int type = 0;
      try
      {
        con = DatabaseFactory.getInstance().getConnection();
        statement = con.prepareStatement("SELECT * FROM `bbs_clannotice` WHERE `clan_id` = ? and type != 2");
        statement.setInt(1, clan.getClanId());
        rset = statement.executeQuery();
        if (rset.next())
        {
          notice = rset.getString("notice");
          type = rset.getInt("type");
        }
      }
      catch (Exception e)
      {
      }
      finally
      {
        DbUtils.closeQuietly(con, statement, rset);
      }
      if (type == 0)
      {
        html = html.replace("<?usage?>", tpls.get(1));
      }
      else
      {
        html = html.replace("<?usage?>", tpls.get(2));
      }
      html = html.replace("%flag%", String.valueOf(type));
      List<String> args = new ArrayList<>();
      args.add("0");
      args.add("0");
      args.add("0");
      args.add("0");
      args.add("0");
      args.add("0");
      args.add("");
      args.add("0");
      args.add("");
      args.add("0");
      args.add("");
      args.add("");
      args.add(notice);
      args.add("");
      args.add("");
      args.add("0");
      args.add("0");
      args.add("");
      player.sendPacket(new ShowBoard(html, "1001", player));
      player.sendPacket(new ShowBoard(args));
    }
    else if ("announcepledgeswitchshowflag".equals(cmd))
    {
      Clan clan = player.getClan();
      if ((clan == null) || (clan.getLevel() < 2) || !player.isClanLeader())
View Full Code Here

Examples of net.sf.l2j.gameserver.serverpackets.ShowBoard

      int idp = Integer.parseInt(st.nextToken());
      showEditPost((TopicBBSManager.getInstance().getTopicByID(idt)),ForumsBBSManager.getInstance().getForumByID(idf),activeChar,idp);
    }
    else
    {
      ShowBoard sb = new ShowBoard("<html><body><br><br><center>the command: "+command+" is not implemented yet</center><br><br></body></html>","101");
      activeChar.sendPacket(sb);
      activeChar.sendPacket(new ShowBoard(null,"102"));
      activeChar.sendPacket(new ShowBoard(null,"103"));
    }
  }
View Full Code Here

Examples of net.sf.l2j.gameserver.serverpackets.ShowBoard

  private void showEditPost(Topic topic, Forum forum, L2PcInstance activeChar, int idp)
  {
    Post p = getGPosttByTopic(topic);
    if((forum == null)||(topic == null)||(p == null))
    {
      ShowBoard sb = new ShowBoard("<html><body><br><br><center>Error, this forum, topic or post does not exit !</center><br><br></body></html>","101");
      activeChar.sendPacket(sb);
      activeChar.sendPacket(new ShowBoard(null,"102"));
      activeChar.sendPacket(new ShowBoard(null,"103"));
    }
    else
    {
      showHtmlEditPost(topic,activeChar,forum,p);
    }
View Full Code Here

Examples of net.sf.l2j.gameserver.serverpackets.ShowBoard

   */
  private void showPost(Topic topic, Forum forum, L2PcInstance activeChar, int ind)
  {
    if((forum == null)||(topic == null))
    {
      ShowBoard sb = new ShowBoard("<html><body><br><br><center>Error, this forum is not implemented yet</center><br><br></body></html>","101");
      activeChar.sendPacket(sb);
      activeChar.sendPacket(new ShowBoard(null,"102"));
      activeChar.sendPacket(new ShowBoard(null,"103"));
    }
    else if(forum.getType() == Forum.MEMO)
    {
      showMemoPost(topic,activeChar,forum);
    }
    else
    {
      ShowBoard sb = new ShowBoard("<html><body><br><br><center>the forum: "+forum.getName()+" is not implemented yet</center><br><br></body></html>","101");
      activeChar.sendPacket(sb);
      activeChar.sendPacket(new ShowBoard(null,"102"));
      activeChar.sendPacket(new ShowBoard(null,"103"));
    }
  }
View Full Code Here

Examples of net.sf.l2j.gameserver.serverpackets.ShowBoard

    int idp = Integer.parseInt(st.nextToken());

    Forum f = ForumsBBSManager.getInstance().getForumByID(idf);
    if(f == null)
    {
      ShowBoard sb = new ShowBoard("<html><body><br><br><center>the forum: "+idf+" does not exist !</center><br><br></body></html>","101");
      activeChar.sendPacket(sb);
      activeChar.sendPacket(new ShowBoard(null,"102"));
      activeChar.sendPacket(new ShowBoard(null,"103"));
    }
    else
    {
      Topic t = f.gettopic(idt);
      if(t == null)
      {
        ShowBoard sb = new ShowBoard("<html><body><br><br><center>the topic: "+idt+" does not exist !</center><br><br></body></html>","101");
        activeChar.sendPacket(sb);
        activeChar.sendPacket(new ShowBoard(null,"102"));
        activeChar.sendPacket(new ShowBoard(null,"103"));
      }
      else
      {
        CPost cp = null;
        Post p = getGPosttByTopic(t);
        if(p != null)
        {
          cp = p.getCPost(idp);
        }
        if(cp == null)
        {
          ShowBoard sb = new ShowBoard("<html><body><br><br><center>the post: "+idp+" does not exist !</center><br><br></body></html>","101");
          activeChar.sendPacket(sb);
          activeChar.sendPacket(new ShowBoard(null,"102"));
          activeChar.sendPacket(new ShowBoard(null,"103"));
        }
        else
        {
          p.getCPost(idp).postTxt = ar4;
          p.updatetxt(idp);
View Full Code Here

Examples of net.sf.l2j.gameserver.serverpackets.ShowBoard

      separateAndSend("<html><body><br><br><center>This Page is only an exemple :)<br><br>command="+command+"</center></body></html>",activeChar);
    }
    else
    {

      ShowBoard sb = new ShowBoard("<html><body><br><br><center>the command: "+command+" is not implemented yet</center><br><br></body></html>","101");
      activeChar.sendPacket(sb);
      activeChar.sendPacket(new ShowBoard(null,"102"));
      activeChar.sendPacket(new ShowBoard(null,"103"));
    }

  }
View Full Code Here

Examples of net.sf.l2j.gameserver.serverpackets.ShowBoard

      {
        showOldCommunity(activeChar, 1);
      }
      else
      {
          ShowBoard sb = new ShowBoard("<html><body><br><br><center>the command: "+command+" is not implemented yet</center><br><br></body></html>","101");
          activeChar.sendPacket(sb);
          activeChar.sendPacket(new ShowBoard(null,"102"));
          activeChar.sendPacket(new ShowBoard(null,"103"));
      }
    }
  }
View Full Code Here

Examples of net.sf.l2j.gameserver.serverpackets.ShowBoard

            htmlCode.append("</body></html>");
            separateAndSend(htmlCode.toString(),activeChar);
    }
    else
    {
      ShowBoard sb = new ShowBoard("<html><body><br><br><center>No player with name "+name+"</center><br><br></body></html>","101");
      activeChar.sendPacket(sb);
      activeChar.sendPacket(new ShowBoard(null,"102"));
      activeChar.sendPacket(new ShowBoard(null,"103"));
    }
  }
View Full Code Here

Examples of net.sf.l2j.gameserver.serverpackets.ShowBoard

              // ignore
      }
    }
    else
    {
      ShowBoard sb = new ShowBoard("<html><body><br><br><center>the command: "+ar1+" is not implemented yet</center><br><br></body></html>","101");
      activeChar.sendPacket(sb);
      activeChar.sendPacket(new ShowBoard(null,"102"));
      activeChar.sendPacket(new ShowBoard(null,"103"));
    }

  }
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.