Hi.
I'm in need of some help with the Duel Request.
I convereted hayzies Duelling from Emulous to a regular based server, but the hard part is the Duel Requesting(As always).
I don't know what packet it should go to.. These are my Duelling packets:
Code:
case 153:
break;
case 139:
int answerPlayer = inStream.readUnsignedWord();
if(server.playerHandler.players[answerPlayer] == null) {
return;
}
if(arenas() || duelStatus == 5) {
sM("You can't challenge inside the arena!");
return;
}
requestDuel(answerPlayer);
break;
But when I try it, nothing happens. Nothing at all.
Any help?
---------- Post added at 08:13 PM ---------- Previous post was at 07:58 PM ----------
Oh and here's requestduel method:
Code:
public void requestDuel(int id) {
try {
resetDuel();
resetDuelItems();
duelingWith = id;
client o = (client) server.playerHandler.players[id];
if(o == null) {
return;
}
duelRequested = true;
if(duelStatus == 0 && o.duelStatus == 0 && duelRequested && o.duelRequested && duelingWith == o.getId() && o.duelingWith == getId()) {
if(GoodDistance(o.absX, o.absY, absX, absY, 8) == false){
openDuel();
o.openDuel();
} else {
sM("You need to get closer to your opponent to start the duel.");
}
} else {
sM("Sending duel request...");
o.sM(playerName+":duelreq:");
}
} catch (Exception e) {
System.out.println("Error requesting duel.");
}
}