Ir para conteúdo
  • Cadastre-se
  • 0

VoteSystem aCis (Funcionando)


Albeci Nogueira

Pergunta

25 respostass a esta questão

Posts recomendados

  • 0
1 hora atrás, Albeci Nogueira disse:

Bom dia, alguem com um sistema de votesystem funcionando, pode ser aCis ou via web mesmo.

Desde já agradeço! 

toma ai, é pra acis mais antiga mas é só trocar nomes das class ex, Player para L2PcInstance etc

O conteúdo está oculto, favor efetuar login ou se cadastrar!

Editado por Christian-SDM
  • Amei 1
Link para o comentário
Compartilhar em outros sites


  • 0
9 horas atrás, Christian-SDM disse:

toma ai, é pra acis mais antiga mas é só trocar nomes das class ex, Player para L2PcInstance etc

O conteúdo está oculto, favor efetuar login ou se cadastrar!

vou add agora, e te aviso.. vlw maninho...

  • Haha 1

giphy.gif 
Se te ajudei não custa nada Curtir  ou Agradecer😉

Link para o comentário
Compartilhar em outros sites

  • 0
10 horas atrás, Christian-SDM disse:

toma ai, é pra acis mais antiga mas é só trocar nomes das class ex, Player para L2PcInstance etc

O conteúdo está oculto, favor efetuar login ou se cadastrar!

começou os problemas kkkk

mano só  vc pra me salvar aqui!!! to usando o l2jmega

Erro nesses imports..

import br.ms.jmods.leonetosoft.votesystem.VoteSystem;
import br.ms.jmods.leonetosoft.votesystem.enums.TOP;
import br.ms.jmods.leonetosoft.votesystem.objects.IRetorno;
import br.ms.jmods.leonetosoft.votesystem.objects.VoteAutorized;
import br.ms.jmods.leonetosoft.votesystem.objects.VoteFail;
import br.ms.jmods.leonetosoft.votesystem.objects.VoteIpNotAutorized;
import br.ms.jmods.leonetosoft.votesystem.objects.VoteOk;
import br.ms.jmods.leonetosoft.votesystem.objects.VotePlayerNotAutorized;

e não nem o L2NpcInstance.java (posso pegar de outra rev acis que tenha?)

Editado por Albeci Nogueira

giphy.gif 
Se te ajudei não custa nada Curtir  ou Agradecer😉

Link para o comentário
Compartilhar em outros sites

  • 0
Agora, Albeci Nogueira disse:

começou os problemas kkkk

mano só  vc pra me salvar aqui!!! to usando o l2jmega

Erro nesses imports..

import br.ms.jmods.leonetosoft.votesystem.VoteSystem;
import br.ms.jmods.leonetosoft.votesystem.enums.TOP;
import br.ms.jmods.leonetosoft.votesystem.objects.IRetorno;
import br.ms.jmods.leonetosoft.votesystem.objects.VoteAutorized;
import br.ms.jmods.leonetosoft.votesystem.objects.VoteFail;
import br.ms.jmods.leonetosoft.votesystem.objects.VoteIpNotAutorized;
import br.ms.jmods.leonetosoft.votesystem.objects.VoteOk;
import br.ms.jmods.leonetosoft.votesystem.objects.VotePlayerNotAutorized;

e não nem o L2NpcInstance.java (posso pegar de outra rev acis que tenha?)

tem um arquivo chamado voteSystemAPI.jar, coloca ele dentro da pasta lib da sua source, e depois aperta F5, automaticamente os erros vao sumir, porque vai encontrar o arquivo principal, Sobre o  l2npcinstance, vc troca para L2Npc ou Npc, nao sei qual class da acis, pq eu mexo com acis antiga. Mas deve ser L2Npc ou Npc

Editado por Christian-SDM
  • Obrigado 1
Link para o comentário
Compartilhar em outros sites

  • 0
10 minutos atrás, Christian-SDM disse:

tem um arquivo chamado voteSystemAPI.jar, coloca ele dentro da pasta lib da sua source, e depois aperta F5, automaticamente os erros vao sumir, porque vai encontrar o arquivo principal, Sobre o  l2npcinstance, vc troca para L2Npc ou Npc, nao sei qual class da acis, pq eu mexo com acis antiga. Mas deve ser L2Npc ou Npc

adicionei o arquivo a pasta libs e dei F5 aqui antes de ler a resposta.. (tô aprendendo um dia chego ao seu patamar!!! 😄) ja ia postar que tinha dado certo os imports.. vou ver a questão do l2npcinstance.. ja informo!!

giphy.gif 
Se te ajudei não custa nada Curtir  ou Agradecer😉

Link para o comentário
Compartilhar em outros sites

  • 0
Agora, Albeci Nogueira disse:

adicionei o arquivo a pasta libs e dei F5 aqui antes de ler a resposta.. (tô aprendendo um dia chego ao seu patamar!!! 😄) ja ia postar que tinha dado certo os imports.. vou ver a questão do l2npcinstance.. ja informo!!

claro tudo se aprende, eu aprendo cada dia, to fazendo curso mas esses conteudos da l2jbrasil, ta sendo bem util, to aprendendo cada dia. é isso, foco no projeto! 

olhei site oficial da acis é assim

L2NpcInstance > Folk

Editado por Christian-SDM
Link para o comentário
Compartilhar em outros sites

  • 0
4 minutos atrás, Christian-SDM disse:

claro tudo se aprende, eu aprendo cada dia, to fazendo curso mas esses conteudos da l2jbrasil, ta sendo bem util, to aprendendo cada dia. é isso, foco no projeto! 

olhei site oficial da acis é assim

L2NpcInstance > Folk

Show mano, um dia vou fazer tbm um curso java... por enquanto pegando essa experiencia aqui.. muita gente que gosta de ajudar.. foco e vontade é meio caminho andado!!!

-------

ahh top... as vezes tem umas mudanças muito louca na rev.. L2NpcInstance  para Folk    lol

  • Haha 1

giphy.gif 
Se te ajudei não custa nada Curtir  ou Agradecer😉

Link para o comentário
Compartilhar em outros sites

  • 0
2 minutos atrás, Christian-SDM disse:

só um aviso rapido , essas novas acis tao cheio de frescura. sobre a class L2VoteSystemGlobalInstance

vc deixa VoteSystemGlobal  

porque se não, não vai consegui le o npc na hora de spawnar xD

blz.. terminei de add agora... 

nenhum erro.. Amém

vou compilar agora!!

  • Amei 1

giphy.gif 
Se te ajudei não custa nada Curtir  ou Agradecer😉

Link para o comentário
Compartilhar em outros sites

  • 0

@Christian-SDM Boa noite mano... 

Compilei.. deu tudo certinho, dei spawn no npc mais não aparece o html do mesmo. 

Sendo que o arquivo com o id do npc que coloquei 55010 está dentro da pasta VoteSystemGlobal em html

segue imagens:

Spoiler

image.png.eb8ee5e68639ad44e6947ee5304d636a.png

image.png.2d6f3547894bf83157c276d1183eb768.png

image.png.2b9565c9de0e27760cd6dfaf0cd7d1fd.png


 

giphy.gif 
Se te ajudei não custa nada Curtir  ou Agradecer😉

Link para o comentário
Compartilhar em outros sites

  • 0
Agora, Albeci Nogueira disse:

@Christian-SDM Boa noite mano... 

Compilei.. deu tudo certinho, dei spawn no npc mais não aparece o html do mesmo. 

Sendo que o arquivo com o id do npc que coloquei 55010 está dentro da pasta VoteSystemGlobal em html

segue imagens:

  Ocultar conteúdo

image.png.eb8ee5e68639ad44e6947ee5304d636a.png

image.png.2d6f3547894bf83157c276d1183eb768.png

image.png.2b9565c9de0e27760cd6dfaf0cd7d1fd.png


 

deve te errado alguma coisa, ou type do npc ou la no core na hora de trocar o nome

Link para o comentário
Compartilhar em outros sites

  • 0
2 minutos atrás, Christian-SDM disse:

deve te errado alguma coisa, ou type do npc ou la no core na hora de trocar o nome

vou revisar o código... e ver o que eu acho! me tira outra duvida, só funciona quando o server tiver online na vps, certo?

giphy.gif 
Se te ajudei não custa nada Curtir  ou Agradecer😉

Link para o comentário
Compartilhar em outros sites

  • 0

Vi que ele criou uma pasta dentro de gamaserver com o arquivo log.ERROR

Spoiler

