Jump to content
  • 0

Paidia an mporite na me help me 2 sovara error game server console


Question

Posted

to proto error den xero gt me kani dsconnecte mipos den exo arketi ram exo 3 GB kai sikono game server console login server console ena l2 kai to antivirus to kaspersky mipos ftei to system den xero ginete auto kai otan katebazo to parathiro tou l2 mou skai DC

 

Error.jpg

 

to deutero malon einai me enan code pou ebala gia to set hero code einai aftos

 

Index: /trunk/L2J_Gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminAdmin.java
===================================================================
--- /trunk/L2J_Gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminAdmin.java	(revision 40)
+++ /trunk/L2J_Gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminAdmin.java	(revision 45)
@@ -55,5 +55,5 @@
	private static final String[] ADMIN_COMMANDS = {"admin_admin", "admin_admin1", "admin_admin2", "admin_admin3", "admin_admin4", "admin_admin5",
		"admin_gmliston", "admin_gmlistoff", "admin_silence", "admin_diet", "admin_tradeoff", "admin_reload", "admin_set", "admin_set_menu", "admin_set_mod",
-		"admin_saveolymp", "admin_sethero", "admin_manualhero"};
+		"admin_saveolymp", "admin_manualhero"};

	private static final int REQUIRED_LEVEL = Config.GM_MENU;
@@ -102,18 +102,4 @@
			catch(Exception e){e.printStackTrace();}
			activeChar.sendMessage("olympiad stuff saved!!");
-		}
-		else if(command.startsWith("admin_sethero")){
-				L2PcInstance target = null;
-	            
-				if (activeChar.getTarget() != null && activeChar.getTarget() instanceof L2PcInstance)
-				{
-					target = (L2PcInstance)activeChar.getTarget();
-					target.setHero(target.isHero()? false : true);
-				}
-				else
-				{
-					target = activeChar;
-					target.setHero(target.isHero()? false : true);
-				}
		}
		else if(command.startsWith("admin_manualhero"))
