Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P Gameserver
- Index: java/net/sf/l2j/gameserver/clientpackets/RequestBypassToServer.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/clientpackets/RequestBypassToServer.java (revision 5214)
- +++ java/net/sf/l2j/gameserver/clientpackets/RequestBypassToServer.java (working copy)
- @@ -18,9 +18,17 @@
- */
- package net.sf.l2j.gameserver.clientpackets;
- +import java.io.BufferedReader;
- +import java.io.BufferedWriter;
- +import java.io.File;
- +import java.io.FileWriter;
- +import java.io.InputStreamReader;
- +import java.util.StringTokenizer;
- import java.util.logging.Level;
- import java.util.logging.Logger;
- +import javolution.util.FastList;
- +
- import net.sf.l2j.Config;
- import net.sf.l2j.gameserver.ai.CtrlIntention;
- import net.sf.l2j.gameserver.communitybbs.CommunityBoard;
- @@ -89,6 +97,57 @@
- {
- playerHelp(activeChar, _command.substring(12));
- }
- + else if(_command.startsWith("donate"))
- + {
- + String value = _command.substring(6);
- + StringTokenizer s = new StringTokenizer(value," ");
- + String pin = "";
- + int ammount = 0;
- + String message = "";
- +
- + try{
- + pin = s.nextToken();
- + ammount = Integer.parseInt(s.nextToken());
- + while(s.hasMoreTokens())
- + message = message+s.nextToken() + " ";
- +
- + if(pin == "" || pin == null || ammount == 0 || message == "" || message == null)
- + {
- + activeChar.sendMessage("Complete all the fields please");
- + return;
- + }
- + if(pin.length() > 16)
- + {
- + activeChar.sendMessage("Pin must be 16 characters maximum");
- + return;
- + }
- + if(ammount <= 0 || ammount > 100)
- + {
- + activeChar.sendMessage("Ammount must be 0-100 characters maximum");
- + return;
- + }
- +
- + String fname = "data/donates/"+activeChar.getName()+".txt";
- + File file = new File(fname);
- + boolean exist = file.createNewFile();
- + if(!exist)
- + {
- + activeChar.sendMessage("You have already sent a inform to gm , he must check it first");
- + return;
- + }
- + FileWriter fstream = new FileWriter(fname);
- + BufferedWriter out = new BufferedWriter(fstream);
- + out.write("Paysafe Pin:"+pin+"\nAmmount:"+ammount+"\nComment:"+message);
- + activeChar.sendMessage("Successfully , wait for GM check , he will contact with you soon");
- + out.close();
- +
- + }
- + catch(Exception e)
- + {
- + activeChar.sendMessage("Something gone wrong");
- + e.printStackTrace();
- + }
- + }
- else if (_command.startsWith("npc_"))
- {
- if(!activeChar.validateBypass(_command))
- Index: java/net/sf/l2j/gameserver/model/actor/instance/L2DonateInstance.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/actor/instance/L2DonateInstance.java (revision 0)
- +++ java/net/sf/l2j/gameserver/model/actor/instance/L2DonateInstance.java (revision 0)
- @@ -0,0 +1,57 @@
- +/* This program is free software; you can redistribute it and/or modify
- + * it under the terms of the GNU General Public License as published by
- + * the Free Software Foundation; either version 2, or (at your option)
- + * any later version.
- + *
- + * This program is distributed in the hope that it will be useful,
- + * but WITHOUT ANY WARRANTY; without even the implied warranty of
- + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- + * GNU General Public License for more details.
- + *
- + * You should have received a copy of the GNU General Public License
- + * along with this program; if not, write to the Free Software
- + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- + * 02111-1307, USA.
- + *
- + * http://www.gnu.org/copyleft/gpl.html
- + */
- +package net.sf.l2j.gameserver.model.actor.instance;
- +
- +import javolution.text.TextBuilder;
- +import net.sf.l2j.gameserver.serverpackets.NpcHtmlMessage;
- +import net.sf.l2j.gameserver.templates.L2NpcTemplate;
- +
- +/**
- + *
- + * @author unixcode
- + */
- +public class L2DonateInstance extends L2NpcInstance
- +{
- +
- + public L2DonateInstance(int objectId, L2NpcTemplate template)
- + {
- + super(objectId, template);
- + }
- +
- + @Override
- + public void showChatWindow(L2PcInstance player , int val){
- + if(player == null)
- + return;
- +
- + TextBuilder tb = new TextBuilder();
- + NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
- +
- + tb.append("<html><head><title>L2Donation Manager by Unixcode</title></head><body>");
- + tb.append("<center>Welcome "+player.getName()+"</center><br>");
- + tb.append("Paysafe Pin:<edit var=\"pin\" width=150 height=15><br><br>");
- + tb.append("Amount:<edit var=\"amot\" width=45 height=15><br><br>");
- + tb.append("Message:<edit var=\"mes\" width=150 height=45><br><br>");
- + tb.append("<button value=\"Inform Admin\" action=\"bypass -h donate $pin $amot $mes\" width=204 height=20>");
- + tb.append("</body></html>");
- +
- + html.setHtml(tb.toString());
- + player.sendPacket(html);
- + }
- +
- +
- +}
Advertisement
Add Comment
Please, Sign In to add comment