L2JMobius

High Five API Vote System - All projects

Invoke · 28 · 15356

Offline G-hamsteR

  • Viscount
  • *****
    • Posts: 326
The logic is the same. Maybe you can't just apply the patch, but if you make the changes manually it should work.


Offline Cristi Crys

  • Vassal
  • *
    • Posts: 2
Hello,why i have this error?

Buildfile: C:\Users\Crys\git\master\L2J_Mobius_7.0_PreludeOfWar\build.xml
checkRequirements:
init:
   [delete] Deleting directory C:\Users\Crys\git\master\build\bin
    [mkdir] Created dir: C:\Users\Crys\git\master\build\bin
compile:
    [javac] Compiling 2386 source files to C:\Users\Crys\git\master\build\bin
    [javac] C:\Users\Crys\git\master\L2J_Mobius_7.0_PreludeOfWar\java\org\l2jmobius\gameserver\votesystem\NpcVoteInstance.java:68: error: method does not override or implement a method from a supertype
    [javac]    @Override
    [javac]    ^
    [javac] C:\Users\Crys\git\master\L2J_Mobius_7.0_PreludeOfWar\java\org\l2jmobius\gameserver\votesystem\VoteManager.java:108: error: incompatible types: PlayerInstance cannot be converted to int
    [javac]          player.sendPacket(new ItemList(player, true));
    [javac]                                         ^
    [javac] C:\Users\Crys\git\master\L2J_Mobius_7.0_PreludeOfWar\java\org\l2jmobius\gameserver\votesystem\VoteManager.java:226: error: incompatible types: PlayerInstance cannot be converted to int
    [javac]                   player.sendPacket(new ItemList(player, true));
    [javac]                                                  ^
    [javac] Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
    [javac] 3 errors

BUILD FAILED
C:\Users\Crys\git\master\L2J_Mobius_7.0_PreludeOfWar\build.xml:65: Compile failed; see the compiler error output for details.



Offline Reanimation

  • Knight
  • ***
    • Posts: 62
Diff:
https://pastebin.com/DSad9XcY

Command:
https://pastebin.com/7ywWXmC1

SQL:

Code: [Select]
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for globalvotes
-- ----------------------------
DROP TABLE IF EXISTS `globalvotes`;
CREATE TABLE `globalvotes`  (
  `voteSite` tinyint(2) NOT NULL,
  `lastRewardVotes` int(11) NULL DEFAULT NULL,
  PRIMARY KEY (`voteSite`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of globalvotes
-- ----------------------------
INSERT INTO `globalvotes` VALUES (0, 13);
INSERT INTO `globalvotes` VALUES (1, 68);
INSERT INTO `globalvotes` VALUES (2, 0);
INSERT INTO `globalvotes` VALUES (3, 3);
INSERT INTO `globalvotes` VALUES (4, 2);
INSERT INTO `globalvotes` VALUES (5, 0);
INSERT INTO `globalvotes` VALUES (6, 0);
INSERT INTO `globalvotes` VALUES (7, 2);
INSERT INTO `globalvotes` VALUES (8, 3);
INSERT INTO `globalvotes` VALUES (9, 0);
INSERT INTO `globalvotes` VALUES (10, 75);

-- ----------------------------
-- Table structure for individualvotes
-- ----------------------------
DROP TABLE IF EXISTS `individualvotes`;
CREATE TABLE `individualvotes`  (
  `voterIp` varchar(40) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `voteSite` tinyint(3) NOT NULL,
  `serverVotingTime` bigint(20) NULL DEFAULT NULL,
  `votingTimeSite` bigint(20) NULL DEFAULT NULL,
  `alreadyRewarded` tinyint(3) NULL DEFAULT NULL,
  PRIMARY KEY (`voterIp`, `voteSite`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;

XML:

Code: [Select]
<?xml version="1.0" encoding="UTF-8"?>
<list>
<votesite name="l2.topgameserver.net" ordinal="0">
<items>
<item itemId="57" itemCount="10000000" />
<item itemId="6673" itemCount="1"/>
</items>
</votesite>
<votesite name="ItopZ.com" ordinal="1">
<items>
<item itemId="57" itemCount="10000000" />
<item itemId="6673" itemCount="1"/>
</items>
</votesite>
<votesite name="L2Top.co" ordinal="2">
<items>
<item itemId="57" itemCount="10000000" />
<item itemId="6673" itemCount="1"/>
</items>
</votesite>
<votesite name="L2Votes.com" ordinal="3">
<items>
<item itemId="57" itemCount="10000000" />
<item itemId="6673" itemCount="1"/>
</items>
</votesite>
<votesite name="Hopzone.net" ordinal="4">
<items>
<item itemId="57" itemCount="10000000" />
<item itemId="6673" itemCount="1"/>
</items>
</votesite>
<votesite name="L2Network.eu" ordinal="5">
<items>
<item itemId="57" itemCount="10000000" />
<item itemId="6673" itemCount="1"/>
</items>
</votesite>
<votesite name="L2Topservers.com" ordinal="6">
<items>
<item itemId="57" itemCount="10000000" />
<item itemId="6673" itemCount="1"/>
</items>
</votesite>
<votesite name="top.l2jbrasil.com" ordinal="7">
<items>
<item itemId="57" itemCount="10000000" />
<item itemId="6673" itemCount="1"/>
</items>
</votesite>
<votesite name="MMOTOP.eu" ordinal="8">
<items>
<item itemId="57" itemCount="10000000" />
<item itemId="6673" itemCount="1"/>
</items>
</votesite>
<votesite name="L2Topzone.com" ordinal="9">
<items>
<item itemId="57" itemCount="10000000" />
<item itemId="6673" itemCount="1"/>
</items>
</votesite>
<votesite name="L2Servers.com" ordinal="10">
<items>
<item itemId="57" itemCount="10000000" />
<item itemId="6673" itemCount="1"/>
</items>
</votesite>
<votesite name="globalVotes" ordinal="11">
<items>
<item itemId="57" itemCount="10000000" />
<item itemId="6673" itemCount="1"/>
</items>
</votesite>
</list>

XSD:
Code: [Select]
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="list">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="votesite" maxOccurs="unbounded" minOccurs="0">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="items">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="item" maxOccurs="unbounded" minOccurs="0">
                      <xs:complexType>
                        <xs:simpleContent>
                          <xs:extension base="xs:string">
                            <xs:attribute type="xs:short" name="itemId" use="optional"/>
                            <xs:attribute type="xs:int" name="itemCount" use="optional"/>
                          </xs:extension>
                        </xs:simpleContent>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
            <xs:attribute type="xs:string" name="name" use="optional"/>
            <xs:attribute type="xs:byte" name="ordinal" use="optional"/>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

html:

Code: [Select]
<html>
<title>Voting panel</title>
<body><center>
<br><img src="L2UI_CH3.herotower_deco" width=256 height=32><br>
<table cellpadding=2 width=280 background="L2UI_CH3.refinewnd_back_Pattern">
<tr><td width="280">Hello <font color="C6AF00">%accountName%</font>, welcome to the voting rewards dashboard, please help us by voting by server every <font color="C6AF00">%everyXtime% hours</font> in all voting sites.</td></tr>
</table>
<table width="290"><tr><td width="290" align="center">You can vote: </td></tr></table>
<br><img src="l2ui.SquareWhite" width=290 height=1><br>

%enablevote%

<br>
<img src="l2ui.SquareWhite" width=290 height=1><br>
</center></body>
</html>

Config votesystemm.ini
Code: [Select]
EnableVoteSystem = True

EnableGlobalVote = True

EnableIndividualVote = True

## Time to Update table totalVotes from DB
NextTimeToAutoUpdateTotalVote = 2

## Time to update table individualVotes in minutes
NextTimeToAutoUpdateIndividualVotes = 30

## In minutes
NextTimeToAutoCleanInnecesaryVotes = 30

## In  minutes
NextTimeToCheckAutoGlobalVotesReward = 10

## In hours
IntervalToNextVote = 12

## Amount of votes to set reward
GlobalVotesAmountToNextReward = 1

EnableVotingCommand = True

VotingCommand = .getreward

## l2.topgameserver.net
VoteLinkTgs = http://l2.topgameserver.net/lineage/VoteApi/

TgsApiKey =

## l2top.co
VoteLinkTopCo = https://l2top.co/reward/

TopCoSrvId =

## ITopz.com
VoteLinkItopz = https://itopz.com/check/

ItopzZpiKey =

ItopzSrvId =

## l2votes.com
VoteLinkVts = https://l2votes.com/

VtsApiKey =

## L2Votes - Server Id
VtsSid = 208

## Hopzone.net
VoteLinkHz = https://api.hopzone.net/lineage2/

HzApiKey =

## l2network.eu
VoteNetworkLink = https://l2network.eu/api.php

VoteNetworkUserName =

VoteNetworkApiKey =

## L2TopServer.com
VoteLinkTss = https://l2topservers.com/votes?

TssApiToken =

## top.l2jbrasil.com
BrasilVoteLink = https://top.l2jbrasil.com/votesystem/index.php?

BrasilUserName =

## Mmotop.eu
VoteLinkMmotop = https://mmotop.eu/l2/data/

MmotopApiKey =

## L2TopZone.com
VoteLinkTz = https://api.l2topzone.com/v1/

TzApiKey =

## L2Servers.com
VoteLinkServers = https://www.l2servers.com/api/

ServersHashCode =

ServersSrvId =

create new NPC with this type in custom folder:
Code: [Select]
type="NpcVote">


Has anyone managed to adapt it to interlude c6? According to what I was able to do, but it doesn't work for me, the system doesn't start, it doesn't give me an error on the console or anything


Offline nightwolf

  • Heir
  • **
    • Posts: 26
this looks a very good system i believe its an upgrade from this https://l2jmobius.org/forum/index.php?topic=4973.0
i just want to let you know that itopz.com is using DEMO as api key for testing and test server id is 325339
so this link https://itopz.com/check/DEMO/325339/ can provide fake data for testing global vote
for individual you just add your ip in the end https://itopz.com/check/DEMO/325339/51.61.61.75 and you get fake data for individual testing

if you want i have this topic https://l2jmobius.org/forum/index.php?topic=5828.0
you can take parts from code if you are interested in for example https://github.com/nightw0lv/iTopZ-Java/blob/master/Interlude/aCis/src/itopz/com/util/Url.java
you can find all the backend api url's i've worked on this project

i have a question did you test global l2jbrasil api?


Offline sztormy

  • Vassal
  • *
    • Posts: 6
Hello! Is there any newbie friendly guide about how to install the system?


Offline Roy2021

  • Heir
  • **
    • Posts: 16
  • I'm Roy ! nice to be here!
I have tried everything to adapt it to the Fafurion chronicle and nothing works for me, any better explained tutorial please, someone? thank you so much. :-X


Offline nightwolf

  • Heir
  • **
    • Posts: 26
I have tried everything to adapt it to the Fafurion chronicle and nothing works for me, any better explained tutorial please, someone? thank you so much. :-X
try to find the cause and if there is an error then you can get help

about the topic try to add hotservers.org and hopzone.eu
https://hopzone.eu/docs.html/ this docs are very easy and also solve the IPv6 problem


Offline G-hamsteR

  • Viscount
  • *****
    • Posts: 326
For those who are having trouble with hopzone or any other website that uses ipv6.

Let's start by saying that it should be common sense for them to disable ipv6 on their side and make everyone's lives easier.

There are two ways to bypass this problem.

1. Add the vote links inside your game. In older clients, you will need some client modifications to allow hyperlinks that open a browser. Instead of adding directly your hopzone link, add your website passing in the account's name. For example "https://myserver.com/vote?account=test

Your website must support ipv6. Then, your website checks your user's IP and if it is IPv6, it adds it to a column in the accounts table. So, instead of just the column last_ip, add a second one, like last_ipv6.

If an account has the last_ipv6 filled, when you make the post request to hopzone, check for the last_ipv6 value.

2. Allow ipv6 to your website and once someone browses it, make a simple GET request to this website using javascript. https://api.ipify.org/
This will return the IPv4 IP of the user. Once you have both, store them in a database. You now have the matches between these two.


Offline Andariel

  • Heir
  • **
    • Posts: 13
can someone help me?
when i press reward this thing show me in console but not doing any action
[20/02 11:03:54] [Character: Test[268479476] - Account: admin - IP: 127.0.0.1] sent not handled RequestBypassToServer: [vote_268464007_site 0]
[20/02 11:04:12] [Character: Test[268479476] - Account: admin - IP: 127.0.0.1] sent not handled RequestBypassToServer: [vote_268464007_site 1]


Offline Andariel

  • Heir
  • **
    • Posts: 13
i am sure is something mising from RequestBypassToServer.java I thing is not share averything in main pastebin.


Offline Andariel

  • Heir
  • **
    • Posts: 13
after many attempts I found this code for interlude classic. But I have almost the same problem with this one...
https://pastebin.com/rJcPsbD4

https://prnt.sc/VJCcWpSwaTd9
https://prnt.sc/13R2sh1TxYyK





Online dramaa

  • Elder
  • ****
    • Posts: 110
after many attempts I found this code for interlude classic. But I have almost the same problem with this one...
https://pastebin.com/rJcPsbD4

https://prnt.sc/VJCcWpSwaTd9
https://prnt.sc/13R2sh1TxYyK

i should not be writing but, maybe just change npc id like idk 50000 (if its free) and make new npc id 50000 and display id what ever you want to be, if you have tried it sorry then

<npc id="50000" displayId="32365" name="Kaaya" usingServerSideName="true" title="Vote Reward System" type="NpcVoteReward">