Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<br>
[![Donate](http://i.imgur.com/FtaJpum.gif)](https://paypal.me/groupload "Donate")<br>
<br>
**GTA V Online - SessionSweeper**<br>
**GTA V Online and RDR 2 Online - SessionSweeper**<br>
Press *Pause/Break* to disconnect from everyone in your current session and be alone.<br>
Press *Scroll Lock* to toggle lock your current session and stop people from joining.<br>
<br>
Expand Down
2 changes: 1 addition & 1 deletion SessionSweeper/SessionSweeper/DataStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace SessionSweeper
{
class DataStorage
{
public static Process pGTAV;
public static Process pRDR2;
public static bool LobbyLocked = false;
public static bool AntiIdlingActive = false;

Expand Down
6 changes: 3 additions & 3 deletions SessionSweeper/SessionSweeper/FirewallControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public class FWCtrl
public void LockLobby(bool playSound = false)
{
INetFwRule newRule = (INetFwRule)Activator.CreateInstance(typeFWRule);
newRule.Name = "GTA V Session Lock";
newRule.Description = "GTA V Session Lock";
newRule.Name = "RDR2 Session Lock";
newRule.Description = "RDR2 Session Lock";
newRule.Protocol = (int)NET_FW_IP_PROTOCOL_.NET_FW_IP_PROTOCOL_UDP;
newRule.LocalPorts = "6672,61455,61457,61456,61458";
newRule.Direction = NET_FW_RULE_DIRECTION_.NET_FW_RULE_DIR_OUT;
Expand All @@ -35,7 +35,7 @@ public void LockLobby(bool playSound = false)
public void UnlockLobby(bool playSound = false)
{
INetFwPolicy2 fwPolicy2 = (INetFwPolicy2)Activator.CreateInstance(typeFWPolicy2);
fwPolicy2.Rules.Remove("GTA V Session Lock");
fwPolicy2.Rules.Remove("RDR2 Session Lock");

if (playSound)
DataStorage.pUnlocked.Play();
Expand Down
5 changes: 4 additions & 1 deletion SessionSweeper/SessionSweeper/SessionSweeper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@
<GenerateManifests>true</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<SignManifests>true</SignManifests>
<SignManifests>false</SignManifests>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>false</SignAssembly>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
Expand Down
3 changes: 3 additions & 0 deletions SessionSweeper/SessionSweeper/SessionSweeper.csproj.user
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@
<FallbackCulture>de-DE</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
</PropertyGroup>
<PropertyGroup>
<EnableSecurityDebugging>false</EnableSecurityDebugging>
</PropertyGroup>
</Project>
30 changes: 15 additions & 15 deletions SessionSweeper/SessionSweeper/fMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ protected override void WndProc(ref Message m)
base.WndProc(ref m);
if (m.Msg == 0x0312)
{
if (isGTAVRunning())
if (isRDR2Running())
{
Keys key = (Keys)(((int)m.LParam >> 16) & 0xFFFF);
int id = m.WParam.ToInt32();
Expand All @@ -54,20 +54,20 @@ protected override void WndProc(ref Message m)
else
{
Activate();
MessageBox.Show("GTA V was not detected!", "SessionSweeper", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show("RDR2 was not detected!", "SessionSweeper", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}

private bool isGTAVRunning()
private bool isRDR2Running()
{
bool isRunning = false;
foreach (Process process in Process.GetProcesses())
{
if (process.ProcessName.Equals("GTA5"))
if (process.ProcessName.Equals("RDR2"))
{
isRunning = true;
DataStorage.pGTAV = process;
DataStorage.pRDR2 = process;
break;
}
}
Expand All @@ -76,7 +76,7 @@ private bool isGTAVRunning()

private void ToggleNetwork()
{
if (isGTAVRunning())
if (isRDR2Running())
{
if (!tmrNetwork.Enabled)
{
Expand All @@ -88,15 +88,15 @@ private void ToggleNetwork()
else
{
Activate();
MessageBox.Show("GTA V was not detected!", "SessionSweeper", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show("RDR2 was not detected!", "SessionSweeper", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}

private void ToggleAntiIdling()
{
DataStorage.AntiIdlingActive = !DataStorage.AntiIdlingActive;

if (isGTAVRunning())
if (isRDR2Running())
{
if (DataStorage.AntiIdlingActive)
{
Expand All @@ -114,32 +114,32 @@ private void ToggleAntiIdling()
else
{
Activate();
MessageBox.Show("GTA V was not detected!", "SessionSweeper", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show("RDR2 was not detected!", "SessionSweeper", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}

private void SweepSession()
{
if (isGTAVRunning())
if (isRDR2Running())
{
if (!tmrResume.Enabled)
{
DataStorage.pPending.Play();
Toolkit.SuspendProcess(DataStorage.pGTAV.Id);
Toolkit.SuspendProcess(DataStorage.pRDR2.Id);
tmrResume.Start();
}
}
else
{
Activate();
MessageBox.Show("GTA V was not detected!", "SessionSweeper", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show("RDR2 was not detected!", "SessionSweeper", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}

private void ToggleLockSession()
{
if (!DataStorage.HasAdministrativeRight) { return; }
if (isGTAVRunning())
if (isRDR2Running())
{
if (DataStorage.LobbyLocked)
{
Expand All @@ -158,7 +158,7 @@ private void ToggleLockSession()
else
{
Activate();
MessageBox.Show("GTA V was not detected!", "SessionSweeper", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show("RDR2 was not detected!", "SessionSweeper", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}

Expand All @@ -171,7 +171,7 @@ private void tmrNetwork_Tick(object sender, EventArgs e)

private void tmrResume_Tick(object sender, EventArgs e)
{
Toolkit.ResumeProcess(DataStorage.pGTAV.Id);
Toolkit.ResumeProcess(DataStorage.pRDR2.Id);
DataStorage.pSweeped.Play();
tmrResume.Stop();
}
Expand Down