[17/03/2020][22:51] - Define API Key!!!
[17/03/2020][22:51] - Impossivel de coletar votos.
[17/03/2020][22:52] - Impossivel de coletar votos.
[17/03/2020][22:56] - Impossivel de coletar votos.
[17/03/2020][22:57] - Impossivel de coletar votos.
[17/03/2020][22:57] - Impossivel de coletar votos.
[17/03/2020][22:59] - Impossivel de coletar votos.
[17/03/2020][22:59] - Impossivel de coletar votos.
[17/03/2020][23:13] - Define API Key!!!
[17/03/2020][23:13] - Impossivel de coletar votos.
[17/03/2020][23:13] - Impossivel de coletar votos.
[17/03/2020][23:15] - Impossivel de coletar votos.
[17/03/2020][23:16] - Impossivel de coletar votos.
[17/03/2020][23:16] - Impossivel de coletar votos.
[17/03/2020][23:16] - Impossivel de coletar votos.
[17/03/2020][23:17] - Impossivel de coletar votos.
[17/03/2020][23:17] - Impossivel de coletar votos.
[17/03/2020][23:19] - Impossivel de coletar votos.
[17/03/2020][23:20] - Impossivel de coletar votos.
[17/03/2020][23:33] - Impossivel de coletar votos.
[17/03/2020][23:35] - Impossivel de coletar votos.
[17/03/2020][23:35] - Impossivel de coletar votos.
[17/03/2020][23:36] - Impossivel de coletar votos.
[17/03/2020][23:36] - Impossivel de coletar votos.

Sendo que já coloquei API

Editado por Albeci Nogueira

giphy.gif 
Se te ajudei não custa nada Curtir  ou Agradecer😉

Link para o comentário
Compartilhar em outros sites

  • 0
Agora, Albeci Nogueira disse:

Vi que ele criou uma pasta dentro de gamaserver com o arquivo log.ERROR

  Ocultar conteúdo

[17/03/2020][22:51] - Define API Key!!!
[17/03/2020][22:51] - Impossivel de coletar votos.
[17/03/2020][22:52] - Impossivel de coletar votos.
[17/03/2020][22:56] - Impossivel de coletar votos.
[17/03/2020][22:57] - Impossivel de coletar votos.
[17/03/2020][22:57] - Impossivel de coletar votos.
[17/03/2020][22:59] - Impossivel de coletar votos.
[17/03/2020][22:59] - Impossivel de coletar votos.
[17/03/2020][23:13] - Define API Key!!!
[17/03/2020][23:13] - Impossivel de coletar votos.
[17/03/2020][23:13] - Impossivel de coletar votos.
[17/03/2020][23:15] - Impossivel de coletar votos.
[17/03/2020][23:16] - Impossivel de coletar votos.
[17/03/2020][23:16] - Impossivel de coletar votos.
[17/03/2020][23:16] - Impossivel de coletar votos.
[17/03/2020][23:17] - Impossivel de coletar votos.
[17/03/2020][23:17] - Impossivel de coletar votos.
[17/03/2020][23:19] - Impossivel de coletar votos.
[17/03/2020][23:20] - Impossivel de coletar votos.
[17/03/2020][23:33] - Impossivel de coletar votos.
[17/03/2020][23:35] - Impossivel de coletar votos.
[17/03/2020][23:35] - Impossivel de coletar votos.
[17/03/2020][23:36] - Impossivel de coletar votos.
[17/03/2020][23:36] - Impossivel de coletar votos.

Sendo que já coloquei API

mas vc n consegue nem abrir html como vai votar?

Agora, Albeci Nogueira disse:

Vi que ele criou uma pasta dentro de gamaserver com o arquivo log.ERROR

  Mostrar conteúdo oculto

[17/03/2020][22:51] - Define API Key!!!
[17/03/2020][22:51] - Impossivel de coletar votos.
[17/03/2020][22:52] - Impossivel de coletar votos.
[17/03/2020][22:56] - Impossivel de coletar votos.
[17/03/2020][22:57] - Impossivel de coletar votos.
[17/03/2020][22:57] - Impossivel de coletar votos.
[17/03/2020][22:59] - Impossivel de coletar votos.
[17/03/2020][22:59] - Impossivel de coletar votos.
[17/03/2020][23:13] - Define API Key!!!
[17/03/2020][23:13] - Impossivel de coletar votos.
[17/03/2020][23:13] - Impossivel de coletar votos.
[17/03/2020][23:15] - Impossivel de coletar votos.
[17/03/2020][23:16] - Impossivel de coletar votos.
[17/03/2020][23:16] - Impossivel de coletar votos.
[17/03/2020][23:16] - Impossivel de coletar votos.
[17/03/2020][23:17] - Impossivel de coletar votos.
[17/03/2020][23:17] - Impossivel de coletar votos.
[17/03/2020][23:19] - Impossivel de coletar votos.
[17/03/2020][23:20] - Impossivel de coletar votos.
[17/03/2020][23:33] - Impossivel de coletar votos.
[17/03/2020][23:35] - Impossivel de coletar votos.
[17/03/2020][23:35] - Impossivel de coletar votos.
[17/03/2020][23:36] - Impossivel de coletar votos.
[17/03/2020][23:36] - Impossivel de coletar votos.

Sendo que já coloquei API

peloq  eu vi ja tem systema de vote na l2jmega pq ja existe o boolean e a publicação dela., mas to adicionando aqui pra ve

Agora, Albeci Nogueira disse:

Vi que ele criou uma pasta dentro de gamaserver com o arquivo log.ERROR

  Mostrar conteúdo oculto

[17/03/2020][22:51] - Define API Key!!!
[17/03/2020][22:51] - Impossivel de coletar votos.
[17/03/2020][22:52] - Impossivel de coletar votos.
[17/03/2020][22:56] - Impossivel de coletar votos.
[17/03/2020][22:57] - Impossivel de coletar votos.
[17/03/2020][22:57] - Impossivel de coletar votos.
[17/03/2020][22:59] - Impossivel de coletar votos.
[17/03/2020][22:59] - Impossivel de coletar votos.
[17/03/2020][23:13] - Define API Key!!!
[17/03/2020][23:13] - Impossivel de coletar votos.
[17/03/2020][23:13] - Impossivel de coletar votos.
[17/03/2020][23:15] - Impossivel de coletar votos.
[17/03/2020][23:16] - Impossivel de coletar votos.
[17/03/2020][23:16] - Impossivel de coletar votos.
[17/03/2020][23:16] - Impossivel de coletar votos.
[17/03/2020][23:17] - Impossivel de coletar votos.
[17/03/2020][23:17] - Impossivel de coletar votos.
[17/03/2020][23:19] - Impossivel de coletar votos.
[17/03/2020][23:20] - Impossivel de coletar votos.
[17/03/2020][23:33] - Impossivel de coletar votos.
[17/03/2020][23:35] - Impossivel de coletar votos.
[17/03/2020][23:35] - Impossivel de coletar votos.
[17/03/2020][23:36] - Impossivel de coletar votos.
[17/03/2020][23:36] - Impossivel de coletar votos.

Sendo que já coloquei API

ja existe o mod vote mas é por comando, a class é VoteHandler.java !!

Agora, Albeci Nogueira disse:

Vi que ele criou uma pasta dentro de gamaserver com o arquivo log.ERROR

  Mostrar conteúdo oculto

[17/03/2020][22:51] - Define API Key!!!
[17/03/2020][22:51] - Impossivel de coletar votos.
[17/03/2020][22:52] - Impossivel de coletar votos.
[17/03/2020][22:56] - Impossivel de coletar votos.
[17/03/2020][22:57] - Impossivel de coletar votos.
[17/03/2020][22:57] - Impossivel de coletar votos.
[17/03/2020][22:59] - Impossivel de coletar votos.
[17/03/2020][22:59] - Impossivel de coletar votos.
[17/03/2020][23:13] - Define API Key!!!
[17/03/2020][23:13] - Impossivel de coletar votos.
[17/03/2020][23:13] - Impossivel de coletar votos.
[17/03/2020][23:15] - Impossivel de coletar votos.
[17/03/2020][23:16] - Impossivel de coletar votos.
[17/03/2020][23:16] - Impossivel de coletar votos.
[17/03/2020][23:16] - Impossivel de coletar votos.
[17/03/2020][23:17] - Impossivel de coletar votos.
[17/03/2020][23:17] - Impossivel de coletar votos.
[17/03/2020][23:19] - Impossivel de coletar votos.
[17/03/2020][23:20] - Impossivel de coletar votos.
[17/03/2020][23:33] - Impossivel de coletar votos.
[17/03/2020][23:35] - Impossivel de coletar votos.
[17/03/2020][23:35] - Impossivel de coletar votos.
[17/03/2020][23:36] - Impossivel de coletar votos.
[17/03/2020][23:36] - Impossivel de coletar votos.

