Jump to content

Recommended Posts

Posted

Thanks *NeverMore* gia tin idea....

Perigrafi:

Kathe 12 ores ginete announce automata an oi players

theloun o server na ginei rr, etsi tous dinete to dikeoma

na patisoun .yes . no(san vote).

Auto krataei gia 3 lepta....molis teliosoun ta 3 lepta

ginonte announce ta apotelesmata.

Analoga me ta nai kai ta oxi, o server kanei restart i

sinexizei ti litourgia.

 

### Eclipse Workspace Patch 1.0
#P TEST_GS2
Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(revision 4767)
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(working copy)
@@ -452,6 +452,7 @@

	private boolean _noble = false;
	private boolean _hero = false;
+	public boolean _vote = false;

	/** The L2FolkInstance corresponding to the last Folk wich one the player talked. */
	private L2FolkInstance _lastFolkNpc = null;
Index: java/net/sf/l2j/gameserver/GameServer.java
===================================================================
--- java/net/sf/l2j/gameserver/GameServer.java	(revision 4767)
+++ java/net/sf/l2j/gameserver/GameServer.java	(working copy)
@@ -197,6 +197,7 @@
import net.sf.l2j.gameserver.handler.usercommandhandlers.PartyInfo;
import net.sf.l2j.gameserver.handler.usercommandhandlers.Time;
import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Wedding;
+import net.sf.l2j.gameserver.handler.voicedcommandhandlers.autorestart;
import net.sf.l2j.gameserver.handler.voicedcommandhandlers.stats;
import net.sf.l2j.gameserver.idfactory.IdFactory;
import net.sf.l2j.gameserver.instancemanager.AuctionManager;
@@ -219,6 +220,7 @@
import net.sf.l2j.gameserver.model.L2Manor;
import net.sf.l2j.gameserver.model.L2PetDataTable;
import net.sf.l2j.gameserver.model.L2World;
+import net.sf.l2j.gameserver.model.entity.AutoRestart;
import net.sf.l2j.gameserver.model.entity.Hero;
import net.sf.l2j.gameserver.model.entity.TvTManager;
import net.sf.l2j.gameserver.network.L2GameClient;
@@ -390,6 +392,8 @@
		CastleManager.getInstance();
		SiegeManager.getInstance();

+		AutoRestart.getInstance();
+		
		TeleportLocationTable.getInstance();
		LevelUpData.getInstance();
		L2World.getInstance();
@@ -589,6 +593,7 @@

		_voicedCommandHandler = VoicedCommandHandler.getInstance();
		_voicedCommandHandler.registerVoicedCommandHandler(new stats());
+		_voicedCommandHandler.registerVoicedCommandHandler(new autorestart());

		if(Config.L2JMOD_ALLOW_WEDDING)
			_voicedCommandHandler.registerVoicedCommandHandler(new Wedding());
Index: java/net/sf/l2j/gameserver/model/entity/AutoRestart.java
===================================================================
--- java/net/sf/l2j/gameserver/model/entity/AutoRestart.java	(revision 0)
+++ java/net/sf/l2j/gameserver/model/entity/AutoRestart.java	(revision 0)
@@ -0,0 +1,139 @@
+/* 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 2, 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+package net.sf.l2j.gameserver.model.entity;
+
+import net.sf.l2j.gameserver.Announcements;
+import net.sf.l2j.gameserver.Shutdown;
+import net.sf.l2j.gameserver.ThreadPoolManager;
+import net.sf.l2j.gameserver.model.L2World;
+import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+
+/**
+ *
+ * @author  Codex
+ */
+public class AutoRestart 
+{
+	static boolean canVote = false;
+	public static int yes = 0;
+	public static int no = 0;
+	
+	class Task implements Runnable{
+		public void run()
+		{
+			handle();
+		}	
+	}
+
+	void handle(){
+		globalMessage("Want a server restart? Vote now by pressing .yes or .no");
+		setCanVote(true);
+		globalMessage("In 3 minutes, votes are closed...please press .yes or .no");
+		waitMinutes(2);
+		globalMessage("In 1 minutes, votes are closed...please press .yes or .no");
+		waitMinutes(1);
+		setCanVote(false);
+		globalMessage("Votes closed, results will be shown in 30 seconds");
+		waitSeconds(30);
+		checkTheVotes();
+		clear();
+		
+	}
+	void globalMessage(String s){
+		Announcements.getInstance().announceToAll(s);
+	}
+	
+	void setCanVote(boolean z){
+		canVote = z;
+	}
+	
+	public static boolean getCanVote(){
+		return canVote;
+	}
+	
+	void waitMinutes(int i){
+		try{
+			Thread.sleep(i * 60000);
+		}
+		catch(Exception ie){
+			ie.printStackTrace();
+		}
+	}
+	
+	void waitSeconds(int i){
+		try{
+			Thread.sleep(i * 1000);
+		}
+		catch(Exception ie){
+			ie.printStackTrace();
+		}
+	}
+	
+	public static void increaseYes(boolean n){
+		if(n){
+			yes = yes + 1;
+		}
+		else{
+			no = no + 1 ;
+		}	
+	}
+	
+	int takeYes(){
+		return yes;
+	}
+	
+	int takeNo(){
+		return no;
+	}
+	
+	void checkTheVotes(){
+		globalMessage("Results: Yes: "+takeYes()+", No: "+takeNo());
+		if(takeYes() > takeNo()){
+			globalMessage("Server will restart...");
+			for(L2PcInstance p: L2World.getInstance().getAllPlayers()){
+			Shutdown.getInstance().startShutdown(p, 30, true);}
+		}
+		else if(takeYes() < takeNo()){
+			globalMessage("Server will not restart...");
+			globalMessage("Server is continuing normally");
+		}
+	}
+	
+	void clear(){
+		yes = 0;
+		no = 0;
+		for(L2PcInstance p: L2World.getInstance().getAllPlayers())
+			p._vote = false;
+	}
+	
+	private AutoRestart()
+	{
+	ThreadPoolManager.getInstance().scheduleGeneral(new Task(), 43200000);
+	}
+	
+	 public static AutoRestart getInstance()
+	 {
+	return SingletonHolder._instance;
+	 }
+	      
+	 private static class SingletonHolder
+	 {
+	 @SuppressWarnings("synthetic-access")
+	protected static final AutoRestart _instance = new AutoRestart();
+	}
+}
Index: java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/autorestart.java
===================================================================
--- java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/autorestart.java	(revision 0)
+++ java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/autorestart.java	(revision 0)
@@ -0,0 +1,76 @@
+/* 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 2, 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+package net.sf.l2j.gameserver.handler.voicedcommandhandlers;
+
+import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
+import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+import net.sf.l2j.gameserver.model.entity.AutoRestart;
+
+/**
+ *
+ * @author  Codex
+ */
+public class autorestart implements IVoicedCommandHandler
+{
+
+	private static final String[] VOICED_COMMANDS = { "yes", "no"};
+	
+	public boolean useVoicedCommand(String command, L2PcInstance activeChar,String target)
+	{
+		if(command.startsWith("yes")){
+		if(!AutoRestart.getCanVote()){
+		   return false;
+		}
+		else if(activeChar._vote = true){
+			activeChar.sendMessage("You have already voted.");
+			return false;
+		}
+		else if(activeChar == null) return false;
+		
+		else {
+			activeChar.sendMessage("You voted successfully.");
+			AutoRestart.increaseYes(true);
+			activeChar._vote = true;
+		}
+	}
+		else if(command.startsWith("no")){
+			if(!AutoRestart.getCanVote()){
+				   return false;
+				}
+			else if(activeChar._vote = true){
+				activeChar.sendMessage("You have already voted.");
+				return false;
+			}
+				else if(activeChar == null) return false;
+			
+			activeChar.sendMessage("You voted successfully.");
+			AutoRestart.increaseYes(false);
+			activeChar._vote = true;
+		}
+		return true;
+}
+
+	/**
+	 * @see net.sf.l2j.gameserver.handler.IVoicedCommandHandler#getVoicedCommandList()
+	 */
+	public String[] getVoicedCommandList()
+	{
+		return VOICED_COMMANDS;
+	}
+
+}

Credits:Me

Einai kalo se servers me polla atoma pisteuw, isos an kolisei o server kamia fora, oi an oi gm den einai mesa.

Posted

akomi ena kalo share apo esena .... Aksizei karma i douleia s tis teleutaies meres nomizw alla krima pou dn mporw na sto dosw ... Otan exo xrono 8a to kanw test na dw ama doulevei

 

 

Thanks For share ...

Posted

poly kalo alla na rotiso ekei pou exeis bali auto:

