- 0
-
Quem Está Navegando
- Nenhum usuário registrado visualizando esta página.
-
Posts
-
O conteúdo está oculto, favor efetuar login ou se cadastrar! Entre ou Cadastre-se
-
Boa Noite Galera o @Mr.Kadu postou o link do projeto mas eu fiz um erro e estarei postando a correção. aqueles que baixou o projeto e tentou ligar e deu erro e por causa do java que foi copilado eu copilei no java 22 e o projeto e no java 17 vou postar o link aqui para vcs, vai incluso a Geodata O conteúdo está oculto, favor efetuar login ou se cadastrar! Entre ou Cadastre-se
-
Nova Revisão com AutoFarm e .Menu O conteúdo está oculto, favor efetuar login ou se cadastrar! Entre ou Cadastre-se
-
alguem tambem esta tendo problemas com email ? quando vc loga com a conta e nao tem email cadastrado. eu levo erro 500
-
muito bom meu amigo. vou começar os testes........
-
@Mr.Kadu VOU COMEÇA OS TESTES AGORA MESMO. VOU VER SE COLOCO UM PROJETO ONLINE. USANDO SUA BASE, AI SERÁ MUITO BOM PRA REPORTAR. abraços mano e muito boa iniciativa com esse projeto, que muitos usaram.
-
Por Gabrieljdb · Postado
Falta arquivo "armorgrp.dat" alguém poderia postar. Grato! -
Também to querendo só a textura do drop no chão, se alguém tiver.
-
Opa Obrigado amigo e aguarde que vamos tentar por todas as quests 99,9% funcional principalemnte porque projeto acis nao vi ate agora com quest 90%
-
Pergunta
claudeny
### Eclipse Workspace Patch 1.0
O conteúdo está oculto, favor efetuar login ou se cadastrar!
-
Entre
- ou
-
Cadastre-se
#P aCis_gameserver
Index: java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java
===================================================================
--- java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java (revision 2)
+++ java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java (working copy)
@@ -17,6 +17,7 @@
import net.sf.l2j.Config;
import net.sf.l2j.gameserver.Announcements;
import net.sf.l2j.gameserver.GameTimeController;
+import net.sf.l2j.gameserver.Restart;
import net.sf.l2j.gameserver.communitybbs.Manager.MailBBSManager;
import net.sf.l2j.gameserver.datatables.AdminCommandAccessRights;
import net.sf.l2j.gameserver.datatables.GmListTable;
@@ -186,6 +187,11 @@
}
}
+ if(Config.RESTART_BY_TIME_OF_DAY)
+ {
+ ShowNextRestart(activeChar);
+ }
+
activeChar.getMacroses().sendUpdate();
activeChar.sendPacket(new UserInfo(activeChar));
activeChar.sendPacket(new HennaInfo(activeChar));
@@ -323,4 +329,10 @@
{
return false;
}
+
+ private static void ShowNextRestart(L2PcInstance activeChar)
+ {
+ activeChar.sendMessage("Next Restart: " + Restart.getInstance().getRestartNextTime());
+ }
+
}
\ No newline at end of file
Index: java/net/sf/l2j/gameserver/Restart.java
===================================================================
--- java/net/sf/l2j/gameserver/Restart.java (revision 0)
+++ java/net/sf/l2j/gameserver/Restart.java (working copy)
@@ -0,0 +1,114 @@
+/*
+* 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 <
+*/
+package net.sf.l2j.gameserver;
+
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.logging.Logger;
+
+import net.sf.l2j.Config;
+import net.sf.l2j.gameserver.ThreadPoolManager;
+
+/**
+* @author Toxico
+*/
+
+public class Restart
+ {
+ //Variaveis globais
+ private static Restart _instance = null;
+ protected static final Logger _log = Logger.getLogger(Restart.class.getName());
+ private Calendar NextRestart;
+ private SimpleDateFormat format = new SimpleDateFormat("HH:mm");
+
+ //Singleton
+ public static Restart getInstance()
+ {
+ if(_instance == null)
+ _instance = new Restart();
+ return _instance;
+ }
+
+ public String getRestartNextTime()
+ {
+ if(NextRestart.getTime() != null)
+ return format.format(NextRestart.getTime());
+ return "Erro";
+ }
+
+ //Connstrutor
+ private Restart()
+ {
+ //:D
+ }
+
+ public void StartCalculationOfNextRestartTime()
+ {
+ try
+ {
+ Calendar currentTime = Calendar.getInstance();
+ Calendar testStartTime = null;
+ long flush2 = 0,timeL = 0;
+ int count = 0;
+
+ for (String timeOfDay : Config.RESTART_INTERVAL_BY_TIME_OF_DAY)
+ {
+ testStartTime = Calendar.getInstance();
+ testStartTime.setLenient(true);
+ String[] splitTimeOfDay = timeOfDay.split(":");
+ testStartTime.set(Calendar.HOUR_OF_DAY, Integer.parseInt(splitTimeOfDay[0]));
+ testStartTime.set(Calendar.MINUTE, Integer.parseInt(splitTimeOfDay[1]));
+ testStartTime.set(Calendar.SECOND, 00);
+ //Verifica a validade to tempo
+ if (testStartTime.getTimeInMillis() < currentTime.getTimeInMillis())
+ {
+ testStartTime.add(Calendar.DAY_OF_MONTH, 1);
+ }
+
+ //TimeL Recebe o quanto falta de milisegundos para o restart
+ timeL = testStartTime.getTimeInMillis() - currentTime.getTimeInMillis();
+
+ //Verifica qual horario sera o proximo restart
+ if(count == 0){
+ flush2 = timeL;
+ NextRestart = testStartTime;
+ }
+
+ if(timeL < flush2){
+ flush2 = timeL;
+ NextRestart = testStartTime;
+ }
+
+ count ++;
+ }
+ _log.info("Auto Restart: Next Restart Time: " + NextRestart.getTime().toString());
+ ThreadPoolManager.getInstance().scheduleGeneral(new StartRestartTask(), flush2);
+ }
+ catch (Exception e)
+ {
+ System.out.println("[AutoRestart]: The restart automated server presented error in load restarts period config !");
+ }
+ }
+
+ class StartRestartTask implements Runnable
+ {
+ @Override
+ public void run()
+ {
+ _log.info("Start automated restart GameServer.");
+ Shutdown.getInstance().autoRestart(Config.RESTART_SECONDS);
+ }
+ }
+}
\ No newline at end of file
Index: java/net/sf/l2j/gameserver/GameServer.java
===================================================================
--- java/net/sf/l2j/gameserver/GameServer.java (revision 2)
+++ java/net/sf/l2j/gameserver/GameServer.java (working copy)
@@ -178,6 +178,13 @@
GmListTable.getInstance();
RaidBossPointsManager.getInstance();
+ Util.printSection("Restart Manager");
+ if(Config.RESTART_BY_TIME_OF_DAY)
+ Restart.getInstance().StartCalculationOfNextRestartTime();
+ else
+ _log.info("# Auto Restart System is Disabled #");
+ System.gc();
+
Util.printSection("Community server");
if (Config.ENABLE_COMMUNITY_BOARD) // Forums has to be loaded before clan data
ForumsBBSManager.getInstance().initRoot();
Index: java/net/sf/l2j/gameserver/Shutdown.java
===================================================================
--- java/net/sf/l2j/gameserver/Shutdown.java (revision 2)
+++ java/net/sf/l2j/gameserver/Shutdown.java (working copy)
@@ -71,6 +71,18 @@
Broadcast.toAllOnlinePlayers(sysm);
}
+ public void autoRestart(int time)
+ {
+ _secondsShut = time;
+
+ countdown();
+
+ _shutdownMode = GM_RESTART;
+
+ SingletonHolder._instance.setMode(GM_RESTART);
+ System.exit(2);
+ }
+
/**
* Default constucter is only used internal to create the shutdown-hook instance
*/
Index: java/net/sf/l2j/Config.java
===================================================================
--- java/net/sf/l2j/Config.java (revision 2)
+++ java/net/sf/l2j/Config.java (working copy)
@@ -652,6 +652,11 @@
public static int ZONE_TOWN;
public static boolean DISABLE_TUTORIAL;
+ /** Auto Restart */
+ public static boolean RESTART_BY_TIME_OF_DAY;
+ public static int RESTART_SECONDS;
+ public static String[] RESTART_INTERVAL_BY_TIME_OF_DAY;
+
// --------------------------------------------------
// Those "hidden" settings haven't configs to avoid admins to fuck their server
// You still can experiment changing values here. But don't say I didn't warn you.
@@ -1261,6 +1266,10 @@
ZONE_TOWN = server.getProperty("ZoneTown", 0);
SERVER_NEWS = server.getProperty("ShowServerNews", false);
DISABLE_TUTORIAL = server.getProperty("DisableTutorial", false);
+
+ RESTART_BY_TIME_OF_DAY = Boolean.parseBoolean(server.getProperty("EnableRestartSystem", "false"));
+ RESTART_SECONDS = Integer.parseInt(server.getProperty("RestartSeconds", "360"));
+ RESTART_INTERVAL_BY_TIME_OF_DAY = server.getProperty("RestartByTimeOfDay", "20:00").split(",");
}
else if (Server.serverMode == Server.MODE_LOGINSERVER)
{
Index: config/server.properties
===================================================================
--- config/server.properties (revision 2)
+++ config/server.properties (working copy)
@@ -370,4 +370,20 @@
ShowServerNews = False
# Disable tutorial on new player game entrance. Default: False.
-DisableTutorial = False
\ No newline at end of file
+DisableTutorial = False
+
+# =================================================================
+# Auto Restart
+# =================================================================
+
+# Enable / Disable Restart Auto
+EnableRestartSystem = True
+
+# If EnableRestartSystem = True Describe hours of the day
+# Example: 22:00,23:00 (hh:mm,hh:mm...)
+# NOTE: Separate ":" mm:hh and "," others restart time
+RestartByTimeOfDay = 00:00,12:00
+
+# Seconds to restart the server ( 360 = 5 Minutos )
+# default = 360
+RestartSeconds = 360
Francisco claudeny Silva andrade
Link para o comentário
Compartilhar em outros sites
0 respostass a esta questão
Posts recomendados
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.