Skip to content

Commit

Permalink
Merge branch 'main' into chore/add-map-image-assets
Browse files Browse the repository at this point in the history
  • Loading branch information
IncPlusPlus authored Aug 20, 2021
2 parents 656f5cb + 8f63a5b commit 8fa2bdf
Show file tree
Hide file tree
Showing 18 changed files with 113 additions and 77 deletions.
71 changes: 9 additions & 62 deletions TF2.CT
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,21 @@
<CheatEntry>
<ID>1</ID>
<Description>"Health (single player) (engine.dll+1122A8DC)"</Description>
<LastState Value="9000" RealAddress="7FFB7A1CA8DC"/>
<VariableType>4 Bytes</VariableType>
<Address>engine.dll+1122A8DC</Address>
</CheatEntry>
<CheatEntry>
<ID>2</ID>
<Description>"Player velocity (client.dll+2A9F704)"</Description>
<LastState Value="0" RealAddress="7FFB5D5CF704"/>
<VariableType>Float</VariableType>
<Address>client.dll+2A9F704</Address>
</CheatEntry>
<CheatEntry>
<ID>3</ID>
<Description>"Map name (multiplayer) (client.dll+23E0FA0)"</Description>
<LastState RealAddress="7FFB5CF10FA0"/>
<ShowAsSigned>0</ShowAsSigned>
<VariableType>String</VariableType>
<Length>10</Length>
<Length>16</Length>
<Unicode>0</Unicode>
<CodePage>0</CodePage>
<ZeroTerminate>1</ZeroTerminate>
Expand All @@ -32,7 +30,6 @@
<CheatEntry>
<ID>4</ID>
<Description>"Map name (single player) (server.dll+C9BE64)"</Description>
<LastState RealAddress="7FFB4FAEBE64"/>
<VariableType>String</VariableType>
<Length>10</Length>
<Unicode>0</Unicode>
Expand All @@ -43,103 +40,65 @@
<CheatEntry>
<ID>5</ID>
<Description>"maybe correct map name (client.dll+B34522)"</Description>
<LastState RealAddress="7FFB5B664522"/>
<VariableType>String</VariableType>
<Length>20</Length>
<Unicode>0</Unicode>
<CodePage>0</CodePage>
<ZeroTerminate>1</ZeroTerminate>
<Address>client.dll+B34522</Address>
</CheatEntry>
<CheatEntry>
<ID>6</ID>
<Description>"Possible map name as friendly string (multiplayer) (engine.dll+1397AC5B)"</Description>
<LastState RealAddress="7FFB7C91AC5B"/>
<VariableType>String</VariableType>
<Length>17</Length>
<Unicode>0</Unicode>
<CodePage>0</CodePage>
<ZeroTerminate>1</ZeroTerminate>
<Address>engine.dll+1397AC5B</Address>
</CheatEntry>
<CheatEntry>
<ID>28</ID>
<Description>"Mission name (single player) (engine.dll+1397AC5A)"</Description>
<LastState RealAddress="7FFB7C91AC5A"/>
<VariableType>String</VariableType>
<Length>14</Length>
<Unicode>0</Unicode>
<CodePage>0</CodePage>
<ZeroTerminate>1</ZeroTerminate>
<Address>engine.dll+1397AC5A</Address>
</CheatEntry>
<CheatEntry>
<ID>7</ID>
<Description>"maybe match time?"</Description>
<LastState Value="4294829862" RealAddress="7FFB5BADF274"/>
<VariableType>4 Bytes</VariableType>
<Address>client.dll+FAF274</Address>
</CheatEntry>
<CheatEntry>
<ID>8</ID>
<Description>"maybe match time?"</Description>
<LastState Value="4294829862" RealAddress="7FFB5BADF23C"/>
<VariableType>4 Bytes</VariableType>
<Address>client.dll+FAF23C</Address>
</CheatEntry>
<CheatEntry>
<ID>9</ID>
<Description>"Health (multiplayer) (engine.dll+1123CF64) (wrong)"</Description>
<LastState Value="4636" RealAddress="7FFB7A1DCF64"/>
<VariableType>4 Bytes</VariableType>
<Address>engine.dll+1123CF64</Address>
</CheatEntry>
<CheatEntry>
<ID>34</ID>
<Description>"Any of these is my score"</Description>
<Description>"Any of these is my score (the offset keeps changing for my player's score)"</Description>
<LastState Value="" RealAddress="00000000"/>
<GroupHeader>1</GroupHeader>
<Address>0</Address>
<CheatEntries>
<CheatEntry>
<ID>31</ID>
<Description>"bruh"</Description>
<LastState Value="0" RealAddress="7FFB7A1DD53C"/>
<VariableType>4 Bytes</VariableType>
<Address>engine.dll+1123D53C</Address>
</CheatEntry>
<CheatEntry>
<ID>32</ID>
<Description>"No description"</Description>
<LastState Value="0" RealAddress="7FFB7A23DE80"/>
<VariableType>4 Bytes</VariableType>
<Address>engine.dll+1129DE80</Address>
</CheatEntry>
<CheatEntry>
<ID>33</ID>
<Description>"No description"</Description>
<LastState Value="0" RealAddress="7FFB7A23DE88"/>
<VariableType>4 Bytes</VariableType>
<Address>engine.dll+1129DE88</Address>
</CheatEntry>
<CheatEntry>
<ID>36</ID>
<Description>"No description"</Description>
<LastState Value="0" RealAddress="7FFB7A1DD534"/>
<VariableType>4 Bytes</VariableType>
<Address>engine.dll+1123D534</Address>
</CheatEntry>
<CheatEntry>
<ID>37</ID>
<Description>"No description"</Description>
<LastState Value="0" RealAddress="7FFB7A356FC4"/>
<VariableType>4 Bytes</VariableType>
<Address>engine.dll+113B6FC4</Address>
</CheatEntry>
<CheatEntry>
<ID>38</ID>
<Description>"No description"</Description>
<LastState Value="0" RealAddress="7FFB7A356FCC"/>
<VariableType>4 Bytes</VariableType>
<Address>engine.dll+113B6FCC</Address>
</CheatEntry>
Expand All @@ -155,29 +114,25 @@
<CheatEntry>
<ID>29</ID>
<Description>"My pilot kills (engine.dll+1123D2A8)"</Description>
<LastState Value="0" RealAddress="7FFB7A1DD2A8"/>
<VariableType>4 Bytes</VariableType>
<Address>engine.dll+1123D2A8</Address>
</CheatEntry>
<CheatEntry>
<ID>30</ID>
<Description>"My minion kills (engine.dll+1123D3B0)"</Description>
<LastState Value="0" RealAddress="7FFB7A1DD3B0"/>
<VariableType>4 Bytes</VariableType>
<Address>engine.dll+1123D3B0</Address>
</CheatEntry>
<CheatEntry>
<ID>35</ID>
<Description>"My team's score"</Description>
<LastState Value="0" RealAddress="7FFB7A1B814C"/>
<ShowAsSigned>0</ShowAsSigned>
<VariableType>4 Bytes</VariableType>
<Address>engine.dll+1121814C</Address>
</CheatEntry>
<CheatEntry>
<ID>21</ID>
<Description>"Enemy team's score"</Description>
<LastState Value="0" RealAddress="7FFB7A1B8CA0"/>
<Description>"Enemy team's score (my team's score in bounty hunt)"</Description>
<VariableType>4 Bytes</VariableType>
<Address>engine.dll+11218CA0</Address>
</CheatEntry>
Expand All @@ -193,30 +148,26 @@
<CheatEntry>
<ID>22</ID>
<Description>"No description"</Description>
<LastState Value="3267993600" RealAddress="7FFB7A1D469C"/>
<VariableType>4 Bytes</VariableType>
<Address>engine.dll+1123469C</Address>
</CheatEntry>
<CheatEntry>
<ID>23</ID>
<Description>"No description"</Description>
<LastState Value="3021297761" RealAddress="7FFB7A1D46A4"/>
<VariableType>4 Bytes</VariableType>
<Address>engine.dll+112346A4</Address>
</CheatEntry>
<CheatEntry>
<ID>24</ID>
<Description>"No description"</Description>
<LastState Value="0" RealAddress="7FFB7A1DD514"/>
<VariableType>4 Bytes</VariableType>
<Address>engine.dll+1123D514</Address>
</CheatEntry>
</CheatEntries>
</CheatEntry>
<CheatEntry>
<ID>27</ID>
<Description>"Game mode name (mp) (maybe) (engine.dll+1397AC4E)"</Description>
<LastState RealAddress="7FFB7C91AC46"/>
<Description>"Full game mode and map name (engine.dll+1397AC4E)"</Description>
<ShowAsSigned>0</ShowAsSigned>
<VariableType>String</VariableType>
<Length>50</Length>
Expand All @@ -234,31 +185,28 @@
<CheatEntries>
<CheatEntry>
<ID>39</ID>
<Description>"No description"</Description>
<LastState Value="0" RealAddress="7FFB7A1B8CA0"/>
<Description>"My team's score"</Description>
<VariableType>4 Bytes</VariableType>
<Address>engine.dll+11218CA0</Address>
</CheatEntry>
<CheatEntry>
<ID>40</ID>
<Description>"Bounty hunt bonus"</Description>
<LastState Value="0" RealAddress="7FFB7A1DD48C"/>
<VariableType>4 Bytes</VariableType>
<Address>engine.dll+1123D48C</Address>
</CheatEntry>
<CheatEntry>
<ID>41</ID>
<Description>"No description"</Description>
<LastState Value="2425" RealAddress="7FFB7A1DD510"/>
<Description>"My score"</Description>
<VariableType>4 Bytes</VariableType>
<Address>engine.dll+1123D510</Address>
</CheatEntry>
</CheatEntries>
</CheatEntry>
<CheatEntry>
<ID>43</ID>
<Description>"Difficulty (engine.dll+130DAD47)"</Description>
<LastState RealAddress="7FFB7C07AD47"/>
<Description>"Difficulty (engine.dll+130DAD47) (investigate wtf this is)"</Description>
<ShowAsSigned>0</ShowAsSigned>
<VariableType>String</VariableType>
<Length>6</Length>
<Unicode>0</Unicode>
Expand All @@ -269,7 +217,6 @@
<CheatEntry>
<ID>44</ID>
<Description>"Campaign difficulty (server.dll+C0963C)"</Description>
<LastState Value="3" RealAddress="7FFB4FA5963C"/>
<VariableType>Byte</VariableType>
<Address>server.dll+C0963C</Address>
</CheatEntry>
Expand Down
Binary file added assets/icons/playlists/2_ahp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/playlists/2_at.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/playlists/2_bh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/playlists/2_ctf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/playlists/2_glitch.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/playlists/2_glitch.pdn
Binary file not shown.
Binary file added assets/icons/playlists/2_lf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/playlists/2_lts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/playlists/2_pvp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/playlists/2_ttdm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions assets/icons/playlists/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Playlist Icons

