Jump to content

Recommended Posts

Posted

Hello,since today i stay at home i decided to do 2 simple codes.

I took the idea from www.l2seraph.eu

This will announce to all instead of admin only,if any account got banned and if any player jailed

### Eclipse Workspace Patch 1.0
#P L2_GameServer_It
Index: java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminBan.java
===================================================================
--- java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminBan.java	(revision 57)
+++ java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminBan.java	(working copy)
@@ -25,6 +25,7 @@
import java.util.StringTokenizer;

import net.sf.l2j.Config;
+import net.sf.l2j.gameserver.Announcements;
import net.sf.l2j.L2DatabaseFactory;
import net.sf.l2j.gameserver.LoginServerThread;
import net.sf.l2j.gameserver.communitybbs.Manager.RegionBBSManager;
@@ -88,7 +89,8 @@
				account_name = plyr.getAccountName();
				RegionBBSManager.getInstance().changeCommunityBoard();
				plyr.logout();
-				activeChar.sendMessage("Account "+account_name+" banned.");
+				Announcements.getInstance().announceToAll("Account "+account_name+" banned");
+				
			}
		}
		else if (command.startsWith("admin_unban"))
@@ -125,7 +127,7 @@
				if (playerObj != null)
				{
					playerObj.setInJail(true, delay);
-					activeChar.sendMessage("Character "+player+" jailed for "+(delay>0 ? delay+" minutes." : "ever!"));
+					Announcements.getInstance().announceToAll("Character "+player+" jailed for "+(delay>0 ? delay+" minutes." : "ever!"));
				}
				else
					jailOfflinePlayer(activeChar, player, delay);

and this one(i guess you will find it more impressive)

will show the server time(I mean,the day,the month,the time) when char logged in.

### Eclipse Workspace Patch 1.0
#P L2_GameServer_It
Index: java/net/sf/l2j/Config.java
===================================================================
--- java/net/sf/l2j/Config.java	(revision 80)
+++ java/net/sf/l2j/Config.java	(working copy)
@@ -1005,6 +1005,9 @@
    public static boolean NOBLESSE_ITEM_LEVEL_RESTRICTION;
    public static boolean NOBLESSE_ITEM_SUBCLASS_RESTRICTION;
    public static boolean NOBLESSE_ITEM_ENABLED;
+    
+    /** Server time*/
+    public static boolean SHOW_SERVER_TIME;
       
    /** Custom Tittle When new char Login */
    public static boolean CHAR_TITLE;
@@ -2124,6 +2127,10 @@
                /** hero weaps enchant */
                ENCHANT_HERO_WEAPONS                                = Boolean.parseBoolean(L2JModSettings.getProperty("EnchantHeroWeapons", "False")); 
                
+                /** Server time */
+                
+                SHOW_SERVER_TIME                                    = Boolean.parseBoolean(L2JModSettings.getProperty("ShowServerTime", "True"));
+                
                /** Noblesse Custom Item */
                NOBLESSE_ITEM_ID						= Integer.parseInt(L2JModSettings.getProperty("NoblesseItemId", "6673"));
                NOBLESSE_ITEM_LEVEL_RESTRICTION			= Boolean.parseBoolean(L2JModSettings.getProperty("NoblesseItemLvlRestriction", "True"));
Index: java/config/l2jmods.properties
===================================================================
--- java/config/l2jmods.properties	(revision 84)
+++ java/config/l2jmods.properties	(working copy)
@@ -387,4 +387,7 @@
# Alternative damage for dagger skills.
DaggerVSHeavy = 2.50
DaggerVSRobe = 1.80
-DaggerVSLight = 2.00
\ No newline at end of file
+DaggerVSLight = 2.00
+
+#Show Server Time when char logged in?
+ShowServerTime = True
\ No newline at end of file
Index: java/net/sf/l2j/gameserver/clientpackets/EnterWorld.java
===================================================================
--- java/net/sf/l2j/gameserver/clientpackets/EnterWorld.java	(revision 84)
+++ java/net/sf/l2j/gameserver/clientpackets/EnterWorld.java	(working copy)
@@ -22,10 +22,12 @@
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.logging.Logger;
+import java.util.Date;

