RealmRelay Effect Blocker

Posts 18 of 8 · Page 1 of 1
RealmRelay Effect Blocker
I've been writing an effect blocker that blocks client-side effects for Realm Relay but the script doesn't seem to be picking up on the SETCONDITION packets (Which, to the best of my knowledge, let the server give the client effects such as confused)
Code:
//effectblock.js

var ID_CREATE_SUCCESS = $.findPacketId("CREATE_SUCCESS");
var ID_SETCONDITION = $.findPacketId("SETCONDITION");

//var blockedEffects = {5,6,7,8,9,10,13};
var blockedEffects = {};
blockedEffects[0] = 5;	//Dazed
blockedEffects[1] = 6;	//Stunned
blockedEffects[2] = 7;	//Blind
blockedEffects[3] = 8;	//Hallucinating
blockedEffects[4] = 9;	//Drunk
blockedEffects[5] = 10;	//Confused
blockedEffects[6] = 13;	//Paralyzed

function onEnable(event) {
	event.echo("Hi there!"); //Debugging
}

function onClientPacket(event) {
	var packet = event.getPacket();
	if ( packet.id() == 23 ) {
		event.echo(packet.conditionType()); //Debugging
		for (var i=0; i <= blockedEffects.length; i++) {
			if (packet.conditionType == blockedEffects[i]) {
				event.cancel()
			}
		}
	}
}
If anyone could help me with this, please do!
Quote Originally Posted by apemanzilla View Post
I've been writing an effect blocker that blocks client-side effects for Realm Relay but the script doesn't seem to be picking up on the SETCONDITION packets (Which, to the best of my knowledge, let the server give the client effects such as confused)
Code:
//effectblock.js

var ID_CREATE_SUCCESS = $.findPacketId("CREATE_SUCCESS");
var ID_SETCONDITION = $.findPacketId("SETCONDITION");

//var blockedEffects = {5,6,7,8,9,10,13};
var blockedEffects = {};
blockedEffects[0] = 5;	//Dazed
blockedEffects[1] = 6;	//Stunned
blockedEffects[2] = 7;	//Blind
blockedEffects[3] = 8;	//Hallucinating
blockedEffects[4] = 9;	//Drunk
blockedEffects[5] = 10;	//Confused
blockedEffects[6] = 13;	//Paralyzed

function onEnable(event) {
	event.echo("Hi there!"); //Debugging
}

function onClientPacket(event) {
	var packet = event.getPacket();
	if ( packet.id() == 23 ) {
		event.echo(packet.conditionType()); //Debugging
		for (var i=0; i <= blockedEffects.length; i++) {
			if (packet.conditionType == blockedEffects[i]) {
				event.cancel()
			}
		}
	}
}
If anyone could help me with this, please do!
Why didnt u just use
if (packet.id == ID_SETCONDITION) { }
Also, its not packet.id() its just packet.id
Quote Originally Posted by Trollaux View Post


Why didnt u just use
if (packet.id == ID_SETCONDITION) { }
Also, its not packet.id() its just packet.id
All the other scripts use packet.id(), and even without the parenthasees it still doesn't work.
I had used the number itself while debugging although it should work with either.
Quote Originally Posted by apemanzilla View Post
All the other scripts use packet.id(), and even without the parenthasees it still doesn't work.
I had used the number itself while debugging although it should work with either.
Hmm. Make sure you are using the proper names from the packet's java class.
Quote Originally Posted by Trollaux View Post


Hmm. Make sure you are using the proper names from the packet's java class.
Double checked it all... Doesn't look like it's picking up on the packets correctly. Doubtful it's an error on my end, will talk to DeVoidCoder
SETCONDITION is not from SERVER->CLIENT; it is from CLIENT->SERVER. It is not used to give client-sided effects; it is probably used to let the server know that the player was affected by some condition.
Pretty sure the only packets you need are the new tick packet for the stat data and the create success for the player_id. Condition effects are sent in an integer whose binary form shows which of 29 status effects are active. It's easy if you know what you are doing but preventing certain condition effects will always be better programmed directly into the client as there won't be the fraction of a second delay.
Quote Originally Posted by Nisuxen View Post
Pretty sure the only packets you need are the new tick packet for the stat data and the create success for the player_id. Condition effects are sent in an integer whose binary form shows which of 29 status effects are active. It's easy if you know what you are doing but preventing certain condition effects will always be better programmed directly into the client as there won't be the fraction of a second delay.
Hmm, will have to look into this. Thanks!
Posts 18 of 8 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?