Jump to content
  • 0
Sign in to follow this  
raivorots

Compiling error

Question

pls help me idk why i get that all error code - if(cmd[0].equals("check")) {
try {
VoteReward reward = Launcher.vote.hasVoted(player.getUsername().toLowerCase().replaceAll(" ", "_"));
if(reward != null){
switch(reward.getReward()){
case 0:
player.getInventory().addItem(995, 10000000);
break;
case 1:
player.getInventory().addItem(8851, 20000);
break;
case 2:
player.getInventory().addItem(24155, 1);
break;

default:
player.getPackets().sendMessage(99, "Reward not found.", player);
break;
}
player.getPackets().sendMessage(99, "Thank you for voting.", player);
} else {
player.getPackets().sendMessage(99, "You have no items waiting for you.", player);
}
} catch (Exception e){
player.getPackets().sendMessage(99, "[GTL Vote] An SQL error has occured.", player);
}
return true;

but error - [url]http://prntscr.com/28vwh7[/url]

please helpe

Share this post


Link to post
Share on other sites

10 answers to this question

Recommended Posts

  • 0
[code]import com.rs.Launcher.vote.hasvoted;[/code]
to
[code]import com.rs.Launcher;[/code]

Share this post


Link to post
Share on other sites
  • 0
[quote name='Stacx'][code]import com.rs.Launcher.vote.hasvoted;[/code]
to
[code]import com.rs.Launcher;[/code][/QUOTE]

Also

[CODE]VoteReward reward = Launcher.vote.hasVoted(player.getUsername().toLowe rCase().replaceAll(" ", "_"));[/CODE]

to

[CODe]VoteReward reward = Launcher.hasVoted(player.getUsername().toLowerCase().replaceAll(" ", "_"));[/CODE]

Share this post


Link to post
Share on other sites
  • 0
[quote name='Yaymyshow']Also

[CODE]VoteReward reward = Launcher.vote.hasVoted(player.getUsername().toLowe rCase().replaceAll(" ", "_"));[/CODE]

to

[CODe]VoteReward reward = Launcher.hasVoted(player.getUsername().toLowerCase().replaceAll(" ", "_"));[/CODE][/QUOTE]

now im getting that error - [url]http://prntscr.com/28vzmz[/url]

Share this post


Link to post
Share on other sites
  • 0
[quote name='raivorots']now im getting that error - [url]http://prntscr.com/28vzmz[/url][/QUOTE]

Post your Launcher.java?

Share this post


Link to post
Share on other sites
  • 0
[quote name='Yaymyshow']Post your Launcher.java?[/QUOTE]

package com.rs;

import com.alex.store.Index;
import com.rs.cache.Cache;
import com.rs.cache.loaders.ItemDefinitions;
import com.rs.cache.loaders.NPCDefinitions;
import com.rs.cache.loaders.ObjectDefinitions;
import com.rs.cores.CoresManager;
import com.rs.game.Region;
import com.rs.game.World;
import com.rs.game.player.Player;
import com.rs.game.tasks.WorldTask;
import com.rs.game.tasks.WorldTasksManager;
import com.rs.net.ServerChannelHandler;
import com.rs.utils.DTRank;
import com.rs.utils.DisplayNames;
import com.rs.utils.IPBanL;
import com.rs.utils.Logger;
import com.rs.utils.PkRank;
import com.rs.utils.SerializableFilesManager;
import com.rs.utils.Utils;
import com.rs.utils.spawning.NPCSpawning;
import org.Vote.*;
import com.rs.utils.spawning.ObjectSpawning;
import com.rs.utils.spawning.RemoveObjects;
import java.io.IOException;
import java.lang.management.ManagementFactory;
import java.net.URL;
import java.util.concurrent.TimeUnit;

public final class Launcher {
public static MainLoader vote = new MainLoader("localhost", "root", "raivis123", "newvote");

public static void main(String[] args) throws Exception {
if (args.length < 3) {
System.out.println("USE: guimode(boolean) debug(boolean) hosted(boolean)");
return;
}
Settings.DEBUG = Boolean.parseBoolean(args[1]);
Settings.HOSTED = Boolean.parseBoolean(args[2]);
long currentTime = Utils.currentTimeMillis();
if (Settings.HOSTED) { /* NOTHING */ }
Logger.log("Launcher", "Loading " + Settings.SERVER_NAME + ", please wait...");
Initializer.loadFiles();
try {
ServerChannelHandler.init();
NPCSpawning.spawnNpcs();
cleanHome();
ObjectSpawning.spawnObjects();
} catch (Throwable e) {
Logger.handle(e);
Logger.log("Launcher", "Failed initing Server Channel Handler. Shutting down...");
System.exit(1);
return;
}
Logger.log("Launcher", "Server is now online. Took " + (Utils.currentTimeMillis() - currentTime) + " seconds to load.");
addAccountsSavingTask();
addCleanMemoryTask();
MemoryManager.addMemoryManagementTask();
MemoryManager.addUptimeTask();
}

private static void addCleanMemoryTask() {
CoresManager.slowExecutor.scheduleWithFixedDelay(new Runnable() {
[MENTION=15855]Over[/MENTION]ride
public void run() {
try {
cleanMemory(true);
} catch (Throwable e) {
Logger.handle(e);
}
}
}, 0, 10, TimeUnit.MINUTES);
}

private static void addAccountsSavingTask() {
CoresManager.slowExecutor.scheduleWithFixedDelay(new Runnable() {
[MENTION=15855]Over[/MENTION]ride
public void run() {
try {
saveFiles();
} catch (Throwable e) {
Logger.handle(e);
}
}
}, 0, 1, TimeUnit.MINUTES);
}

public static void saveFiles() {
for (Player player : World.getPlayers()) {
if (player == null || !player.hasStarted() || player.hasFinished()) {
continue;
}
SerializableFilesManager.savePlayer(player);
}
DisplayNames.save();
IPBanL.save();
PkRank.save();
DTRank.save();
}

public static void cleanHome() {
WorldTasksManager.schedule(new WorldTask() {
[MENTION=15855]Over[/MENTION]ride
public void run() {
if (World.getPlayers().size() > 0) {
RemoveObjects.removeObjects();
stop();
}
}
}, 0, 10);
}

public static void cleanMemory(boolean force) {
if (force) {
ItemDefinitions.clearItemsDefinitions();
NPCDefinitions.clearNPCDefinitions();
ObjectDefinitions.clearObjectDefinitions();
for (Region region : World.getRegions().values()) {
region.removeMapFromMemory();
}
}
for (Index index : Cache.STORE.getIndexes()) {
index.resetCachedFiles();
}
CoresManager.fastExecutor.purge();
System.gc();
}

public static void shutdown() {
try {
closeServices();
} finally {
System.exit(0);
}
}

public static void closeServices() {
ServerChannelHandler.shutdown();
CoresManager.shutdown();
}

public static void restart() {
closeServices();
System.gc();
try {
Runtime.getRuntime().exec("java -server -Xms2048m -Xmx20000m -cp bin;/data/libs/netty-3.2.7.Final.jar;/data/libs/FileStore.jar Launcher false false true false");
System.exit(0);
} catch (Throwable e) {
Logger.handle(e);
}
}

private Launcher() {
}
}

Share this post


Link to post
Share on other sites
  • 0
[quote name='Yaymyshow']Also

[CODE]VoteReward reward = Launcher.vote.hasVoted(player.getUsername().toLowe rCase().replaceAll(" ", "_"));[/CODE]

to

[CODe]VoteReward reward = Launcher.hasVoted(player.getUsername().toLowerCase().replaceAll(" ", "_"));[/CODE][/QUOTE]

Please look at the compiler... It's the text formatting the forum uses that split that there.
[MENTION=154546]raivorots[/MENTION] use the code tags when posting code, [code] [/ code] around your code (remove the extra space I added) and post your RegularPlayer.java Edited by Stacx

Share this post


Link to post
Share on other sites
  • 0
My bad, carry on using what you used before. VoteReward reward = Launcher.vote.hasVoted(player.getUsername().toLowerCase().replaceAll(" ", "_"));

Share this post


Link to post
Share on other sites
  • 0
[quote name='Yaymyshow']My bad, carry on using what you used before. VoteReward reward = Launcher.vote.hasVoted(player.getUsername().toLowerCase().replaceAll(" ", "_"));[/QUOTE]

now im getting this error - [url]http://prntscr.com/28w1ix[/url]
:d
can u add me on skype maybe u can help me with teamviewer - raivis.taurins1

Share this post


Link to post
Share on other sites
  • 0
[quote name='raivorots']now im getting this error - [url]http://prntscr.com/28w1ix[/url]
:d
can u add me on skype maybe u can help me with teamviewer - raivis.taurins1[/QUOTE]

Kinda going full retard atm, I need some sleep sorry xd, very tired still.

Share this post


Link to post
Share on other sites
  • 0
[quote name='Yaymyshow']Kinda going full retard atm, I need some sleep sorry xd, very tired still.[/QUOTE]

ohh k im almost done server to publicize and when i want add vote i get that fucking errors;(
but ohh looks cant get online today
xD

Share this post


Link to post
Share on other sites
Sign in to follow this  

×