import net.sf.l2j.Base64;
import net.sf.l2j.Config;
import net.sf.l2j.L2DatabaseFactory;
+import net.sf.l2j.gameserver.GameTimeController;
import net.sf.l2j.gameserver.Announcements;
import net.sf.l2j.gameserver.GmListTable;
import net.sf.l2j.gameserver.LoginServerThread;
@@ -256,6 +258,18 @@
                        activeChar.sendPacket(ni);
                           }
                
+                     if (Config.SHOW_SERVER_TIME)
+                     {
+                        int t = GameTimeController.getInstance().getGameTime();
+                		String h = "" + (t / 60) % 24;
+                		String m;
+                		if (t % 60 < 10)
+                			m = "0" + t % 60;
+                		else
+                			m = "" + t % 60;
+                        activeChar.sendMessage("SVR time is " + (new Date(System.currentTimeMillis())));		
+                     }
+                        
        if (Config.ANNOUNCE_HERO_LOGIN)
        {
        	if (activeChar.isHero())

 

Hope you like it all,

>.>

Posted

Well nice mods, thanks.The second one is cool. I think the first one will be better if you can do it kinda different, I mean with a config too. nvm I will try it.

Posted

Well nice mods, thanks.The second one is cool. I think the first one will be better if you can do it kinda different, I mean with a config too. nvm I will try it.

Aprreciate!

Yes ok i know its better with configs(for 1th i mean)but ok

thanks

Thanks for share man.

thanks
Posted

Well nice mods, thanks.The second one is cool. I think the first one will be better if you can do it kinda different, I mean with a config too. nvm I will try it.

Guest
This topic is now closed to further replies.


  • Posts

    • We've added 5% discounts for bulk purchases of Google accounts for orders of 300 or more, and 10% for orders of 500 or more. The discount is applied automatically when you place your order! The discount is indicated in the product title and description for each category.  
    • 🎄 CHRISTMAS EVENT 🎄   ‼️ Information and details: https://forum.l2harbor.com/threads/rozhdestvenskie-xlopoty-christmas-chores.9430/post-171464
    • METATG.ORG Direct Telegram Service Provider A bonus of +7% on every order! *We add 7% more followers than your ordered amount to proactively cover potential drops and guarantee you an honest result." Telegram Followers - Price per 1000 SUBSCRIBERS Subscribers 3 days - $0.10 ~ 8 RUB Subscribers. Daily Completion: 200,000,000 Subscribers 7 days - $0.17 ~ 13.6 RUB Subscribers. Daily Completion: 200,000,000 Subscribers 14 days - $0.20 ~ 16 RUB Subscribers. Daily Completion: 200,000,000 Subscribers 30 days - $0.30 ~ 24 RUB Subscribers. Daily Completion: 200,000,000 Subscribers 60 days - $0.40 ~ 32 RUB Subscribers, 14-day guarantee. Daily Completion: 200,000,000 Subscribers 90 days (Super Fast) - $0.50 ~ 40 RUB Subscribers, 14-day guarantee. Daily Completion: 200,000,000 Subscribers 120 days (Super Fast) - $0.60 ~ 48 RUB Subscribers, 14-day guarantee. Daily Completion: 200,000,000 Subscribers Lifetime (Super Fast) - $0.70 ~ 56 RUB Lifetime Subscribers. 14-day guarantee. Daily Completion: 200,000,000 Telegram Services - Price per 1000 Post Views - $0.06 ~ 5 RUB Reactions - $0.08 ~ 6.5 RUB Bot Starts - $0.10 ~ 8 RUB Bot Starts with referrals - $0.15 ~ 12 RUB DISCOUNTS and CASHBACK for large volumes Direct Supplier. We work from our own accounts with our own software! High execution speed. Multiple payment methods. We work 24/7! Additional discounts are discussed for volumes starting from $1000 per day. SUPPORT 24/7 - TELEGRAM WEBSITE 24/7 - METATG.ORG
    • Added: a brand-new default dashboard template. You can now add multiple game/login server builds. Full support for running both PTS & L2J servers simultaneously, with switching between them. Payment systems: added OmegaPay and Pally (new PayPal-style API). Account history now stores everything: donations, items delivered to characters, referrals, transfers between game accounts, and coin transfers to another master account. Personal Promo Code System: you can create a promo code and assign it to a user or promoter. When donating, a player can enter this promo code to receive bonus coins, and the promo code owner also receives a bonus — all fully configurable in the admin panel.     Look demo site: demo
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock