|
Você não é registrado, por favor registre-se para ter acesso ao conteúdo completo. Caso seja registrado, efetue login. Esqueceu sua senha? Clique aqui Recomendamos o uso do Mozilla Firefox para uma melhor visualização. |
|
| Início | Postados Hoje | Marcar Fóruns Como Lidos | Álbums | Banidos | SE Team | Medalhas |
|
|||||||
| Registrar | Loteria VIP | Staff SE | Regras do fórum | Comunidade | Arcade | Postados Hoje | Pesquisar | Experience |
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
![]() |
|
|
LinkBack | Ferramentas do Tópico | Modos de Exibição |
|
|
#1 (permalink) | ||||||||||||||
|
Amigo SE
![]() Registrado em: Dec 2008
Localização: São Paulo
Posts: 1,188
Agradeceu: 162
Agradecido 1,768 Vezes em 486 Posts
Achei Ruim:
Acharam ruim Vezes em Posts
Meu Estado:
![]()
Nome Real: Victor
|
Este Mod mostra quantos players estão conectados através do comando .online no momento. Funciona em todas as plataformas.
Código:
[Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]
Index: /java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Online.java
===================================================================
--- /java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Online.java (revision 0)
+++ /java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Online.java (revision 0)
@@ -0,0 +1,59 @@
+package net.sf.l2j.gameserver.handler.voicedcommandhandlers;
+
+
+import net.sf.l2j.gameserver.model.L2World;
+import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+import net.sf.l2j.gameserver.network.SystemMessageId;
+import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
+import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
+
+/**
+*
+* @author Ombladon
+*
+* this class...
+* shows the amount of online players to any1 who calls it.
+*/
+public class Online implements IVoicedCommandHandler
+{
+
+
+private static final String[] VOICED_COMMANDS = {"online"};
+
+public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
+{
+if (command.startsWith("online"))
+{
+showPlayers(activeChar, target);
+}
+
+return true;
+
+}
+
+
+
+public String[] getVoicedCommandList()
+{
+return VOICED_COMMANDS;
+}
+
+
+public void showPlayers (L2PcInstance player, String target)
+
+{
+SystemMessage sm = new SystemMessage(SystemMessageId.S1);
+sm = new SystemMessage(SystemMessageId.S1);
+sm.addString("======<Online Players>======");
+player.sendPacket(sm);
+sm = new SystemMessage(SystemMessageId.S1);
+sm.addString("There are "+L2World.getInstance().getAllPlayers().size()+" players on.");
+player.sendPacket(sm);
+
+sm = new SystemMessage(SystemMessageId.S1);
+sm.addString("=======================");
+player.sendPacket(sm);
+}
+
+
+}
Código:
[Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]
registerVoicedCommandHandler(new Hellbound()); registerVoicedCommandHandler(new Banking()); registerVoicedCommandHandler(new VersionInfo()); + registerVoicedCommandHandler(new Online());
__________________
[Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar] [Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar] |
||||||||||||||
|
|
|||||||||||||||
| O seguinte membro ao lado disse Obrigado(a) a : KaL por gostar deste Post : |
Drako (03-03-2010) |
| Links Patrocinados |
|
|
#2 (permalink) |
|
Banido
![]() Registrado em: Feb 2009
Posts: 22
Agradeceu: 119
Agradecido 61 Vezes em 11 Posts
Achei Ruim:
Acharam ruim Vezes em Posts
|
explica direito pq coloquei asim crieii essa pasta {handler} depois coloqueii um bloco de notas com essas seguintes formas
Código:
[Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]
Index: /java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Online.java
===================================================================
--- /java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Online.java (revision 0)
+++ /java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Online.java (revision 0)
@@ -0,0 +1,59 @@
+package net.sf.l2j.gameserver.handler.voicedcommandhandlers;
+
+
+import net.sf.l2j.gameserver.model.L2World;
+import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+import net.sf.l2j.gameserver.network.SystemMessageId;
+import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
+import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
+
+/**
+*
+* @author Ombladon
+*
+* this class...
+* shows the amount of online players to any1 who calls it.
+*/
+public class Online implements IVoicedCommandHandler
+{
+
+
+private static final String[] VOICED_COMMANDS = {"online"};
+
+public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
+{
+if (command.startsWith("online"))
+{
+showPlayers(activeChar, target);
+}
+
+return true;
+
+}
+
+
+
+public String[] getVoicedCommandList()
+{
+return VOICED_COMMANDS;
+}
+
+
+public void showPlayers (L2PcInstance player, String target)
+
+{
+SystemMessage sm = new SystemMessage(SystemMessageId.S1);
+sm = new SystemMessage(SystemMessageId.S1);
+sm.addString("======<Online Players>======");
+player.sendPacket(sm);
+sm = new SystemMessage(SystemMessageId.S1);
+sm.addString("There are "+L2World.getInstance().getAllPlayers().size()+" players on.");
+player.sendPacket(sm);
+
+sm = new SystemMessage(SystemMessageId.S1);
+sm.addString("=======================");
+player.sendPacket(sm);
+}
+
+
+}
|
|
|
|
|
|
#3 (permalink) |
|
Membro - Tenente
![]() Registrado em: May 2009
Localização: Brasil
Posts: 92
Agradeceu: 29
Agradecido 392 Vezes em 70 Posts
Achei Ruim:
Acharam ruim Vezes em Posts
Nome Real: Aleff
|
voce tem que retirar os "+" sinal de mais(+) se nao vai ficar incorreto o código... pois ai esta o Diff
|
|
|
|
|
|
#4 (permalink) |
|
Membro - Aspirante
![]() Registrado em: Dec 2008
Posts: 50
Agradeceu: 14
Agradecido 8 Vezes em 7 Posts
Achei Ruim:
Acharam ruim Vezes em Posts
|
Vixe ta dificil aqui, o meu nao tem essa segunda parte Vá no arquivo gameserver/handler/VoicedCommandHandler.java, tipo tem esse arquivo mais nao consigo add nada nele, porque nao tem nem linhas semelhantes ^^.
Alguem sabe o que devo fazer, no meu VoicedCommandHandler.java, esta assim : Código:
[Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]
/*
* 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;
import java.util.Map;
import java.util.logging.Logger;
import javolution.util.FastMap;
import net.sf.l2j.Config;
/**
* This class ...
*
* @version $Revision: 1.1.4.5 $ $Date: 2005/03/27 15:30:09 $
*/
public class VoicedCommandHandler
{
private static Logger _log = Logger.getLogger(ItemHandler.class.getName());
private Map<String, IVoicedCommandHandler> _datatable;
public static VoicedCommandHandler getInstance()
{
return SingletonHolder._instance;
}
private VoicedCommandHandler()
{
_datatable = new FastMap<String, IVoicedCommandHandler>();
}
public void registerVoicedCommandHandler(IVoicedCommandHandler handler)
{
String[] ids = handler.getVoicedCommandList();
for (int i = 0; i < ids.length; i++)
{
if (Config.DEBUG)
_log.fine("Adding handler for command " + ids[i]);
_datatable.put(ids[i], handler);
}
}
public IVoicedCommandHandler getVoicedCommandHandler(String voicedCommand)
{
String command = voicedCommand;
if (voicedCommand.indexOf(" ") != -1)
{
command = voicedCommand.substring(0, voicedCommand.indexOf(" "));
}
if (Config.DEBUG)
_log.fine("getting handler for command: " + command + " -> " + (_datatable.get(command) != null));
return _datatable.get(command);
}
/**
* @return
*/
public int size()
{
return _datatable.size();
}
@SuppressWarnings("synthetic-access")
private static class SingletonHolder
{
protected static final VoicedCommandHandler _instance = new VoicedCommandHandler();
}
}
|
|
|
|
|
|
#5 (permalink) | ||||||||||||||
|
Amigo SE
![]() Registrado em: Dec 2008
Localização: São Paulo
Posts: 1,188
Agradeceu: 162
Agradecido 1,768 Vezes em 486 Posts
Achei Ruim:
Acharam ruim Vezes em Posts
Meu Estado:
![]()
Nome Real: Victor
|
Nem todos os packs estão seguindo a mesma orientação na criação dos comandos, por isso essa diferença na hora de registá-los. Procure nos arquivos da pasta handler algum lugar onde tenham estas linhas de registro, similares...caso não encontre, basta adicionar o arquivo do comando, sem registrá-lo, pois será automatico o seu registro.
__________________
[Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar] [Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar] |
||||||||||||||
|
|
|
||||||||||||||
|
|
#8 (permalink) | ||||||||||||||
|
Membro - Veterano
![]() Registrado em: Nov 2008
Posts: 561
Agradeceu: 657
Agradecido 137 Vezes em 103 Posts
Nome Real: ManoeL
|
cara quando voce coloca no SERVIDOR via JAVA automaticamente quando compila ele ja adiciona
---------- gente so lembrando issu se adiciona via JAVA .... não em outros lugares .... se ajudei agradeça |
||||||||||||||
|
|
|
||||||||||||||
| O seguinte membro ao lado disse Obrigado(a) a : ManoeL-ADM por gostar deste Post : |
deserts2 (18-12-2009)
|
|
|
#9 (permalink) |
|
Membro - Cabo
![]() Registrado em: Jun 2009
Posts: 27
Agradeceu: 101
Agradecido 8 Vezes em 5 Posts
Achei Ruim:
Acharam ruim Vezes em Posts
|
entao tipow c eu colokar ali no java eu nao preciso add nada nas config do server ?
qnd eu copilar ja vai tar la a opcao pra false ou true ? |
|
|
|
|
|
#10 (permalink) | ||||||||||||||
|
Membro - Coronel
![]() Registrado em: Nov 2009
Localização: Town of Aden
Posts: 171
Agradeceu: 46
Agradecido 126 Vezes em 64 Posts
Achei Ruim:
Acharam ruim Vezes em Posts
|
isso é um java patch vejam este tutorial para add ele:
[Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar] e tbm... a config si vc quizer add uma config pra isso sugiro que veja o tutorial do Anthony - Java Core Modificacoes é ótimo pra quem esta iniciando no Java tem aqui na area de Java Mods ta aki o link : [Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar] |
||||||||||||||
|
|
|
||||||||||||||
![]() |
|
|