U3Games

Games | Desarrollo & Soporte => Lineage => L2 | Sección Web => Mensaje iniciado por: Swarlog en Jun 14, 2025, 11:22 PM

Título: Vote Web System
Publicado por: Swarlog en Jun 14, 2025, 11:22 PM
(https://i.imgur.com/lfcZk0R.png)

Os presentamos nuestro propio sistema de votación vía web.
Completamente configurable y sincronizado con su servidor!


--> Prueba disponible en línea, AQUÍ! <-- (http://www.l2kingdoms.com/vote)

Usuario: l2jdevs1, l2jdevs2, l2jdevs3, ... | Contraseña: l2jdevs1, l2jdevs2, l2jdevs3, ...

Imágenes del proyecto
(https://i.imgur.com/lfcZk0R.png)

(https://i.imgur.com/oPA4YZI.png)

(https://i.imgur.com/PLnefQi.png)

(https://i.imgur.com/pTukUOv.png)

(https://i.imgur.com/NDoGFgX.png)




Lista y estado de desarrollo actual.

Verde ------- Característica ya probada e implementada.
Naranja ----- Característica en desarrollo o parcialmente completada.
Rojo --------- Característica no disponible aún.



LISTA DE CARACTERÍSTICAS:



LISTA DE IMPLEMENTACIONES:



IDIOMAS DISPONIBLES:



MÁS INFORMACIÓN:



IMPLEMENTACIÓN ADICIONAL:

Si quereis que el servidor reinicie cada mes los votos, os dejo este script:

/*
 * Copyright © 2004-2025 L2JDevs
 *
 * This file is part of L2JDevs.
 *
 * L2JDevs 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.
 *
 * L2JDevs 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 custom.VoteTaskSystem;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Calendar;
import java.util.logging.Level;
import java.util.logging.Logger;

import org.l2jdevs.commons.database.pool.impl.ConnectionFactory;
import org.l2jdevs.gameserver.model.actor.L2Npc;
import org.l2jdevs.gameserver.model.actor.instance.L2PcInstance;

import ai.npc.AbstractNpcAI;

/**
 * Vote Task System
 * @author U3Games
 */
public class VoteTaskSystem extends AbstractNpcAI
{
    // Logger Class
    private static Logger LOGGER = Logger.getLogger(VoteTaskSystem.class.getName());
   
    // Mist
    private static final int _dayCheckCalendar = Integer.valueOf(Calendar.getInstance().get(Calendar.DAY_OF_MONTH));
   
    // Quotes
    private final String CLEAR_VOTES = "UPDATE vote_system_count SET votes=? WHERE votes > 0";
   
    private VoteTaskSystem()
    {
        super(VoteTaskSystem.class.getSimpleName(), "custom");
        onAdvEvent("AUTOCHECK", null, null);
    }
   
    @Override
    public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
    {
        switch (event)
        {
            case "AUTOCHECK":
            {
                if (_dayCheckCalendar == 1)
                {
                    updatedVoteCount();
                }
               
                break;
            }
        }
       
        return event;
    }
   
    /**
     * Clear all votes of players to 0.
     */
    private void updatedVoteCount()
    {
        final int initVoteCount = 0;
        try (Connection con = ConnectionFactory.getInstance().getConnection();
            PreparedStatement ps = con.prepareStatement(CLEAR_VOTES))
        {
            ps.setInt(1, initVoteCount);
            ps.execute();
        }
        catch (SQLException e)
        {
            LOGGER.log(Level.WARNING, getClass().getSimpleName() + ": Error while update vote count to: " + initVoteCount + ". " + e, e);
        }
    }
   
    public static void main(String[] args)
    {
        new VoteTaskSystem();
    }
}