Jump to content

Rimv911

Member
  • Content count

    21
  • Joined

  • Last visited

  1. Rimv911

    VPS Compiling Error

    I get these errors when I try to compile the src folder: [CODE]34. ERROR in /LightPk614/src/dragonkk/rs2rsps/model/player/Player.java (at line 737) if(this.getConnection().getChannel() == null) ^^^^^^^^^^ The method getChannel() from the type ConnectionHandler refers to the missing type Channel ---------- 35. ERROR in /LightPk614/src/dragonkk/rs2rsps/model/player/Player.java (at line 779) String host = this.getConnection().getChannel().getRemoteAddress().toString(); ^^^^^^^^^^ The method getChannel() from the type ConnectionHandler refers to the missing type Channel ---------- 36. ERROR in /LightPk614/src/dragonkk/rs2rsps/model/player/Player.java (at line 875) String ip = "" + this.getConnection().getChannel().getLocalAddress(); ^^^^^^^^^^ The method getChannel() from the type ConnectionHandler refers to the missing type Channel ---------- 37. ERROR in /LightPk614/src/dragonkk/rs2rsps/model/player/Player.java (at line 898) String host = this.getConnection().getChannel().getRemoteAddress().toString(); ^^^^^^^^^^ The method getChannel() from the type ConnectionHandler refers to the missing type Channel ---------- 38. ERROR in /LightPk614/src/dragonkk/rs2rsps/model/player/Player.java (at line 953) String host = this.getConnection().getChannel().getRemoteAddress().toString(); ^^^^^^^^^^ The method getChannel() from the type ConnectionHandler refers to the missing type Channel ---------- 39. ERROR in /LightPk614/src/dragonkk/rs2rsps/model/player/Player.java (at line 989) String host = this.getConnection().getChannel().getRemoteAddress().toString(); ^^^^^^^^^^ The method getChannel() from the type ConnectionHandler refers to the missing type Channel ---------- 40. WARNING in /LightPk614/src/dragonkk/rs2rsps/model/player/Player.java (at line 1077) boolean isOnline = WorldId != 0; ^^^^^^^^ The local variable isOnline is never read ---------- ---------- 41. ERROR in /LightPk614/src/dragonkk/rs2rsps/net/codec/ConnectionHandler.java (at line 43) public Channel getChannel() { ^^^^^^^ Channel cannot be resolved to a type[/CODE] And that's how the getChannel() class looks like: [CODE]package dragonkk.rs2rsps.net.codec; import dragonkk.rs2rsps.io.OutStream; import dragonkk.rs2rsps.model.player.Player; import org.jboss.netty.buffer.ChannelBuffers; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelFuture; import java.util.LinkedList; import java.util.Queue; public class ConnectionHandler { public boolean nulled = false; public ConnectionHandler(Channel channel) { this.channel = channel; //this.inStream = new InStream(1204); } public transient Queue<OutStream> packetQueue = new LinkedList<OutStream>(); public void processPacketQueue() { if(packetQueue.isEmpty()) return; for(OutStream packet : packetQueue) { writeInstant(packet); } packetQueue.clear(); } //private transient InStream inStream; private transient Channel channel; private transient byte ConnectionStage; private transient byte NameHash; private transient long SessionKey; private transient Player player; private transient byte displayMode; private transient String name = ""; public long lastResponce; public Channel getChannel() { <<<<<<<<<<<<<<<< THIS look good to me.. return channel; } public void write(OutStream outStream) { //packetQueue.add(outStream); writeInstant(outStream); } public ChannelFuture writeInstant(OutStream outStream) { if (channel != null && outStream.offset() > 0 && channel.isConnected()) { return channel.write(ChannelBuffers.copiedBuffer(outStream.buffer(), 0, outStream.offset())); } return null; } public void setConnectionStage(byte connectionStage) { ConnectionStage = connectionStage; } public byte getConnectionStage() { return ConnectionStage; } /*public InStream getInStream() { return inStream; }*/ public void setNameHash(byte nameHash) { NameHash = nameHash; } public byte getNameHash() { return NameHash; } public void setSessionKey(long sessionKey) { SessionKey = sessionKey; } public long getSessionKey() { return SessionKey; } public void setPlayer(Player player) { this.player = player; } public Player getPlayer() { return player; } public boolean isDisconnected() { return !getChannel().isConnected(); } public int getDisplayMode() { return displayMode; } public void setDisplayMode(int mode) { this.displayMode = (byte) mode; } /** * @param name the name to set */ public void setName(String name) { this.name = name; } /** * @return the name */ public String getName() { return name; } }[/CODE] Help my solve this error The method getChannel() from the type ConnectionHandler refers to the missing type Channel, Thanks.
  2. [quote name='crezzy'][/QUOTE] So I tryed to compile the server in the VPS and look what i got!! [CODE]34. ERROR in /LightPk614/src/dragonkk/rs2rsps/model/player/Player.java (at line 737) if(this.getConnection().getChannel() == null) ^^^^^^^^^^ The method getChannel() from the type ConnectionHandler refers to the missing type Channel ---------- 35. ERROR in /LightPk614/src/dragonkk/rs2rsps/model/player/Player.java (at line 779) String host = this.getConnection().getChannel().getRemoteAddress().toString(); ^^^^^^^^^^ The method getChannel() from the type ConnectionHandler refers to the missing type Channel ---------- 36. ERROR in /LightPk614/src/dragonkk/rs2rsps/model/player/Player.java (at line 875) String ip = "" + this.getConnection().getChannel().getLocalAddress(); ^^^^^^^^^^ The method getChannel() from the type ConnectionHandler refers to the missing type Channel ---------- 37. ERROR in /LightPk614/src/dragonkk/rs2rsps/model/player/Player.java (at line 898) String host = this.getConnection().getChannel().getRemoteAddress().toString(); ^^^^^^^^^^ The method getChannel() from the type ConnectionHandler refers to the missing type Channel ---------- 38. ERROR in /LightPk614/src/dragonkk/rs2rsps/model/player/Player.java (at line 953) String host = this.getConnection().getChannel().getRemoteAddress().toString(); ^^^^^^^^^^ The method getChannel() from the type ConnectionHandler refers to the missing type Channel ---------- 39. ERROR in /LightPk614/src/dragonkk/rs2rsps/model/player/Player.java (at line 989) String host = this.getConnection().getChannel().getRemoteAddress().toString(); ^^^^^^^^^^ The method getChannel() from the type ConnectionHandler refers to the missing type Channel ---------- 40. WARNING in /LightPk614/src/dragonkk/rs2rsps/model/player/Player.java (at line 1077) boolean isOnline = WorldId != 0; ^^^^^^^^ The local variable isOnline is never read ---------- ---------- 41. ERROR in /LightPk614/src/dragonkk/rs2rsps/net/codec/ConnectionHandler.java (at line 43) public Channel getChannel() { ^^^^^^^ Channel cannot be resolved to a type [/CODE] Could you give me a hand with that?
  3. [quote name='crezzy']Umm seems fine. well I just looked the error up for you and this is what it means: [B]I suggest compiling the server again on the vps[/B][/QUOTE] And the vps shows there is no javac in the vps.. Crap.. From one error to two..
  4. [quote name='Yaymyshow']My bad, just woke up, kinda abit trippy right now, wrote 'admin' on the other thread instead of 'questions'... lmao 'I have a few admins' .. fp[/QUOTE] S**t happens :D
  5. That what confused me, the ServerChannelHandler is there when I compiled it and the .class it's there when i try to run it but the damn thing can't find it...
  6. It is I checked like a 100 times :/
  7. [quote name='crezzy']Umm paste your serverChannelHandler I'll take a look for you.[/QUOTE] [CODE]package dragonkk.rs2rsps.net; import dragonkk.rs2rsps.io.InStream; import dragonkk.rs2rsps.model.World; import dragonkk.rs2rsps.model.player.Player; import dragonkk.rs2rsps.net.codec.ConnectionHandler; import dragonkk.rs2rsps.net.codec.ConnectionWorker; import dragonkk.rs2rsps.util.Logger; import org.jboss.netty.bootstrap.ServerBootstrap; import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.channel.*; import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory; import java.net.InetSocketAddress; import java.util.concurrent.Executors; [MENTION=47027]chan[/MENTION]nelPipelineCoverage("all") public class ServerChannelHandler extends SimpleChannelHandler { public ServerChannelHandler() { ServerBootstrap bootstrap = new ServerBootstrap(new NioServerSocketChannelFactory(Executors.newCachedThreadPool(), Executors.newCachedThreadPool())); bootstrap.getPipeline().addLast("handler", this); bootstrap.setOption("child.tcpNoDelay", true); bootstrap.bind(new InetSocketAddress(43594)); Logger.log(this, "Loaded port 43594"); } [MENTION=15855]Over[/MENTION]ride public final void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent e) { Channel channel = e.getChannel(); int count = 0; String host = channel.getRemoteAddress().toString(); host = host.substring(1, host.indexOf(':')); if (World.PermbannedIpsContain(host)) { e.getChannel().close(); return; } for (Player player : World.getPlayers()) { String playerHost = player.getConnection().getChannel().getRemoteAddress().toString(); playerHost = playerHost.substring(1, playerHost.indexOf(':')); if (playerHost.equals(host)) { if (++count == 6) { channel.close(); return; } } } ConnectionHandler connection = new ConnectionHandler(channel); ctx.setAttachment(connection); } [MENTION=15855]Over[/MENTION]ride public final void channelDisconnected(ChannelHandlerContext ctx, ChannelStateEvent e) { ConnectionHandler p = (ConnectionHandler) ctx.getAttachment(); if (p != null) { World.unRegisterConnection(p); ctx.setAttachment(null); } } [MENTION=15855]Over[/MENTION]ride public final void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent ee) throws Exception { } [MENTION=15855]Over[/MENTION]ride public final void messageReceived(ChannelHandlerContext ctx, MessageEvent e) { ConnectionHandler p = (ConnectionHandler) ctx.getAttachment(); ChannelBuffer buf = (ChannelBuffer) e.getMessage(); buf.markReaderIndex(); int avail = buf.readableBytes(); if (avail > 5000) { e.getChannel().close(); return; } byte[] b = new byte[avail]; buf.readBytes(b); InStream in = new InStream(b); if (p.getPlayer() == null) { ConnectionWorker.run(p, in); } else { Packets.run(p, in); } } } [/CODE]
  8. [quote name='crezzy']Have you converted your run.bat to run.sh correctly? Or make sure that the compiled file is in the bin folder. take a look at this: [URL="http://javarevisited.blogspot.co.uk/2011/06/noclassdeffounderror-exception-in.html"]http://javarevisited.blogspot.co.uk/2011/06/noclassdeffounderror-exception-in.html[/URL][/QUOTE] This is how the .sh looks like: [CODE]java -Xmx512m -classpath bin:lib/* dragonkk.rs2rsps.Server[/CODE] This is how the bat looks like: [CODE]@echo off title Running... "C:\Program Files\Java\jre7\bin\java.exe" -Xmx512m -cp bin;lib/* dragonkk.rs2rsps.Server pause[/CODE] You see I compiled the server on my pc and [B][COLOR="#FF0000"]not[/COLOR][/B] on the acctual VPS, but I don't know if thats the case. And on the VPS it start loading the server, but when it gets to ServerChannelHandler it gives me that error. :/
  9. DAT MisPost...
  10. Rimv911

    Compiling error

    [quote name='raivorots']what problem can be when i compile code - case 1: else if (id == 28296) player.getInventory().addItem(22989, 1); error - starting... Picked up _JAVA_OPTIONS: -Xmx1000M src\com\rs\net\decoders\handlers\ObjectHandler.java:139: error: 'else' without ' if' else if (id == 28296) ^ 1 error Press any key to continue . . .[/QUOTE] That "Starting" isn't as title? And I think your options isn't good replace \ with / and it should work. The second error is that you writed else without if in line 139.
  11. [quote name='crezzy']Make sure your the file ServerChannelHandler is located in the directory dragonkk.rs2rsps.net.ServerChannelHandler[/QUOTE] I'am 100% it is because when i run it on my win7 it loads without any error or warnings, but on centOS VPS it give me this error? Those it make any difference if i compile the server in the VPS? Because i compiled it and uploaded it to the VPS..
  12. I try to run the server and im getting this error [CODE]Exception in thread "main" java.lang.NoClassDefFoundError: dragonkk.rs2rsps.net.ServerChannelHandler at dragonkk.rs2rsps.Server.<init>(Server.java:113) at dragonkk.rs2rsps.Server.main(Server.java:120) [/CODE] Could anyone help me? I can't solve this on my own..
  13. [QUOTE]ahh so i dont know about that soory bro [/QUOTE] Unless this is wrong: [CODE] public final static String PATH = "./cache/";[/CODE]
  14. That alrgiht.. Searching on google for 3 day straight figuring out simple thing that i can't figure out... I can on mt pc.. That error basicly says wrong cache directory.. But it's fine i've tested it.. chaned in CacheConstants.java to even /usr/server/cache/ still nothing.. I have no idea what the hell is wrong...
  15. [quote name='raivorots']This is because you have not configured your path(s) correctly. You will need to change all your file path(s) to the directory your files / server are located. I usually use the home directory on my Linux box, so my path looks like so Code: Scanner s = new Scanner(new File("/home/SERVERFOLDER/Data/cfg/" + filename)); or Scanner s = new Scanner(new File("/home/SERVERFOLDER/bin/cache" + filename)); maybe this?[/QUOTE] dont think so.. The problem is the server starts to load it says vote is disabled, 105 commands loaded, then starting to load cache, and the error appears..
×