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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Posts

    • Hi everyone,   In 2014, I completely stepped away from developing L2 servers and doing L2J-related work. Since then, I’ve only opened this server about once a year and helped a few servers and individuals for free. I haven’t taken on any paid L2J work since then.   LINEAGE2.GOLD is a project that has reached about Season 6. The first season launched at the end of 2020 and was a fully rebuilt Gold-style server on the Classic client (protocol 110). It featured many custom systems and enhancements. After several seasons, I decided to abandon the Mobius-based project and move to Lucera, as my goal was to get as close as possible to Interlude PTS behavior while still staying on the L2J platform.   The current project was once again completely rebuilt, this time on the Essence client (protocol 306), and is based on Lucera. Because of that, acquiring a license from Deazer is required.   My Lucera extender includes, but is not limited to: Formulas.java Basic anti-bot detection, which proved quite effective, we caught most Adrenaline users using relatively simple server-side logic, logged them, and took staff action. Simple admin account lookup commands based on IP, HWID, and similar identifiers. In-game Captcha via https://lineage2.gold/code, protected by Cloudflare, including admin commands for blacklisting based on aggression levels and whitelisting. Additional admin tools such as Auto-Play status checks, Enchanted Hero Weapon live sync, force add/remove clans from castle sieges, item listeners for live item monitoring, and more. A fully rewritten Auto-Play system with support for ExAutoPlaySetting, while still using the Auto-Play UI wheel, featuring: Debuff Efficiency Party Leader Assist Respectful Hunting Healer AI Target Mode Range Mode Summoner buff support Dwarf mechanics Reworked EffectDispelEffects to restore buffs after Cancellation. Raid Bomb item support. Reworked CronZoneSwitcher. Prime Time Raid Respawn Service. Community Board features such as Top rankings and RB/Epic status. Custom systems for Noblesse, Subclasses, support-class rewards, and much more.   Depending on the deal, the project can include: The lineage2.gold domain The website built on the Laravel PHP framework The server’s Discord Client Interface source Server files and extender source The server database (excluding private data such as emails and passwords)   I’m primarily looking for a serious team to continue the project, as it would be a shame to see this work abandoned. This is not cheap. You can DM me with offers. If you’re wondering why I’m doing this: I’ve felt a clear lack of appreciation from the L2 community, and I’m not interested in doing charity work for people who don’t deserve it. I’m simply not someone who tolerates BS. Server Info: https://lineage2.gold/info Server for test: https://lineage2.gold/download Over 110 videos YouTube playlist: https://www.youtube.com/watch?v=HO7BZaxUv2U&list=PLD9WZ0Nj-zstZaYeWxAxTKbX7ia2M_DUu&index=113
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..

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