Skip to content

XMPP MITM Setup Guide

Danger

The socket does not have any datatypes built in, it returns the xmpp data that valorant intended you must parse by yourself!

Danger

This setup uses MITM (Man In The Middle) all riot services will need to be closed before running, if your software closes before riot your chat services will be offline until you restart your Riot Clients

Step 1: Initialize RadiantConnect

Initialize the XMPP Instance, it's suggested to run the KillRiot method before continuing

C#
1
2
3
4
5
ValXMPP.KillRiot();

Thread.Sleep(2000);

ValXMPP chatServer = new ValXMPP();

Step 2: Initialize the socket connection

This will begin the actual socket connection and will start a Riot instance.

C#
1
chatServer.InitializeConnection();

Step 3: Subscribe to the message events

This is where you'll receive the messages from server and client

C#
1
2
3
4
5
6
chatServer.OnOutboundMessage += (data)=>{
    Debug.WriteLine($"SERVER MESSAGE: {data}");
};
chatServer.OnInboundMessage += (data)=>{
    Debug.WriteLine($"CLIENT MESSAGE: {data}");
};

Step 3.1: Subscribe to new socket connections Required for sending messages

C#
1
2
3
chatServer.OnSocketCreated += (socketHandle) => {
    socketHandle.SendXmlMessageAsync(/*XML String*/);
};

Step 3.2: Subscribe to valorant presence update event

C#
1
2
3
chatServer.OnValorantPresenceUpdated += (valorantPresence) => {
    // valorantPresence returns ValorantPresence data type
};

Step 4: Profit

In the end it should look something like this example

C#
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
ValXMPP.KillRiot();

Thread.Sleep(2000);

ValXMPP chatServer = new();

chatServer.InitializeConnection();

chatServer.OnOutboundMessage += (data)=>{
    Debug.WriteLine($"SERVER MESSAGE: {data}");
};

chatServer.OnInboundMessage += (data)=>{
    Debug.WriteLine($"SERVER MESSAGE: {data}");
};

chatServer.OnSocketCreated += (socketHandle) => {
    socketHandle.SendXmlMessageAsync("</presence>");
};

chatServer.OnValorantPresenceUpdated += (valorantPresence) =>
{
    Debug.WriteLine(valorantPresence.PartyId);
};