Index: /trunk/L2J_Gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminHero.java
===================================================================
--- /trunk/L2J_Gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminHero.java	(revision 45)
+++ /trunk/L2J_Gameserver/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminHero.java	(revision 45)
@@ -0,0 +1,132 @@
+/*
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package net.sf.l2j.gameserver.handler.admincommandhandlers;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import net.sf.l2j.Config;
+import net.sf.l2j.L2DatabaseFactory;
+import net.sf.l2j.gameserver.GmListTable;
+import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
+import net.sf.l2j.gameserver.model.L2Object;
+import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+import net.sf.l2j.gameserver.network.SystemMessageId;
+import net.sf.l2j.gameserver.serverpackets.SystemMessage;
+
+public class AdminHero implements IAdminCommandHandler{
+	private static String[] _adminCommands = {"admin_sethero"};
+	private final static Log _log = LogFactory.getLog(AdminHero.class.getName());
+	private static final int REQUIRED_LEVEL = Config.GM_MENU;
+
+	public boolean useAdminCommand(String command, L2PcInstance activeChar){
+		if (!Config.ALT_PRIVILEGES_ADMIN){
+			if (!(checkLevel(activeChar.getAccessLevel()) && activeChar.isGM())){
+				return false;
+			}
+		}
+		if (command.startsWith("admin_sethero")){
+			L2Object target = activeChar.getTarget();
+			L2PcInstance player = null;
+			SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2);
+			if (target instanceof L2PcInstance){
+				player = (L2PcInstance)target;
+			}else{
+				player = activeChar;
+			}
+
+			if (player.isHero()){
+				player.setHero(false);
+				sm.addString("You are no longer a server hero.");
+				GmListTable.broadcastMessageToGMs("GM "+activeChar.getName()+" removed hero stat of player"+ target.getName());
+				Connection connection = null;
+				try{
+					connection = L2DatabaseFactory.getInstance().getConnection();
+
+					PreparedStatement statement = connection.prepareStatement("SELECT obj_id FROM characters where char_name=?");
+					statement.setString(1,target.getName());
+					ResultSet rset = statement.executeQuery();
+					int objId = 0;
+					if (rset.next()){
+						objId = rset.getInt(1);
+					}
+					rset.close();
+					statement.close();
+
+					if (objId == 0) {connection.close(); return false;}
+
+					statement = connection.prepareStatement("UPDATE characters SET hero=0 WHERE obj_id=?");
+					statement.setInt(1, objId);
+					statement.execute();
+					statement.close();
+					connection.close();
+				}
+				catch (Exception e){
+					_log.warn("could not set Hero stats of char:", e);
+				}
+				finally{
+					try { connection.close(); } catch (Exception e) {}
+				}
+			}else{
+				player.setHero(true);
+				sm.addString("You are now a server Hero, Congratulations!");
+				GmListTable.broadcastMessageToGMs("GM "+activeChar.getName()+" has given Hero status to "+target.getName()+".");
+				Connection connection = null;
+				try{
+					connection = L2DatabaseFactory.getInstance().getConnection();
+
+					PreparedStatement statement = connection.prepareStatement("SELECT obj_id FROM characters where char_name=?");
+					statement.setString(1,target.getName());
+					ResultSet rset = statement.executeQuery();
+					int objId = 0;
+					if (rset.next()){
+						objId = rset.getInt(1);
+					}
+					rset.close();
+					statement.close();
+
+					if (objId == 0) {connection.close(); return false;}
+
+					statement = connection.prepareStatement("UPDATE characters SET hero=1 WHERE obj_id=?");
+					statement.setInt(1, objId);
+					statement.execute();
+					statement.close();
+					connection.close();
+				}
+				catch (Exception e){
+					_log.warn("could not set Hero stats of char:", e);
+				}
+				finally{
+					try { connection.close(); } catch (Exception e) {}
+				}
+
+			}
+			player.sendPacket(sm);
+			player.broadcastUserInfo();
+			if(player.isHero() == true){}
+		}
+		return false;
+	}
+   public String[] getAdminCommandList() {
+		return _adminCommands;
+	}
+	private boolean checkLevel(int level){
+		return (level >= REQUIRED_LEVEL);
+	}
+}
Index: /trunk/L2J_Gameserver/java/net/sf/l2j/gameserver/GameServer.java
===================================================================
--- /trunk/L2J_Gameserver/java/net/sf/l2j/gameserver/GameServer.java	(revision 30)
+++ /trunk/L2J_Gameserver/java/net/sf/l2j/gameserver/GameServer.java	(revision 45)
@@ -92,4 +92,5 @@
import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminHeal;
import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminHelpPage;
+import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminHero;
import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminInvul;
import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminKick;
@@ -529,4 +530,5 @@
		_adminCommandHandler.registerAdminCommandHandler(new AdminHeal());
		_adminCommandHandler.registerAdminCommandHandler(new AdminHelpPage());
+		_adminCommandHandler.registerAdminCommandHandler(new AdminHero());
		_adminCommandHandler.registerAdminCommandHandler(new AdminShutdown());
		_adminCommandHandler.registerAdminCommandHandler(new AdminSpawn());

5 answers to this question

Recommended Posts

  • 0
Posted

file m nomize dn exei simasia autos o kodikas giati to error vgenei sth sintaksi apo mysql gia ksanakane install thn DB sou h kane ena backup pou eixes...

an exeis pragmata mesa pou dn 8es na xa8oune kane ena backup kane 3ana install thn DB des an anigei kai meta perna sigkekrimena templates apo to backup

 

  • 0
Posted

file mou  ayto to error  sto bgazei gia ton logo oti  exeis  3exasei na baleis  to 'hero'  sto characters.sql

 

oriste kai to java code pou to exei mesa kai den to briskh  kai sou to bgazei to error

 

tatement = connection.prepareStatement("UPDATE characters SET hero=0 WHERE obj_id=?");

 


diladi  mporeis na kaneis to e3eis na peraseis ayto edw

 

ALTER TABLE `characters` ADD `hero` TINYINT NOT NULL DEFAULT '0' AFTER `nobless`;

 

kai na eisai ok

  • 0
Posted

file mou  ayto to error  sto bgazei gia ton logo oti  exeis  3exasei na baleis  to 'hero'  sto characters.sql

 

oriste kai to java code pou to exei mesa kai den to briskh  kai sou to bgazei to error

 

tatement = connection.prepareStatement("UPDATE characters SET hero=0 WHERE obj_id=?");

 


diladi  mporeis na kaneis to e3eis na peraseis ayto edw

 

ALTER TABLE `characters` ADD `hero` TINYINT NOT NULL DEFAULT '0' AFTER `nobless`;

 

kai na eisai ok

ontws nomiza oti 8a to eixe apo mono tou alla ekana la8os ... :D

  • 0
Posted

file Flash™ apla se proskinao me ekanes theo epiase to perasa mesa sta sql ton code kai to ekana execute sql files file apla proskino

elega tha mou eperne 20 meres psaxnontas :P kai pali se afxaristo kai ton panos9999 pou asxolithike me tin lisi tou problimatos pou ixa

ALA FILE NA SE ROTISO KAI KATI ALO TO 1 ERROR APO TI LETE NA MOU PETAI DC OTAN EIMAI MESA STO L2 MOU PETAI DC OTAN KATEBAZO TO PARATHIRO MOU PETAI DC KAI SE NET OXI MONO STO PC MOU TI PREPI NA PROKALI TO DC AA NAI EXO KANI KAI POLYMORPH SYSTEM LETE GIA AFTO NA MOU PETAI DC I NA EINAI TO SYSTEM TOU L2

  • 0
Posted

file Flash™ apla se proskinao me ekanes theo epiase to perasa mesa sta sql ton code kai to ekana execute sql files file apla proskino

elega tha mou eperne 20 meres psaxnontas :P kai pali se afxaristo kai ton panos9999 pou asxolithike me tin lisi tou problimatos pou ixa

ALA FILE NA SE ROTISO KAI KATI ALO TO 1 ERROR APO TI LETE NA MOU PETAI DC OTAN EIMAI MESA STO L2 MOU PETAI DC OTAN KATEBAZO TO PARATHIRO MOU PETAI DC KAI SE NET OXI MONO STO PC MOU TI PREPI NA PROKALI TO DC AA NAI EXO KANI KAI POLYMORPH SYSTEM LETE GIA AFTO NA MOU PETAI DC I NA EINAI TO SYSTEM TOU L2

Είσαι κάτι φταίει από το client σου και πετάει dc.

Ξανακάνε το download καλύτερα..

 

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
Answer this question...

×   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

    • Server mid rate craft PvP   CLIENTE INTERLUDE Website server Discord olympus x25 &nbsp;server 🇧🇷🇦🇷🇨🇱🇬🇷🇲🇽🇵🇪🇸🇰🇪🇸🇺🇾 Server mid rate craft PvP 🔱CLIENTE INTERLUDE🔱 🔅xpx25 🔅Sp x25 🔅Adena x15 🔅Droop x2 🔅Spoil x2 🔅Raidboss xp x2 🔅Raidboss sp x2 🔅Raidboss droop x1 🔅All Rate quest reward  x1 ⚠️All Quest drop reward. x1 🔅Manor x 3 🔅Seal stone x1 🛡️🗡️INFO GRADO S🗡️🛡️ ⚠️Inicia desabilitado drop/spoil/quest. 🔱PROFESIONES/SUBCLASS🔱 🛡️1st profession - 50medal 🛡️2nd profession - 500 medal 🛡️3rd profession - 1k medal +30kk adena 🛡️Sub class - Quest. No necesita matar raids. ⚙️Configuraciones⚙️ 🛡️Gmshop  grade - B. 🛡️Grade A-S Craft - yes x1 chance 🛡️Globlal teleport - yes 🛡️Buffer 1hora. 🛡️Buffer slot 24(+4divine)+12 dances-song 🛡️Auto learn skils - yes 🛡️Autoloot - yes 🛡️Mana potion recarga 1000 ,9segundos delay. 🛡️Champions system:     ▫️lvl 30 - 76     ▫️chance respawn 0.5%.     ▫️adena x20 🛡️Max lvl party 14 lvl. 🛡️Festive sweeper on. 🛡️Max client pc 2. 🛡️Raid boss respawn retail. 🛡️Nobleza quest - yes. 🛡️Barakiel respawn 6 horas + -30 min. 🛡️Olimpiada duracion 14 dias. 🛡️Olimpiada de 18:00 a 00:00 🛡️Safe enchant +3 🛡️Normal enchant scroll 50% ⚠️+11-16 chance 30% 🛡️Bleesed enchant scroll 55% ⚠️+11-16 chance 35% 🛡️Rate dinamico x1 lvl 77-80   🛡️🗡️CLANES INFO🗡️🛡️ 🔅Crear clan min. level 20 🔅Max Alianzas 1 🔅Duracion penalidades clan / alianzas 8 horas. 🔅Cambio de lider 24 horas. 🛡️⚔️ ASEDIOS ⚔️🛡️ 🔅Cada 2 semanas. 🔅Proteccion hwid 1 pc. 🔅Clanes registrados. acceden a zona de asedio. 🔅Castillo asediable Aden. 🔅Reward 1000 FA 🔅Horario 16:00 GMT-3 🎊PACK DE INICIO🎊 🔅Start set - armor\weapon no grade. 🔅Level 20  - 5 shadow cuppon grado D 🔅Level 40 - 5 shadow cuppon grado C 🔅Free Autofarm 24 horas. 💰 INFO PREMIUM 💰 🔅Free autofarm. 🔅xp x30 🔅sp x30 🔅adena x17 🔅drop x4 🔅spoil x4 🔅enchant +2% 🔅seal stone x1 🔅Altb Gk-Gmshop/buffe ⚔️ RAID  BOSS INFO ⚔️ 🔅Raid boss 70 ++ respawn 5 días despues. 🔅Raid boss 75 ++ respawn 15 días despues 🔅Drop LETTER L2DAY para tradear en GMshop. ⚔️ INFO SEVEN SING ⚔️ 🔅Inicio del drop Seal stones dia 5 de iniciado el server. 🎊 EPIC RAID INFO 🎊 🔅Queen Ant (lvl 40)respawn Lunes a Viernes 22:00 GMT-3 drop chance 30%. 🔅Core (lvl 80)respawn Martes-miercoles 20:20 GMT-3 drop chance 100%. 🔅Orfen (lvl 80)respawn Martes-miercoles 21:00 GMT-3 drop chance 100%. 🔅Zaken (lvl 80)respawn Jueves 23:00 GMT-3 drop chance 100%. 🔅Frintezza (lvl 80)respawn Viernes 23:00 GMT-3 drop chance 100%. 🔅Baium (lvl 80)respawn Sabado 22:00 GMT-3 drop chance 100%. 🔅Valakas (lvl 80)respawn Domingo 20:00 GMT-3 drop chance 100%. 🔅Antharas (lvl 80)respawn Domingo 22:00 GMT-3 drop chance 100%.
    • The server is running in l2house.com.ar with C4 mode and in L2Tekila within the same login you can also test it in C5, if you want me to raise another chronicle to test, just let me know.
    • video nice song TopGear  gaming 1990    ....  
    • I have a system where Accounts are saved on login screen for fast login. I am playing a server where this feature is not on the logic screen. How I can try to add this feature to the system? I don't know what files I would have to touch.   Thanks!!
  • Topics

×
×
  • Create New...