Sendo que já coloquei API

ja existe o npc de vote!

VoteNpc.java

Link para o comentário
Compartilhar em outros sites

  • 0
Agora, Albeci Nogueira disse:

pois é.. num sei o que aconteceu.. mas apareceu essa pasta ai e esse log de erro.. estou revisando aqui..

 

sim ta dando erro pq ta dando conlfito, ja existe ação do npc vote, vc ta adicionando outro em cima, ja existe o npc, da uma olhada nos xmls, la tem npc de vote funcionando. Mas creio q n ta funcionando pq vc deve te alterado, tentando colocar esse

Link para o comentário
Compartilhar em outros sites

  • 0
8 minutos atrás, Christian-SDM disse:

mas vc n consegue nem abrir html como vai votar?

peloq  eu vi ja tem systema de vote na l2jmega pq ja existe o boolean e a publicação dela., mas to adicionando aqui pra ve

ja existe o mod vote mas é por comando, a class é VoteHandler.java !!

ja existe o npc de vote!

VoteNpc.java

eu tirei tudo que tinha a respeito dele, nao estava funcionando e quando fui adicionar esse que me passou estava com erro de duplicação  em isVoting, então removi o código do antigo.

giphy.gif 
Se te ajudei não custa nada Curtir  ou Agradecer😉

Link para o comentário
Compartilhar em outros sites

  • 0
Agora, Albeci Nogueira disse:

eu tirei tudo que tinha a respeito dele, nao estava funcionando e quando fui adicionar esse que me passou estava com erro de duplicação  em isVoting, então removi o código do antigo.

nao tava funcionando npc de vote q ja tinha? ou vc n souber usar? pq comigo ta funcionando tanto esse da jmega como esse q te mandei.

Link para o comentário
Compartilhar em outros sites

  • 0
5 minutos atrás, Christian-SDM disse:

nao tava funcionando npc de vote q ja tinha? ou vc n souber usar? pq comigo ta funcionando tanto esse da jmega como esse q te mandei.

oxe.. pois tentei muito, configurei os links normal, votava e não reconhecia o voto, informava que não tinha votado!

#Hopzone Url Link.
HopzoneUrl =

O conteúdo está oculto, favor efetuar login ou se cadastrar!

está correto?

Editado por Albeci Nogueira

giphy.gif 
Se te ajudei não custa nada Curtir  ou Agradecer😉

Link para o comentário
Compartilhar em outros sites

  • 0
Agora, Albeci Nogueira disse:

oxe.. pois tentei muito, configurei os links normal, votava e não reconhecia o voto, informava que não tinha votado!

Então não sei pq ja foi utilizado. Mas tenta esse ai q vo enviar, eu coloquei na jmega ja adaptado.

Spoiler

/*
 * 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.model.actor.instance;

import java.util.StringTokenizer;

import net.sf.l2j.commons.concurrent.ThreadPool;

import net.sf.l2j.Config;
import net.sf.l2j.gameserver.datatables.GmListTable;
import net.sf.l2j.gameserver.model.World;
import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
import net.sf.l2j.gameserver.network.clientpackets.Say2;
import net.sf.l2j.gameserver.network.serverpackets.CreatureSay;

import br.ms.jmods.leonetosoft.votesystem.VoteSystem;
import br.ms.jmods.leonetosoft.votesystem.enums.TOP;
import br.ms.jmods.leonetosoft.votesystem.objects.IRetorno;
import br.ms.jmods.leonetosoft.votesystem.objects.VoteAutorized;
import br.ms.jmods.leonetosoft.votesystem.objects.VoteFail;
import br.ms.jmods.leonetosoft.votesystem.objects.VoteIpNotAutorized;
import br.ms.jmods.leonetosoft.votesystem.objects.VoteOk;
import br.ms.jmods.leonetosoft.votesystem.objects.VotePlayerNotAutorized;


/**
 * Vote System Global Licensing in: votesystemglobal.com
 * @author leonetosoft
 */
public class VoteNPC extends Folk
{
    private int TOTAL_VOTES = 0;
    private int PLAYERS_IN_VOTE = 0;
    
    public VoteNPC(int objectID, NpcTemplate template)
    {
        super(objectID, template);
    }
    
    /**
     * ByPass use
     *     <a action="bypass -h npc_%objectId%_vote 1"><font color="FFFF00">VOTE FOR TOPZONE</font></a><br1>
     *    <a action="bypass -h npc_%objectId%_vote 2"><font color="FFFF00">VOTE FOR TOPSERVERS200</font></a><br1>
     *    <a action="bypass -h npc_%objectId%_vote 3"><font color="FFFF00">VOTE FOR L2JBRASIL</font></a><br1>
     *    <a action="bypass -h npc_%objectId%_vote 4"><font color="FFFF00">VOTE FOR L2NETWORK</font></a><br1>
     *    <a action="bypass -h npc_%objectId%_vote 5"><font color="FFFF00">VOTE FOR HOPZONE</font></a><br1>
     *  ...
     */
    @Override
    public void onBypassFeedback(final Player player, String command)
    {
        StringTokenizer st = new StringTokenizer(command, " ");
        String currentcommand = st.nextToken();
        
        if (VoteSystem.getInstance().getKey() == null)
        {
            configureSystem();
        }
        
        try
        {
            if (currentcommand.startsWith("vote"))
            {
                if (Config.VOTE_SYSTEM_GLOBAL_MIN_LV != 0 && player.getLevel() < Config.VOTE_SYSTEM_GLOBAL_MIN_LV)
                {
                    player.sendMessage("Min Lv to vote is " + Config.VOTE_SYSTEM_GLOBAL_MIN_LV + ".");
                    return;
                }
                if (Config.VOTE_SYSTEM_GLOBAL_MIN_PVP != 0 && player.getPvpKills() < Config.VOTE_SYSTEM_GLOBAL_MIN_PVP)
                {
                    player.sendMessage("Min PvP to vote is " + Config.VOTE_SYSTEM_GLOBAL_MIN_PVP + ".");
                    return;
                }
                if (player.isVoting())
                {
                    player.sendMessage("You should expect another validation process.");
                    return;
                }
                
                int top = Integer.parseInt(st.nextToken());
                String ip = player.getClient().getConnection().getInetAddress().getHostAddress();
                
                TOP voteTop = null;
                switch (top)
                {
                    case 1: // TOPZONE
                        if (Config.VOTE_SYSTEM_GLOBAL_TOPZONE_ENABLE)
                            voteTop = TOP.TOPZONE;
                        break;
                    
                    case 2:// TOPSERVERS200
                        if (Config.VOTE_SYSTEM_GLOBAL_TOPSERVERS200_ENABLE)
                            voteTop = TOP.TOPSERVERS200;
                        break;
                    
                    case 3:// L2JBRASIL
                        if (Config.VOTE_SYSTEM_GLOBAL_L2JBRASIL_ENABLE)
                            voteTop = TOP.L2JBRASIL;
                        break;
                    
                    case 4:// L2NETWORK
                        if (Config.VOTE_SYSTEM_GLOBAL_L2NETWORK_ENABLE)
                            voteTop = TOP.L2NETWORK;
                        break;
                    
                    case 5:// HOPZONE
                        if (Config.VOTE_SYSTEM_GLOBAL_HOPZONE_ENABLE)
                            voteTop = TOP.HOPZONE;
                        break;
                    
                    case 6:// TOPEXPERT
                        if (Config.VOTE_SYSTEM_GLOBAL_TOPEXPERT_ENABLE)
                            voteTop = TOP.TOPEXPERT200;
                        break;
                        
                    case 7:// TOP100ARENA
                        if (Config.VOTE_SYSTEM_GLOBAL_TOP100ARENA_ENABLE)
                            voteTop = TOP.TOP100ARENA;
                        break;
                }
                
                if (voteTop == null)
                {
                    say(player, "Vote selected is deactived.");
                    return;
                }
                
                if (!canVote())
                {
                    say(player, "The NPC reached the amount of simultaneous vote, please wait.");
                    return;
                }
                
                addPlayerVote();
                player.isVoting(true);
                
                IRetorno ret = VoteSystem.getInstance().autorizeVote(player.getObjectId(), player.getName(), ip, voteTop);
                
                if (ret == null)
                {
                    decrementPlayerVote();
                    player.isVoting(false);
                    say(player, "Vote not autorized in " + voteTop);
                    return;
                }
                
                if (ret instanceof VotePlayerNotAutorized)
                {
                    player.isVoting(false);
                    decrementPlayerVote();
                    String nextvote = ((VotePlayerNotAutorized) ret).getNextVote();
                    say(player, "Vote not autorized, please await next vote in " + nextvote);
                    return;
                }
                
                if (ret instanceof VoteIpNotAutorized)
                {
                    player.isVoting(false);
                    decrementPlayerVote();
                    String nextvote = ((VoteIpNotAutorized) ret).getAutorizeDate();
                    say(player, "Ip not autorized, please await next vote in " + nextvote);
                    return;
                }
                
                if (ret instanceof VoteAutorized)
                {
                    say(player, "Authorized vote, your vote in " + voteTop.toString() + " will be validated in " + Config.VOTE_SYSTEM_GLOBA_DELAY_CONFIRM + " seconds, we will vote now to earn your reward.");
                    say(player, "Your protocol for this vote is: #" + ((VoteAutorized) ret).getVoteId());
                    ThreadPool.schedule(new ValidVote(player.getName(), voteTop), Config.VOTE_SYSTEM_GLOBA_DELAY_CONFIRM * 1000);
                }
            }
            else
                super.onBypassFeedback(player, command);
        }
        catch (Exception e)
        {
            player.sendMessage("NPC ESTA APRESENTANDO ERRO, INFORME O ADMIN!");
            e.printStackTrace();
        }
        
    }
    
    public synchronized boolean canVote()
    {
        if (this.PLAYERS_IN_VOTE < Config.VOTE_SYSTEM_GLOBAL_TOTAL_VOTE_SIMULTANEOUS)
        {
            return true;
        }
        
        return false;
    }
    
    public synchronized void addPlayerVote()
    {
        this.PLAYERS_IN_VOTE++;
    }
    
    public synchronized void decrementPlayerVote()
    {
        this.PLAYERS_IN_VOTE--;
    }
    
    void say(Player player, String msg)
    {
        CreatureSay statusItemMsg = new CreatureSay(0, Say2.TELL, this.getTemplate().getName(), msg);
        
        player.sendPacket(statusItemMsg);
    }
    
    /**
     * Packet Configure API
     */
    public void configureSystem()
    {
        System.out.println("Vote System Global: Configuring system params.");
        VoteSystem.getInstance().setKey(Config.VOTE_SYSTEM_GLOBAL_CLIENT_KEY);
        VoteSystem.getInstance().setServerApi(Config.VOTE_SYSTEM_GLOBAL_API_URL);
        VoteSystem.getInstance().configureApi(Config.VOTE_SYSTEM_GLOBAL_TOPZONE_ID, Config.VOTE_SYSTEM_GLOBAL_TOPSERVERS200_ID, Config.VOTE_SYSTEM_GLOBAL_L2JBRASIL_ID, Config.VOTE_SYSTEM_GLOBAL_L2NETWORK_ID, Config.VOTE_SYSTEM_GLOBAL_HOPZONE_ID, Config.VOTE_SYSTEM_GLOBAL_TOPEXPERT_ID, Config.VOTE_SYSTEM_GLOBAL_TOP100ARENA_ID);
        System.out.println("Vote System Global: Couting total votes confirmed.");
        setTotalVotes(VoteSystem.getInstance().getVotesCount());
        System.out.println("Vote System Global: Total Votes confirmed is: #" + getTotalVotes());
        
    }
    
    /**
     * Add item
     * @param player
     * @param id
     * @param count
     */
    public synchronized void AddItem(Player player, int id, int count)
    {
        player.addItem("voteSystem", id, count, this, true);
    }
    
    public int getTotalVotes()
    {
        return TOTAL_VOTES;
    }
    
    public void setTotalVotes(int tOTAL_VOTES)
    {
        TOTAL_VOTES = tOTAL_VOTES;
    }
    
    /**
     * Thread vote validation
     * - Check if player is online
     * @author leonetosoft
     */
    private class ValidVote implements Runnable
    {
        private String player_name;
        private TOP top;
        
        public ValidVote(String player_name, TOP top)
        {
            this.player_name = player_name;
            this.top = top;
        }
    
        @Override
        public void run()
        {
            decrementPlayerVote();
            
            Player player = World.getInstance().getPlayer(player_name);
            
            if (player == null || (player.getClient() == null || !player.isOnline()))
            {
                System.out.println("Vote System Global: Warning player " + player_name + " current offline.");
                return;
            }
            
            player.isVoting(false);
            
            IRetorno ret = VoteSystem.getInstance().validVote(player.getObjectId(), player.getClient().getConnection().getInetAddress().getHostAddress(), top);

            if (ret == null)
            {
                say(player, "Your vote in " + top.toString() + " is not validated.");
                return;
            }
            
            if (ret instanceof VoteFail)
            {
                say(player, "Your vote in " + top.toString() + " has NOT been confirmed!.");
                return;
            }
            
            if (ret instanceof VoteOk)
            {
                setTotalVotes(((VoteOk) ret).getTotalVotes());
                say(player, "Thanks for your vote! Vote number is #" + ((VoteOk) ret).getTotalVotes());
                AddItem(player, Config.VOTE_SYSTEM_GLOBAL_REWARD_ID, Config.VOTE_SYSTEM_GLOBAL_REWARD_AMOUNT);
                say(player, "Next vote in " + top.toString() + ": " + ((VoteOk) ret).getNextVote());
                GmListTable.broadcastMessageToGMs("Vote System Global: Player " + player.getName() + " confirmed vote. Total vote confirmed: " + getTotalVotes());
            }
            
        }
        
    }
    
}

 

Link para o comentário
Compartilhar em outros sites

  • 0
53 minutos atrás, Albeci Nogueira disse:

oxe.. pois tentei muito, configurei os links normal, votava e não reconhecia o voto, informava que não tinha votado!

#Hopzone Url Link.
HopzoneUrl =

O conteúdo está oculto, favor efetuar login ou se cadastrar!

está correto?

diz que é privado o mod q precisa de lincença, mas eu usei no projeto aqui antes lol

89601779_199100187991288_4650443519838650368_n.png?_nc_cat=111&_nc_sid=b96e70&_nc_ohc=UUDceeNMA74AX-pF3Eo&_nc_ht=scontent.fpet4-1.fna&oh=6927bc9fb4b8989d719e03eadcafc2dc&oe=5E95D1E1

 

Link para o comentário
Compartilhar em outros sites

  • 0

Lembrei, tem que botar o arquivo html, dentro da pasta default

Toma Arquivo adaptado 

Spoiler

/*
 * 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.model.actor.instance;

import java.util.StringTokenizer;

import net.sf.l2j.commons.concurrent.ThreadPool;

import net.sf.l2j.Config;
import net.sf.l2j.gameserver.datatables.GmListTable;
import net.sf.l2j.gameserver.model.World;
import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
import net.sf.l2j.gameserver.network.clientpackets.Say2;
import net.sf.l2j.gameserver.network.serverpackets.CreatureSay;

import br.ms.jmods.leonetosoft.votesystem.VoteSystem;
import br.ms.jmods.leonetosoft.votesystem.enums.TOP;
import br.ms.jmods.leonetosoft.votesystem.objects.IRetorno;
import br.ms.jmods.leonetosoft.votesystem.objects.VoteAutorized;
import br.ms.jmods.leonetosoft.votesystem.objects.VoteFail;
import br.ms.jmods.leonetosoft.votesystem.objects.VoteIpNotAutorized;
import br.ms.jmods.leonetosoft.votesystem.objects.VoteOk;
import br.ms.jmods.leonetosoft.votesystem.objects.VotePlayerNotAutorized;


/**
 * Vote System Global Licensing in: votesystemglobal.com
 * @author leonetosoft
 */
public class VoteSystemGlobal extends Folk
{
    private int TOTAL_VOTES = 0;
    private int PLAYERS_IN_VOTE = 0;
    
    public VoteSystemGlobal(int objectId, NpcTemplate template)
    {
        super(objectId, template);
    }
    