### Eclipse Workspace Patch 1.0
#P TEST_GS2
Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(revision 4767)
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(working copy)
@@ -452,6 +452,7 @@

	private boolean _noble = false;
	private boolean _hero = false;
+	public boolean _vote = false;

simeni oti den ta boroun na psifizoun oi hero kai oi nobless?

Posted

poly kalo alla na rotiso ekei pou exeis bali auto:

### Eclipse Workspace Patch 1.0
#P TEST_GS2
Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(revision 4767)
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(working copy)
@@ -452,6 +452,7 @@

	private boolean _noble = false;
	private boolean _hero = false;
+	public boolean _vote = false;

simeni oti den ta boroun na psifizoun oi hero kai oi nobless?

oxi vevea.....
  • 8 months later...

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

    • Purchase Telegram Stars at a favorable price with minimal markup. New auctions from Telegram are expected, and our bot will help you prepare in advance. Active links: Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. Other services: Digital goods store (Website): Go to Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Virtual numbers service: Go to SMM Panel: Go to – promotion of your social media accounts. We want to present to you the current list of promotions and special offers for purchasing products and services of our service: 1. You can use a promo code for your first purchase: SOCNET (15% discount) 2. Get $1 on your store balance or a 10–20% discount — just send your username after registering on our website using the following template: "SEND ME BONUS, MY USERNAME IS..." — you need to write this in our forum thread! 3. Get $1 for the first trial launch of the SMM Panel: just open a ticket with the subject “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our bot for purchasing stars! News: ➡ Telegram channel: https://t.me/accsforyou_shop ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord server: https://discord.gg/y9AStFFsrh Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Purchase Telegram Stars at a favorable price with minimal markup. New auctions from Telegram are expected, and our bot will help you prepare in advance. Active links: Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. Other services: Digital goods store (Website): Go to Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Virtual numbers service: Go to SMM Panel: Go to – promotion of your social media accounts. We want to present to you the current list of promotions and special offers for purchasing products and services of our service: 1. You can use a promo code for your first purchase: SOCNET (15% discount) 2. Get $1 on your store balance or a 10–20% discount — just send your username after registering on our website using the following template: "SEND ME BONUS, MY USERNAME IS..." — you need to write this in our forum thread! 3. Get $1 for the first trial launch of the SMM Panel: just open a ticket with the subject “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our bot for purchasing stars! News: ➡ Telegram channel: https://t.me/accsforyou_shop ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord server: https://discord.gg/y9AStFFsrh Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Purchase Telegram Stars at a favorable price with minimal markup. New auctions from Telegram are expected, and our bot will help you prepare in advance. Active links: Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. Other services: Digital goods store (Website): Go to Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Virtual numbers service: Go to SMM Panel: Go to – promotion of your social media accounts. We want to present to you the current list of promotions and special offers for purchasing products and services of our service: 1. You can use a promo code for your first purchase: SOCNET (15% discount) 2. Get $1 on your store balance or a 10–20% discount — just send your username after registering on our website using the following template: "SEND ME BONUS, MY USERNAME IS..." — you need to write this in our forum thread! 3. Get $1 for the first trial launch of the SMM Panel: just open a ticket with the subject “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our bot for purchasing stars! News: ➡ Telegram channel: https://t.me/accsforyou_shop ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord server: https://discord.gg/y9AStFFsrh Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • 亲爱的合作伙伴! 目前我们非常需要以下项目: ➡ WhatsApp 老账户 ➡ Twitter 带粉丝和帖子账户(老账户) 请通过以下联系方式与我们联系。我们很高兴与您合作! 我们项目的有效链接: 数字商品商店(网站): 前往 商店 Telegram 机器人: 前往 – 通过 Telegram 信使方便访问商店。 虚拟号码服务: 前往 用于购买 Telegram Stars 的 Telegram 机器人: 前往 – 在 Telegram 中快速且优惠地购买 Stars。 SMM 面板: 前往 – 推广您的社交媒体账户。 联系方式和支持: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Dear partners! At the moment we are in great need of the following positions: ➡ WhatsApp OLD Accounts ➡ Twitter accounts with followers and posts (old accounts) Contact us via the details below. We will be glad to cooperate! Active links to our projects: Digital goods store (Website): Go to Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Virtual numbers service: Go to Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. SMM Panel: Go to – promotion of your social media accounts. Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
  • 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