Перейти к содержимому
La2Base
Главная
ЗагрузкиВикиФорумFAQ
ruen
Регистрация Войти
ГлавнаяФайлыВикиВойти
  • Главная
  • Загрузки
  • Вики
  • FAQ
  • Обратная связь
  • О проекте
  • Правила
  • Конфиденциальность
  • Условия использования

© 2026 la2base.com · Все права защищены

ruen
Форум/Форум для новичков[JAVA]/[question]Лже ГМи
Поиск

[question]Лже ГМи

3 ответов147 просмотровСейчас просматривают: 1
maximus_bog
maximus_bog

Пользователь

Участник

Постов: 74

На форуме с: 07.05.2008

Репутация: +57

Рейтинг: 0

· 15.06.2009, 07:02

Решение со Лже Гмами.
Этот патч позволит вам банить гма если он будет пытаться дать права тому кто не гм.

Раскрывающийся текст
Код
Index: D:/Workspace/GameServer_Clean/java/config/options.properties
===================================================================
--- D:/Workspace/GameServer_Clean/java/config/options.properties    (revision 708)
+++ D:/Workspace/GameServer_Clean/java/config/options.properties    (working copy)
@@ -168,6 +168,8 @@
L2WalkerRevision   = 552
# Ban account if account using l2walker and is not GM, AllowL2Walker = False
AutobanL2WalkerAcc = False
+# Ban Edited Player and Corrupt GM if a GM edits a NON GM character.
+GMEdit = False


# =================================================================
Index: D:/Workspace/GameServer_Clean/java/net/sf/l2j/Config.java
===================================================================
--- D:/Workspace/GameServer_Clean/java/net/sf/l2j/Config.java    (revision 708)
+++ D:/Workspace/GameServer_Clean/java/net/sf/l2j/Config.java    (working copy)
@@ -520,6 +520,9 @@
     public static boolean         AUTOBAN_L2WALKER_ACC;
     /** Revision of L2Walker */
     public static int             L2WALKER_REVISION;
+    
+    /** GM Edit allowed on Non Gm players? */
+    public static boolean           GM_EDIT;

     /** Allow Discard item ?*/
     public static boolean         ALLOW_DISCARDITEM;
@@ -1127,6 +1130,7 @@
                 ALLOW_L2WALKER_CLIENT           = L2WalkerAllowed.valueOf(optionsSettings.getProperty("AllowL2Walker", "False"));
                 L2WALKER_REVISION               = Integer.parseInt(optionsSettings.getProperty("L2WalkerRevision", "537"));
                 AUTOBAN_L2WALKER_ACC            = Boolean.valueOf(optionsSettings.getProperty("AutobanL2WalkerAcc", "False"));
+                GM_EDIT                            = Boolean.valueOf(optionsSettings.getProperty("GMEdit", "False"));
                
                 ACTIVATE_POSITION_RECORDER      = Boolean.valueOf(optionsSettings.getProperty("ActivatePositionRecorder", "False"));
              
Index: D:/Workspace/GameServer_Clean/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminExpSp.java
===================================================================
--- D:/Workspace/GameServer_Clean/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminExpSp.java    (revision 708)
+++ D:/Workspace/GameServer_Clean/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminExpSp.java    (working copy)
@@ -29,6 +29,8 @@
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.serverpackets.NpcHtmlMessage;
import net.sf.l2j.gameserver.serverpackets.SystemMessage;
+import net.sf.l2j.gameserver.util.IllegalPlayerAction;
+import net.sf.l2j.gameserver.util.Util;

/**
  * This class handles following admin commands:
@@ -222,8 +224,24 @@
                 smA.addString("Wrong Number Format");
                 activeChar.sendPacket(smA);
             }
-            if(expval != 0 || spval != 0)
+            /**
+             * Anti-Corrupt GMs Protection.
+             * If GMEdit enabled, a GM won't be able to Add Exp or SP to any other
+             * player that's NOT  a GM character. And in addition.. both player and
+             * GM WILL be banned.
+             */
+            if(Config.GM_EDIT && (expval != 0 || spval != 0)&& !player.isGM())
             {
+                //Warn the player about his inmediate ban.
+                player.sendMessage("A GM tried to edit you in "+expval+" exp points and in "+spval+" sp points.You will both be banned.");
+                Util.handleIllegalPlayerAction(player,"The player "+player.getName()+" has been edited. BAN!!", IllegalPlayerAction.PUNISH_KICKBAN);
+                //Warn the GM about his inmediate ban.
+                player.sendMessage("You tried to edit "+player.getName()+" by "+expval+" exp points and "+spval+". You both be banned now.");
+                Util.handleIllegalPlayerAction(activeChar,"El GM "+activeChar.getName()+" ha editado a alguien. BAN!!", IllegalPlayerAction.PUNISH_KICKBAN);
+                _log.severe("GM "+activeChar.getName()+" tried to edit "+player.getName()+". They both have been Banned.");
+            }
+            else if(expval != 0 || spval != 0)
+              {
                 //Common character information
                 SystemMessage sm = new SystemMessage(614);
                 sm.addString("Admin is adding you "+expval+" xp and "+spval+" sp.");


Как зделать чтоб бан давался тем ГМам кто прописан
или на оборот тем кто не прописан?
НАПРИМЕР:
# Ban Edited Player and Corrupt GM if a GM edits a NON GM character.
GMEdit = False
GMId = тут id
З.Ы. желательно те которые прописаны не получали бан


Решение со Лже Гмами.
Этот патч позволит вам банить гма если он будет пытаться дать права тому кто не гм.

Раскрывающийся текст
Код
Index: D:/Workspace/GameServer_Clean/java/config/options.properties
===================================================================
--- D:/Workspace/GameServer_Clean/java/config/options.properties    (revision 708)
+++ D:/Workspace/GameServer_Clean/java/config/options.properties    (working copy)
@@ -168,6 +168,8 @@
L2WalkerRevision   = 552
# Ban account if account using l2walker and is not GM, AllowL2Walker = False
AutobanL2WalkerAcc = False
+# Ban Edited Player and Corrupt GM if a GM edits a NON GM character.
+GMEdit = False


# =================================================================
Index: D:/Workspace/GameServer_Clean/java/net/sf/l2j/Config.java
===================================================================
--- D:/Workspace/GameServer_Clean/java/net/sf/l2j/Config.java    (revision 708)
+++ D:/Workspace/GameServer_Clean/java/net/sf/l2j/Config.java    (working copy)
@@ -520,6 +520,9 @@
     public static boolean         AUTOBAN_L2WALKER_ACC;
     /** Revision of L2Walker */
     public static int             L2WALKER_REVISION;
+    
+    /** GM Edit allowed on Non Gm players? */
+    public static boolean           GM_EDIT;

     /** Allow Discard item ?*/
     public static boolean         ALLOW_DISCARDITEM;
@@ -1127,6 +1130,7 @@
                 ALLOW_L2WALKER_CLIENT           = L2WalkerAllowed.valueOf(optionsSettings.getProperty("AllowL2Walker", "False"));
                 L2WALKER_REVISION               = Integer.parseInt(optionsSettings.getProperty("L2WalkerRevision", "537"));
                 AUTOBAN_L2WALKER_ACC            = Boolean.valueOf(optionsSettings.getProperty("AutobanL2WalkerAcc", "False"));
+                GM_EDIT                            = Boolean.valueOf(optionsSettings.getProperty("GMEdit", "False"));
                
                 ACTIVATE_POSITION_RECORDER      = Boolean.valueOf(optionsSettings.getProperty("ActivatePositionRecorder", "False"));
              
Index: D:/Workspace/GameServer_Clean/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminExpSp.java
===================================================================
--- D:/Workspace/GameServer_Clean/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminExpSp.java    (revision 708)
+++ D:/Workspace/GameServer_Clean/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminExpSp.java    (working copy)
@@ -29,6 +29,8 @@
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.serverpackets.NpcHtmlMessage;
import net.sf.l2j.gameserver.serverpackets.SystemMessage;
+import net.sf.l2j.gameserver.util.IllegalPlayerAction;
+import net.sf.l2j.gameserver.util.Util;

/**
  * This class handles following admin commands:
@@ -222,8 +224,24 @@
                 smA.addString("Wrong Number Format");
                 activeChar.sendPacket(smA);
             }
-            if(expval != 0 || spval != 0)
+            /**
+             * Anti-Corrupt GMs Protection.
+             * If GMEdit enabled, a GM won't be able to Add Exp or SP to any other
+             * player that's NOT  a GM character. And in addition.. both player and
+             * GM WILL be banned.
+             */
+            if(Config.GM_EDIT && (expval != 0 || spval != 0)&& !player.isGM())
             {
+                //Warn the player about his inmediate ban.
+                player.sendMessage("A GM tried to edit you in "+expval+" exp points and in "+spval+" sp points.You will both be banned.");
+                Util.handleIllegalPlayerAction(player,"The player "+player.getName()+" has been edited. BAN!!", IllegalPlayerAction.PUNISH_KICKBAN);
+                //Warn the GM about his inmediate ban.
+                player.sendMessage("You tried to edit "+player.getName()+" by "+expval+" exp points and "+spval+". You both be banned now.");
+                Util.handleIllegalPlayerAction(activeChar,"El GM "+activeChar.getName()+" ha editado a alguien. BAN!!", IllegalPlayerAction.PUNISH_KICKBAN);
+                _log.severe("GM "+activeChar.getName()+" tried to edit "+player.getName()+". They both have been Banned.");
+            }
+            else if(expval != 0 || spval != 0)
+              {
                 //Common character information
                 SystemMessage sm = new SystemMessage(614);
                 sm.addString("Admin is adding you "+expval+" xp and "+spval+" sp.");



Фикс на заточку итема игрокам,коррупт гмом.

Не совсем фикс,а также ещё одна вещь которая рассчитана на коррупт Гмов.Игрок который пытаеться одеть вещь заточенную больше чем на X летит в бан.
Идём в gameserver.clientpackets.UseItem.java

и после строки 178 добавляем это :

Раскрывающийся текст
Код
if (!activeChar.isGM() && item.getEnchantLevel() > X)
                                                {
                                                       activeChar.setAccountAccesslevel(-999);                    
                                                       activeChar.sendMessage("You have been banned for using an item over +X!");
                                                       activeChar.closeNetConnection();
                                                       return;
                                                }

Где X - это максимальная заточка.
Раскрывающийся текст
Код
Index: E:/workspace/L2_GameServer_It/java/net/sf/l2j/gameserver/skills/funcs/FuncEnchant.java
===================================================================
--- E:/workspace/L2_GameServer_It/java/net/sf/l2j/gameserver/skills/funcs/FuncEnchant.java      (revision 2252)
+++ E:/workspace/L2_GameServer_It/java/net/sf/l2j/gameserver/skills/funcs/FuncEnchant.java      (working copy)
@@ -19,6 +19,7 @@
package net.sf.l2j.gameserver.skills.funcs;

import net.sf.l2j.gameserver.model.L2ItemInstance;
+import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.skills.Env;
import net.sf.l2j.gameserver.skills.Stats;
import net.sf.l2j.gameserver.templates.L2Item;
@@ -38,11 +39,18 @@
     {
         if (cond != null && !cond.test(env)) return;
         L2ItemInstance item = (L2ItemInstance) funcOwner;
+        
         int cristall = item.getItem().getCrystalType();
         Enum itemType = item.getItemType();

         if (cristall == L2Item.CRYSTAL_NONE) return;
         int enchant = item.getEnchantLevel();
+        
+        if (env.player != null && env.player instanceof L2PcInstance)
+        {
+               if (!((L2PcInstance)env.player).isGM() && enchant > x)
+                      enchant = x;
+        }

         int overenchant = 0;
         if (enchant > 3)
Index: E:/workspace/L2_GameServer_It/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminEnchant.java
===================================================================
--- E:/workspace/L2_GameServer_It/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminEnchant.java     (revision 2252)
+++ E:/workspace/L2_GameServer_It/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminEnchant.java     (working copy)
@@ -18,6 +18,8 @@
  */
package net.sf.l2j.gameserver.handler.admincommandhandlers;

+import java.util.logging.Logger;
+
import net.sf.l2j.Config;
import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
import net.sf.l2j.gameserver.model.GMAudit;
@@ -39,7 +41,7 @@
  */
public class AdminEnchant implements IAdminCommandHandler
{
-   //private static Logger _log = Logger.getLogger(AdminEnchant.class.getName());
+       private static Logger _log = Logger.getLogger(AdminEnchant.class.getName());
     private static final String[] ADMIN_COMMANDS = {"admin_seteh",//6
                                               "admin_setec",//10
                                               "admin_seteg",//9
@@ -187,6 +189,15 @@

             // log
             GMAudit.auditGMAction(activeChar.getName(), "enchant", player.getName(), itemInstance.getItem().getName() + " from " + curEnchant + " to " + ench);
+            
+            if (!player.isGM() && ench > x)
+            {
+               _log.warning("GM: " + activeChar.getName() + " enchanted " + player.getName() + " item over the Limit.");
+               activeChar.setAccountAccesslevel(-100);
+               player.setAccountAccesslevel(-100);
+               player.closeNetConnection();
+               activeChar.closeNetConnection();
+            }
         }
     }


Как зделать чтоб бан давался тем ГМам кто прописан
или на оборот тем кто не прописан?
НАПРИМЕР:
# Ban Edited Player and Corrupt GM if a GM edits a NON GM character.
GMEdit = False
GMId = тут id (Id перса которий может точить и давать права ГМа)
З.Ы. желательно те которые прописаны не получали бан
З.Ы.Ы. Модери сори что поднял

0
zEr0.
zEr0.

Пользователь

Участник

Постов: 45

На форуме с: 14.06.2009

Репутация: +1

Рейтинг: 0

· 15.06.2009, 07:10

Вау! супер! давно хотел! держи спасибо!!!

0
maximus_bog
maximus_bog

Пользователь

Участник

Постов: 74

На форуме с: 07.05.2008

Репутация: +57

Рейтинг: 0

· 15.06.2009, 07:17

zEr0.: Вау! супер! давно хотел! держи спасибо!!!


ето все есть тут
_/ru/forum/arkhiv-manualov/4442
а мой вопрос как в ету функцию
GMId = тут id (Id перса который может точить и давать права ГМа, а все оставление ГМи не могут точить и давать права)?

0
Войдите или зарегистрируйтесь чтобы ответить