RuneScape 2 Development > Server Tutorials

How to USE rs2dv.

Pages: <<< (35/48) >>>

shangtsung1:


--- Quote from: jonaske on June 08, 2008, 08:59:06 AM ---Could somebody please post a working createFrameVarSizeWord() method
because i don't get mine at work !!
PLEASE!

--- End quote ---



--- Code: --- public void createFrameVarSize(int id)
{
buffer[currentOffset++] = (byte)(id + packetEncryption.getNextKey());
buffer[currentOffset++] = 0;
if (frameStackPtr >= frameStackSize-1)
{
throw new RuntimeException("Stack overflow");
}
else
frameStack[++frameStackPtr] = currentOffset;
}

public void createFrameVarSizeWord(int id)
{
try
{
buffer[currentOffset++] = (byte)(id + packetEncryption.getNextKey());
writeWord(0);
if (frameStackPtr >= frameStackSize-1)
{
throw new RuntimeException("Stack overflow");
}
else
frameStack[++frameStackPtr] = currentOffset;
}
catch(Exception e)
{}
}

public void endFrameVarSize()
{
try
{
if (frameStackPtr < 0)
throw new RuntimeException("Stack empty");
else
writeFrameSize(currentOffset - frameStack[frameStackPtr--]);
}
catch(Exception e)
{}
}

public void endFrameVarSizeWord()
{
try
{
if (frameStackPtr < 0)
throw new RuntimeException("Stack empty");
else
writeFrameSizeWord(currentOffset - frameStack[frameStackPtr--]);
}
catch(Exception e)
{}
}
--- End code ---



the method i use ;)


EDIT: Hope you don't mind, just put them into code tags.

West7man:

Hahaha I spent 4 hours to find out how to get rs2dv working and.. Haha I'm laughing loud, here is the tutorial...
This is great!
I found an ANT installing guide in a NUTSHELL
I have got Windows Vista 32bit and this way worked for me:

1) http://serialize.blogspot.com/2007/06/installing-ant-another-neat-tool.html
2) I run build.bat
3) Now I added a file called "runv2.bat" to the bin folder:
Code:

--- Code: ---@echo off
run.bat net.varek.rs2d.test.Main
pause
--- End code ---
4) Run the file "runv2.bat" and it should work.
Again: I have got WinVista 32bit.! So don't blame me if your win95 doesn't support...

MrBabbelen:


--- Code: ---package net.varek.rs2d.packethandler;

import org.apache.mina.common.IoSession;

import net.varek.rs2d.net.*;
import net.varek.rs2d.model.Player;

public class Combat implements PacketHandler {
    public void handlePacket(Packet p, IoSession session) {
Player player = (Player) session.getAttachment();
String username = player.getUsername();
Integer playerAttacking = p.readLEShortA();
for (int i = 0; i < 2; i++)
    if (username.equalsIgnoreCase(player.getAdmins(I))) {
player.getActionSender().sendMessage(
"You are an admin, and cannot player kill.");
return;
    } else
player.getAttacker().setAttacker(player);
    }
}
--- End code ---
Combat.
PeeHPee's from rune-   server
Find the packet, etc yourself ;)
I haven't figured out the packet yet.

jonaske:

shangtsung1
a WORKING method in RS2D ..
not in wl


West7man:

I can't run my server.. The "run.bat" pauses at this point:

--- Code: ---Buildfile: ..\custom-build.xml

run:
     [java] [00:00:00] [main] Loaded world
     [java] [00:00:00] [main]   Added packet handler: net.varek.rs2d.test.QuietP
acketHandler@d2906a (binds=[0, 86, 210, 121, 3])
     [java] [00:00:00] [main]   Added packet handler: net.varek.rs2d.test.Debugg
ingPacketHandler@72ffb (binds=[])
     [java] [00:00:00] [main]   Added packet handler: net.varek.rs2d.packethandl
er.Walking@1df38fd (binds=[164, 98, 248])
     [java] [00:00:00] [main]   Added packet handler: net.varek.rs2d.packethandl
er.ActionButton@16a786 (binds=[185])
     [java] [00:00:00] [main]   Added packet handler: net.varek.rs2d.packethandl
er.PublicChat@1507fb2 (binds=[4])
     [java] Exception in thread "main" sun.misc.ServiceConfigurationError: java.
lang.ClassNotFoundException: sun.nio.ch.EPollSelectorProvider
     [java]     at java.nio.channels.spi.SelectorProvider.loadProviderFromProper
ty(SelectorProvider.java:82)
     [java]     at java.nio.channels.spi.SelectorProvider.access$000(SelectorPro
vider.java:54)
     [java]     at java.nio.channels.spi.SelectorProvider$1.run(SelectorProvider
.java:153)
     [java]     at java.security.AccessController.doPrivileged(Native Method)
     [java]     at java.nio.channels.spi.SelectorProvider.provider(SelectorProvi
der.java:150)
     [java]     at java.nio.channels.Selector.open(Selector.java:209)
     [java]     at org.apache.mina.transport.socket.nio.SocketAcceptor.startupWo
rker(SocketAcceptor.java:162)
     [java]     at org.apache.mina.transport.socket.nio.SocketAcceptor.bind(Sock
etAcceptor.java:141)
     [java]     at net.varek.rs2d.Server.start(Unknown Source)
     [java]     at net.varek.rs2d.test.Main.main(Unknown Source)
     [java] Caused by: java.lang.ClassNotFoundException: sun.nio.ch.EPollSelecto
rProvider
     [java]     at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
     [java]     at java.security.AccessController.doPrivileged(Native Method)
     [java]     at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
     [java]     at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
     [java]     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)

     [java]     at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
     [java]     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

     [java]     at java.lang.Class.forName0(Native Method)
     [java]     at java.lang.Class.forName(Class.java:247)
     [java]     at java.nio.channels.spi.SelectorProvider.loadProviderFromProper
ty(SelectorProvider.java:77)
     [java]     ... 9 more

--- End code ---

Why does it stop at "... 9 more" ?  :confused:

I see that this shitwheel problem occurs only in vista... hmm.. And the error starts in the custom-build file at:
<jvmarg line="-Djava.nio.channels.spi.SelectorProvider=sun.nio.ch.EPollSelectorProvider -XX:+AggressiveOpts -XX:+UseParallelGC -XX:+UseBiasedLocking -XX:NewSize=64m" />

Pages: <<< (35/48) >>>

Go to full version