HelpRealm Relay - Reconnect Script

Posts 1–4 of 4 · Page 1 of 1
Realm Relay - Reconnect Script
Hi guys, since Realm Relay has been released i got more interrested in coding hacks for rotmg because the hacks are written in javascript!
The reconnect thing would be a thing i would like to manage via realm relay but i dont know where to get the data from dungeon connections readable and accesible via javascript, could you give me some information or hints where to look up?
When you connect to a new area, you need to grab the keyTime, key, and gameId from the hello packet. You can then use that to construct a reconnect packet to send to the client.
Use portal packet first
Then receive reconnect packet, with the key time, key, key size, and gameId host ip
Then use the hello packet to connect with the above information
I found the packets and their ids but dont really know how to access the important information.. Just by storing 'packet.key' into a variable if its a reconnect packet?

2nd problem: Im trying to write a chat notifier with spam filter but i cant get this code to work

Code:
function displayRealmRelayNotification(event, playerObjectId, color, text) {
	var notificationPacket = event.createPacket(ID_NOTIFICATION);
	notificationPacket.objectId = playerObjectId;
	notificationPacket.message = "{\"key\":\"blank\",\"tokens\":{\"data\":\"" + text + "\"}}";
	notificationPacket.color = color;
	event.sendToClient(notificationPacket);
}



function onServerPacket(event) {
	var packet = event.getPacket();
	switch (packet.id()) {
		case ID_TEXT: {
			var text = packet.text;
			var boss = this
			if(text.IndexOf('lab') != -1) || (text.IndexOf('mad') != -1){
				player_id = packet.objectId;
				var toPrint = "Lab Callers:\\n";
				toPrint += player_id
				boss.displayRealmRelayNotification(event, player_id, 0xFF7700, toPrint);
			}
		}
	}
}
Posts 1–4 of 4 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us