These are the icons that show up when selecting what game modes you want to queue for. The screenshot blow shows these icons. They're a little rough around the edges but they should be fine given my intent to use them as the "small image" in Discord's Rich Presence status.

![image](https://user-images.githubusercontent.com/6992149/130292150-468a9ebf-dec9-4c6f-af03-a1cfd7970ae2.png)

## Source

I nabbed these from the Remnant Fleet Discord server. These icons are the work of mrvn4 (Octo#8859).
60 changes: 60 additions & 0 deletions assets/icons/playlists/playlists.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/ripped textures/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Ripped Textures

These are textures ripped from the game while it was running. This was accomplished using [NinjaRipper](https://ninjaripper.com/download.php) version [1.7.1](https://www.mediafire.com/file/z1w91t5keytvq3r/ninjaripper1.7.1_with_new_script.7z).
Binary file added assets/ripped textures/Tex_0387_1.dds
Binary file not shown.
Binary file added assets/ripped textures/Tex_0407_1.dds
Binary file not shown.
20 changes: 14 additions & 6 deletions titanfall2-rp/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Text.RegularExpressions;
using System.Threading;
using DiscordRPC;
using DiscordRPC.Logging;
Expand Down Expand Up @@ -50,48 +51,55 @@ static void Main(string[] args)

public static void SetCurrentPresence(DiscordRpcClient client, Titanfall2Api tf2Api)
{
var (gameDetails, gameState, timestamps) = GetDetailsAndState(tf2Api);
var (gameDetails, gameState, timestamps, assets) = GetDetailsAndState(tf2Api);
//Set the rich presence
//Call this as many times as you want and anywhere in your code.
client.SetPresence(new RichPresence()
{
Details = gameDetails,
State = gameState,
Timestamps = timestamps,
Assets = new Assets()
Assets = assets == null ? new Assets()
{
LargeImageKey = "icon-900x900",
LargeImageText = "Large Image Text",
// SmallImageKey = "image_small"
}
} : assets
});
}

public static (string, string, Timestamps) GetDetailsAndState(Titanfall2Api tf2Api)
public static (string, string, Timestamps, Assets assets) GetDetailsAndState(Titanfall2Api tf2Api)
{
Regex rg = new Regex("");
string gameDetails = "";
string gameState = "";
Timestamps timestamps = null;
Assets assets = null;

if (tf2Api.GetGameModeName().Contains("Campaign"))
{
gameDetails = "Campaign (" + tf2Api.GetSinglePlayerDifficulty() + ")";
gameState = tf2Api.GetSinglePlayerMissionName();
gameState = tf2Api.GetFriendlyMapName();
timestamps = new Timestamps(StartTimestamp);
}
else if (tf2Api.GetMultiplayerMapName().Equals("mp_lobby"))
{
gameDetails = "In a lobby";
timestamps = new Timestamps(StartTimestamp);
}
else if (tf2Api.GetGameModeAndMapName().Contains("Attrition"))
{
gameDetails = tf2Api.GetGameModeName();
gameState = tf2Api.GetFriendlyMapName();
}
// Could be main menu, might be some other random thing. This can be cleaned up later
else
{
gameDetails = tf2Api.GetGameModeName();
timestamps = new Timestamps(StartTimestamp);
}

return (gameDetails, gameState, timestamps);
return (gameDetails, gameState, timestamps, assets);
}
}
}
27 changes: 18 additions & 9 deletions titanfall2-rp/Titanfall2API.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
using System;
using System.Text;
using System.Text.RegularExpressions;
using Process.NET;
using static titanfall2_rp.ProcessApi;