    /**
     * ByPass use
     *     <a action="bypass -h npc_%objectId%_vote 1"><font color="FFFF00">VOTE FOR TOPZONE</font></a><br1>
     *    <a action="bypass -h npc_%objectId%_vote 2"><font color="FFFF00">VOTE FOR TOPSERVERS200</font></a><br1>
     *    <a action="bypass -h npc_%objectId%_vote 3"><font color="FFFF00">VOTE FOR L2JBRASIL</font></a><br1>
     *    <a action="bypass -h npc_%objectId%_vote 4"><font color="FFFF00">VOTE FOR L2NETWORK</font></a><br1>
     *    <a action="bypass -h npc_%objectId%_vote 5"><font color="FFFF00">VOTE FOR HOPZONE</font></a><br1>
     *  ...
     */
    @Override
    public void onBypassFeedback(final Player player, String command)
    {
        StringTokenizer st = new StringTokenizer(command, " ");
        String currentcommand = st.nextToken();
        
        if (VoteSystem.getInstance().getKey() == null)
        {
            configureSystem();
        }
        
        try
        {
            if (currentcommand.startsWith("vote"))
            {
                if (Config.VOTE_SYSTEM_GLOBAL_MIN_LV != 0 && player.getLevel() < Config.VOTE_SYSTEM_GLOBAL_MIN_LV)
                {
                    player.sendMessage("Min Lv to vote is " + Config.VOTE_SYSTEM_GLOBAL_MIN_LV + ".");
                    return;
                }
                if (Config.VOTE_SYSTEM_GLOBAL_MIN_PVP != 0 && player.getPvpKills() < Config.VOTE_SYSTEM_GLOBAL_MIN_PVP)
                {
                    player.sendMessage("Min PvP to vote is " + Config.VOTE_SYSTEM_GLOBAL_MIN_PVP + ".");
                    return;
                }
                if (player.isVoting())
                {
                    player.sendMessage("You should expect another validation process.");
                    return;
                }
                
                int top = Integer.parseInt(st.nextToken());
                String ip = player.getClient().getConnection().getInetAddress().getHostAddress();
                
                TOP voteTop = null;
                switch (top)
                {
                    case 1: // TOPZONE
                        if (Config.VOTE_SYSTEM_GLOBAL_TOPZONE_ENABLE)
                            voteTop = TOP.TOPZONE;
                        break;
                    
                    case 2:// TOPSERVERS200
                        if (Config.VOTE_SYSTEM_GLOBAL_TOPSERVERS200_ENABLE)
                            voteTop = TOP.TOPSERVERS200;
                        break;
                    
                    case 3:// L2JBRASIL
                        if (Config.VOTE_SYSTEM_GLOBAL_L2JBRASIL_ENABLE)
                            voteTop = TOP.L2JBRASIL;
                        break;
                    
                    case 4:// L2NETWORK
                        if (Config.VOTE_SYSTEM_GLOBAL_L2NETWORK_ENABLE)
                            voteTop = TOP.L2NETWORK;
                        break;
                    
                    case 5:// HOPZONE
                        if (Config.VOTE_SYSTEM_GLOBAL_HOPZONE_ENABLE)
                            voteTop = TOP.HOPZONE;
                        break;
                    
                    case 6:// TOPEXPERT
                        if (Config.VOTE_SYSTEM_GLOBAL_TOPEXPERT_ENABLE)
                            voteTop = TOP.TOPEXPERT200;
                        break;
                        
                    case 7:// TOP100ARENA
                        if (Config.VOTE_SYSTEM_GLOBAL_TOP100ARENA_ENABLE)
                            voteTop = TOP.TOP100ARENA;
                        break;
                }
                
                if (voteTop == null)
                {
                    say(player, "Vote selected is deactived.");
                    return;
                }
                
                if (!canVote())
                {
                    say(player, "The NPC reached the amount of simultaneous vote, please wait.");
                    return;
                }
                
                addPlayerVote();
                player.isVoting(true);
                
                IRetorno ret = VoteSystem.getInstance().autorizeVote(player.getObjectId(), player.getName(), ip, voteTop);
                
                if (ret == null)
                {
                    decrementPlayerVote();
                    player.isVoting(false);
                    say(player, "Vote not autorized in " + voteTop);
                    return;
                }
                
                if (ret instanceof VotePlayerNotAutorized)
                {
                    player.isVoting(false);
                    decrementPlayerVote();
                    String nextvote = ((VotePlayerNotAutorized) ret).getNextVote();
                    say(player, "Vote not autorized, please await next vote in " + nextvote);
                    return;
                }
                
                if (ret instanceof VoteIpNotAutorized)
                {
                    player.isVoting(false);
                    decrementPlayerVote();
                    String nextvote = ((VoteIpNotAutorized) ret).getAutorizeDate();
                    say(player, "Ip not autorized, please await next vote in " + nextvote);
                    return;
                }
                
                if (ret instanceof VoteAutorized)
                {
                    say(player, "Authorized vote, your vote in " + voteTop.toString() + " will be validated in " + Config.VOTE_SYSTEM_GLOBA_DELAY_CONFIRM + " seconds, we will vote now to earn your reward.");
                    say(player, "Your protocol for this vote is: #" + ((VoteAutorized) ret).getVoteId());
                    ThreadPool.schedule(new ValidVote(player.getName(), voteTop), Config.VOTE_SYSTEM_GLOBA_DELAY_CONFIRM * 1000);
                }
            }
            else
                super.onBypassFeedback(player, command);
        }
        catch (Exception e)
        {
            player.sendMessage("NPC ESTA APRESENTANDO ERRO, INFORME O ADMIN!");
            e.printStackTrace();
        }
        
    }
    
    public synchronized boolean canVote()
    {
        if (this.PLAYERS_IN_VOTE < Config.VOTE_SYSTEM_GLOBAL_TOTAL_VOTE_SIMULTANEOUS)
        {
            return true;
        }
        
        return false;
    }
    
    public synchronized void addPlayerVote()
    {
        this.PLAYERS_IN_VOTE++;
    }
    
    public synchronized void decrementPlayerVote()
    {
        this.PLAYERS_IN_VOTE--;
    }
    
    void say(Player player, String msg)
    {
        CreatureSay statusItemMsg = new CreatureSay(0, Say2.TELL, this.getTemplate().getName(), msg);
        
        player.sendPacket(statusItemMsg);
    }
    
    /**
     * Packet Configure API
     */
    public void configureSystem()
    {
        System.out.println("Vote System Global: Configuring system params.");
        VoteSystem.getInstance().setKey(Config.VOTE_SYSTEM_GLOBAL_CLIENT_KEY);
        VoteSystem.getInstance().setServerApi(Config.VOTE_SYSTEM_GLOBAL_API_URL);
        VoteSystem.getInstance().configureApi(Config.VOTE_SYSTEM_GLOBAL_TOPZONE_ID, Config.VOTE_SYSTEM_GLOBAL_TOPSERVERS200_ID, Config.VOTE_SYSTEM_GLOBAL_L2JBRASIL_ID, Config.VOTE_SYSTEM_GLOBAL_L2NETWORK_ID, Config.VOTE_SYSTEM_GLOBAL_HOPZONE_ID, Config.VOTE_SYSTEM_GLOBAL_TOPEXPERT_ID, Config.VOTE_SYSTEM_GLOBAL_TOP100ARENA_ID);
        System.out.println("Vote System Global: Couting total votes confirmed.");
        setTotalVotes(VoteSystem.getInstance().getVotesCount());
        System.out.println("Vote System Global: Total Votes confirmed is: #" + getTotalVotes());
        
    }
    
    /**
     * Add item
     * @param player
     * @param id
     * @param count
     */
    public synchronized void AddItem(Player player, int id, int count)
    {
        player.addItem("voteSystem", id, count, this, true);
    }
    
    public int getTotalVotes()
    {
        return TOTAL_VOTES;
    }
    
    public void setTotalVotes(int tOTAL_VOTES)
    {
        TOTAL_VOTES = tOTAL_VOTES;
    }
    
    /**
     * Thread vote validation
     * - Check if player is online
     * @author leonetosoft
     */
    private class ValidVote implements Runnable
    {
        private String player_name;
        private TOP top;
        
        public ValidVote(String player_name, TOP top)
        {
            this.player_name = player_name;
            this.top = top;
        }
    
