Jump to content

Mhoska

Legendary Member
  • Posts

    835
  • Credits

  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by Mhoska

  1. Can someone test this and tell us? I just dont have the time now.
  2. so does that mean that this one dont even work? cos those basic modifications were done to make the whole thing work
  3. you could try but some servers need ssl auth and other stuff i didnt add in that code but if you have any problem when you change it just post on help section and ill tell you what you have to do :) like this i think it only works for smtp.live.com and gmail
  4. maybe if morrow i have some free time ill add some configs to make it easier for newbies.
  5. ill do it sec. Updated take a look at the new patch.
  6. oh yeah, it may cause lag. but as i say its a pretty basic idea pussaaaay! haha
  7. is there any difference between yours and this one http://maxcheaters.com/forum/index.php?topic=228475.0 ??
  8. 2 words :( i hate 2 words post, but np i got the point of your post. and thank you :) tyvm :) thanks for your kind words sir :)
  9. owh then is broken ill change it. Changed.
  10. So I was bored and I decide to do something to share it. I'll explain a little: So Basically the player talks to a NPC and he writes a msg with whatever he/she wants to report and this its gonna be sended to the administrator mail, so you can see whatever the report on your smartphone or on your pc or w/e. also you need to put a valid gmail account in order to make this work, it doesnt work with yahoo or any of those, just with gmail you can read that in the code, so read it carefuly while you adding it. You can extend it,its the very basic idea. Created: Today. Credits: Me Thanks to vampir who help me to test the code. ### Eclipse Workspace Patch 1.0 #P L2J_Server Index: java/com/l2jserver/gameserver/model/actor/instance/L2MailReportInstance.java =================================================================== --- java/com/l2jserver/gameserver/model/actor/instance/L2MailReportInstance.java (revision 0) +++ java/com/l2jserver/gameserver/model/actor/instance/L2MailReportInstance.java (revision 0) @@ -0,0 +1,138 @@ +package com.l2jserver.gameserver.model.actor.instance; + +import java.util.Properties; +import java.util.StringTokenizer; + +import javax.mail.Address; +import javax.mail.Message; +import javax.mail.Session; +import javax.mail.Transport; +import javax.mail.internet.InternetAddress; +import javax.mail.internet.MimeMessage; + +import com.l2jserver.gameserver.instancemanager.InstanceManager; +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; + +import javolution.text.TextBuilder; +import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage; +import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate; + +/** + * version v1.1 + * @author Mhoska + */ + +public class L2MailReportInstance extends L2NpcInstance { + + public L2MailReportInstance(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>Reporter For MxC </title></head><body>"); + tb.append("<center>Welcome " + player.getName() + "</center><br>"); + tb.append("<center>This is not a toy If you use this and you arent</center><br>"); + tb.append("<center>really sure of what you re doing</center><br>"); + tb.append("<center>you could get punished</center><br>"); + tb.append("<center></center><br>"); + tb.append("<center></center><br>"); + tb.append("<center>Now Please do your report.</center><br>"); + tb.append("Report:<edit var=\"mes\" width=150 height=45><br><br>"); + tb.append("<button value=\"Send Report\" action=\"bypass -h MailReport $mes\" width=204 height=20>"); + tb.append("</body></html>"); + + html.setHtml(tb.toString()); + player.sendPacket(html); + } + + @Override + @SuppressWarnings("null") + public void onBypassFeedback(L2PcInstance player, String command) + { + if (!canInteract(player)) + return; + if (command.startsWith("MailReport")) { + Long resendtime = InstanceManager.getInstance().getInstanceTime(player.getObjectId(), 99999); + if (System.currentTimeMillis() < resendtime) + { + player.sendMessage("You did a report not too long ago, you gotta wait 24 hours"); + } + else{ + String value = command.substring(6); + StringTokenizer s = new StringTokenizer(value, " "); + String message = ""; + + try { + while (s.hasMoreTokens()) + message = message + s.nextToken() + " "; + + if (message == "" || message == null) { + player.sendMessage("Dont try to send a blank message."); + return; + } + if (message.length() < 30) { + player.sendMessage("You Must write at leas 30 characters."); + return; + } + if (message.length() > 1000) { + player.sendMessage("Maximun 1000 Characters, if you report isn't completed."); + player.sendMessage("please send us a new one."); + return; + } + + try { + //Please use a Gmail email because this smtp is coded based on Gmail + //just add your real email data or this isn't going to work. + //you can set the string to. to any email adress you want to receive the reports. + String MyEmail = "trololo@gmail.com"; + String MyPw = "trololo"; + String to = "dum-beep-email@gmail.com"; + + Properties props = new Properties(); + props.put("mail.smtps.host", "smtp.gmail.com"); + props.put("mail.smtps.auth", "true"); + props.put("mail.transport.protocol", "smtp"); + props.put("mail.debug", "false"); + + Session mailSession = Session.getDefaultInstance(props); + Transport transport = mailSession.getTransport("smtps"); + + InternetAddress fromAddress = new InternetAddress(MyEmail); + InternetAddress toAddress = new InternetAddress(to); + + Message simpleMessage = new MimeMessage(mailSession); + + simpleMessage.setFrom(fromAddress); + simpleMessage.setRecipient(Message.RecipientType.TO, + toAddress); + simpleMessage.setSubject("Ingame Report from:" + + player.getName()); + simpleMessage.setText("The player Report is:" + message); + + transport.connect("smtp.gmail.com", MyEmail, MyPw); + transport.sendMessage(simpleMessage, + new Address[] { toAddress }); + transport.close(); + + InstanceManager.getInstance().setInstanceTime(player.getObjectId(), 99999, ((System.currentTimeMillis() + 86400000))); + + } catch (Exception e) { + System.exit(1); + } + + } catch (Exception e) { + player.sendMessage("Something gone wrong you gotta do your report again"); + e.printStackTrace(); + } + } + super.onBypassFeedback(player, command); + } + } +} \ No newline at end of file v1.1 update I added a delay on the use of the report, 24 hours.
  11. nice share, i mean the best one around you sir got yourself +1 karma.
  12. Im bored i need someone to test a code im gonna share in mxc, who is up to, any client will work. the only thing you need to know is how to click the button Apply Patch in eclipse. any client will work c6 - h5. GOGOGGOGOGO
  13. is posible and it exist, take a loot at l2net private forums or lf videos on youtube, you will see. :)
  14. looks nice, but how about if you announce the question that won the survey and with x amount of votes?
  15. ayeee i see alot of you talkin bout our project but how many of you got a license and updates? ill say noone.
  16. Real developers aint gonna work for free, tryskell is right. p.s: watcha words son.
  17. i dunno about full quests working but we are working atm on retail and custom we got full 7s full dv and loa and those things, if you want more info just send us a email to sales@l2jhidden.com
  18. take a look at http://maxcheaters.com/forum/index.php?topic=233621.0 or just go to www.l2jhidden.com
×
×
  • Create New...