Jump to content

Recommended Posts

Posted

This code will paralyze all the players before the server restarts (15 seconds before the server restarts/shuts down by default but you can change it), and unparalyze them if the server restart is cancelled.

 

I create this because many ppl when server restarted or shutdown they cheat such us safe enchanting,buffs stucking and more

 

So the code is the following:

 

 

 

 

 

Index: D:/#PROJECT/l2jserver_IntGS_Clean/java/net/sf/l2j/gameserver/Shutdown.java

===================================================================

--- D:/#PROJECT/l2jserver_IntGS_Clean/java/net/sf/l2j/gameserver/Shutdown.java

+++ D:/Workspace/GameServer_Clean/java/net/sf/l2j/gameserver/Shutdown.java

@@ -52,8 +52,35 @@

public static final int GM_RESTART = 2;

public static final int ABORT = 3;

private static String[] _modeText = {"SIGTERM", "shutting down", "restarting", "aborting"};

-   

    /**

+    * Don't allow players to do anything while server is Restarting/Shuting down

+    * this way they won't be able tu use any exploit during restart procedure.

+    */

+    private void paralyzeAllCharacters()

+    {

+    for (L2PcInstance player : L2World.getInstance().getAllPlayers())

+    {

+    //Stop movement for every character connected

+    player.setTarget(null); // Delete it's target

+    player.stopMove(null); // Stop it's movement

+    player.setIsParalyzed(true); // Deny movement

+    player.setIsInvul(true); // Make it invul (this way they won't get killed by a mob)

+    }

+    }

+    /**

+    * Allow players to move again and erase their invul status

+    */

+    private void unparalyzeAllCharacters ()

+    {

+    for (L2PcInstance player: L2World.getInstance().getAllPlayers())

+    {

+    //Restore movement for every char connected

+    player.setIsParalyzed(false); //Unparalize

+    player.setIsInvul(false); //Make vulnerable once again

+    }

+    }

+