        @Override
        public void run()
        {
            decrementPlayerVote();
            
            Player player = World.getInstance().getPlayer(player_name);
            
            if (player == null || (player.getClient() == null || !player.isOnline()))
            {
                System.out.println("Vote System Global: Warning player " + player_name + " current offline.");
                return;
            }
            
            player.isVoting(false);
            
            IRetorno ret = VoteSystem.getInstance().validVote(player.getObjectId(), player.getClient().getConnection().getInetAddress().getHostAddress(), top);

            if (ret == null)
            {
                say(player, "Your vote in " + top.toString() + " is not validated.");
                return;
            }
            
            if (ret instanceof VoteFail)
            {
                say(player, "Your vote in " + top.toString() + " has NOT been confirmed!.");
                return;
            }
            
            if (ret instanceof VoteOk)
            {
                setTotalVotes(((VoteOk) ret).getTotalVotes());
                say(player, "Thanks for your vote! Vote number is #" + ((VoteOk) ret).getTotalVotes());
                AddItem(player, Config.VOTE_SYSTEM_GLOBAL_REWARD_ID, Config.VOTE_SYSTEM_GLOBAL_REWARD_AMOUNT);
                say(player, "Next vote in " + top.toString() + ": " + ((VoteOk) ret).getNextVote());
                GmListTable.broadcastMessageToGMs("Vote System Global: Player " + player.getName() + " confirmed vote. Total vote confirmed: " + getTotalVotes());
            }
            
        }
        
    }
    
}

mas não to conseguindo votar nessa versao do mod, deve se pq é pago, eu n tenho mais a free

 

 

foto (2).jpg

  • Amei 1
Link para o comentário
Compartilhar em outros sites

  • 0
7 horas atrás, Christian-SDM disse:

Lembrei, tem que botar o arquivo html, dentro da pasta default

Toma Arquivo adaptado 

  Mostrar conteúdo oculto

/*
 * 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.model.actor.instance;

import java.util.StringTokenizer;

import net.sf.l2j.commons.concurrent.ThreadPool;

import net.sf.l2j.Config;
import net.sf.l2j.gameserver.datatables.GmListTable;
import net.sf.l2j.gameserver.model.World;
import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
import net.sf.l2j.gameserver.network.clientpackets.Say2;
import net.sf.l2j.gameserver.network.serverpackets.CreatureSay;

import br.ms.jmods.leonetosoft.votesystem.VoteSystem;
import br.ms.jmods.leonetosoft.votesystem.enums.TOP;
import br.ms.jmods.leonetosoft.votesystem.objects.IRetorno;
import br.ms.jmods.leonetosoft.votesystem.objects.VoteAutorized;
import br.ms.jmods.leonetosoft.votesystem.objects.VoteFail;
import br.ms.jmods.leonetosoft.votesystem.objects.VoteIpNotAutorized;
import br.ms.jmods.leonetosoft.votesystem.objects.VoteOk;
import br.ms.jmods.leonetosoft.votesystem.objects.VotePlayerNotAutorized;


/**
 * Vote System Global Licensing in: votesystemglobal.com
 * @author leonetosoft
 */
public class VoteSystemGlobal extends Folk
{
    private int TOTAL_VOTES = 0;
    private int PLAYERS_IN_VOTE = 0;
    
    public VoteSystemGlobal(int objectId, NpcTemplate template)
    {
        super(objectId, template);
    }
    
    /**
     * ByPass use
     *     <a action="bypass -h npc_%objectId%_vote 1"><font color="FFFF00">VOTE FOR TOPZONE</font></a><br1>
     *    <a action="bypass -h npc_%objectId%_vote 2"><font color="FFFF00">VOTE FOR TOPSERVERS200</font></a><br1>
     *    <a action="bypass -h npc_%objectId%_vote 3"><font color="FFFF00">VOTE FOR L2JBRASIL</font></a><br1>
     *    <a action="bypass -h npc_%objectId%_vote 4"><font color="FFFF00">VOTE FOR L2NETWORK</font></a><br1>
     *    <a action="bypass -h npc_%objectId%_vote 5"><font color="FFFF00">VOTE FOR HOPZONE</font></a><br1>
     *  ...
     */
    @Override
    public void onBypassFeedback(final Player player, String command)
    {
        StringTokenizer st = new StringTokenizer(command, " ");
        String currentcommand = st.nextToken();
        
        if (VoteSystem.getInstance().getKey() == null)
        {
            configureSystem();
        }
        
        try
        {
            if (currentcommand.startsWith("vote"))
            {
                if (Config.VOTE_SYSTEM_GLOBAL_MIN_LV != 0 && player.getLevel() < Config.VOTE_SYSTEM_GLOBAL_MIN_LV)
                {
                    player.sendMessage("Min Lv to vote is " + Config.VOTE_SYSTEM_GLOBAL_MIN_LV + ".");
                    return;
                }
                if (Config.VOTE_SYSTEM_GLOBAL_MIN_PVP != 0 && player.getPvpKills() < Config.VOTE_SYSTEM_GLOBAL_MIN_PVP)
                {
                    player.sendMessage("Min PvP to vote is " + Config.VOTE_SYSTEM_GLOBAL_MIN_PVP + ".");
                    return;
                }
                if (player.isVoting())
                {
                    player.sendMessage("You should expect another validation process.");
                    return;
                }
                
                int top = Integer.parseInt(st.nextToken());
                String ip = player.getClient().getConnection().getInetAddress().getHostAddress();
                
                TOP voteTop = null;
                switch (top)
                {
                    case 1: // TOPZONE
                        if (Config.VOTE_SYSTEM_GLOBAL_TOPZONE_ENABLE)
                            voteTop = TOP.TOPZONE;
                        break;
                    
                    case 2:// TOPSERVERS200
                        if (Config.VOTE_SYSTEM_GLOBAL_TOPSERVERS200_ENABLE)
                            voteTop = TOP.TOPSERVERS200;
                        break;
                    
                    case 3:// L2JBRASIL
                        if (Config.VOTE_SYSTEM_GLOBAL_L2JBRASIL_ENABLE)
                            voteTop = TOP.L2JBRASIL;
                        break;
                    
                    case 4:// L2NETWORK
                        if (Config.VOTE_SYSTEM_GLOBAL_L2NETWORK_ENABLE)
                            voteTop = TOP.L2NETWORK;
                        break;
                    
                    case 5:// HOPZONE
                        if (Config.VOTE_SYSTEM_GLOBAL_HOPZONE_ENABLE)
                            voteTop = TOP.HOPZONE;
                        break;
                    
                    case 6:// TOPEXPERT
                        if (Config.VOTE_SYSTEM_GLOBAL_TOPEXPERT_ENABLE)
                            voteTop = TOP.TOPEXPERT200;
                        break;
                        
                    case 7:// TOP100ARENA
                        if (Config.VOTE_SYSTEM_GLOBAL_TOP100ARENA_ENABLE)
                            voteTop = TOP.TOP100ARENA;
                        break;
                }
                
                if (voteTop == null)
                {
                    say(player, "Vote selected is deactived.");
                    return;
                }
                
                if (!canVote())
                {
                    say(player, "The NPC reached the amount of simultaneous vote, please wait.");
                    return;
                }
                
                addPlayerVote();
                player.isVoting(true);
                
                IRetorno ret = VoteSystem.getInstance().autorizeVote(player.getObjectId(), player.getName(), ip, voteTop);
                
                if (ret == null)
                {
                    decrementPlayerVote();
                    player.isVoting(false);
                    say(player, "Vote not autorized in " + voteTop);
                    return;
                }
                
                if (ret instanceof VotePlayerNotAutorized)
                {
                    player.isVoting(false);
                    decrementPlayerVote();
                    String nextvote = ((VotePlayerNotAutorized) ret).getNextVote();
                    say(player, "Vote not autorized, please await next vote in " + nextvote);
                    return;
                }
                
                if (ret instanceof VoteIpNotAutorized)
                {
                    player.isVoting(false);
                    decrementPlayerVote();
                    String nextvote = ((VoteIpNotAutorized) ret).getAutorizeDate();
                    say(player, "Ip not autorized, please await next vote in " + nextvote);
                    return;
                }
                
                if (ret instanceof VoteAutorized)
                {
                    say(player, "Authorized vote, your vote in " + voteTop.toString() + " will be validated in " + Config.VOTE_SYSTEM_GLOBA_DELAY_CONFIRM + " seconds, we will vote now to earn your reward.");
                    say(player, "Your protocol for this vote is: #" + ((VoteAutorized) ret).getVoteId());
                    ThreadPool.schedule(new ValidVote(player.getName(), voteTop), Config.VOTE_SYSTEM_GLOBA_DELAY_CONFIRM * 1000);
                }
            }
            else
                super.onBypassFeedback(player, command);
        }
        catch (Exception e)
        {
            player.sendMessage("NPC ESTA APRESENTANDO ERRO, INFORME O ADMIN!");
            e.printStackTrace();
        }
        
    }
    