namespace titanfall2_rp
{
public class Titanfall2Api
{
private static readonly Regex gameModeAndMapRegex = new Regex("Playing (.*) on (.*)");
private ProcessSharp _sharp;
private IntPtr _engineDllBaseAddress;
private IntPtr _clientDllBaseAddress;
Expand All @@ -24,16 +26,25 @@ public int GetPlayerVelocity()
return _sharp.Memory.Read<int>(_clientDllBaseAddress + 0x2A9F704);
}

public string GetGameModeAndMapName()
{
_ensureInit();
return _sharp.Memory.Read(_engineDllBaseAddress + 0x1397AC46, Encoding.UTF8, 50);
}

public string GetFriendlyMapName()
{
_ensureInit();
return _sharp.Memory.Read<string>(_engineDllBaseAddress + 0x1397AC5A);
var m = gameModeAndMapRegex.Match(GetGameModeAndMapName());
return m.Success ? m.Groups[2].Value : "UNKNOWN MAP NAME";
}

public string GetGameModeName()
{
_ensureInit();
return _sharp.Memory.Read(_engineDllBaseAddress + 0x1397AC46, Encoding.UTF8, 50);
var m = gameModeAndMapRegex.Match(GetGameModeAndMapName());
return m.Success ? m.Groups[1].Value : "UNKNOWN GAME MODE";

}

public string GetMultiplayerMapName()
Expand All @@ -45,13 +56,7 @@ public string GetMultiplayerMapName()
public string GetSinglePlayerMapName()
{
_ensureInit();
return _sharp.Memory.Read<string>(_serverDllBaseAddress + 0xC9BE64);
}

public string GetSinglePlayerMissionName()
{
_ensureInit();
return _sharp.Memory.Read(_engineDllBaseAddress + 0x1397AC5A, Encoding.UTF8, 14);
return _sharp.Memory.Read(_serverDllBaseAddress + 0xC9BE64, Encoding.UTF8, 50);
}

public string GetSinglePlayerDifficulty()
Expand All @@ -72,6 +77,10 @@ public string GetSinglePlayerDifficulty()
return "UNKNOWN DIFFICULTY";
}

/// <summary>
/// Inside this class are multiplayer subclasses for each game mode (because the stats are different
/// based on the game type. They'll also be in different memory locations).
/// </summary>
class MultiPlayerGameStats
{
class Attrition { }
Expand Down

0 comments on commit 8fa2bdf

Please sign in to comment.