+    /**

      * This function starts a shutdown countdown from Telnet (Copied from Function startShutdown())

      *

      * @param ip            IP Which Issued shutdown command

@@ -100,7 +127,8 @@

        Announcements _an = Announcements.getInstance();

        _log.warning("IP: " + IP + " issued shutdown ABORT. " + _modeText[shutdownMode] + " has been stopped!");

        _an.announceToAll("Server aborts " + _modeText[shutdownMode] + " and continues normal operation!");

-

+        //Restore movement in case shutdown/restart are cancelled

+        unparalyzeAllCharacters();

        if (_counterInstance != null) {

            _counterInstance._abort();

        }

@@ -310,6 +338,9 @@

LoginServerThread.getInstance().setServerStatus(ServerStatus.STATUS_DOWN); //avoids new players from logging in

_an.announceToAll("The server is " + _modeText[shutdownMode] + " in 1 minute.");break;

case 30:_an.announceToAll("The server is " + _modeText[shutdownMode] + " in 30 seconds.");break;

+                    case 15:

+                        paralyzeAllCharacters();

+                        _an.announceToAll("The players will now be inmobilized to prevent Exploits during the "+ _modeText[shutdownMode] +" procedure");break;

case 5:_an.announceToAll("The server is " + _modeText[shutdownMode] + " in 5 seconds, please delog NOW !");break;

}

 

Index: D:/#PROJECT/l2jserver_IntGS_Clean/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminShutdown.java

===================================================================

--- D:/#PROJECT/l2jserver_IntGS_Clean/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminShutdown.java (revision 669)

+++ D:/#PROJECT/l2jserver_IntGS_Clean/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminShutdown.java (working copy)

@@ -53,7 +53,15 @@

try

{

int val = Integer.parseInt(command.substring(22));

- serverShutdown(activeChar, val, false);

+                //A restart procedure HAS to be issued at least 60 seconds before it takes effect

+                if (val >= 60)

+                    {

+                        serverShutdown(activeChar, val, false);

+                    }

+                else

+                    {

+                    sendHtmlForm(activeChar);

+                    } 

}

catch (StringIndexOutOfBoundsException e)

{

@@ -64,7 +72,15 @@

try

{

int val = Integer.parseInt(command.substring(21));

- serverShutdown(activeChar, val, true);

+                //A restart procedure HAS to be issued at least 60 seconds before it takes effect

+                if (val >= 60)

+                {

+                serverShutdown(activeChar, val, true);

+                }

+                else

+                {

+                sendHtmlForm(activeChar);

+                }

}

catch (StringIndexOutOfBoundsException e)

{

@@ -111,7 +127,7 @@

replyMSG.append("<tr><td>Game Time: " + format.format(cal.getTime()) + "</td></tr>");

replyMSG.append("</table><br>");

replyMSG.append("<table width=270>");

- replyMSG.append("<tr><td>Enter in seconds the time till the server shutdowns bellow:</td></tr>");

+        replyMSG.append("<tr><td>Enter in seconds the time till the server shutdowns bellow (min. 60 sec.):</td></tr>");

replyMSG.append("<br>");

replyMSG.append("<tr><td><center>Seconds till: <edit var=\"shutdown_time\" width=60></center></td></tr>");

replyMSG.append("</table><

 

 

Posted

Thx for that

I dont understand the code... :S actually where to put it ...for example what is this? @@ -52,8 +52,35 @@

But in some servers you see a message that u cannot enchant while server restarts. Doesnt it work here?

 

Posted

It freezes the playes and makes them invul (for the last 15''), while it announces them that, and stops their movement packs exchange with the server. It also has negate values if you wanna issue a stop shutdown command. It also forces you to issue at least a 60'' shutdown command...

 

I would say it is good, but, l2joff has added a security bar that does the same thing.. And i'm sure i had seen the same code arround... Gimme a sec ^^

 

Actually, my memory never traits me... http://forum.l2jserver.com/thread.php?threadid=23476 ;D

Is that me or i believe that we have some credits problems on this forum? x.x Anyway, i don't want to mess... Let's call it a good share to exist, and a typo at the post's syntax...

 

*Ehm, if you don't know what it actually is, do not consider using it :P It's a java patch, it can be used with eclipse, but first you have to edit it to match to your revision...

Posted

This code will paralyze all the players before the server restarts (15 seconds before the server restarts/shuts down by default but you can change it), and unparalyze them if the server restart is cancelled.

 

I create this because many ppl when server restarted or shutdown they cheat such us safe enchanting,buffs stucking and more

 

So the code is the following:

 

 

 

 

 

Index: D:/#PROJECT/l2jserver_IntGS_Clean/java/net/sf/l2j/gameserver/Shutdown.java

===================================================================

--- D:/#PROJECT/l2jserver_IntGS_Clean/java/net/sf/l2j/gameserver/Shutdown.java

+++ D:/Workspace/GameServer_Clean/java/net/sf/l2j/gameserver/Shutdown.java

@@ -52,8 +52,35 @@

public static final int GM_RESTART = 2;

public static final int ABORT = 3;

private static String[] _modeText = {"SIGTERM", "shutting down", "restarting", "aborting"};

-   

    /**

+    * Don't allow players to do anything while server is Restarting/Shuting down

+    * this way they won't be able tu use any exploit during restart procedure.

+    */

+    private void paralyzeAllCharacters()

+    {

+    for (L2PcInstance player : L2World.getInstance().getAllPlayers())

+    {

+    //Stop movement for every character connected

+    player.setTarget(null); // Delete it's target

+    player.stopMove(null); // Stop it's movement

+    player.setIsParalyzed(true); // Deny movement

+    player.setIsInvul(true); // Make it invul (this way they won't get killed by a mob)

+    }

+    }

+    /**

+    * Allow players to move again and erase their invul status

+    */

+    private void unparalyzeAllCharacters ()

+    {

+    for (L2PcInstance player: L2World.getInstance().getAllPlayers())

+    {

+    //Restore movement for every char connected

+    player.setIsParalyzed(false); //Unparalize

+    player.setIsInvul(false); //Make vulnerable once again

+    }

+    }

+

+    /**

      * This function starts a shutdown countdown from Telnet (Copied from Function startShutdown())

      *

      * @param ip            IP Which Issued shutdown command

@@ -100,7 +127,8 @@

        Announcements _an = Announcements.getInstance();

        _log.warning("IP: " + IP + " issued shutdown ABORT. " + _modeText[shutdownMode] + " has been stopped!");

        _an.announceToAll("Server aborts " + _modeText[shutdownMode] + " and continues normal operation!");

-

+        //Restore movement in case shutdown/restart are cancelled

+        unparalyzeAllCharacters();

        if (_counterInstance != null) {

            _counterInstance._abort();

        }

@@ -310,6 +338,9 @@

LoginServerThread.getInstance().setServerStatus(ServerStatus.STATUS_DOWN); //avoids new players from logging in

_an.announceToAll("The server is " + _modeText[shutdownMode] + " in 1 minute.");break;

case 30:_an.announceToAll("The server is " + _modeText[shutdownMode] + " in 30 seconds.");break;

+                    case 15:

+                        paralyzeAllCharacters();

+                        _an.announceToAll("The players will now be inmobilized to prevent Exploits during the "+ _modeText[shutdownMode] +" procedure");break;

case 5:_an.announceToAll("The server is " + _modeText[shutdownMode] + " in 5 seconds, please delog NOW !");break;

}

 

Index: D:/#PROJECT/l2jserver_IntGS_Clean/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminShutdown.java

===================================================================

--- D:/#PROJECT/l2jserver_IntGS_Clean/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminShutdown.java (revision 669)

+++ D:/#PROJECT/l2jserver_IntGS_Clean/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminShutdown.java (working copy)

@@ -53,7 +53,15 @@

try

{

int val = Integer.parseInt(command.substring(22));

- serverShutdown(activeChar, val, false);

+                //A restart procedure HAS to be issued at least 60 seconds before it takes effect

+                if (val >= 60)

+                    {

+                        serverShutdown(activeChar, val, false);

+                    }

+                else

+                    {

+                    sendHtmlForm(activeChar);

+                    } 

}

catch (StringIndexOutOfBoundsException e)

{

@@ -64,7 +72,15 @@

try

{

int val = Integer.parseInt(command.substring(21));

- serverShutdown(activeChar, val, true);

+                //A restart procedure HAS to be issued at least 60 seconds before it takes effect

+                if (val >= 60)

+                {

+                serverShutdown(activeChar, val, true);

+                }

+                else

+                {

+                sendHtmlForm(activeChar);

+                }

}

catch (StringIndexOutOfBoundsException e)

{

@@ -111,7 +127,7 @@

replyMSG.append("<tr><td>Game Time: " + format.format(cal.getTime()) + "</td></tr>");

replyMSG.append("</table><br>");

replyMSG.append("<table width=270>");

- replyMSG.append("<tr><td>Enter in seconds the time till the server shutdowns bellow:</td></tr>");

+        replyMSG.append("<tr><td>Enter in seconds the time till the server shutdowns bellow (min. 60 sec.):</td></tr>");

replyMSG.append("<br>");

replyMSG.append("<tr><td><center>Seconds till: <edit var=\"shutdown_time\" width=60></center></td></tr>");

replyMSG.append("</table><

 

 

Damn you let player s have funn :P

Posted

It freezes the playes and makes them invul (for the last 15''), while it announces them that, and stops their movement packs exchange with the server. It also has negate values if you wanna issue a stop shutdown command. It also forces you to issue at least a 60'' shutdown command...

 

I would say it is good, but, l2joff has added a security bar that does the same thing.. And i'm sure i had seen the same code arround... Gimme a sec ^^

 

Actually, my memory never traits me... http://forum.l2jserver.com/thread.php?threadid=23476 ;D

Is that me or i believe that we have some credits problems on this forum? x.x Anyway, i don't want to mess... Let's call it a good share to exist, and a typo at the post's syntax...

 

*Ehm, if you don't know what it actually is, do not consider using it :P It's a java patch, it can be used with eclipse, but first you have to edit it to match to your revision...

 

I know that l2joff do that but it works on old rev not the final.The code is similar but not the same.And the patches stop work right know man.You must do that by yourselfe if you want to mae a code

 

This announce by l2joff and l2jfree

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • Well, I made this. So if you want to create a talent system design you can always dm me. You can find my contact info here 🙂  
    • como vamos conseguir ler esse arquivos pra salvar ?  
    • DISCORD : https://discord.com/users/325653525793210378 utchiha_market telegram : https://t.me/utchiha_market SELLIX STORE : https://utchihamkt.mysellix.io/ Join our server for more products : https://discord.gg/uthciha-services https://campsite.bio/utchihaamkt
    • Eldamar Don't tell me what to do, stop spamming and mind your own business, it's 2025, who's going to play your server like it's 2007, you're ridiculous.
    • New Season Koofs Vs Noobs Get ready for the return of the epic Lineage II experience! L2KvN is coming back stronger than ever, featuring thrilling PvP, powerful factions, and unforgettable gameplay! Whether you're new to the world of L2KvN or returning to conquer it once more, there’s something for everyone:   Global Launch Times Mark your calendars! The server will launch at the following times around the world 20:00 Greece (Athens) GMT +2  20:00 Russia (Moscow) GMT +3 00:00 Russia (Novosibirsk) GMT +7 05:00 Russia (Vladivostok) GMT +10 14:00 Brazil GMT -3 13:00 Argentina GMT -3 20:00 Lithuania GMT +2 18:00 United Kingdom GMT 0 13:00 USA (Eastern Time) GMT -5 10:00 USA (Pacific Time) GMT -8   L2KvN server is with high rates and custom features. Offers fast progression and an exciting experience. Perfect for fans of intense gameplay.   Server Chronicles Interlude Rates: PvP(High) Adena: x1(Custom) Drop Rate: x1(Custom) 1 PvP = 2 Adena(4 For Premium Users)   Premium Account can be activated by purchasing Premium Account Coupon from L2Store and double-clicking the coupon. Premium Account provides the following: 1 PvP: 4 Adena   General Rates Start up Player System Instant LvL 80 Choose For What Faction You Love To Fight [Koofs - Noobs] Koofs Base: Dark Elf Village Noobs Base: Elven Village Prepare You Character Scheme Buff Or Choose Auto Buff PrePare Your Character Equipment From KvN Shop Killing spree systems Full GM shop. Free class change and Subclass All NPCs available in town. Custom Items Balanced. Community Board BugReport/RaidInfo/TopPvP-Online 1 PvP = 1 Adena (2 If Premium)   Enchant Rates Safe Enchant +6 Max Enchant +21 Normal Scroll Chance: 100% (+0 to +6) Blessed Scroll Chance: 85% (+6 to +21) Ex: If +14 failed for +15, return +14   LifeStone Rates High Lifestone Chance: 5% Top Lifestone Chance: 10%   Grand Bosses Queen Ant 8H +1Random (there is a chance to spawn in 7H or 9H) Drops RB Ring/LS/BOGS Baium 8H +1Random (there is a chance to spawn in 7H or 9H) Drops RB Ring/LS/BOGS Zaken 8H +1Random (there is a chance to spawn in 7H or 9H) Drops RB Ring/LS/BOGS Antharas 8H +1Random (there is a chance to spawn in 7H or 9H) Drops RB Ring/LS/BOGS Valakas 8H +1Random (there is a chance to spawn in 7H or 9H) Drops RB Ring/LS/BOGS   Elo Ranking System start unranked and ranks is Unranked-Iron-Bronze-Silver-Gold-Platinum-Diamond All ranks have 3 rank example Iron III Iron II iron I (iron iii is first and iron i is last. you need iron 1 to upgrade to silver.) unranked to iron need 50 points. and all ranks need 100 points to up a rank 5 points per kill if you die you lose 3 points. if you demote (have 4 points and die and you silver i you will demote to bronze iii 20 points.) if you bronze i 99 points and got 1 kill (+5 points) you uprank to silver iii 20 points. every rank have berets. see in video berets in ranks Iron/Bronze/Silver/Gold/Platinum/Diamond (only visual no extra buffs)   PvP Zone System maps change every 1 hour Orc Village Gludin Town   Event System Events every 1 hour TeamVsTeam => 12:00 14:00 16:00 18:00 20:00 22:00 23:59 02:00 04:00 06:00 08:00 10:00 12:00 Capture The Flag => 13:00 15:00 17:00 19:00 21:00 23:00 01:00 03:00 05:00 07:00 09:00 11:00 Rewards = MvP 5 Events | Winner Team 10 Events | Looser 5 Events   🌐 Website: https://l2kvn.com/ 🌐 Website: https://discord.gg/unn2XBhwef
  • Topics

×
×
  • Create New...