    public synchronized boolean canVote()
    {
        if (this.PLAYERS_IN_VOTE < Config.VOTE_SYSTEM_GLOBAL_TOTAL_VOTE_SIMULTANEOUS)
        {
            return true;
        }
        
        return false;
    }
    
    public synchronized void addPlayerVote()
    {
        this.PLAYERS_IN_VOTE++;
    }
    
    public synchronized void decrementPlayerVote()
    {
        this.PLAYERS_IN_VOTE--;
    }
    
    void say(Player player, String msg)
    {
        CreatureSay statusItemMsg = new CreatureSay(0, Say2.TELL, this.getTemplate().getName(), msg);
        
        player.sendPacket(statusItemMsg);
    }
    
    /**
     * Packet Configure API
     */
    public void configureSystem()
    {
        System.out.println("Vote System Global: Configuring system params.");
        VoteSystem.getInstance().setKey(Config.VOTE_SYSTEM_GLOBAL_CLIENT_KEY);
        VoteSystem.getInstance().setServerApi(Config.VOTE_SYSTEM_GLOBAL_API_URL);
        VoteSystem.getInstance().configureApi(Config.VOTE_SYSTEM_GLOBAL_TOPZONE_ID, Config.VOTE_SYSTEM_GLOBAL_TOPSERVERS200_ID, Config.VOTE_SYSTEM_GLOBAL_L2JBRASIL_ID, Config.VOTE_SYSTEM_GLOBAL_L2NETWORK_ID, Config.VOTE_SYSTEM_GLOBAL_HOPZONE_ID, Config.VOTE_SYSTEM_GLOBAL_TOPEXPERT_ID, Config.VOTE_SYSTEM_GLOBAL_TOP100ARENA_ID);
        System.out.println("Vote System Global: Couting total votes confirmed.");
        setTotalVotes(VoteSystem.getInstance().getVotesCount());
        System.out.println("Vote System Global: Total Votes confirmed is: #" + getTotalVotes());
        
    }
    
    /**
     * Add item
     * @param player
     * @param id
     * @param count
     */
    public synchronized void AddItem(Player player, int id, int count)
    {
        player.addItem("voteSystem", id, count, this, true);
    }
    
    public int getTotalVotes()
    {
        return TOTAL_VOTES;
    }
    
    public void setTotalVotes(int tOTAL_VOTES)
    {
        TOTAL_VOTES = tOTAL_VOTES;
    }
    
    /**
     * Thread vote validation
     * - Check if player is online
     * @author leonetosoft
     */
    private class ValidVote implements Runnable
    {
        private String player_name;
        private TOP top;
        
        public ValidVote(String player_name, TOP top)
        {
            this.player_name = player_name;
            this.top = top;
        }
    
        @Override
        public void run()
        {
            decrementPlayerVote();
            
            Player player = World.getInstance().getPlayer(player_name);
            
            if (player == null || (player.getClient() == null || !player.isOnline()))
            {
                System.out.println("Vote System Global: Warning player " + player_name + " current offline.");
                return;
            }
            
            player.isVoting(false);
            
            IRetorno ret = VoteSystem.getInstance().validVote(player.getObjectId(), player.getClient().getConnection().getInetAddress().getHostAddress(), top);

            if (ret == null)
            {
                say(player, "Your vote in " + top.toString() + " is not validated.");
                return;
            }
            
            if (ret instanceof VoteFail)
            {
                say(player, "Your vote in " + top.toString() + " has NOT been confirmed!.");
                return;
            }
            
            if (ret instanceof VoteOk)
            {
                setTotalVotes(((VoteOk) ret).getTotalVotes());
                say(player, "Thanks for your vote! Vote number is #" + ((VoteOk) ret).getTotalVotes());
                AddItem(player, Config.VOTE_SYSTEM_GLOBAL_REWARD_ID, Config.VOTE_SYSTEM_GLOBAL_REWARD_AMOUNT);
                say(player, "Next vote in " + top.toString() + ": " + ((VoteOk) ret).getNextVote());
                GmListTable.broadcastMessageToGMs("Vote System Global: Player " + player.getName() + " confirmed vote. Total vote confirmed: " + getTotalVotes());
            }
            
        }
        
    }
    
}

mas não to conseguindo votar nessa versao do mod, deve se pq é pago, eu n tenho mais a free

 

 

foto (2).jpg

Opa @Christian-SDM show.. vou colocar lá o html na pasta e substituir o codigo pelo seu, eu tenho o cadastro no site da voteglobalsystem plano free, vou ver se funciona. Obrigado pela atenção mano!!

  • Amei 1

giphy.gif 
Se te ajudei não custa nada Curtir  ou Agradecer😉

Link para o comentário
Compartilhar em outros sites

  • 0
Em 18/03/2020 at 01:21, Christian-SDM disse:

Lembrei, tem que botar o arquivo html, dentro da pasta default

Toma Arquivo adaptado 

  Mostrar conteúdo oculto

/*
 * 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.model.actor.instance;

import java.util.StringTokenizer;

import net.sf.l2j.commons.concurrent.ThreadPool;

import net.sf.l2j.Config;
import net.sf.l2j.gameserver.datatables.GmListTable;
import net.sf.l2j.gameserver.model.World;
import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
import net.sf.l2j.gameserver.network.clientpackets.Say2;
import net.sf.l2j.gameserver.network.serverpackets.CreatureSay;

import br.ms.jmods.leonetosoft.votesystem.VoteSystem;
import br.ms.jmods.leonetosoft.votesystem.enums.TOP;
import br.ms.jmods.leonetosoft.votesystem.objects.IRetorno;
import br.ms.jmods.leonetosoft.votesystem.objects.VoteAutorized;
import br.ms.jmods.leonetosoft.votesystem.objects.VoteFail;
import br.ms.jmods.leonetosoft.votesystem.objects.VoteIpNotAutorized;
import br.ms.jmods.leonetosoft.votesystem.objects.VoteOk;
import br.ms.jmods.leonetosoft.votesystem.objects.VotePlayerNotAutorized;


/**
 * Vote System Global Licensing in: votesystemglobal.com
 * @author leonetosoft
 */
public class VoteSystemGlobal extends Folk
{
    private int TOTAL_VOTES = 0;
    private int PLAYERS_IN_VOTE = 0;
    
    public VoteSystemGlobal(int objectId, NpcTemplate template)
    {
        super(objectId, template);
    }
    
