Probably the connection to your webhost which is causing a delay or lag.
|
if (playerCommand.equalsIgnoreCase("check") || playerCommand.equalsIgnoreCase("reward")) {
try {
VoteReward reward = Server.voteChecker.getReward(c.playerName.replaceA ll(" ", "_"));
if(reward != null){
switch(reward.getReward()){
case 0:
//first reward
break;
case 1:
//sencond reward
break;
//ect...
default:
c.sendMessage("Reward not found.");
break;
}
c.sendMessage("Thank you for voting.");
} else {
c.sendMessage("You have no items waiting for you.");
}
} catch (Exception e){
c.sendMessage("An error occurred please try again later.");
}
}
I think i have to close the connection after it has done the check?
Not sure how
Probably the connection to your webhost which is causing a delay or lag.
must be because theres no redeem command
What tutorial did you follow? Post it to me
Might be that you didn't remote you Server's ip from your panel. You must have remote mysql.
EDIT: also fix your reward cases, example:case 0 (reward one) gives me 1m.Code:if (playerCommand.equalsIgnoreCase("check") || playerCommand.equalsIgnoreCase("reward")) { try { VoteReward reward = Server.voteChecker.getReward(c.playerName.replaceAll(" ", "_")); if(reward != null){ switch(reward.getReward()){ case 0: c.getItems().addItem(995, 1000000); break; case 1: c.Wheel +=2; break; case 2: c.lvlPoints +=30; break; default: c.sendMessage("Reward not found."); break; } c.sendMessage("Thank you for voting."); } else { c.sendMessage("You have no items waiting for you."); } } catch (Exception e){ c.sendMessage("An error occurred please try again later."); } }
case 1 (reward two) gives me 2 spins
case 2 (reward three) gives me 30 levelpoints
or it might just be that you're, you know, running io in the main thread...
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |