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

    • My official facebook profile!: https://www.facebook.com/spectrumL2 Specifications: Revamped L2JACIS revision FROM the core Private project!!! Revision that has been receiving corrections for over 3 years!!! Events already installed in the revision: TVT CTF KTB PARTY FARM SPOIL EVENT CRAZY RATES TOURNAMENT TIME ZONE (INSTANCE) All working correctly!!! SIEGE ESSENTIAL FEATURES: Walls fix Gates fix Flags fix 100% functional: OLYMPIADS: Implemented settings Hero receives enchanted Weapons with equal status PvP Weapons Optional /true/false Hero can acquire all Hero Weapons Optional true/false OTHER IMPLEMENTATIONS: Teleport fixed (directly to Giran) Teleport effect classic Vip skins vip collor name Pack NPCs with effect already configured BOSES already configured Mobs already configured CLASS BALANCE SPECIAL SYSTEM We have a SPECIAL system developed for Class Balance with only 1 digit in XML %tage of configurable debuffs Player limitation system in BOSES or PvP zones BS blocking system in FLEG zones or events Among others dozens of improvements made in the review... price: 390 USD !  OBS: WE CAN CHANGE THE BANNER AND NAME OF THE SERVICE TO THE ONE OF YOUR PREFERENCE BUT THE SETTINGS MUST BE KEPT ANY CHANGES REQUIRE ADDITION        
    • Server is Online – 1,000+ Active Players! We’re excited to announce the addition of a Europe Proxy to improve connectivity for our EU players! Clans can now benefit from VIP Access to help you catch up faster. 🎯 If you're a clan leader with at least 9 active members, join our Discord and open a ticket to claim your VIP rewards!  
    • The Telegram team is rolling out a new batch of Stars-only gifts you’ll be able to mint as NFTs. Don’t miss your chance to join the next Telegram trend and earn from it! Buy Telegram Stars cheap and KYC-free 1 Star from $0.0149 (min. 50 Stars, bulk discounts available) Promo code STARS5 — 5 % off Pay any way you like: bank cards · crypto · other popular methods How to purchase: ➡Online Store — Click ➡ Telegram bot — Click Other services: ➡ SMM panel — Click Regular buyers get extra discounts and promo codes. Support: ➡ Telegram: https://t.me/solomon_bog ➡ Telegram channel: https://t.me/accsforyou_shop ➡ Discord: https://discord.gg/y9AStFFsrh ➡ WhatsApp: https://wa.me/79051904467 ➡ Email: solomonbog@socnet.store Use these contacts to discuss wholesale orders, partnerships (current list: https://socnet.bgng.io/partners) or to become a supplier. SocNet — your shop for digital goods and premium subscriptions
    • The Telegram team is rolling out a new batch of Stars-only gifts you’ll be able to mint as NFTs. Don’t miss your chance to join the next Telegram trend and earn from it! Buy Telegram Stars cheap and KYC-free 1 Star from $0.0149 (min. 50 Stars, bulk discounts available) Promo code STARS5 — 5 % off Pay any way you like: bank cards · crypto · other popular methods How to purchase: ➡Online Store — Click ➡ Telegram bot — Click Other services: ➡ SMM panel — Click Regular buyers get extra discounts and promo codes. Support: ➡ Telegram: https://t.me/solomon_bog ➡ Telegram channel: https://t.me/accsforyou_shop ➡ Discord: https://discord.gg/y9AStFFsrh ➡ WhatsApp: https://wa.me/79051904467 ➡ Email: solomonbog@socnet.store Use these contacts to discuss wholesale orders, partnerships (current list: https://socnet.bgng.io/partners) or to become a supplier. SocNet — your shop for digital goods and premium subscriptions
    • 📜 • Mass PVP – Craft – Progressive Server (ITEMS, ARMOR, WEAPONS, ETC) 🕹️ • Chronicles: Lineage 2 - Interlude (C6) 🛠️ • Retail status 🕒 • Server Time: GMT -3 🏙️ • Main Town: Giran ✨ • Teleportation for all Towns, Gk Global 🛡️ • NPC BUFFER - GMSHOP B-GRADE - DONATION SHOP - AUCTION MANAGER 🐉 • Epic Bosses: Chaotic Zones 🔁 • Protection respawn: 15 seconds ⏰ • Restart Server: 05:00 AM Today 💸 • RTM allowed between players (ask Staff if in doubt) 📊 SERVER RATES: • EXP: x8 • SP: x10 • Adena: x3 • Seal Stone: x3 • Drop: x3 • Spoil: x5 • Raid EXP/SP/Drop: x3 • Premium Rates: x2 🌐 Website: https://www.l2roosters.com 💬 Discord: https://discord.gg/cUyYXrfy 🔥 Join us now and forge your legacy at Roosters Gaming!
  • 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