    /**
     * ByPass use
     *     <a action="bypass -h npc_%objectId%_vote 1"><font color="FFFF00">VOTE FOR TOPZONE</font></a><br1>
     *    <a action="bypass -h npc_%objectId%_vote 2"><font color="FFFF00">VOTE FOR TOPSERVERS200</font></a><br1>
     *    <a action="bypass -h npc_%objectId%_vote 3"><font color="FFFF00">VOTE FOR L2JBRASIL</font></a><br1>
     *    <a action="bypass -h npc_%objectId%_vote 4"><font color="FFFF00">VOTE FOR L2NETWORK</font></a><br1>
     *    <a action="bypass -h npc_%objectId%_vote 5"><font color="FFFF00">VOTE FOR HOPZONE</font></a><br1>
     *  ...
     */
    @Override
    public void onBypassFeedback(final Player player, String command)
    {
        StringTokenizer st = new StringTokenizer(command, " ");
        String currentcommand = st.nextToken();
        
        if (VoteSystem.getInstance().getKey() == null)
        {
            configureSystem();
        }
        
        try
        {
            if (currentcommand.startsWith("vote"))
            {
                if (Config.VOTE_SYSTEM_GLOBAL_MIN_LV != 0 && player.getLevel() < Config.VOTE_SYSTEM_GLOBAL_MIN_LV)
                {
                    player.sendMessage("Min Lv to vote is " + Config.VOTE_SYSTEM_GLOBAL_MIN_LV + ".");
                    return;
                }
                if (Config.VOTE_SYSTEM_GLOBAL_MIN_PVP != 0 && player.getPvpKills() < Config.VOTE_SYSTEM_GLOBAL_MIN_PVP)
                {
                    player.sendMessage("Min PvP to vote is " + Config.VOTE_SYSTEM_GLOBAL_MIN_PVP + ".");
                    return;
                }
                if (player.isVoting())
                {
                    player.sendMessage("You should expect another validation process.");
                    return;
                }
                
                int top = Integer.parseInt(st.nextToken());
                String ip = player.getClient().getConnection().getInetAddress().getHostAddress();
                
                TOP voteTop = null;
                switch (top)
                {
                    case 1: // TOPZONE
                        if (Config.VOTE_SYSTEM_GLOBAL_TOPZONE_ENABLE)
                            voteTop = TOP.TOPZONE;
                        break;
                    
                    case 2:// TOPSERVERS200
                        if (Config.VOTE_SYSTEM_GLOBAL_TOPSERVERS200_ENABLE)
                            voteTop = TOP.TOPSERVERS200;
                        break;
                    
                    case 3:// L2JBRASIL
                        if (Config.VOTE_SYSTEM_GLOBAL_L2JBRASIL_ENABLE)
                            voteTop = TOP.L2JBRASIL;
                        break;
                    
                    case 4:// L2NETWORK
                        if (Config.VOTE_SYSTEM_GLOBAL_L2NETWORK_ENABLE)
                            voteTop = TOP.L2NETWORK;
                        break;
                    
                    case 5:// HOPZONE
                        if (Config.VOTE_SYSTEM_GLOBAL_HOPZONE_ENABLE)
                            voteTop = TOP.HOPZONE;
                        break;
                    
                    case 6:// TOPEXPERT
                        if (Config.VOTE_SYSTEM_GLOBAL_TOPEXPERT_ENABLE)
                            voteTop = TOP.TOPEXPERT200;
                        break;
                        
                    case 7:// TOP100ARENA
                        if (Config.VOTE_SYSTEM_GLOBAL_TOP100ARENA_ENABLE)
                            voteTop = TOP.TOP100ARENA;
                        break;
                }
                
                if (voteTop == null)
                {
                    say(player, "Vote selected is deactived.");
                    return;
                }
                
                if (!canVote())
                {
                    say(player, "The NPC reached the amount of simultaneous vote, please wait.");
                    return;
                }
                
                addPlayerVote();
                player.isVoting(true);
                
                IRetorno ret = VoteSystem.getInstance().autorizeVote(player.getObjectId(), player.getName(), ip, voteTop);
                
                if (ret == null)
                {
                    decrementPlayerVote();
                    player.isVoting(false);
                    say(player, "Vote not autorized in " + voteTop);
                    return;
                }
                
                if (ret instanceof VotePlayerNotAutorized)
                {
                    player.isVoting(false);
                    decrementPlayerVote();
                    String nextvote = ((VotePlayerNotAutorized) ret).getNextVote();
                    say(player, "Vote not autorized, please await next vote in " + nextvote);
                    return;
                }
                
                if (ret instanceof VoteIpNotAutorized)
                {
                    player.isVoting(false);
                    decrementPlayerVote();
                    String nextvote = ((VoteIpNotAutorized) ret).getAutorizeDate();
                    say(player, "Ip not autorized, please await next vote in " + nextvote);
                    return;
                }
                
                if (ret instanceof VoteAutorized)
                {
                    say(player, "Authorized vote, your vote in " + voteTop.toString() + " will be validated in " + Config.VOTE_SYSTEM_GLOBA_DELAY_CONFIRM + " seconds, we will vote now to earn your reward.");
                    say(player, "Your protocol for this vote is: #" + ((VoteAutorized) ret).getVoteId());
                    ThreadPool.schedule(new ValidVote(player.getName(), voteTop), Config.VOTE_SYSTEM_GLOBA_DELAY_CONFIRM * 1000);
                }
            }
            else
                super.onBypassFeedback(player, command);
        }
        catch (Exception e)
        {
            player.sendMessage("NPC ESTA APRESENTANDO ERRO, INFORME O ADMIN!");
            e.printStackTrace();
        }
        
    }
    
    public synchronized boolean canVote()
    {
        if (this.PLAYERS_IN_VOTE < Config.VOTE_SYSTEM_GLOBAL_TOTAL_VOTE_SIMULTANEOUS)
        {
            return true;
        }
        
        return false;
    }
    
    public synchronized void addPlayerVote()
    {
        this.PLAYERS_IN_VOTE++;
    }
    
    public synchronized void decrementPlayerVote()
    {
        this.PLAYERS_IN_VOTE--;
    }
    
    void say(Player player, String msg)
    {
        CreatureSay statusItemMsg = new CreatureSay(0, Say2.TELL, this.getTemplate().getName(), msg);
        
        player.sendPacket(statusItemMsg);
    }
    
    /**
     * Packet Configure API
     */
    public void configureSystem()
    {
        System.out.println("Vote System Global: Configuring system params.");
        VoteSystem.getInstance().setKey(Config.VOTE_SYSTEM_GLOBAL_CLIENT_KEY);
        VoteSystem.getInstance().setServerApi(Config.VOTE_SYSTEM_GLOBAL_API_URL);
        VoteSystem.getInstance().configureApi(Config.VOTE_SYSTEM_GLOBAL_TOPZONE_ID, Config.VOTE_SYSTEM_GLOBAL_TOPSERVERS200_ID, Config.VOTE_SYSTEM_GLOBAL_L2JBRASIL_ID, Config.VOTE_SYSTEM_GLOBAL_L2NETWORK_ID, Config.VOTE_SYSTEM_GLOBAL_HOPZONE_ID, Config.VOTE_SYSTEM_GLOBAL_TOPEXPERT_ID, Config.VOTE_SYSTEM_GLOBAL_TOP100ARENA_ID);
        System.out.println("Vote System Global: Couting total votes confirmed.");
        setTotalVotes(VoteSystem.getInstance().getVotesCount());
        System.out.println("Vote System Global: Total Votes confirmed is: #" + getTotalVotes());
        
    }
    
    /**
     * Add item
     * @param player
     * @param id
     * @param count
     */
    public synchronized void AddItem(Player player, int id, int count)
    {
        player.addItem("voteSystem", id, count, this, true);
    }
    
    public int getTotalVotes()
    {
        return TOTAL_VOTES;
    }
    
    public void setTotalVotes(int tOTAL_VOTES)
    {
        TOTAL_VOTES = tOTAL_VOTES;
    }
    
    /**
     * Thread vote validation
     * - Check if player is online
     * @author leonetosoft
     */
    private class ValidVote implements Runnable
    {
        private String player_name;
        private TOP top;
        
        public ValidVote(String player_name, TOP top)
        {
            this.player_name = player_name;
            this.top = top;
        }
    
        @Override
        public void run()
        {
            decrementPlayerVote();
            
            Player player = World.getInstance().getPlayer(player_name);
            
            if (player == null || (player.getClient() == null || !player.isOnline()))
            {
                System.out.println("Vote System Global: Warning player " + player_name + " current offline.");
                return;
            }
            
            player.isVoting(false);
            
            IRetorno ret = VoteSystem.getInstance().validVote(player.getObjectId(), player.getClient().getConnection().getInetAddress().getHostAddress(), top);

            if (ret == null)
            {
                say(player, "Your vote in " + top.toString() + " is not validated.");
                return;
            }
            
            if (ret instanceof VoteFail)
            {
                say(player, "Your vote in " + top.toString() + " has NOT been confirmed!.");
                return;
            }
            
            if (ret instanceof VoteOk)
            {
                setTotalVotes(((VoteOk) ret).getTotalVotes());
                say(player, "Thanks for your vote! Vote number is #" + ((VoteOk) ret).getTotalVotes());
                AddItem(player, Config.VOTE_SYSTEM_GLOBAL_REWARD_ID, Config.VOTE_SYSTEM_GLOBAL_REWARD_AMOUNT);
                say(player, "Next vote in " + top.toString() + ": " + ((VoteOk) ret).getNextVote());
                GmListTable.broadcastMessageToGMs("Vote System Global: Player " + player.getName() + " confirmed vote. Total vote confirmed: " + getTotalVotes());
            }
            
        }
        
    }
    
}

mas não to conseguindo votar nessa versao do mod, deve se pq é pago, eu n tenho mais a free

 

 

foto (2).jpg

O motivo de não funcionar é pq a versão free só da acesso a dois Top

  • L2TOPBRASIL
  • TOPEXPERT200

e o pior nenhum dos sites estão mais disponíveis.. kkkk ai lascou-se...

 

giphy.gif 
Se te ajudei não custa nada Curtir  ou Agradecer😉

Link para o comentário
Compartilhar em outros sites

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.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  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.

Processando...



×
×
  • Criar Novo...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.