Jump to content

B1ggBoss

Legendary Member
  • Posts

    494
  • Credits

  • Joined

  • Last visited

  • Days Won

    1
  • Feedback

    0%

Everything posted by B1ggBoss

  1. enough, i wont dekarma you guys cuz is a waste of time. Locked
  2. those scripts perform connections to database example Connection con = null; try { con = L2DatabaseFactory.getInstance().getConnection(); // Do stuff... } catch(Exception e) { } and, at the end they dont close the database like this: finally { L2DatabaseFactory.close(con); } or like this finally { try { if(con != null) con.close(); } catch(Exception e) {} }
  3. Blame/off topic is not allowed in this section, you may create a topic at Off Topic board. If this continues, im locking the topic
  4. Npoly creates a zone by joining the vertices you put in the xml files. minZ and maxZ determines the height of the zone. I guess you wanna increase the zone size, for what you should increase the x,y vertices pair
  5. usually, a personal computer isnt enough to run a l2jserver, moreover if you run any l2 client in such computer as well. A probe of that is that local network should have 0 ping and is exhasuted enough to have a 5 ms delay
  6. Folow this: - This link will teach you how to download the source code and how to compile it: http://maxcheaters.com/forum/index.php?topic=81843.0 - This link will teach you how to apply patches like the one i posted above: http://www.l2jserver.com/wiki/Apply_a_Patch
  7. Index: java/com/l2jserver/gameserver/model/olympiad/Olympiad.java =================================================================== --- java/com/l2jserver/gameserver/model/olympiad/Olympiad.java (revision 4868) +++ java/com/l2jserver/gameserver/model/olympiad/Olympiad.java (working copy) @@ -578,8 +578,7 @@ Announcements.getInstance().announceToAll(sm); Calendar currentTime = Calendar.getInstance(); - currentTime.add(Calendar.MONTH, 1); - currentTime.set(Calendar.DAY_OF_MONTH, 1); + currentTime.add(Calendar.WEEK_OF_YEAR, 2); currentTime.set(Calendar.AM_PM, Calendar.AM); currentTime.set(Calendar.HOUR, 12); currentTime.set(Calendar.MINUTE, 0);
  8. http://maxcheaters.com/forum/index.php?topic=220125.0 to Dev Help [EN]
  9. try editing it in database while server is off
  10. for last revision l2jserver trunk Clan message w/o community board core Index: java/com/l2jserver/gameserver/model/L2Clan.java =================================================================== --- java/com/l2jserver/gameserver/model/L2Clan.java (revision 4874) +++ java/com/l2jserver/gameserver/model/L2Clan.java (working copy) @@ -51,6 +51,7 @@ import com.l2jserver.gameserver.network.serverpackets.ExSubPledgeSkillAdd; import com.l2jserver.gameserver.network.serverpackets.ItemList; import com.l2jserver.gameserver.network.serverpackets.L2GameServerPacket; +import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jserver.gameserver.network.serverpackets.PledgeReceiveSubPledgeCreated; import com.l2jserver.gameserver.network.serverpackets.PledgeShowInfoUpdate; import com.l2jserver.gameserver.network.serverpackets.PledgeShowMemberListAll; @@ -174,6 +175,8 @@ private boolean _noticeEnabled = false; private static final int MAX_NOTICE_LENGTH = 8192; + private String _clanMessage; // Non community board message + /** * Called if a clan is referenced only by id. * In this case all other data needs to be fetched from db @@ -772,7 +775,7 @@ try { con = L2DatabaseFactory.getInstance().getConnection(); - statement = con.prepareStatement("UPDATE clan_data SET leader_id=?,ally_id=?,ally_name=?,reputation_score=?,ally_penalty_expiry_time=?,ally_penalty_type=?,char_penalty_expiry_time=?,dissolving_expiry_time=? WHERE clan_id=?"); + statement = con.prepareStatement("UPDATE clan_data SET leader_id=?,ally_id=?,ally_name=?,reputation_score=?,ally_penalty_expiry_time=?,ally_penalty_type=?,char_penalty_expiry_time=?,dissolving_expiry_time=?, clan_message=? WHERE clan_id=?"); statement.setInt(1, getLeaderId()); statement.setInt(2, getAllyId()); statement.setString(3, getAllyName()); @@ -781,7 +784,8 @@ statement.setInt(6, getAllyPenaltyType()); statement.setLong(7, getCharPenaltyExpiryTime()); statement.setLong(8, getDissolvingExpiryTime()); - statement.setInt(9, getClanId()); + statement.setString(9, getClanMessage()); + statement.setInt(10, getClanId()); statement.execute(); if (Config.DEBUG) _log.fine("New clan leader saved in db: " + getClanId()); @@ -900,7 +904,7 @@ L2ClanMember member; con = L2DatabaseFactory.getInstance().getConnection(); - PreparedStatement statement = con.prepareStatement("SELECT clan_name,clan_level,hasCastle,ally_id,ally_name,leader_id,crest_id,crest_large_id,ally_crest_id,reputation_score,auction_bid_at,ally_penalty_expiry_time,ally_penalty_type,char_penalty_expiry_time,dissolving_expiry_time FROM clan_data where clan_id=?"); + PreparedStatement statement = con.prepareStatement("SELECT clan_name,clan_level,hasCastle,ally_id,ally_name,leader_id,crest_id,crest_large_id,ally_crest_id,reputation_score,auction_bid_at,ally_penalty_expiry_time,ally_penalty_type,char_penalty_expiry_time,dissolving_expiry_time,clan_message FROM clan_data where clan_id=?"); statement.setInt(1, getClanId()); ResultSet clanData = statement.executeQuery(); @@ -930,6 +934,8 @@ setReputationScore(clanData.getInt("reputation_score"), false); setAuctionBiddedAt(clanData.getInt("auction_bid_at"), false); + setMessage(clanData.getString("clan_message")); + int leaderId = (clanData.getInt("leader_id")); PreparedStatement statement2 = con.prepareStatement("SELECT char_name,level,classid,charId,title,power_grade,subpledge,apprentice,sponsor,sex,race FROM characters WHERE clanid=?"); @@ -2835,4 +2841,45 @@ } } } + + public String getClanMessage() + { + return _clanMessage; + } + + public void setMessage(final String message) + { + _clanMessage = message; + } + + public void sendEditWindow(final L2PcInstance leader) + { + try + { + NpcHtmlMessage msg = new NpcHtmlMessage(5); + msg.setFile(null, "data/html/changeclanmsg.htm"); + msg.replace("%defaultText%", getClanMessage() != null && !getClanMessage().isEmpty()? + getClanMessage() : ""); + leader.sendPacket(msg); + } + catch(NullPointerException npe) + { + _log.warning("L2Clan: Could not find the edit clan message html! : data/html/changeclanmsg.htm"); + } + } + + public void sendClanMessage(final L2PcInstance member) + { + try + { + NpcHtmlMessage msg = new NpcHtmlMessage(5); + msg.setFile(null, "data/html/clanmessage.htm"); + msg.replace("%message%", getClanMessage()); + member.sendPacket(msg); + } + catch(NullPointerException npe) + { + _log.warning("L2Clan: Could not find the clan message html!: data/html/clanmessage.htm"); + } + } } Index: java/com/l2jserver/gameserver/network/clientpackets/EnterWorld.java =================================================================== --- java/com/l2jserver/gameserver/network/clientpackets/EnterWorld.java (revision 4874) +++ java/com/l2jserver/gameserver/network/clientpackets/EnterWorld.java (working copy) @@ -195,6 +195,10 @@ { activeChar.sendPacket(new PledgeSkillList(activeChar.getClan())); + final String clanMessage = activeChar.getClan().getClanMessage(); + if(clanMessage != null && !clanMessage.isEmpty()) + activeChar.getClan().sendClanMessage(activeChar); + notifyClanMembers(activeChar); notifySponsorOrApprentice(activeChar); Index: java/com/l2jserver/gameserver/network/clientpackets/RequestBypassToServer.java =================================================================== --- java/com/l2jserver/gameserver/network/clientpackets/RequestBypassToServer.java (revision 4874) +++ java/com/l2jserver/gameserver/network/clientpackets/RequestBypassToServer.java (working copy) @@ -27,6 +27,7 @@ import com.l2jserver.gameserver.handler.IAdminCommandHandler; import com.l2jserver.gameserver.handler.IBypassHandler; import com.l2jserver.gameserver.model.L2CharPosition; +import com.l2jserver.gameserver.model.L2Clan; import com.l2jserver.gameserver.model.L2Object; import com.l2jserver.gameserver.model.L2World; import com.l2jserver.gameserver.model.actor.L2Npc; @@ -241,6 +242,33 @@ Hero.getInstance().showHeroDiary(player, heroclass, heroid, heropage); } } + else if(_command.startsWith("editClanNotice")) + { + if(!activeChar.isClanLeader()) + { + activeChar.sendMessage("You must be a clan leader to change such text!"); + return; + } + String msg = _command.substring(15); + if(msg.length() > 100) + { + activeChar.sendMessage("The text cannot be over 100 characters lenght"); + activeChar.getClan().sendEditWindow(activeChar); + return; + } + final L2Clan clan = activeChar.getClan(); + clan.setMessage(msg); + if(msg != null && !msg.isEmpty()) // Update notice for online members + { + for(L2PcInstance mem : clan.getOnlineMembers(0)) + { + if(mem != null) + clan.sendClanMessage(mem); + } + } + } else { final IBypassHandler handler = BypassHandler.getInstance().getBypassHandler(_command); DP Index: data/html/changeclanmsg.htm =================================================================== --- data/html/changeclanmsg.htm (revision 0) +++ data/html/changeclanmsg.htm (revision 0) @@ -0,0 +1,23 @@ +<html> +<title>Clan Message Editor</title> +<body> +Here you will be able to edit your clan's MOTD. Enter the text in the <font color=LEVEL>above box</font> and press <font color=LEVEL>"Set Text"</font> +<br> +<center> +Current Message +<br> +<font color="2E9AFE"> +%defaultText% +</font> +<br><br> +<center> +<font color="FF0000">NOTE: If you enter an empty text, no page will pop up for clan members.</font> +<br> +MAX: 100 characters +<br> +<MultiEdit var="textbox" width=240 height=100> +<br> +<a action="bypass -h editClanNotice $textbox">Set Text</a> +</center> +</body> +</html> \ No newline at end of file Index: data/html/clanmessage.htm =================================================================== --- data/html/clanmessage.htm (revision 0) +++ data/html/clanmessage.htm (revision 0) @@ -0,0 +1,8 @@ +<html> +<title>Clan Message</title> +<center> +Here is the message of your clan: +<br> +%message% +</body> +</html> \ No newline at end of file Index: data/scripts/handlers/voicedcommandhandlers/ClanMessage.java =================================================================== --- data/scripts/handlers/voicedcommandhandlers/ClanMessage.java (revision 0) +++ data/scripts/handlers/voicedcommandhandlers/ClanMessage.java (revision 0) @@ -0,0 +1,31 @@ +/** + * + */ +package handlers.voicedcommandhandlers; + +import com.l2jserver.gameserver.handler.IVoicedCommandHandler; +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; + +/** + * @author BiggBoss + */ +public final class ClanMessage implements IVoicedCommandHandler +{ + private final String[] CMD = {"editClanMessage"}; + + @Override + public boolean useVoicedCommand(String command, L2PcInstance activeChar, String params) + { + if(!activeChar.isClanLeader()) + return false; + + activeChar.getClan().sendEditWindow(activeChar); + return true; + } + + @Override + public String[] getVoicedCommandList() + { + return CMD; + } +} Index: data/scripts/handlers/MasterHandler.java =================================================================== --- data/scripts/handlers/MasterHandler.java (revision 8319) +++ data/scripts/handlers/MasterHandler.java (working copy) @@ -243,6 +243,7 @@ import handlers.usercommandhandlers.Time; import handlers.voicedcommandhandlers.Banking; import handlers.voicedcommandhandlers.ChatAdmin; +import handlers.voicedcommandhandlers.ClanMessage; import handlers.voicedcommandhandlers.Debug; import handlers.voicedcommandhandlers.Lang; import handlers.voicedcommandhandlers.TvTVoicedInfo; @@ -552,6 +553,7 @@ VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new Lang()); if (Config.L2JMOD_DEBUG_VOICE_COMMAND) VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new Debug()); + VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new ClanMessage()); _log.config("Loaded " + VoicedCommandHandler.getInstance().size() + " VoicedHandlers"); } Index: dist/sql/server/clan_data.sql =================================================================== --- dist/sql/server/clan_data.sql (revision 8319) +++ dist/sql/server/clan_data.sql (working copy) @@ -15,6 +15,7 @@ `ally_penalty_type` DECIMAL( 1 ) NOT NULL DEFAULT 0, `char_penalty_expiry_time` bigint(13) unsigned NOT NULL DEFAULT '0', `dissolving_expiry_time` bigint(13) unsigned NOT NULL DEFAULT '0', + `clan_message` varchar(100), -- 100 = text lenght PRIMARY KEY (`clan_id`), KEY `leader_id` (`leader_id`), KEY `ally_id` (`ally_id`)
  11. yes, 192.168.1.1 is a reserver address and will never be attached to any computer connected to the local network
  12. to open ports just: Go to your local network management ( http://192.168.0.1 or http://192.168.1.1 ) It will ask for an username and a password Then, look for the port forwarding setting. If you are using a router, you must open the ports for your lan ip (which is the form of 192.168.x.x ). Open ports 2106 and 7777, both TCP and UDP. If gameserver and loginserver are in different machines, open 9014 as well. Now, save settings Reset your modem/router Once your modem/router is back to life, check your external ip (it could change due the restart) and place in the proper config files
  13. Posting in twitter and then announce in l2j or announce in l2j and then posting in twitter?
  14. 1) My code cannot throw such errors about cast exceptions since im not using any other object to be casted to L2PcInstance than the original one 2) You wrotte double checks of the same thing (like team2 member) 3) So, as i understand from your code, the guards should attack those players inside castle zone which are from different faction than the castle owner?
  15. i did not understand much well what you explain, but sounds a crappy code. All you have to do is replace the 1000 pvps check by the character faction and the zone faction owner. If they are different, attack
×
×
  • Create New...