Skip to content

L2jBrasil/top.l2jbrasil.com-jar-ext-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

topL2jBrasil.com Extension for Lucera

This is a Java extension for the Lucera L2J emulator, designed to integrate with the top.l2jbrasil.com voting system.

Features

  • Individual Vote Verification: Uses player_id (Unique Entropic ID based on IP) to validate votes individually.
  • Array Support: Handles the new API response format containing arrays of votes.
  • Anti-Flood: Prevents duplicate rewards by tracking the last rewarded vote ID.
  • Configurable: Options to ignore vote status (reward anyway) and customize rewards.

Installation

  1. Download: Go to the Releases page and download the latest topl2jbrasil_com.jar.
  2. Deploy: Place the .jar file into your server's libs/ or extensions/ folder (verify your server's specific folder for extensions).
  3. Config:
    • Copy config/TOPL2JBR.properties (from source) to your server's config/ directory.
    • Open config/TOPL2JBR.properties and set your ApiKey and RewardItemId.
  4. Restart: Restart your GameServer to load the extension.

Usage Guide

For Players: How to Vote

  1. Get your ID: Log in to the game and type the command:

    .voteid
    

    You will receive a unique, short code (e.g., AgB321).

  2. Vote: Go to the server's voting page on top.l2jbrasil.com.

    • When asked "Tem um vote id?", enter the code you received (e.g., AgB321).
    • Complete the CAPTCHA and vote.
image
  1. Reward: The system automatically checks for your vote in the background (every few minutes). Once confirmed, you will automatically receive your reward in your inventory.

For Admins: How it Works

  • Entropic ID: The system generates a unique, short ID based on the player's IP address. This ID is permanent for that IP and is easy to type (max 6 characters).
  • Automation: The VoteManager runs periodically (configurable in properties) to check for valid votes using this ID.
  • Validation: Duplicate votes for the same ID are filtered out to prevent abuse.

Configuration

# Enable the Vote Manager
UseTOPL2JBRVoteManager = true

# Your API Key from top.l2jbrasil.com
ApiKey = YOUR_API_KEY

# Check interval in seconds (default: 300)
CheckDelay = 300

# Reward Item ID (e.g., 57 for Adena)
RewardItemId = 57

# Reward Count
RewardCount = 1

# If true, rewards player even if the vote status is not '1' (validated)
RewardIgnoreVoteStatus = false

Compilation and Testing

This project depends on l2.gameserver and l2.commons libraries from the Lucera server.

Local Development (with Stubs)

To compile and test locally without the full server source, "Stub" classes are provided in the test/stubs directory.

Compile Production Code:

javac -d out/build_prod -sourcepath test/stubs src/topl2jbrasil_com/*.java

Compile and Run Tests:

javac -d out/build_test -cp out/build_prod -sourcepath "test/stubs;src" test/topl2jbrasil_com/*.java
java -cp "out/build_test;out/build_prod;test/stubs" topl2jbrasil_com.IntegrationTest

Production Build

To generate the final .jar for your server:

jar cf topl2jbrasil_com.jar -C out/build_prod .

This JAR contains only the extension code and is ready to be loaded by the server.

License

MIT License

Copyright (c) 2023 top.l2jbrasil.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Community supported jar ext for voting on top.l2jbrasil.com

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages