Fix
- Added docs - Added cs2dumper files to gitignore again. - Fixed workspace manifest
This commit is contained in:
260
docs/src/csflow/context.rs.html
Normal file
260
docs/src/csflow/context.rs.html
Normal file
@@ -0,0 +1,260 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `csflow/src/context.rs`."><title>context.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="csflow" data-themes="" data-resource-suffix="" data-rustdoc-version="1.74.0 (79e9716c9 2023-11-13)" data-channel="1.74.0" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../src-files.js"></script><script defer src="../../static.files/main-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><a class="sub-logo-container" href="../../csflow/index.html"><img class="rust-logo" src="../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
|
||||
<a href="#2" id="2">2</a>
|
||||
<a href="#3" id="3">3</a>
|
||||
<a href="#4" id="4">4</a>
|
||||
<a href="#5" id="5">5</a>
|
||||
<a href="#6" id="6">6</a>
|
||||
<a href="#7" id="7">7</a>
|
||||
<a href="#8" id="8">8</a>
|
||||
<a href="#9" id="9">9</a>
|
||||
<a href="#10" id="10">10</a>
|
||||
<a href="#11" id="11">11</a>
|
||||
<a href="#12" id="12">12</a>
|
||||
<a href="#13" id="13">13</a>
|
||||
<a href="#14" id="14">14</a>
|
||||
<a href="#15" id="15">15</a>
|
||||
<a href="#16" id="16">16</a>
|
||||
<a href="#17" id="17">17</a>
|
||||
<a href="#18" id="18">18</a>
|
||||
<a href="#19" id="19">19</a>
|
||||
<a href="#20" id="20">20</a>
|
||||
<a href="#21" id="21">21</a>
|
||||
<a href="#22" id="22">22</a>
|
||||
<a href="#23" id="23">23</a>
|
||||
<a href="#24" id="24">24</a>
|
||||
<a href="#25" id="25">25</a>
|
||||
<a href="#26" id="26">26</a>
|
||||
<a href="#27" id="27">27</a>
|
||||
<a href="#28" id="28">28</a>
|
||||
<a href="#29" id="29">29</a>
|
||||
<a href="#30" id="30">30</a>
|
||||
<a href="#31" id="31">31</a>
|
||||
<a href="#32" id="32">32</a>
|
||||
<a href="#33" id="33">33</a>
|
||||
<a href="#34" id="34">34</a>
|
||||
<a href="#35" id="35">35</a>
|
||||
<a href="#36" id="36">36</a>
|
||||
<a href="#37" id="37">37</a>
|
||||
<a href="#38" id="38">38</a>
|
||||
<a href="#39" id="39">39</a>
|
||||
<a href="#40" id="40">40</a>
|
||||
<a href="#41" id="41">41</a>
|
||||
<a href="#42" id="42">42</a>
|
||||
<a href="#43" id="43">43</a>
|
||||
<a href="#44" id="44">44</a>
|
||||
<a href="#45" id="45">45</a>
|
||||
<a href="#46" id="46">46</a>
|
||||
<a href="#47" id="47">47</a>
|
||||
<a href="#48" id="48">48</a>
|
||||
<a href="#49" id="49">49</a>
|
||||
<a href="#50" id="50">50</a>
|
||||
<a href="#51" id="51">51</a>
|
||||
<a href="#52" id="52">52</a>
|
||||
<a href="#53" id="53">53</a>
|
||||
<a href="#54" id="54">54</a>
|
||||
<a href="#55" id="55">55</a>
|
||||
<a href="#56" id="56">56</a>
|
||||
<a href="#57" id="57">57</a>
|
||||
<a href="#58" id="58">58</a>
|
||||
<a href="#59" id="59">59</a>
|
||||
<a href="#60" id="60">60</a>
|
||||
<a href="#61" id="61">61</a>
|
||||
<a href="#62" id="62">62</a>
|
||||
<a href="#63" id="63">63</a>
|
||||
<a href="#64" id="64">64</a>
|
||||
<a href="#65" id="65">65</a>
|
||||
<a href="#66" id="66">66</a>
|
||||
<a href="#67" id="67">67</a>
|
||||
<a href="#68" id="68">68</a>
|
||||
<a href="#69" id="69">69</a>
|
||||
<a href="#70" id="70">70</a>
|
||||
<a href="#71" id="71">71</a>
|
||||
<a href="#72" id="72">72</a>
|
||||
<a href="#73" id="73">73</a>
|
||||
<a href="#74" id="74">74</a>
|
||||
<a href="#75" id="75">75</a>
|
||||
<a href="#76" id="76">76</a>
|
||||
<a href="#77" id="77">77</a>
|
||||
<a href="#78" id="78">78</a>
|
||||
<a href="#79" id="79">79</a>
|
||||
<a href="#80" id="80">80</a>
|
||||
<a href="#81" id="81">81</a>
|
||||
<a href="#82" id="82">82</a>
|
||||
<a href="#83" id="83">83</a>
|
||||
<a href="#84" id="84">84</a>
|
||||
<a href="#85" id="85">85</a>
|
||||
<a href="#86" id="86">86</a>
|
||||
<a href="#87" id="87">87</a>
|
||||
<a href="#88" id="88">88</a>
|
||||
<a href="#89" id="89">89</a>
|
||||
<a href="#90" id="90">90</a>
|
||||
<a href="#91" id="91">91</a>
|
||||
<a href="#92" id="92">92</a>
|
||||
<a href="#93" id="93">93</a>
|
||||
<a href="#94" id="94">94</a>
|
||||
<a href="#95" id="95">95</a>
|
||||
<a href="#96" id="96">96</a>
|
||||
<a href="#97" id="97">97</a>
|
||||
<a href="#98" id="98">98</a>
|
||||
<a href="#99" id="99">99</a>
|
||||
<a href="#100" id="100">100</a>
|
||||
<a href="#101" id="101">101</a>
|
||||
<a href="#102" id="102">102</a>
|
||||
<a href="#103" id="103">103</a>
|
||||
<a href="#104" id="104">104</a>
|
||||
<a href="#105" id="105">105</a>
|
||||
<a href="#106" id="106">106</a>
|
||||
<a href="#107" id="107">107</a>
|
||||
<a href="#108" id="108">108</a>
|
||||
<a href="#109" id="109">109</a>
|
||||
<a href="#110" id="110">110</a>
|
||||
<a href="#111" id="111">111</a>
|
||||
<a href="#112" id="112">112</a>
|
||||
<a href="#113" id="113">113</a>
|
||||
<a href="#114" id="114">114</a>
|
||||
<a href="#115" id="115">115</a>
|
||||
<a href="#116" id="116">116</a>
|
||||
<a href="#117" id="117">117</a>
|
||||
<a href="#118" id="118">118</a>
|
||||
<a href="#119" id="119">119</a>
|
||||
<a href="#120" id="120">120</a>
|
||||
<a href="#121" id="121">121</a>
|
||||
<a href="#122" id="122">122</a>
|
||||
<a href="#123" id="123">123</a>
|
||||
<a href="#124" id="124">124</a>
|
||||
<a href="#125" id="125">125</a>
|
||||
<a href="#126" id="126">126</a>
|
||||
<a href="#127" id="127">127</a>
|
||||
<a href="#128" id="128">128</a>
|
||||
<a href="#129" id="129">129</a>
|
||||
<a href="#130" id="130">130</a>
|
||||
</pre></div><pre class="rust"><code><span class="kw">use </span>memflow::{plugins::{IntoProcessInstanceArcBox, Inventory, ConnectorArgs, args::Args}, os::{ModuleInfo, Os, Process}, mem::MemoryView, types::Address};
|
||||
|
||||
<span class="kw">use crate</span>::{error::Error, structs::{CPlayerController, CBaseEntity}, cs2dumper, traits::MemoryClass};
|
||||
|
||||
<span class="kw">pub struct </span>CheatCtx {
|
||||
<span class="kw">pub </span>process: IntoProcessInstanceArcBox<<span class="lifetime">'static</span>>,
|
||||
<span class="kw">pub </span>client_module: ModuleInfo,
|
||||
<span class="kw">pub </span>engine_module: ModuleInfo,
|
||||
}
|
||||
|
||||
<span class="kw">impl </span>CheatCtx {
|
||||
<span class="kw">fn </span>check_version(<span class="kw-2">&mut </span><span class="self">self</span>) -> <span class="prelude-ty">Result</span><(), Error> {
|
||||
<span class="kw">let </span>game_build_number: u32 = <span class="self">self</span>.process.read(<span class="self">self</span>.engine_module.base + cs2dumper::offsets::engine2_dll::dwBuildNumber)<span class="question-mark">?</span>;
|
||||
<span class="kw">let </span>offset_build_number = cs2dumper::offsets::game_info::buildNumber;
|
||||
|
||||
<span class="kw">if </span>game_build_number <span class="kw">as </span>usize != offset_build_number {
|
||||
<span class="kw">return </span><span class="prelude-val">Err</span>(Error::GameVersionMismatch(game_build_number <span class="kw">as </span>usize, offset_build_number))
|
||||
}
|
||||
|
||||
<span class="prelude-val">Ok</span>(())
|
||||
}
|
||||
|
||||
<span class="kw">pub fn </span>setup(connector: Connector, pcileech_device: String) -> <span class="prelude-ty">Result</span><CheatCtx, Error> {
|
||||
<span class="kw">let </span>inventory = Inventory::scan();
|
||||
|
||||
<span class="kw">let </span>os = {
|
||||
<span class="kw">if </span>connector == Connector::Pcileech {
|
||||
<span class="kw">let </span>args = Args::new()
|
||||
.insert(<span class="string">"device"</span>, <span class="kw-2">&</span>pcileech_device);
|
||||
|
||||
<span class="kw">let </span>connector_args = ConnectorArgs::new(<span class="prelude-val">None</span>, args, <span class="prelude-val">None</span>);
|
||||
|
||||
inventory.builder()
|
||||
.connector(<span class="kw-2">&</span>connector.to_string())
|
||||
.args(connector_args)
|
||||
.os(<span class="string">"win32"</span>)
|
||||
.build()<span class="question-mark">?
|
||||
</span>} <span class="kw">else </span>{
|
||||
inventory.builder()
|
||||
.connector(<span class="kw-2">&</span>connector.to_string())
|
||||
.os(<span class="string">"win32"</span>)
|
||||
.build()<span class="question-mark">?
|
||||
</span>}
|
||||
};
|
||||
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>process = os.into_process_by_name(<span class="string">"cs2.exe"</span>)<span class="question-mark">?</span>;
|
||||
|
||||
<span class="kw">let </span>client_module = process.module_by_name(<span class="string">"client.dll"</span>)<span class="question-mark">?</span>;
|
||||
|
||||
<span class="kw">let </span>engine_module = process.module_by_name(<span class="string">"engine2.dll"</span>)<span class="question-mark">?</span>;
|
||||
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>ctx = <span class="self">Self </span>{
|
||||
process,
|
||||
client_module,
|
||||
engine_module,
|
||||
};
|
||||
|
||||
ctx.check_version()<span class="question-mark">?</span>;
|
||||
|
||||
<span class="prelude-val">Ok</span>(ctx)
|
||||
}
|
||||
|
||||
<span class="kw">pub fn </span>get_local(<span class="kw-2">&mut </span><span class="self">self</span>) -> <span class="prelude-ty">Result</span><CPlayerController, Error> {
|
||||
<span class="kw">let </span>ptr = <span class="self">self</span>.process.read_addr64(<span class="self">self</span>.client_module.base + cs2dumper::offsets::client_dll::dwLocalPlayerController)<span class="question-mark">?</span>;
|
||||
<span class="prelude-val">Ok</span>(CPlayerController::new(ptr))
|
||||
}
|
||||
|
||||
<span class="kw">pub fn </span>get_plantedc4(<span class="kw-2">&mut </span><span class="self">self</span>) -> <span class="prelude-ty">Result</span><CBaseEntity, Error> {
|
||||
<span class="kw">let </span>ptr = <span class="self">self</span>.process.read_addr64(<span class="self">self</span>.client_module.base + cs2dumper::offsets::client_dll::dwPlantedC4)<span class="question-mark">?</span>;
|
||||
<span class="kw">let </span>ptr2 = <span class="self">self</span>.process.read_addr64(ptr)<span class="question-mark">?</span>;
|
||||
<span class="prelude-val">Ok</span>(CBaseEntity::new(ptr2))
|
||||
}
|
||||
|
||||
<span class="kw">pub fn </span>is_bomb_planted(<span class="kw-2">&mut </span><span class="self">self</span>) -> <span class="prelude-ty">Result</span><bool, Error> {
|
||||
<span class="kw">let </span>game_rules = <span class="self">self</span>.process.read_addr64(<span class="self">self</span>.client_module.base + cs2dumper::offsets::client_dll::dwGameRules)<span class="question-mark">?</span>;
|
||||
<span class="kw">let </span>data: u8 = <span class="self">self</span>.process.read(game_rules + cs2dumper::client::C_CSGameRules::m_bBombPlanted)<span class="question-mark">?</span>;
|
||||
<span class="prelude-val">Ok</span>(data != <span class="number">0</span>)
|
||||
}
|
||||
|
||||
<span class="kw">pub fn </span>is_bomb_dropped(<span class="kw-2">&mut </span><span class="self">self</span>) -> <span class="prelude-ty">Result</span><bool, Error> {
|
||||
<span class="kw">let </span>game_rules = <span class="self">self</span>.process.read_addr64(<span class="self">self</span>.client_module.base + cs2dumper::offsets::client_dll::dwGameRules)<span class="question-mark">?</span>;
|
||||
<span class="kw">let </span>data: u8 = <span class="self">self</span>.process.read(game_rules + cs2dumper::client::C_CSGameRules::m_bBombDropped)<span class="question-mark">?</span>;
|
||||
<span class="prelude-val">Ok</span>(data != <span class="number">0</span>)
|
||||
}
|
||||
|
||||
<span class="kw">pub fn </span>get_entity_list(<span class="kw-2">&mut </span><span class="self">self</span>) -> <span class="prelude-ty">Result</span><Address, Error> {
|
||||
<span class="kw">let </span>ptr = <span class="self">self</span>.process.read_addr64(<span class="self">self</span>.client_module.base + cs2dumper::offsets::client_dll::dwEntityList)<span class="question-mark">?</span>;
|
||||
<span class="prelude-val">Ok</span>(ptr)
|
||||
}
|
||||
|
||||
<span class="kw">pub fn </span>get_globals(<span class="kw-2">&mut </span><span class="self">self</span>) -> <span class="prelude-ty">Result</span><Address, Error> {
|
||||
<span class="kw">let </span>ptr = <span class="self">self</span>.process.read_addr64(<span class="self">self</span>.client_module.base + cs2dumper::offsets::client_dll::dwGlobalVars)<span class="question-mark">?</span>;
|
||||
<span class="prelude-val">Ok</span>(ptr)
|
||||
}
|
||||
|
||||
<span class="kw">pub fn </span>map_name(<span class="kw-2">&mut </span><span class="self">self</span>, global_vars: Address) -> <span class="prelude-ty">Result</span><String, Error> {
|
||||
<span class="kw">let </span>ptr = <span class="self">self</span>.process.read_addr64(global_vars + <span class="number">0x188</span>)<span class="question-mark">?</span>;
|
||||
<span class="prelude-val">Ok</span>(<span class="self">self</span>.process.read_char_string_n(ptr, <span class="number">32</span>)<span class="question-mark">?</span>)
|
||||
}
|
||||
|
||||
<span class="kw">pub fn </span>highest_entity_index(<span class="kw-2">&mut </span><span class="self">self</span>) -> <span class="prelude-ty">Result</span><i32, Error> {
|
||||
<span class="kw">let </span>game_entity_system = <span class="self">self</span>.process.read_addr64(<span class="self">self</span>.client_module.base + cs2dumper::offsets::client_dll::dwGameEntitySystem)<span class="question-mark">?</span>;
|
||||
<span class="kw">let </span>highest_index = <span class="self">self</span>.process.read(game_entity_system + cs2dumper::offsets::client_dll::dwGameEntitySystem_getHighestEntityIndex)<span class="question-mark">?</span>;
|
||||
<span class="prelude-val">Ok</span>(highest_index)
|
||||
}
|
||||
|
||||
<span class="kw">pub fn </span>network_is_ingame(<span class="kw-2">&mut </span><span class="self">self</span>) -> <span class="prelude-ty">Result</span><bool, Error> {
|
||||
<span class="kw">let </span>ptr = <span class="self">self</span>.process.read_addr64(<span class="self">self</span>.engine_module.base + cs2dumper::offsets::engine2_dll::dwNetworkGameClient)<span class="question-mark">?</span>;
|
||||
<span class="kw">let </span>signonstate: i32 = <span class="self">self</span>.process.read(ptr + cs2dumper::offsets::engine2_dll::dwNetworkGameClient_signOnState)<span class="question-mark">?</span>;
|
||||
<span class="prelude-val">Ok</span>(signonstate == <span class="number">6</span>)
|
||||
}
|
||||
}
|
||||
|
||||
<span class="attr">#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, clap::ValueEnum, Default)]
|
||||
</span><span class="kw">pub enum </span>Connector {
|
||||
<span class="attr">#[default]
|
||||
</span>Qemu,
|
||||
Kvm,
|
||||
Pcileech
|
||||
}
|
||||
|
||||
<span class="kw">impl </span>ToString <span class="kw">for </span>Connector {
|
||||
<span class="kw">fn </span>to_string(<span class="kw-2">&</span><span class="self">self</span>) -> String {
|
||||
<span class="kw">match </span><span class="self">self </span>{
|
||||
Connector::Qemu => String::from(<span class="string">"qemu"</span>),
|
||||
Connector::Kvm => String::from(<span class="string">"kvm"</span>),
|
||||
Connector::Pcileech => String::from(<span class="string">"pcileech"</span>),
|
||||
}
|
||||
}
|
||||
}</code></pre></div></section></main></body></html>
|
||||
8340
docs/src/csflow/cs2dumper/client.rs.html
Normal file
8340
docs/src/csflow/cs2dumper/client.rs.html
Normal file
File diff suppressed because it is too large
Load Diff
488
docs/src/csflow/cs2dumper/engine2.rs.html
Normal file
488
docs/src/csflow/cs2dumper/engine2.rs.html
Normal file
@@ -0,0 +1,488 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `csflow/src/cs2dumper/engine2.rs`."><title>engine2.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="csflow" data-themes="" data-resource-suffix="" data-rustdoc-version="1.74.0 (79e9716c9 2023-11-13)" data-channel="1.74.0" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../src-files.js"></script><script defer src="../../../static.files/main-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><a class="sub-logo-container" href="../../../csflow/index.html"><img class="rust-logo" src="../../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
|
||||
<a href="#2" id="2">2</a>
|
||||
<a href="#3" id="3">3</a>
|
||||
<a href="#4" id="4">4</a>
|
||||
<a href="#5" id="5">5</a>
|
||||
<a href="#6" id="6">6</a>
|
||||
<a href="#7" id="7">7</a>
|
||||
<a href="#8" id="8">8</a>
|
||||
<a href="#9" id="9">9</a>
|
||||
<a href="#10" id="10">10</a>
|
||||
<a href="#11" id="11">11</a>
|
||||
<a href="#12" id="12">12</a>
|
||||
<a href="#13" id="13">13</a>
|
||||
<a href="#14" id="14">14</a>
|
||||
<a href="#15" id="15">15</a>
|
||||
<a href="#16" id="16">16</a>
|
||||
<a href="#17" id="17">17</a>
|
||||
<a href="#18" id="18">18</a>
|
||||
<a href="#19" id="19">19</a>
|
||||
<a href="#20" id="20">20</a>
|
||||
<a href="#21" id="21">21</a>
|
||||
<a href="#22" id="22">22</a>
|
||||
<a href="#23" id="23">23</a>
|
||||
<a href="#24" id="24">24</a>
|
||||
<a href="#25" id="25">25</a>
|
||||
<a href="#26" id="26">26</a>
|
||||
<a href="#27" id="27">27</a>
|
||||
<a href="#28" id="28">28</a>
|
||||
<a href="#29" id="29">29</a>
|
||||
<a href="#30" id="30">30</a>
|
||||
<a href="#31" id="31">31</a>
|
||||
<a href="#32" id="32">32</a>
|
||||
<a href="#33" id="33">33</a>
|
||||
<a href="#34" id="34">34</a>
|
||||
<a href="#35" id="35">35</a>
|
||||
<a href="#36" id="36">36</a>
|
||||
<a href="#37" id="37">37</a>
|
||||
<a href="#38" id="38">38</a>
|
||||
<a href="#39" id="39">39</a>
|
||||
<a href="#40" id="40">40</a>
|
||||
<a href="#41" id="41">41</a>
|
||||
<a href="#42" id="42">42</a>
|
||||
<a href="#43" id="43">43</a>
|
||||
<a href="#44" id="44">44</a>
|
||||
<a href="#45" id="45">45</a>
|
||||
<a href="#46" id="46">46</a>
|
||||
<a href="#47" id="47">47</a>
|
||||
<a href="#48" id="48">48</a>
|
||||
<a href="#49" id="49">49</a>
|
||||
<a href="#50" id="50">50</a>
|
||||
<a href="#51" id="51">51</a>
|
||||
<a href="#52" id="52">52</a>
|
||||
<a href="#53" id="53">53</a>
|
||||
<a href="#54" id="54">54</a>
|
||||
<a href="#55" id="55">55</a>
|
||||
<a href="#56" id="56">56</a>
|
||||
<a href="#57" id="57">57</a>
|
||||
<a href="#58" id="58">58</a>
|
||||
<a href="#59" id="59">59</a>
|
||||
<a href="#60" id="60">60</a>
|
||||
<a href="#61" id="61">61</a>
|
||||
<a href="#62" id="62">62</a>
|
||||
<a href="#63" id="63">63</a>
|
||||
<a href="#64" id="64">64</a>
|
||||
<a href="#65" id="65">65</a>
|
||||
<a href="#66" id="66">66</a>
|
||||
<a href="#67" id="67">67</a>
|
||||
<a href="#68" id="68">68</a>
|
||||
<a href="#69" id="69">69</a>
|
||||
<a href="#70" id="70">70</a>
|
||||
<a href="#71" id="71">71</a>
|
||||
<a href="#72" id="72">72</a>
|
||||
<a href="#73" id="73">73</a>
|
||||
<a href="#74" id="74">74</a>
|
||||
<a href="#75" id="75">75</a>
|
||||
<a href="#76" id="76">76</a>
|
||||
<a href="#77" id="77">77</a>
|
||||
<a href="#78" id="78">78</a>
|
||||
<a href="#79" id="79">79</a>
|
||||
<a href="#80" id="80">80</a>
|
||||
<a href="#81" id="81">81</a>
|
||||
<a href="#82" id="82">82</a>
|
||||
<a href="#83" id="83">83</a>
|
||||
<a href="#84" id="84">84</a>
|
||||
<a href="#85" id="85">85</a>
|
||||
<a href="#86" id="86">86</a>
|
||||
<a href="#87" id="87">87</a>
|
||||
<a href="#88" id="88">88</a>
|
||||
<a href="#89" id="89">89</a>
|
||||
<a href="#90" id="90">90</a>
|
||||
<a href="#91" id="91">91</a>
|
||||
<a href="#92" id="92">92</a>
|
||||
<a href="#93" id="93">93</a>
|
||||
<a href="#94" id="94">94</a>
|
||||
<a href="#95" id="95">95</a>
|
||||
<a href="#96" id="96">96</a>
|
||||
<a href="#97" id="97">97</a>
|
||||
<a href="#98" id="98">98</a>
|
||||
<a href="#99" id="99">99</a>
|
||||
<a href="#100" id="100">100</a>
|
||||
<a href="#101" id="101">101</a>
|
||||
<a href="#102" id="102">102</a>
|
||||
<a href="#103" id="103">103</a>
|
||||
<a href="#104" id="104">104</a>
|
||||
<a href="#105" id="105">105</a>
|
||||
<a href="#106" id="106">106</a>
|
||||
<a href="#107" id="107">107</a>
|
||||
<a href="#108" id="108">108</a>
|
||||
<a href="#109" id="109">109</a>
|
||||
<a href="#110" id="110">110</a>
|
||||
<a href="#111" id="111">111</a>
|
||||
<a href="#112" id="112">112</a>
|
||||
<a href="#113" id="113">113</a>
|
||||
<a href="#114" id="114">114</a>
|
||||
<a href="#115" id="115">115</a>
|
||||
<a href="#116" id="116">116</a>
|
||||
<a href="#117" id="117">117</a>
|
||||
<a href="#118" id="118">118</a>
|
||||
<a href="#119" id="119">119</a>
|
||||
<a href="#120" id="120">120</a>
|
||||
<a href="#121" id="121">121</a>
|
||||
<a href="#122" id="122">122</a>
|
||||
<a href="#123" id="123">123</a>
|
||||
<a href="#124" id="124">124</a>
|
||||
<a href="#125" id="125">125</a>
|
||||
<a href="#126" id="126">126</a>
|
||||
<a href="#127" id="127">127</a>
|
||||
<a href="#128" id="128">128</a>
|
||||
<a href="#129" id="129">129</a>
|
||||
<a href="#130" id="130">130</a>
|
||||
<a href="#131" id="131">131</a>
|
||||
<a href="#132" id="132">132</a>
|
||||
<a href="#133" id="133">133</a>
|
||||
<a href="#134" id="134">134</a>
|
||||
<a href="#135" id="135">135</a>
|
||||
<a href="#136" id="136">136</a>
|
||||
<a href="#137" id="137">137</a>
|
||||
<a href="#138" id="138">138</a>
|
||||
<a href="#139" id="139">139</a>
|
||||
<a href="#140" id="140">140</a>
|
||||
<a href="#141" id="141">141</a>
|
||||
<a href="#142" id="142">142</a>
|
||||
<a href="#143" id="143">143</a>
|
||||
<a href="#144" id="144">144</a>
|
||||
<a href="#145" id="145">145</a>
|
||||
<a href="#146" id="146">146</a>
|
||||
<a href="#147" id="147">147</a>
|
||||
<a href="#148" id="148">148</a>
|
||||
<a href="#149" id="149">149</a>
|
||||
<a href="#150" id="150">150</a>
|
||||
<a href="#151" id="151">151</a>
|
||||
<a href="#152" id="152">152</a>
|
||||
<a href="#153" id="153">153</a>
|
||||
<a href="#154" id="154">154</a>
|
||||
<a href="#155" id="155">155</a>
|
||||
<a href="#156" id="156">156</a>
|
||||
<a href="#157" id="157">157</a>
|
||||
<a href="#158" id="158">158</a>
|
||||
<a href="#159" id="159">159</a>
|
||||
<a href="#160" id="160">160</a>
|
||||
<a href="#161" id="161">161</a>
|
||||
<a href="#162" id="162">162</a>
|
||||
<a href="#163" id="163">163</a>
|
||||
<a href="#164" id="164">164</a>
|
||||
<a href="#165" id="165">165</a>
|
||||
<a href="#166" id="166">166</a>
|
||||
<a href="#167" id="167">167</a>
|
||||
<a href="#168" id="168">168</a>
|
||||
<a href="#169" id="169">169</a>
|
||||
<a href="#170" id="170">170</a>
|
||||
<a href="#171" id="171">171</a>
|
||||
<a href="#172" id="172">172</a>
|
||||
<a href="#173" id="173">173</a>
|
||||
<a href="#174" id="174">174</a>
|
||||
<a href="#175" id="175">175</a>
|
||||
<a href="#176" id="176">176</a>
|
||||
<a href="#177" id="177">177</a>
|
||||
<a href="#178" id="178">178</a>
|
||||
<a href="#179" id="179">179</a>
|
||||
<a href="#180" id="180">180</a>
|
||||
<a href="#181" id="181">181</a>
|
||||
<a href="#182" id="182">182</a>
|
||||
<a href="#183" id="183">183</a>
|
||||
<a href="#184" id="184">184</a>
|
||||
<a href="#185" id="185">185</a>
|
||||
<a href="#186" id="186">186</a>
|
||||
<a href="#187" id="187">187</a>
|
||||
<a href="#188" id="188">188</a>
|
||||
<a href="#189" id="189">189</a>
|
||||
<a href="#190" id="190">190</a>
|
||||
<a href="#191" id="191">191</a>
|
||||
<a href="#192" id="192">192</a>
|
||||
<a href="#193" id="193">193</a>
|
||||
<a href="#194" id="194">194</a>
|
||||
<a href="#195" id="195">195</a>
|
||||
<a href="#196" id="196">196</a>
|
||||
<a href="#197" id="197">197</a>
|
||||
<a href="#198" id="198">198</a>
|
||||
<a href="#199" id="199">199</a>
|
||||
<a href="#200" id="200">200</a>
|
||||
<a href="#201" id="201">201</a>
|
||||
<a href="#202" id="202">202</a>
|
||||
<a href="#203" id="203">203</a>
|
||||
<a href="#204" id="204">204</a>
|
||||
<a href="#205" id="205">205</a>
|
||||
<a href="#206" id="206">206</a>
|
||||
<a href="#207" id="207">207</a>
|
||||
<a href="#208" id="208">208</a>
|
||||
<a href="#209" id="209">209</a>
|
||||
<a href="#210" id="210">210</a>
|
||||
<a href="#211" id="211">211</a>
|
||||
<a href="#212" id="212">212</a>
|
||||
<a href="#213" id="213">213</a>
|
||||
<a href="#214" id="214">214</a>
|
||||
<a href="#215" id="215">215</a>
|
||||
<a href="#216" id="216">216</a>
|
||||
<a href="#217" id="217">217</a>
|
||||
<a href="#218" id="218">218</a>
|
||||
<a href="#219" id="219">219</a>
|
||||
<a href="#220" id="220">220</a>
|
||||
<a href="#221" id="221">221</a>
|
||||
<a href="#222" id="222">222</a>
|
||||
<a href="#223" id="223">223</a>
|
||||
<a href="#224" id="224">224</a>
|
||||
<a href="#225" id="225">225</a>
|
||||
<a href="#226" id="226">226</a>
|
||||
<a href="#227" id="227">227</a>
|
||||
<a href="#228" id="228">228</a>
|
||||
<a href="#229" id="229">229</a>
|
||||
<a href="#230" id="230">230</a>
|
||||
<a href="#231" id="231">231</a>
|
||||
<a href="#232" id="232">232</a>
|
||||
<a href="#233" id="233">233</a>
|
||||
<a href="#234" id="234">234</a>
|
||||
<a href="#235" id="235">235</a>
|
||||
<a href="#236" id="236">236</a>
|
||||
<a href="#237" id="237">237</a>
|
||||
<a href="#238" id="238">238</a>
|
||||
<a href="#239" id="239">239</a>
|
||||
<a href="#240" id="240">240</a>
|
||||
<a href="#241" id="241">241</a>
|
||||
<a href="#242" id="242">242</a>
|
||||
<a href="#243" id="243">243</a>
|
||||
<a href="#244" id="244">244</a>
|
||||
</pre></div><pre class="rust"><code><span class="comment">/*
|
||||
* Created using https://github.com/a2x/cs2-dumper
|
||||
* Sat, 30 Dec 2023 03:17:25 +0000
|
||||
*/
|
||||
|
||||
</span><span class="attr">#![allow(non_snake_case, non_upper_case_globals)]
|
||||
|
||||
</span><span class="kw">pub mod </span>CEmptyEntityInstance {
|
||||
}
|
||||
|
||||
<span class="kw">pub mod </span>CEntityComponent {
|
||||
}
|
||||
|
||||
<span class="kw">pub mod </span>CEntityComponentHelper {
|
||||
<span class="kw">pub const </span>m_flags: usize = <span class="number">0x8</span>; <span class="comment">// uint32_t
|
||||
</span><span class="kw">pub const </span>m_pInfo: usize = <span class="number">0x10</span>; <span class="comment">// EntComponentInfo_t*
|
||||
</span><span class="kw">pub const </span>m_nPriority: usize = <span class="number">0x18</span>; <span class="comment">// int32_t
|
||||
</span><span class="kw">pub const </span>m_pNext: usize = <span class="number">0x20</span>; <span class="comment">// CEntityComponentHelper*
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>CEntityIOOutput {
|
||||
<span class="kw">pub const </span>m_Value: usize = <span class="number">0x18</span>; <span class="comment">// CVariantBase<CVariantDefaultAllocator>
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>CEntityIdentity {
|
||||
<span class="kw">pub const </span>m_nameStringableIndex: usize = <span class="number">0x14</span>; <span class="comment">// int32_t
|
||||
</span><span class="kw">pub const </span>m_name: usize = <span class="number">0x18</span>; <span class="comment">// CUtlSymbolLarge
|
||||
</span><span class="kw">pub const </span>m_designerName: usize = <span class="number">0x20</span>; <span class="comment">// CUtlSymbolLarge
|
||||
</span><span class="kw">pub const </span>m_flags: usize = <span class="number">0x30</span>; <span class="comment">// uint32_t
|
||||
</span><span class="kw">pub const </span>m_worldGroupId: usize = <span class="number">0x38</span>; <span class="comment">// WorldGroupId_t
|
||||
</span><span class="kw">pub const </span>m_fDataObjectTypes: usize = <span class="number">0x3C</span>; <span class="comment">// uint32_t
|
||||
</span><span class="kw">pub const </span>m_PathIndex: usize = <span class="number">0x40</span>; <span class="comment">// ChangeAccessorFieldPathIndex_t
|
||||
</span><span class="kw">pub const </span>m_pPrev: usize = <span class="number">0x58</span>; <span class="comment">// CEntityIdentity*
|
||||
</span><span class="kw">pub const </span>m_pNext: usize = <span class="number">0x60</span>; <span class="comment">// CEntityIdentity*
|
||||
</span><span class="kw">pub const </span>m_pPrevByClass: usize = <span class="number">0x68</span>; <span class="comment">// CEntityIdentity*
|
||||
</span><span class="kw">pub const </span>m_pNextByClass: usize = <span class="number">0x70</span>; <span class="comment">// CEntityIdentity*
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>CEntityInstance {
|
||||
<span class="kw">pub const </span>m_iszPrivateVScripts: usize = <span class="number">0x8</span>; <span class="comment">// CUtlSymbolLarge
|
||||
</span><span class="kw">pub const </span>m_pEntity: usize = <span class="number">0x10</span>; <span class="comment">// CEntityIdentity*
|
||||
</span><span class="kw">pub const </span>m_CScriptComponent: usize = <span class="number">0x28</span>; <span class="comment">// CScriptComponent*
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>CNetworkVarChainer {
|
||||
<span class="kw">pub const </span>m_PathIndex: usize = <span class="number">0x20</span>; <span class="comment">// ChangeAccessorFieldPathIndex_t
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>CScriptComponent { <span class="comment">// CEntityComponent
|
||||
</span><span class="kw">pub const </span>m_scriptClassName: usize = <span class="number">0x30</span>; <span class="comment">// CUtlSymbolLarge
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>CVariantDefaultAllocator {
|
||||
}
|
||||
|
||||
<span class="kw">pub mod </span>EngineLoopState_t {
|
||||
<span class="kw">pub const </span>m_nPlatWindowWidth: usize = <span class="number">0x18</span>; <span class="comment">// int32_t
|
||||
</span><span class="kw">pub const </span>m_nPlatWindowHeight: usize = <span class="number">0x1C</span>; <span class="comment">// int32_t
|
||||
</span><span class="kw">pub const </span>m_nRenderWidth: usize = <span class="number">0x20</span>; <span class="comment">// int32_t
|
||||
</span><span class="kw">pub const </span>m_nRenderHeight: usize = <span class="number">0x24</span>; <span class="comment">// int32_t
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>EntComponentInfo_t {
|
||||
<span class="kw">pub const </span>m_pName: usize = <span class="number">0x0</span>; <span class="comment">// char*
|
||||
</span><span class="kw">pub const </span>m_pCPPClassname: usize = <span class="number">0x8</span>; <span class="comment">// char*
|
||||
</span><span class="kw">pub const </span>m_pNetworkDataReferencedDescription: usize = <span class="number">0x10</span>; <span class="comment">// char*
|
||||
</span><span class="kw">pub const </span>m_pNetworkDataReferencedPtrPropDescription: usize = <span class="number">0x18</span>; <span class="comment">// char*
|
||||
</span><span class="kw">pub const </span>m_nRuntimeIndex: usize = <span class="number">0x20</span>; <span class="comment">// int32_t
|
||||
</span><span class="kw">pub const </span>m_nFlags: usize = <span class="number">0x24</span>; <span class="comment">// uint32_t
|
||||
</span><span class="kw">pub const </span>m_pBaseClassComponentHelper: usize = <span class="number">0x60</span>; <span class="comment">// CEntityComponentHelper*
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>EntInput_t {
|
||||
}
|
||||
|
||||
<span class="kw">pub mod </span>EntOutput_t {
|
||||
}
|
||||
|
||||
<span class="kw">pub mod </span>EventAdvanceTick_t { <span class="comment">// EventSimulate_t
|
||||
</span><span class="kw">pub const </span>m_nCurrentTick: usize = <span class="number">0x30</span>; <span class="comment">// int32_t
|
||||
</span><span class="kw">pub const </span>m_nCurrentTickThisFrame: usize = <span class="number">0x34</span>; <span class="comment">// int32_t
|
||||
</span><span class="kw">pub const </span>m_nTotalTicksThisFrame: usize = <span class="number">0x38</span>; <span class="comment">// int32_t
|
||||
</span><span class="kw">pub const </span>m_nTotalTicks: usize = <span class="number">0x3C</span>; <span class="comment">// int32_t
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>EventAppShutdown_t {
|
||||
<span class="kw">pub const </span>m_nDummy0: usize = <span class="number">0x0</span>; <span class="comment">// int32_t
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>EventClientAdvanceTick_t { <span class="comment">// EventAdvanceTick_t
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>EventClientFrameSimulate_t {
|
||||
<span class="kw">pub const </span>m_LoopState: usize = <span class="number">0x0</span>; <span class="comment">// EngineLoopState_t
|
||||
</span><span class="kw">pub const </span>m_flRealTime: usize = <span class="number">0x28</span>; <span class="comment">// float
|
||||
</span><span class="kw">pub const </span>m_flFrameTime: usize = <span class="number">0x2C</span>; <span class="comment">// float
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>EventClientOutput_t {
|
||||
<span class="kw">pub const </span>m_LoopState: usize = <span class="number">0x0</span>; <span class="comment">// EngineLoopState_t
|
||||
</span><span class="kw">pub const </span>m_flRenderTime: usize = <span class="number">0x28</span>; <span class="comment">// float
|
||||
</span><span class="kw">pub const </span>m_flRealTime: usize = <span class="number">0x2C</span>; <span class="comment">// float
|
||||
</span><span class="kw">pub const </span>m_flRenderFrameTimeUnbounded: usize = <span class="number">0x30</span>; <span class="comment">// float
|
||||
</span><span class="kw">pub const </span>m_bRenderOnly: usize = <span class="number">0x34</span>; <span class="comment">// bool
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>EventClientPauseSimulate_t { <span class="comment">// EventSimulate_t
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>EventClientPollInput_t {
|
||||
<span class="kw">pub const </span>m_LoopState: usize = <span class="number">0x0</span>; <span class="comment">// EngineLoopState_t
|
||||
</span><span class="kw">pub const </span>m_flRealTime: usize = <span class="number">0x28</span>; <span class="comment">// float
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>EventClientPollNetworking_t {
|
||||
<span class="kw">pub const </span>m_nTickCount: usize = <span class="number">0x0</span>; <span class="comment">// int32_t
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>EventClientPostAdvanceTick_t { <span class="comment">// EventPostAdvanceTick_t
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>EventClientPostOutput_t {
|
||||
<span class="kw">pub const </span>m_LoopState: usize = <span class="number">0x0</span>; <span class="comment">// EngineLoopState_t
|
||||
</span><span class="kw">pub const </span>m_flRenderTime: usize = <span class="number">0x28</span>; <span class="comment">// double
|
||||
</span><span class="kw">pub const </span>m_flRenderFrameTime: usize = <span class="number">0x30</span>; <span class="comment">// float
|
||||
</span><span class="kw">pub const </span>m_flRenderFrameTimeUnbounded: usize = <span class="number">0x34</span>; <span class="comment">// float
|
||||
</span><span class="kw">pub const </span>m_bRenderOnly: usize = <span class="number">0x38</span>; <span class="comment">// bool
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>EventClientPostSimulate_t { <span class="comment">// EventSimulate_t
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>EventClientPreOutput_t {
|
||||
<span class="kw">pub const </span>m_LoopState: usize = <span class="number">0x0</span>; <span class="comment">// EngineLoopState_t
|
||||
</span><span class="kw">pub const </span>m_flRenderTime: usize = <span class="number">0x28</span>; <span class="comment">// double
|
||||
</span><span class="kw">pub const </span>m_flRenderFrameTime: usize = <span class="number">0x30</span>; <span class="comment">// double
|
||||
</span><span class="kw">pub const </span>m_flRenderFrameTimeUnbounded: usize = <span class="number">0x38</span>; <span class="comment">// double
|
||||
</span><span class="kw">pub const </span>m_flRealTime: usize = <span class="number">0x40</span>; <span class="comment">// float
|
||||
</span><span class="kw">pub const </span>m_bRenderOnly: usize = <span class="number">0x44</span>; <span class="comment">// bool
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>EventClientPreSimulate_t { <span class="comment">// EventSimulate_t
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>EventClientPredictionPostNetupdate_t {
|
||||
}
|
||||
|
||||
<span class="kw">pub mod </span>EventClientProcessGameInput_t {
|
||||
<span class="kw">pub const </span>m_LoopState: usize = <span class="number">0x0</span>; <span class="comment">// EngineLoopState_t
|
||||
</span><span class="kw">pub const </span>m_flRealTime: usize = <span class="number">0x28</span>; <span class="comment">// float
|
||||
</span><span class="kw">pub const </span>m_flFrameTime: usize = <span class="number">0x2C</span>; <span class="comment">// float
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>EventClientProcessInput_t {
|
||||
<span class="kw">pub const </span>m_LoopState: usize = <span class="number">0x0</span>; <span class="comment">// EngineLoopState_t
|
||||
</span><span class="kw">pub const </span>m_flRealTime: usize = <span class="number">0x28</span>; <span class="comment">// float
|
||||
</span><span class="kw">pub const </span>m_flTickInterval: usize = <span class="number">0x2C</span>; <span class="comment">// float
|
||||
</span><span class="kw">pub const </span>m_flTickStartTime: usize = <span class="number">0x30</span>; <span class="comment">// double
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>EventClientProcessNetworking_t {
|
||||
}
|
||||
|
||||
<span class="kw">pub mod </span>EventClientSceneSystemThreadStateChange_t {
|
||||
<span class="kw">pub const </span>m_bThreadsActive: usize = <span class="number">0x0</span>; <span class="comment">// bool
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>EventClientSendInput_t {
|
||||
<span class="kw">pub const </span>m_bFinalClientCommandTick: usize = <span class="number">0x0</span>; <span class="comment">// bool
|
||||
</span><span class="kw">pub const </span>m_nAdditionalClientCommandsToCreate: usize = <span class="number">0x4</span>; <span class="comment">// int32_t
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>EventClientSimulate_t { <span class="comment">// EventSimulate_t
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>EventFrameBoundary_t {
|
||||
<span class="kw">pub const </span>m_flFrameTime: usize = <span class="number">0x0</span>; <span class="comment">// float
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>EventModInitialized_t {
|
||||
}
|
||||
|
||||
<span class="kw">pub mod </span>EventPostAdvanceTick_t { <span class="comment">// EventSimulate_t
|
||||
</span><span class="kw">pub const </span>m_nCurrentTick: usize = <span class="number">0x30</span>; <span class="comment">// int32_t
|
||||
</span><span class="kw">pub const </span>m_nCurrentTickThisFrame: usize = <span class="number">0x34</span>; <span class="comment">// int32_t
|
||||
</span><span class="kw">pub const </span>m_nTotalTicksThisFrame: usize = <span class="number">0x38</span>; <span class="comment">// int32_t
|
||||
</span><span class="kw">pub const </span>m_nTotalTicks: usize = <span class="number">0x3C</span>; <span class="comment">// int32_t
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>EventPostDataUpdate_t {
|
||||
<span class="kw">pub const </span>m_nCount: usize = <span class="number">0x0</span>; <span class="comment">// int32_t
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>EventPreDataUpdate_t {
|
||||
<span class="kw">pub const </span>m_nCount: usize = <span class="number">0x0</span>; <span class="comment">// int32_t
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>EventProfileStorageAvailable_t {
|
||||
<span class="kw">pub const </span>m_nSplitScreenSlot: usize = <span class="number">0x0</span>; <span class="comment">// CSplitScreenSlot
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>EventServerAdvanceTick_t { <span class="comment">// EventAdvanceTick_t
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>EventServerPollNetworking_t { <span class="comment">// EventSimulate_t
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>EventServerPostAdvanceTick_t { <span class="comment">// EventPostAdvanceTick_t
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>EventServerPostSimulate_t { <span class="comment">// EventSimulate_t
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>EventServerProcessNetworking_t { <span class="comment">// EventSimulate_t
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>EventServerSimulate_t { <span class="comment">// EventSimulate_t
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>EventSetTime_t {
|
||||
<span class="kw">pub const </span>m_LoopState: usize = <span class="number">0x0</span>; <span class="comment">// EngineLoopState_t
|
||||
</span><span class="kw">pub const </span>m_nClientOutputFrames: usize = <span class="number">0x28</span>; <span class="comment">// int32_t
|
||||
</span><span class="kw">pub const </span>m_flRealTime: usize = <span class="number">0x30</span>; <span class="comment">// double
|
||||
</span><span class="kw">pub const </span>m_flRenderTime: usize = <span class="number">0x38</span>; <span class="comment">// double
|
||||
</span><span class="kw">pub const </span>m_flRenderFrameTime: usize = <span class="number">0x40</span>; <span class="comment">// double
|
||||
</span><span class="kw">pub const </span>m_flRenderFrameTimeUnbounded: usize = <span class="number">0x48</span>; <span class="comment">// double
|
||||
</span><span class="kw">pub const </span>m_flRenderFrameTimeUnscaled: usize = <span class="number">0x50</span>; <span class="comment">// double
|
||||
</span><span class="kw">pub const </span>m_flTickRemainder: usize = <span class="number">0x58</span>; <span class="comment">// double
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>EventSimpleLoopFrameUpdate_t {
|
||||
<span class="kw">pub const </span>m_LoopState: usize = <span class="number">0x0</span>; <span class="comment">// EngineLoopState_t
|
||||
</span><span class="kw">pub const </span>m_flRealTime: usize = <span class="number">0x28</span>; <span class="comment">// float
|
||||
</span><span class="kw">pub const </span>m_flFrameTime: usize = <span class="number">0x2C</span>; <span class="comment">// float
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>EventSimulate_t {
|
||||
<span class="kw">pub const </span>m_LoopState: usize = <span class="number">0x0</span>; <span class="comment">// EngineLoopState_t
|
||||
</span><span class="kw">pub const </span>m_bFirstTick: usize = <span class="number">0x28</span>; <span class="comment">// bool
|
||||
</span><span class="kw">pub const </span>m_bLastTick: usize = <span class="number">0x29</span>; <span class="comment">// bool
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>EventSplitScreenStateChanged_t {
|
||||
}</code></pre></div></section></main></body></html>
|
||||
9
docs/src/csflow/cs2dumper/mod.rs.html
Normal file
9
docs/src/csflow/cs2dumper/mod.rs.html
Normal file
@@ -0,0 +1,9 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `csflow/src/cs2dumper/mod.rs`."><title>mod.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="csflow" data-themes="" data-resource-suffix="" data-rustdoc-version="1.74.0 (79e9716c9 2023-11-13)" data-channel="1.74.0" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../src-files.js"></script><script defer src="../../../static.files/main-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><a class="sub-logo-container" href="../../../csflow/index.html"><img class="rust-logo" src="../../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
|
||||
<a href="#2" id="2">2</a>
|
||||
<a href="#3" id="3">3</a>
|
||||
<a href="#4" id="4">4</a>
|
||||
</pre></div><pre class="rust"><code><span class="attr">#![allow(dead_code)]
|
||||
</span><span class="kw">pub mod </span>client;
|
||||
<span class="kw">pub mod </span>engine2;
|
||||
<span class="kw">pub mod </span>offsets;
|
||||
</code></pre></div></section></main></body></html>
|
||||
102
docs/src/csflow/cs2dumper/offsets.rs.html
Normal file
102
docs/src/csflow/cs2dumper/offsets.rs.html
Normal file
@@ -0,0 +1,102 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `csflow/src/cs2dumper/offsets.rs`."><title>offsets.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="csflow" data-themes="" data-resource-suffix="" data-rustdoc-version="1.74.0 (79e9716c9 2023-11-13)" data-channel="1.74.0" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../src-files.js"></script><script defer src="../../../static.files/main-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><a class="sub-logo-container" href="../../../csflow/index.html"><img class="rust-logo" src="../../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
|
||||
<a href="#2" id="2">2</a>
|
||||
<a href="#3" id="3">3</a>
|
||||
<a href="#4" id="4">4</a>
|
||||
<a href="#5" id="5">5</a>
|
||||
<a href="#6" id="6">6</a>
|
||||
<a href="#7" id="7">7</a>
|
||||
<a href="#8" id="8">8</a>
|
||||
<a href="#9" id="9">9</a>
|
||||
<a href="#10" id="10">10</a>
|
||||
<a href="#11" id="11">11</a>
|
||||
<a href="#12" id="12">12</a>
|
||||
<a href="#13" id="13">13</a>
|
||||
<a href="#14" id="14">14</a>
|
||||
<a href="#15" id="15">15</a>
|
||||
<a href="#16" id="16">16</a>
|
||||
<a href="#17" id="17">17</a>
|
||||
<a href="#18" id="18">18</a>
|
||||
<a href="#19" id="19">19</a>
|
||||
<a href="#20" id="20">20</a>
|
||||
<a href="#21" id="21">21</a>
|
||||
<a href="#22" id="22">22</a>
|
||||
<a href="#23" id="23">23</a>
|
||||
<a href="#24" id="24">24</a>
|
||||
<a href="#25" id="25">25</a>
|
||||
<a href="#26" id="26">26</a>
|
||||
<a href="#27" id="27">27</a>
|
||||
<a href="#28" id="28">28</a>
|
||||
<a href="#29" id="29">29</a>
|
||||
<a href="#30" id="30">30</a>
|
||||
<a href="#31" id="31">31</a>
|
||||
<a href="#32" id="32">32</a>
|
||||
<a href="#33" id="33">33</a>
|
||||
<a href="#34" id="34">34</a>
|
||||
<a href="#35" id="35">35</a>
|
||||
<a href="#36" id="36">36</a>
|
||||
<a href="#37" id="37">37</a>
|
||||
<a href="#38" id="38">38</a>
|
||||
<a href="#39" id="39">39</a>
|
||||
<a href="#40" id="40">40</a>
|
||||
<a href="#41" id="41">41</a>
|
||||
<a href="#42" id="42">42</a>
|
||||
<a href="#43" id="43">43</a>
|
||||
<a href="#44" id="44">44</a>
|
||||
<a href="#45" id="45">45</a>
|
||||
<a href="#46" id="46">46</a>
|
||||
<a href="#47" id="47">47</a>
|
||||
<a href="#48" id="48">48</a>
|
||||
<a href="#49" id="49">49</a>
|
||||
<a href="#50" id="50">50</a>
|
||||
<a href="#51" id="51">51</a>
|
||||
</pre></div><pre class="rust"><code><span class="comment">/*
|
||||
* Created using https://github.com/a2x/cs2-dumper
|
||||
* Sat, 30 Dec 2023 03:17:26 +0000
|
||||
*/
|
||||
|
||||
</span><span class="attr">#![allow(non_snake_case, non_upper_case_globals)]
|
||||
|
||||
</span><span class="kw">pub mod </span>client_dll { <span class="comment">// client.dll
|
||||
</span><span class="kw">pub const </span>dwEntityList: usize = <span class="number">0x17C1950</span>;
|
||||
<span class="kw">pub const </span>dwForceAttack: usize = <span class="number">0x16C1E70</span>;
|
||||
<span class="kw">pub const </span>dwForceAttack2: usize = <span class="number">0x16C1F00</span>;
|
||||
<span class="kw">pub const </span>dwForceBackward: usize = <span class="number">0x16C2140</span>;
|
||||
<span class="kw">pub const </span>dwForceCrouch: usize = <span class="number">0x16C2410</span>;
|
||||
<span class="kw">pub const </span>dwForceForward: usize = <span class="number">0x16C20B0</span>;
|
||||
<span class="kw">pub const </span>dwForceJump: usize = <span class="number">0x16C2380</span>;
|
||||
<span class="kw">pub const </span>dwForceLeft: usize = <span class="number">0x16C21D0</span>;
|
||||
<span class="kw">pub const </span>dwForceRight: usize = <span class="number">0x16C2260</span>;
|
||||
<span class="kw">pub const </span>dwGameEntitySystem: usize = <span class="number">0x18ED250</span>;
|
||||
<span class="kw">pub const </span>dwGameEntitySystem_getHighestEntityIndex: usize = <span class="number">0x1510</span>;
|
||||
<span class="kw">pub const </span>dwGameRules: usize = <span class="number">0x181E048</span>;
|
||||
<span class="kw">pub const </span>dwGlobalVars: usize = <span class="number">0x16BDC98</span>;
|
||||
<span class="kw">pub const </span>dwGlowManager: usize = <span class="number">0x181D7B0</span>;
|
||||
<span class="kw">pub const </span>dwInterfaceLinkList: usize = <span class="number">0x191AEE8</span>;
|
||||
<span class="kw">pub const </span>dwLocalPlayerController: usize = <span class="number">0x1810F48</span>;
|
||||
<span class="kw">pub const </span>dwLocalPlayerPawn: usize = <span class="number">0x16C8F38</span>;
|
||||
<span class="kw">pub const </span>dwPlantedC4: usize = <span class="number">0x1824A88</span>;
|
||||
<span class="kw">pub const </span>dwPrediction: usize = <span class="number">0x16C8E00</span>;
|
||||
<span class="kw">pub const </span>dwSensitivity: usize = <span class="number">0x181ED48</span>;
|
||||
<span class="kw">pub const </span>dwSensitivity_sensitivity: usize = <span class="number">0x40</span>;
|
||||
<span class="kw">pub const </span>dwViewAngles: usize = <span class="number">0x1880DC0</span>;
|
||||
<span class="kw">pub const </span>dwViewMatrix: usize = <span class="number">0x1820150</span>;
|
||||
<span class="kw">pub const </span>dwViewRender: usize = <span class="number">0x1820998</span>;
|
||||
}
|
||||
|
||||
<span class="kw">pub mod </span>engine2_dll { <span class="comment">// engine2.dll
|
||||
</span><span class="kw">pub const </span>dwBuildNumber: usize = <span class="number">0x4E03D4</span>;
|
||||
<span class="kw">pub const </span>dwNetworkGameClient: usize = <span class="number">0x4DF988</span>;
|
||||
<span class="kw">pub const </span>dwNetworkGameClient_getLocalPlayer: usize = <span class="number">0xF0</span>;
|
||||
<span class="kw">pub const </span>dwNetworkGameClient_maxClients: usize = <span class="number">0x250</span>;
|
||||
<span class="kw">pub const </span>dwNetworkGameClient_signOnState: usize = <span class="number">0x240</span>;
|
||||
<span class="kw">pub const </span>dwWindowHeight: usize = <span class="number">0x596E1C</span>;
|
||||
<span class="kw">pub const </span>dwWindowWidth: usize = <span class="number">0x596E18</span>;
|
||||
}
|
||||
|
||||
<span class="kw">pub mod </span>game_info { <span class="comment">// Some additional information about the game at dump time
|
||||
</span><span class="kw">pub const </span>buildNumber: usize = <span class="number">0x369F</span>; <span class="comment">// Game build number
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub mod </span>inputsystem_dll { <span class="comment">// inputsystem.dll
|
||||
</span><span class="kw">pub const </span>dwInputSystem: usize = <span class="number">0x35760</span>;
|
||||
}</code></pre></div></section></main></body></html>
|
||||
10
docs/src/csflow/enums/mod.rs.html
Normal file
10
docs/src/csflow/enums/mod.rs.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `csflow/src/enums/mod.rs`."><title>mod.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="csflow" data-themes="" data-resource-suffix="" data-rustdoc-version="1.74.0 (79e9716c9 2023-11-13)" data-channel="1.74.0" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../src-files.js"></script><script defer src="../../../static.files/main-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><a class="sub-logo-container" href="../../../csflow/index.html"><img class="rust-logo" src="../../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
|
||||
<a href="#2" id="2">2</a>
|
||||
<a href="#3" id="3">3</a>
|
||||
<a href="#4" id="4">4</a>
|
||||
<a href="#5" id="5">5</a>
|
||||
</pre></div><pre class="rust"><code><span class="kw">mod </span>player_type;
|
||||
<span class="kw">mod </span>teamid;
|
||||
|
||||
<span class="kw">pub use </span>player_type::PlayerType;
|
||||
<span class="kw">pub use </span>teamid::TeamID;</code></pre></div></section></main></body></html>
|
||||
18
docs/src/csflow/enums/player_type.rs.html
Normal file
18
docs/src/csflow/enums/player_type.rs.html
Normal file
@@ -0,0 +1,18 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `csflow/src/enums/player_type.rs`."><title>player_type.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="csflow" data-themes="" data-resource-suffix="" data-rustdoc-version="1.74.0 (79e9716c9 2023-11-13)" data-channel="1.74.0" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../src-files.js"></script><script defer src="../../../static.files/main-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><a class="sub-logo-container" href="../../../csflow/index.html"><img class="rust-logo" src="../../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
|
||||
<a href="#2" id="2">2</a>
|
||||
<a href="#3" id="3">3</a>
|
||||
<a href="#4" id="4">4</a>
|
||||
<a href="#5" id="5">5</a>
|
||||
<a href="#6" id="6">6</a>
|
||||
<a href="#7" id="7">7</a>
|
||||
<a href="#8" id="8">8</a>
|
||||
<a href="#9" id="9">9</a>
|
||||
</pre></div><pre class="rust"><code><span class="attr">#[derive(Debug, Clone, Copy, serde::Serialize, serde::Deserialize, Default, PartialEq)]
|
||||
</span><span class="kw">pub enum </span>PlayerType {
|
||||
<span class="attr">#[default]
|
||||
</span>Unknown,
|
||||
Spectator,
|
||||
Local,
|
||||
Enemy,
|
||||
Team
|
||||
}</code></pre></div></section></main></body></html>
|
||||
14
docs/src/csflow/enums/teamid.rs.html
Normal file
14
docs/src/csflow/enums/teamid.rs.html
Normal file
@@ -0,0 +1,14 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `csflow/src/enums/teamid.rs`."><title>teamid.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="csflow" data-themes="" data-resource-suffix="" data-rustdoc-version="1.74.0 (79e9716c9 2023-11-13)" data-channel="1.74.0" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../src-files.js"></script><script defer src="../../../static.files/main-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><a class="sub-logo-container" href="../../../csflow/index.html"><img class="rust-logo" src="../../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
|
||||
<a href="#2" id="2">2</a>
|
||||
<a href="#3" id="3">3</a>
|
||||
<a href="#4" id="4">4</a>
|
||||
<a href="#5" id="5">5</a>
|
||||
<a href="#6" id="6">6</a>
|
||||
<a href="#7" id="7">7</a>
|
||||
</pre></div><pre class="rust"><code><span class="attr">#[repr(i32)]
|
||||
#[derive(Debug, Eq, PartialEq, enum_primitive_derive::Primitive)]
|
||||
</span><span class="kw">pub enum </span>TeamID {
|
||||
Spectator = <span class="number">1</span>,
|
||||
T = <span class="number">2</span>,
|
||||
CT = <span class="number">3
|
||||
</span>}</code></pre></div></section></main></body></html>
|
||||
66
docs/src/csflow/error.rs.html
Normal file
66
docs/src/csflow/error.rs.html
Normal file
@@ -0,0 +1,66 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `csflow/src/error.rs`."><title>error.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="csflow" data-themes="" data-resource-suffix="" data-rustdoc-version="1.74.0 (79e9716c9 2023-11-13)" data-channel="1.74.0" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../src-files.js"></script><script defer src="../../static.files/main-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><a class="sub-logo-container" href="../../csflow/index.html"><img class="rust-logo" src="../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
|
||||
<a href="#2" id="2">2</a>
|
||||
<a href="#3" id="3">3</a>
|
||||
<a href="#4" id="4">4</a>
|
||||
<a href="#5" id="5">5</a>
|
||||
<a href="#6" id="6">6</a>
|
||||
<a href="#7" id="7">7</a>
|
||||
<a href="#8" id="8">8</a>
|
||||
<a href="#9" id="9">9</a>
|
||||
<a href="#10" id="10">10</a>
|
||||
<a href="#11" id="11">11</a>
|
||||
<a href="#12" id="12">12</a>
|
||||
<a href="#13" id="13">13</a>
|
||||
<a href="#14" id="14">14</a>
|
||||
<a href="#15" id="15">15</a>
|
||||
<a href="#16" id="16">16</a>
|
||||
<a href="#17" id="17">17</a>
|
||||
<a href="#18" id="18">18</a>
|
||||
<a href="#19" id="19">19</a>
|
||||
<a href="#20" id="20">20</a>
|
||||
<a href="#21" id="21">21</a>
|
||||
<a href="#22" id="22">22</a>
|
||||
<a href="#23" id="23">23</a>
|
||||
<a href="#24" id="24">24</a>
|
||||
<a href="#25" id="25">25</a>
|
||||
<a href="#26" id="26">26</a>
|
||||
<a href="#27" id="27">27</a>
|
||||
<a href="#28" id="28">28</a>
|
||||
<a href="#29" id="29">29</a>
|
||||
<a href="#30" id="30">30</a>
|
||||
<a href="#31" id="31">31</a>
|
||||
<a href="#32" id="32">32</a>
|
||||
<a href="#33" id="33">33</a>
|
||||
</pre></div><pre class="rust"><code><span class="kw">use </span>memflow::types::Address;
|
||||
<span class="kw">use </span>thiserror::Error;
|
||||
|
||||
<span class="kw">use </span><span class="kw">crate</span>::structs::Vec3;
|
||||
|
||||
<span class="attr">#[derive(Error, Debug)]
|
||||
</span><span class="kw">pub enum </span>Error {
|
||||
<span class="doccomment">/// Game version mismatch.
|
||||
/// First arg is the game version, second is the offset version.
|
||||
</span><span class="attr">#[error(<span class="string">"version mismatch, game has version {0}, but offsets have version {1}"</span>)]
|
||||
</span>GameVersionMismatch(usize, usize),
|
||||
|
||||
<span class="attr">#[error(<span class="string">"memflow error: {0}"</span>)]
|
||||
</span>Memflow(<span class="attr">#[from] </span>memflow::error::Error),
|
||||
|
||||
<span class="attr">#[error(<span class="string">"memflow partial error when reading address: {0}"</span>)]
|
||||
</span>MemflowPartialAddress(<span class="attr">#[from] </span>memflow::error::PartialError<Address>),
|
||||
|
||||
<span class="attr">#[error(<span class="string">"memflow partial error when reading Vec3: {0}"</span>)]
|
||||
</span>MemflowPartialVec3(<span class="attr">#[from] </span>memflow::error::PartialError<Vec3>),
|
||||
|
||||
<span class="attr">#[error(<span class="string">"memflow partial error when reading String: {0}"</span>)]
|
||||
</span>MemflowPartialString(<span class="attr">#[from] </span>memflow::error::PartialError<String>),
|
||||
|
||||
<span class="attr">#[error(<span class="string">"memflow partial error when reading i32: {0}"</span>)]
|
||||
</span>MemflowPartiali32(<span class="attr">#[from] </span>memflow::error::PartialError<i32>),
|
||||
|
||||
<span class="attr">#[error(<span class="string">"memflow partial error when reading u32: {0}"</span>)]
|
||||
</span>MemflowPartialu32(<span class="attr">#[from] </span>memflow::error::PartialError<u32>),
|
||||
|
||||
<span class="attr">#[error(<span class="string">"memflow partial error when reading u8: {0}"</span>)]
|
||||
</span>MemflowPartialu8(<span class="attr">#[from] </span>memflow::error::PartialError<u8>)
|
||||
}</code></pre></div></section></main></body></html>
|
||||
28
docs/src/csflow/lib.rs.html
Normal file
28
docs/src/csflow/lib.rs.html
Normal file
@@ -0,0 +1,28 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `csflow/src/lib.rs`."><title>lib.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="csflow" data-themes="" data-resource-suffix="" data-rustdoc-version="1.74.0 (79e9716c9 2023-11-13)" data-channel="1.74.0" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../src-files.js"></script><script defer src="../../static.files/main-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><a class="sub-logo-container" href="../../csflow/index.html"><img class="rust-logo" src="../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
|
||||
<a href="#2" id="2">2</a>
|
||||
<a href="#3" id="3">3</a>
|
||||
<a href="#4" id="4">4</a>
|
||||
<a href="#5" id="5">5</a>
|
||||
<a href="#6" id="6">6</a>
|
||||
<a href="#7" id="7">7</a>
|
||||
<a href="#8" id="8">8</a>
|
||||
<a href="#9" id="9">9</a>
|
||||
<a href="#10" id="10">10</a>
|
||||
<a href="#11" id="11">11</a>
|
||||
<a href="#12" id="12">12</a>
|
||||
<a href="#13" id="13">13</a>
|
||||
<a href="#14" id="14">14</a>
|
||||
</pre></div><pre class="rust"><code><span class="attr">#![allow(dead_code)]
|
||||
|
||||
</span><span class="kw">mod </span>cs2dumper;
|
||||
<span class="kw">mod </span>context;
|
||||
<span class="kw">mod </span>error;
|
||||
|
||||
<span class="kw">pub mod </span>structs;
|
||||
<span class="kw">pub mod </span>traits;
|
||||
<span class="kw">pub mod </span>enums;
|
||||
|
||||
<span class="kw">pub use </span>context::<span class="kw-2">*</span>;
|
||||
<span class="kw">pub use </span>error::Error;
|
||||
|
||||
<span class="kw">pub use </span>memflow::prelude <span class="kw">as </span>memflow;</code></pre></div></section></main></body></html>
|
||||
94
docs/src/csflow/structs/entity/base_entity.rs.html
Normal file
94
docs/src/csflow/structs/entity/base_entity.rs.html
Normal file
@@ -0,0 +1,94 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `csflow/src/structs/entity/base_entity.rs`."><title>base_entity.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="csflow" data-themes="" data-resource-suffix="" data-rustdoc-version="1.74.0 (79e9716c9 2023-11-13)" data-channel="1.74.0" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../../src-files.js"></script><script defer src="../../../../static.files/main-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><a class="sub-logo-container" href="../../../../csflow/index.html"><img class="rust-logo" src="../../../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
|
||||
<a href="#2" id="2">2</a>
|
||||
<a href="#3" id="3">3</a>
|
||||
<a href="#4" id="4">4</a>
|
||||
<a href="#5" id="5">5</a>
|
||||
<a href="#6" id="6">6</a>
|
||||
<a href="#7" id="7">7</a>
|
||||
<a href="#8" id="8">8</a>
|
||||
<a href="#9" id="9">9</a>
|
||||
<a href="#10" id="10">10</a>
|
||||
<a href="#11" id="11">11</a>
|
||||
<a href="#12" id="12">12</a>
|
||||
<a href="#13" id="13">13</a>
|
||||
<a href="#14" id="14">14</a>
|
||||
<a href="#15" id="15">15</a>
|
||||
<a href="#16" id="16">16</a>
|
||||
<a href="#17" id="17">17</a>
|
||||
<a href="#18" id="18">18</a>
|
||||
<a href="#19" id="19">19</a>
|
||||
<a href="#20" id="20">20</a>
|
||||
<a href="#21" id="21">21</a>
|
||||
<a href="#22" id="22">22</a>
|
||||
<a href="#23" id="23">23</a>
|
||||
<a href="#24" id="24">24</a>
|
||||
<a href="#25" id="25">25</a>
|
||||
<a href="#26" id="26">26</a>
|
||||
<a href="#27" id="27">27</a>
|
||||
<a href="#28" id="28">28</a>
|
||||
<a href="#29" id="29">29</a>
|
||||
<a href="#30" id="30">30</a>
|
||||
<a href="#31" id="31">31</a>
|
||||
<a href="#32" id="32">32</a>
|
||||
<a href="#33" id="33">33</a>
|
||||
<a href="#34" id="34">34</a>
|
||||
<a href="#35" id="35">35</a>
|
||||
<a href="#36" id="36">36</a>
|
||||
<a href="#37" id="37">37</a>
|
||||
<a href="#38" id="38">38</a>
|
||||
<a href="#39" id="39">39</a>
|
||||
<a href="#40" id="40">40</a>
|
||||
<a href="#41" id="41">41</a>
|
||||
<a href="#42" id="42">42</a>
|
||||
<a href="#43" id="43">43</a>
|
||||
<a href="#44" id="44">44</a>
|
||||
<a href="#45" id="45">45</a>
|
||||
<a href="#46" id="46">46</a>
|
||||
<a href="#47" id="47">47</a>
|
||||
</pre></div><pre class="rust"><code><span class="kw">use </span>memflow::{types::Address, mem::MemoryView};
|
||||
<span class="kw">use crate</span>::{CheatCtx, Error, cs2dumper, traits::{BaseEntity, MemoryClass}, structs::Vec3};
|
||||
|
||||
<span class="kw">pub struct </span>CBaseEntity(Address);
|
||||
|
||||
<span class="kw">impl </span>MemoryClass <span class="kw">for </span>CBaseEntity {
|
||||
<span class="kw">fn </span>ptr(<span class="kw-2">&</span><span class="self">self</span>) -> Address {
|
||||
<span class="self">self</span>.<span class="number">0
|
||||
</span>}
|
||||
|
||||
<span class="kw">fn </span>new(ptr: Address) -> <span class="self">Self </span>{
|
||||
<span class="self">Self</span>(ptr)
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">impl </span>BaseEntity <span class="kw">for </span>CBaseEntity {
|
||||
<span class="kw">fn </span>from_index(ctx: <span class="kw-2">&mut </span>CheatCtx, entity_list: Address, index: i32) -> <span class="prelude-ty">Result</span><<span class="prelude-ty">Option</span><CBaseEntity>, Error> {
|
||||
<span class="kw">let </span>list_entry = ctx.process.read_addr64(entity_list + <span class="number">8 </span>* (index >> <span class="number">9</span>) + <span class="number">16</span>)<span class="question-mark">?</span>;
|
||||
<span class="kw">if </span>list_entry.is_null() && !list_entry.is_valid() {
|
||||
<span class="kw">return </span><span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>);
|
||||
}
|
||||
|
||||
<span class="kw">let </span>player_ptr = ctx.process.read_addr64(list_entry + <span class="number">120 </span>* (index & <span class="number">0x1FF</span>))<span class="question-mark">?</span>;
|
||||
<span class="kw">if </span>player_ptr.is_null() && !player_ptr.is_valid() {
|
||||
<span class="kw">return </span><span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>);
|
||||
}
|
||||
|
||||
<span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="self">Self</span>::new(player_ptr)))
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>pos(<span class="kw-2">&</span><span class="self">self</span>, ctx: <span class="kw-2">&mut </span>CheatCtx) -> <span class="prelude-ty">Result</span><Vec3, Error> {
|
||||
<span class="kw">let </span>node = ctx.process.read_addr64(<span class="self">self</span>.<span class="number">0 </span>+ cs2dumper::client::C_BaseEntity::m_pGameSceneNode)<span class="question-mark">?</span>;
|
||||
<span class="prelude-val">Ok</span>(ctx.process.read(node + cs2dumper::client::CGameSceneNode::m_vecAbsOrigin)<span class="question-mark">?</span>)
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>class_name(<span class="kw-2">&</span><span class="self">self</span>, ctx: <span class="kw-2">&mut </span>CheatCtx) -> <span class="prelude-ty">Result</span><String, Error> {
|
||||
<span class="kw">let </span>entity_identity_ptr = ctx.process.read_addr64(<span class="self">self</span>.<span class="number">0 </span>+ cs2dumper::client::CEntityInstance::m_pEntity)<span class="question-mark">?</span>;
|
||||
<span class="kw">let </span>class_name_ptr = ctx.process.read_addr64(entity_identity_ptr + cs2dumper::client::CEntityIdentity::m_designerName)<span class="question-mark">?</span>;
|
||||
<span class="prelude-val">Ok</span>(ctx.process.read_char_string_n(class_name_ptr, <span class="number">32</span>)<span class="question-mark">?</span>)
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">impl </span>CBaseEntity {
|
||||
<span class="kw">pub fn </span>to_player_controller(<span class="kw-2">&</span><span class="self">self</span>) -> <span class="kw">super</span>::CPlayerController {
|
||||
<span class="kw">super</span>::CPlayerController::new(<span class="self">self</span>.<span class="number">0</span>)
|
||||
}
|
||||
}</code></pre></div></section></main></body></html>
|
||||
14
docs/src/csflow/structs/entity/mod.rs.html
Normal file
14
docs/src/csflow/structs/entity/mod.rs.html
Normal file
@@ -0,0 +1,14 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `csflow/src/structs/entity/mod.rs`."><title>mod.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="csflow" data-themes="" data-resource-suffix="" data-rustdoc-version="1.74.0 (79e9716c9 2023-11-13)" data-channel="1.74.0" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../../src-files.js"></script><script defer src="../../../../static.files/main-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><a class="sub-logo-container" href="../../../../csflow/index.html"><img class="rust-logo" src="../../../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
|
||||
<a href="#2" id="2">2</a>
|
||||
<a href="#3" id="3">3</a>
|
||||
<a href="#4" id="4">4</a>
|
||||
<a href="#5" id="5">5</a>
|
||||
<a href="#6" id="6">6</a>
|
||||
<a href="#7" id="7">7</a>
|
||||
</pre></div><pre class="rust"><code><span class="kw">mod </span>base_entity;
|
||||
<span class="kw">mod </span>player_controller;
|
||||
<span class="kw">mod </span>player_pawn;
|
||||
|
||||
<span class="kw">pub use </span>base_entity::CBaseEntity;
|
||||
<span class="kw">pub use </span>player_controller::CPlayerController;
|
||||
<span class="kw">pub use </span>player_pawn::CPlayerPawn;</code></pre></div></section></main></body></html>
|
||||
176
docs/src/csflow/structs/entity/player_controller.rs.html
Normal file
176
docs/src/csflow/structs/entity/player_controller.rs.html
Normal file
@@ -0,0 +1,176 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `csflow/src/structs/entity/player_controller.rs`."><title>player_controller.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="csflow" data-themes="" data-resource-suffix="" data-rustdoc-version="1.74.0 (79e9716c9 2023-11-13)" data-channel="1.74.0" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../../src-files.js"></script><script defer src="../../../../static.files/main-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><a class="sub-logo-container" href="../../../../csflow/index.html"><img class="rust-logo" src="../../../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
|
||||
<a href="#2" id="2">2</a>
|
||||
<a href="#3" id="3">3</a>
|
||||
<a href="#4" id="4">4</a>
|
||||
<a href="#5" id="5">5</a>
|
||||
<a href="#6" id="6">6</a>
|
||||
<a href="#7" id="7">7</a>
|
||||
<a href="#8" id="8">8</a>
|
||||
<a href="#9" id="9">9</a>
|
||||
<a href="#10" id="10">10</a>
|
||||
<a href="#11" id="11">11</a>
|
||||
<a href="#12" id="12">12</a>
|
||||
<a href="#13" id="13">13</a>
|
||||
<a href="#14" id="14">14</a>
|
||||
<a href="#15" id="15">15</a>
|
||||
<a href="#16" id="16">16</a>
|
||||
<a href="#17" id="17">17</a>
|
||||
<a href="#18" id="18">18</a>
|
||||
<a href="#19" id="19">19</a>
|
||||
<a href="#20" id="20">20</a>
|
||||
<a href="#21" id="21">21</a>
|
||||
<a href="#22" id="22">22</a>
|
||||
<a href="#23" id="23">23</a>
|
||||
<a href="#24" id="24">24</a>
|
||||
<a href="#25" id="25">25</a>
|
||||
<a href="#26" id="26">26</a>
|
||||
<a href="#27" id="27">27</a>
|
||||
<a href="#28" id="28">28</a>
|
||||
<a href="#29" id="29">29</a>
|
||||
<a href="#30" id="30">30</a>
|
||||
<a href="#31" id="31">31</a>
|
||||
<a href="#32" id="32">32</a>
|
||||
<a href="#33" id="33">33</a>
|
||||
<a href="#34" id="34">34</a>
|
||||
<a href="#35" id="35">35</a>
|
||||
<a href="#36" id="36">36</a>
|
||||
<a href="#37" id="37">37</a>
|
||||
<a href="#38" id="38">38</a>
|
||||
<a href="#39" id="39">39</a>
|
||||
<a href="#40" id="40">40</a>
|
||||
<a href="#41" id="41">41</a>
|
||||
<a href="#42" id="42">42</a>
|
||||
<a href="#43" id="43">43</a>
|
||||
<a href="#44" id="44">44</a>
|
||||
<a href="#45" id="45">45</a>
|
||||
<a href="#46" id="46">46</a>
|
||||
<a href="#47" id="47">47</a>
|
||||
<a href="#48" id="48">48</a>
|
||||
<a href="#49" id="49">49</a>
|
||||
<a href="#50" id="50">50</a>
|
||||
<a href="#51" id="51">51</a>
|
||||
<a href="#52" id="52">52</a>
|
||||
<a href="#53" id="53">53</a>
|
||||
<a href="#54" id="54">54</a>
|
||||
<a href="#55" id="55">55</a>
|
||||
<a href="#56" id="56">56</a>
|
||||
<a href="#57" id="57">57</a>
|
||||
<a href="#58" id="58">58</a>
|
||||
<a href="#59" id="59">59</a>
|
||||
<a href="#60" id="60">60</a>
|
||||
<a href="#61" id="61">61</a>
|
||||
<a href="#62" id="62">62</a>
|
||||
<a href="#63" id="63">63</a>
|
||||
<a href="#64" id="64">64</a>
|
||||
<a href="#65" id="65">65</a>
|
||||
<a href="#66" id="66">66</a>
|
||||
<a href="#67" id="67">67</a>
|
||||
<a href="#68" id="68">68</a>
|
||||
<a href="#69" id="69">69</a>
|
||||
<a href="#70" id="70">70</a>
|
||||
<a href="#71" id="71">71</a>
|
||||
<a href="#72" id="72">72</a>
|
||||
<a href="#73" id="73">73</a>
|
||||
<a href="#74" id="74">74</a>
|
||||
<a href="#75" id="75">75</a>
|
||||
<a href="#76" id="76">76</a>
|
||||
<a href="#77" id="77">77</a>
|
||||
<a href="#78" id="78">78</a>
|
||||
<a href="#79" id="79">79</a>
|
||||
<a href="#80" id="80">80</a>
|
||||
<a href="#81" id="81">81</a>
|
||||
<a href="#82" id="82">82</a>
|
||||
<a href="#83" id="83">83</a>
|
||||
<a href="#84" id="84">84</a>
|
||||
<a href="#85" id="85">85</a>
|
||||
<a href="#86" id="86">86</a>
|
||||
<a href="#87" id="87">87</a>
|
||||
<a href="#88" id="88">88</a>
|
||||
</pre></div><pre class="rust"><code><span class="kw">use </span>memflow::{types::Address, mem::MemoryView};
|
||||
<span class="kw">use </span>num_traits::FromPrimitive;
|
||||
|
||||
<span class="kw">use crate</span>::{CheatCtx, Error, cs2dumper, structs::Vec3, traits::{MemoryClass, BaseEntity}, enums::{TeamID, PlayerType}};
|
||||
|
||||
<span class="kw">pub struct </span>CPlayerController(Address);
|
||||
|
||||
<span class="kw">impl </span>MemoryClass <span class="kw">for </span>CPlayerController {
|
||||
<span class="kw">fn </span>ptr(<span class="kw-2">&</span><span class="self">self</span>) -> Address {
|
||||
<span class="self">self</span>.<span class="number">0
|
||||
</span>}
|
||||
|
||||
<span class="kw">fn </span>new(ptr: Address) -> <span class="self">Self </span>{
|
||||
<span class="self">Self</span>(ptr)
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">impl </span>BaseEntity <span class="kw">for </span>CPlayerController {
|
||||
<span class="kw">fn </span>from_index(ctx: <span class="kw-2">&mut </span>CheatCtx, entity_list: Address, index: i32) -> <span class="prelude-ty">Result</span><<span class="prelude-ty">Option</span><CPlayerController>, Error> {
|
||||
<span class="kw">let </span>list_entry = ctx.process.read_addr64(entity_list + <span class="number">8 </span>* (index >> <span class="number">9</span>) + <span class="number">16</span>)<span class="question-mark">?</span>;
|
||||
<span class="kw">if </span>list_entry.is_null() && !list_entry.is_valid() {
|
||||
<span class="kw">return </span><span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>);
|
||||
}
|
||||
|
||||
<span class="kw">let </span>player_ptr = ctx.process.read_addr64(list_entry + <span class="number">120 </span>* (index & <span class="number">0x1FF</span>))<span class="question-mark">?</span>;
|
||||
<span class="kw">if </span>player_ptr.is_null() && !player_ptr.is_valid() {
|
||||
<span class="kw">return </span><span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>);
|
||||
}
|
||||
|
||||
<span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="self">Self</span>::new(player_ptr)))
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>pos(<span class="kw-2">&</span><span class="self">self</span>, ctx: <span class="kw-2">&mut </span>CheatCtx) -> <span class="prelude-ty">Result</span><Vec3, Error> {
|
||||
<span class="kw">let </span>node = ctx.process.read_addr64(<span class="self">self</span>.<span class="number">0 </span>+ cs2dumper::client::C_BaseEntity::m_pGameSceneNode)<span class="question-mark">?</span>;
|
||||
<span class="prelude-val">Ok</span>(ctx.process.read(node + cs2dumper::client::CGameSceneNode::m_vecAbsOrigin)<span class="question-mark">?</span>)
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>class_name(<span class="kw-2">&</span><span class="self">self</span>, ctx: <span class="kw-2">&mut </span>CheatCtx) -> <span class="prelude-ty">Result</span><String, Error> {
|
||||
<span class="kw">let </span>entity_identity_ptr = ctx.process.read_addr64(<span class="self">self</span>.<span class="number">0 </span>+ cs2dumper::client::CEntityInstance::m_pEntity)<span class="question-mark">?</span>;
|
||||
<span class="kw">let </span>class_name_ptr = ctx.process.read_addr64(entity_identity_ptr + cs2dumper::client::CEntityIdentity::m_designerName)<span class="question-mark">?</span>;
|
||||
<span class="prelude-val">Ok</span>(ctx.process.read_char_string_n(class_name_ptr, <span class="number">32</span>)<span class="question-mark">?</span>)
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">impl </span>CPlayerController {
|
||||
<span class="kw">pub fn </span>get_pawn(<span class="kw-2">&</span><span class="self">self</span>, ctx: <span class="kw-2">&mut </span>CheatCtx, entity_list: Address) -> <span class="prelude-ty">Result</span><<span class="prelude-ty">Option</span><<span class="kw">super</span>::CPlayerPawn>, Error> {
|
||||
<span class="kw">let </span>uhandle = ctx.process.read(<span class="self">self</span>.<span class="number">0 </span>+ cs2dumper::client::CCSPlayerController::m_hPlayerPawn)<span class="question-mark">?</span>;
|
||||
<span class="kw">super</span>::CPlayerPawn::from_uhandle(ctx, entity_list, uhandle)
|
||||
}
|
||||
|
||||
<span class="comment">// Technically something that should be in the BaseEntity trait, but we are only gonna use it on CPlayerController
|
||||
</span><span class="kw">pub fn </span>get_team(<span class="kw-2">&</span><span class="self">self</span>, ctx: <span class="kw-2">&mut </span>CheatCtx) -> <span class="prelude-ty">Result</span><<span class="prelude-ty">Option</span><TeamID>, Error> {
|
||||
<span class="kw">let </span>team_num: i32 = ctx.process.read(<span class="self">self</span>.<span class="number">0 </span>+ cs2dumper::client::C_BaseEntity::m_iTeamNum)<span class="question-mark">?</span>;
|
||||
<span class="prelude-val">Ok</span>(TeamID::from_i32(team_num))
|
||||
}
|
||||
|
||||
<span class="kw">pub fn </span>get_player_type(<span class="kw-2">&</span><span class="self">self</span>, ctx: <span class="kw-2">&mut </span>CheatCtx, local: <span class="kw-2">&</span>CPlayerController) -> <span class="prelude-ty">Result</span><<span class="prelude-ty">Option</span><PlayerType>, Error> {
|
||||
<span class="kw">if </span><span class="self">self</span>.<span class="number">0 </span>== local.<span class="number">0 </span>{
|
||||
<span class="kw">return </span><span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(PlayerType::Local))
|
||||
}
|
||||
|
||||
<span class="kw">let </span>team = {
|
||||
<span class="kw">match </span><span class="self">self</span>.get_team(ctx)<span class="question-mark">? </span>{
|
||||
<span class="prelude-val">Some</span>(t) => t,
|
||||
<span class="prelude-val">None </span>=> { <span class="kw">return </span><span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>) },
|
||||
}
|
||||
};
|
||||
|
||||
<span class="kw">let </span>local_team = {
|
||||
<span class="kw">match </span>local.get_team(ctx)<span class="question-mark">? </span>{
|
||||
<span class="prelude-val">Some</span>(t) => t,
|
||||
<span class="prelude-val">None </span>=> { <span class="kw">return </span><span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>) },
|
||||
}
|
||||
};
|
||||
|
||||
<span class="kw">let </span>player_type = {
|
||||
<span class="kw">if </span>team == TeamID::Spectator {
|
||||
PlayerType::Spectator
|
||||
} <span class="kw">else if </span>team != local_team {
|
||||
PlayerType::Enemy
|
||||
} <span class="kw">else </span>{
|
||||
PlayerType::Team
|
||||
}
|
||||
};
|
||||
|
||||
<span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(player_type))
|
||||
}
|
||||
}</code></pre></div></section></main></body></html>
|
||||
160
docs/src/csflow/structs/entity/player_pawn.rs.html
Normal file
160
docs/src/csflow/structs/entity/player_pawn.rs.html
Normal file
@@ -0,0 +1,160 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `csflow/src/structs/entity/player_pawn.rs`."><title>player_pawn.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="csflow" data-themes="" data-resource-suffix="" data-rustdoc-version="1.74.0 (79e9716c9 2023-11-13)" data-channel="1.74.0" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../../src-files.js"></script><script defer src="../../../../static.files/main-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><a class="sub-logo-container" href="../../../../csflow/index.html"><img class="rust-logo" src="../../../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
|
||||
<a href="#2" id="2">2</a>
|
||||
<a href="#3" id="3">3</a>
|
||||
<a href="#4" id="4">4</a>
|
||||
<a href="#5" id="5">5</a>
|
||||
<a href="#6" id="6">6</a>
|
||||
<a href="#7" id="7">7</a>
|
||||
<a href="#8" id="8">8</a>
|
||||
<a href="#9" id="9">9</a>
|
||||
<a href="#10" id="10">10</a>
|
||||
<a href="#11" id="11">11</a>
|
||||
<a href="#12" id="12">12</a>
|
||||
<a href="#13" id="13">13</a>
|
||||
<a href="#14" id="14">14</a>
|
||||
<a href="#15" id="15">15</a>
|
||||
<a href="#16" id="16">16</a>
|
||||
<a href="#17" id="17">17</a>
|
||||
<a href="#18" id="18">18</a>
|
||||
<a href="#19" id="19">19</a>
|
||||
<a href="#20" id="20">20</a>
|
||||
<a href="#21" id="21">21</a>
|
||||
<a href="#22" id="22">22</a>
|
||||
<a href="#23" id="23">23</a>
|
||||
<a href="#24" id="24">24</a>
|
||||
<a href="#25" id="25">25</a>
|
||||
<a href="#26" id="26">26</a>
|
||||
<a href="#27" id="27">27</a>
|
||||
<a href="#28" id="28">28</a>
|
||||
<a href="#29" id="29">29</a>
|
||||
<a href="#30" id="30">30</a>
|
||||
<a href="#31" id="31">31</a>
|
||||
<a href="#32" id="32">32</a>
|
||||
<a href="#33" id="33">33</a>
|
||||
<a href="#34" id="34">34</a>
|
||||
<a href="#35" id="35">35</a>
|
||||
<a href="#36" id="36">36</a>
|
||||
<a href="#37" id="37">37</a>
|
||||
<a href="#38" id="38">38</a>
|
||||
<a href="#39" id="39">39</a>
|
||||
<a href="#40" id="40">40</a>
|
||||
<a href="#41" id="41">41</a>
|
||||
<a href="#42" id="42">42</a>
|
||||
<a href="#43" id="43">43</a>
|
||||
<a href="#44" id="44">44</a>
|
||||
<a href="#45" id="45">45</a>
|
||||
<a href="#46" id="46">46</a>
|
||||
<a href="#47" id="47">47</a>
|
||||
<a href="#48" id="48">48</a>
|
||||
<a href="#49" id="49">49</a>
|
||||
<a href="#50" id="50">50</a>
|
||||
<a href="#51" id="51">51</a>
|
||||
<a href="#52" id="52">52</a>
|
||||
<a href="#53" id="53">53</a>
|
||||
<a href="#54" id="54">54</a>
|
||||
<a href="#55" id="55">55</a>
|
||||
<a href="#56" id="56">56</a>
|
||||
<a href="#57" id="57">57</a>
|
||||
<a href="#58" id="58">58</a>
|
||||
<a href="#59" id="59">59</a>
|
||||
<a href="#60" id="60">60</a>
|
||||
<a href="#61" id="61">61</a>
|
||||
<a href="#62" id="62">62</a>
|
||||
<a href="#63" id="63">63</a>
|
||||
<a href="#64" id="64">64</a>
|
||||
<a href="#65" id="65">65</a>
|
||||
<a href="#66" id="66">66</a>
|
||||
<a href="#67" id="67">67</a>
|
||||
<a href="#68" id="68">68</a>
|
||||
<a href="#69" id="69">69</a>
|
||||
<a href="#70" id="70">70</a>
|
||||
<a href="#71" id="71">71</a>
|
||||
<a href="#72" id="72">72</a>
|
||||
<a href="#73" id="73">73</a>
|
||||
<a href="#74" id="74">74</a>
|
||||
<a href="#75" id="75">75</a>
|
||||
<a href="#76" id="76">76</a>
|
||||
<a href="#77" id="77">77</a>
|
||||
<a href="#78" id="78">78</a>
|
||||
<a href="#79" id="79">79</a>
|
||||
<a href="#80" id="80">80</a>
|
||||
</pre></div><pre class="rust"><code><span class="kw">use </span>memflow::{types::Address, mem::MemoryView};
|
||||
|
||||
<span class="kw">use crate</span>::{Error, CheatCtx, cs2dumper, structs::Vec3, traits::MemoryClass};
|
||||
|
||||
<span class="kw">pub struct </span>CPlayerPawn(Address);
|
||||
|
||||
<span class="kw">impl </span>MemoryClass <span class="kw">for </span>CPlayerPawn {
|
||||
<span class="kw">fn </span>ptr(<span class="kw-2">&</span><span class="self">self</span>) -> Address {
|
||||
<span class="self">self</span>.<span class="number">0
|
||||
</span>}
|
||||
|
||||
<span class="kw">fn </span>new(ptr: Address) -> <span class="self">Self </span>{
|
||||
<span class="self">Self</span>(ptr)
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">impl </span>CPlayerPawn {
|
||||
<span class="kw">pub fn </span>from_uhandle(ctx: <span class="kw-2">&mut </span>CheatCtx, entity_list: Address, uhandle: u32) -> <span class="prelude-ty">Result</span><<span class="prelude-ty">Option</span><<span class="self">Self</span>>, Error> {
|
||||
<span class="kw">let </span>list_entry = ctx.process.read_addr64(entity_list + <span class="number">0x8 </span>* ((uhandle & <span class="number">0x7FFF</span>) >> <span class="number">9</span>) + <span class="number">16</span>)<span class="question-mark">?</span>;
|
||||
|
||||
<span class="kw">if </span>list_entry.is_null() || !list_entry.is_valid() {
|
||||
<span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>)
|
||||
} <span class="kw">else </span>{
|
||||
<span class="kw">let </span>ptr = ctx.process.read_addr64(list_entry + <span class="number">120 </span>* (uhandle & <span class="number">0x1FF</span>))<span class="question-mark">?</span>;
|
||||
<span class="prelude-val">Ok</span>(<span class="prelude-val">Some</span>(<span class="self">Self</span>(ptr)))
|
||||
}
|
||||
}
|
||||
|
||||
<span class="comment">// Todo: Optimize this function: find another way to do this
|
||||
</span><span class="kw">pub fn </span>has_c4(<span class="kw-2">&</span><span class="self">self</span>, ctx: <span class="kw-2">&mut </span>CheatCtx, entity_list: Address) -> <span class="prelude-ty">Result</span><bool, Error> {
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>has_c4 = <span class="bool-val">false</span>;
|
||||
<span class="kw">let </span>wep_services = ctx.process.read_addr64(<span class="self">self</span>.<span class="number">0 </span>+ cs2dumper::client::C_BasePlayerPawn::m_pWeaponServices)<span class="question-mark">?</span>;
|
||||
<span class="kw">let </span>wep_count: i32 = ctx.process.read(wep_services + cs2dumper::client::CPlayer_WeaponServices::m_hMyWeapons)<span class="question-mark">?</span>;
|
||||
<span class="kw">let </span>wep_base = ctx.process.read_addr64(wep_services + cs2dumper::client::CPlayer_WeaponServices::m_hMyWeapons + <span class="number">0x8</span>)<span class="question-mark">?</span>;
|
||||
|
||||
<span class="kw">for </span>wep_idx <span class="kw">in </span><span class="number">0</span>..wep_count {
|
||||
<span class="kw">let </span>handle: i32 = ctx.process.read(wep_base + wep_idx * <span class="number">0x4</span>)<span class="question-mark">?</span>;
|
||||
<span class="kw">if </span>handle == -<span class="number">1 </span>{
|
||||
<span class="kw">continue</span>;
|
||||
}
|
||||
|
||||
<span class="kw">let </span>list_entry = ctx.process.read_addr64(entity_list + <span class="number">0x8 </span>* ((handle & <span class="number">0x7FFF</span>) >> <span class="number">9</span>) + <span class="number">16</span>)<span class="question-mark">?</span>;
|
||||
<span class="kw">if let </span><span class="prelude-val">Some</span>(wep_ptr) = {
|
||||
<span class="kw">if </span>list_entry.is_null() || !list_entry.is_valid() {
|
||||
<span class="prelude-val">None
|
||||
</span>} <span class="kw">else </span>{
|
||||
<span class="kw">let </span>ptr = ctx.process.read_addr64(list_entry + <span class="number">120 </span>* (handle & <span class="number">0x1FF</span>))<span class="question-mark">?</span>;
|
||||
<span class="prelude-val">Some</span>(ptr)
|
||||
}
|
||||
} {
|
||||
<span class="kw">let </span>wep_data = ctx.process.read_addr64(wep_ptr + cs2dumper::client::C_BaseEntity::m_nSubclassID + <span class="number">0x8</span>)<span class="question-mark">?</span>;
|
||||
<span class="kw">let </span>id: i32 = ctx.process.read(wep_data + cs2dumper::client::CCSWeaponBaseVData::m_WeaponType)<span class="question-mark">?</span>;
|
||||
|
||||
<span class="kw">if </span>id == <span class="number">7 </span>{
|
||||
has_c4 = <span class="bool-val">true</span>;
|
||||
<span class="kw">break</span>;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
<span class="prelude-val">Ok</span>(has_c4)
|
||||
}
|
||||
|
||||
<span class="kw">pub fn </span>pos(<span class="kw-2">&</span><span class="self">self</span>, ctx: <span class="kw-2">&mut </span>CheatCtx) -> <span class="prelude-ty">Result</span><Vec3, Error> {
|
||||
<span class="prelude-val">Ok</span>(ctx.process.read(<span class="self">self</span>.<span class="number">0 </span>+ cs2dumper::client::C_BasePlayerPawn::m_vOldOrigin)<span class="question-mark">?</span>)
|
||||
}
|
||||
|
||||
<span class="kw">pub fn </span>angles(<span class="kw-2">&</span><span class="self">self</span>, ctx: <span class="kw-2">&mut </span>CheatCtx) -> <span class="prelude-ty">Result</span><Vec3, Error> {
|
||||
<span class="prelude-val">Ok</span>(ctx.process.read(<span class="self">self</span>.<span class="number">0 </span>+ cs2dumper::client::C_CSPlayerPawnBase::m_angEyeAngles)<span class="question-mark">?</span>)
|
||||
}
|
||||
|
||||
<span class="kw">pub fn </span>health(<span class="kw-2">&</span><span class="self">self</span>, ctx: <span class="kw-2">&mut </span>CheatCtx) -> <span class="prelude-ty">Result</span><u32, Error> {
|
||||
<span class="prelude-val">Ok</span>(ctx.process.read(<span class="self">self</span>.<span class="number">0 </span>+ cs2dumper::client::C_BaseEntity::m_iHealth)<span class="question-mark">?</span>)
|
||||
}
|
||||
|
||||
<span class="doccomment">/// Same as ::get_health > 0
|
||||
</span><span class="kw">pub fn </span>is_alive(<span class="kw-2">&</span><span class="self">self</span>, ctx: <span class="kw-2">&mut </span>CheatCtx) -> <span class="prelude-ty">Result</span><bool, Error> {
|
||||
<span class="prelude-val">Ok</span>(<span class="self">self</span>.health(ctx)<span class="question-mark">? </span>> <span class="number">0</span>)
|
||||
}
|
||||
}</code></pre></div></section></main></body></html>
|
||||
10
docs/src/csflow/structs/mod.rs.html
Normal file
10
docs/src/csflow/structs/mod.rs.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `csflow/src/structs/mod.rs`."><title>mod.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="csflow" data-themes="" data-resource-suffix="" data-rustdoc-version="1.74.0 (79e9716c9 2023-11-13)" data-channel="1.74.0" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../src-files.js"></script><script defer src="../../../static.files/main-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><a class="sub-logo-container" href="../../../csflow/index.html"><img class="rust-logo" src="../../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
|
||||
<a href="#2" id="2">2</a>
|
||||
<a href="#3" id="3">3</a>
|
||||
<a href="#4" id="4">4</a>
|
||||
<a href="#5" id="5">5</a>
|
||||
</pre></div><pre class="rust"><code><span class="kw">mod </span>vec3;
|
||||
<span class="kw">mod </span>entity;
|
||||
|
||||
<span class="kw">pub use </span>vec3::Vec3;
|
||||
<span class="kw">pub use </span>entity::{CBaseEntity, CPlayerController, CPlayerPawn};</code></pre></div></section></main></body></html>
|
||||
22
docs/src/csflow/structs/vec3.rs.html
Normal file
22
docs/src/csflow/structs/vec3.rs.html
Normal file
@@ -0,0 +1,22 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `csflow/src/structs/vec3.rs`."><title>vec3.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="csflow" data-themes="" data-resource-suffix="" data-rustdoc-version="1.74.0 (79e9716c9 2023-11-13)" data-channel="1.74.0" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../src-files.js"></script><script defer src="../../../static.files/main-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><a class="sub-logo-container" href="../../../csflow/index.html"><img class="rust-logo" src="../../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
|
||||
<a href="#2" id="2">2</a>
|
||||
<a href="#3" id="3">3</a>
|
||||
<a href="#4" id="4">4</a>
|
||||
<a href="#5" id="5">5</a>
|
||||
<a href="#6" id="6">6</a>
|
||||
<a href="#7" id="7">7</a>
|
||||
<a href="#8" id="8">8</a>
|
||||
<a href="#9" id="9">9</a>
|
||||
<a href="#10" id="10">10</a>
|
||||
<a href="#11" id="11">11</a>
|
||||
</pre></div><pre class="rust"><code><span class="kw">use </span>serde::Serialize;
|
||||
|
||||
<span class="attr">#[derive(Debug, Clone, Copy, Serialize, serde::Deserialize)]
|
||||
#[repr(C)]
|
||||
</span><span class="kw">pub struct </span>Vec3 {
|
||||
<span class="kw">pub </span>x: f32,
|
||||
<span class="kw">pub </span>y: f32,
|
||||
<span class="kw">pub </span>z: f32
|
||||
}
|
||||
|
||||
<span class="kw">unsafe impl </span>dataview::Pod <span class="kw">for </span>Vec3 {}</code></pre></div></section></main></body></html>
|
||||
22
docs/src/csflow/traits/base_entity.rs.html
Normal file
22
docs/src/csflow/traits/base_entity.rs.html
Normal file
@@ -0,0 +1,22 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `csflow/src/traits/base_entity.rs`."><title>base_entity.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="csflow" data-themes="" data-resource-suffix="" data-rustdoc-version="1.74.0 (79e9716c9 2023-11-13)" data-channel="1.74.0" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../src-files.js"></script><script defer src="../../../static.files/main-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><a class="sub-logo-container" href="../../../csflow/index.html"><img class="rust-logo" src="../../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
|
||||
<a href="#2" id="2">2</a>
|
||||
<a href="#3" id="3">3</a>
|
||||
<a href="#4" id="4">4</a>
|
||||
<a href="#5" id="5">5</a>
|
||||
<a href="#6" id="6">6</a>
|
||||
<a href="#7" id="7">7</a>
|
||||
<a href="#8" id="8">8</a>
|
||||
<a href="#9" id="9">9</a>
|
||||
<a href="#10" id="10">10</a>
|
||||
<a href="#11" id="11">11</a>
|
||||
</pre></div><pre class="rust"><code><span class="kw">use </span>memflow::types::Address;
|
||||
|
||||
<span class="kw">use crate</span>::{CheatCtx, structs::Vec3, Error};
|
||||
|
||||
<span class="doccomment">/// A trait for basic functions from C_BaseEntity
|
||||
/// CCSPlayerController inherits C_BaseEntity, which is why this trait exists.
|
||||
</span><span class="kw">pub trait </span>BaseEntity {
|
||||
<span class="kw">fn </span>from_index(ctx: <span class="kw-2">&mut </span>CheatCtx, entity_list: Address, index: i32) -> <span class="prelude-ty">Result</span><<span class="prelude-ty">Option</span><<span class="self">Self</span>>, Error> <span class="kw">where </span><span class="self">Self</span>: std::marker::Sized;
|
||||
<span class="kw">fn </span>pos(<span class="kw-2">&</span><span class="self">self</span>, ctx: <span class="kw-2">&mut </span>CheatCtx) -> <span class="prelude-ty">Result</span><Vec3, Error>;
|
||||
<span class="kw">fn </span>class_name(<span class="kw-2">&</span><span class="self">self</span>, ctx: <span class="kw-2">&mut </span>CheatCtx) -> <span class="prelude-ty">Result</span><String, Error>;
|
||||
}</code></pre></div></section></main></body></html>
|
||||
14
docs/src/csflow/traits/memory_class.rs.html
Normal file
14
docs/src/csflow/traits/memory_class.rs.html
Normal file
@@ -0,0 +1,14 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `csflow/src/traits/memory_class.rs`."><title>memory_class.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="csflow" data-themes="" data-resource-suffix="" data-rustdoc-version="1.74.0 (79e9716c9 2023-11-13)" data-channel="1.74.0" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../src-files.js"></script><script defer src="../../../static.files/main-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><a class="sub-logo-container" href="../../../csflow/index.html"><img class="rust-logo" src="../../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
|
||||
<a href="#2" id="2">2</a>
|
||||
<a href="#3" id="3">3</a>
|
||||
<a href="#4" id="4">4</a>
|
||||
<a href="#5" id="5">5</a>
|
||||
<a href="#6" id="6">6</a>
|
||||
<a href="#7" id="7">7</a>
|
||||
</pre></div><pre class="rust"><code><span class="kw">use </span>memflow::types::Address;
|
||||
|
||||
<span class="doccomment">/// A trait that implements basic functions for a class represented by a single pointer
|
||||
</span><span class="kw">pub trait </span>MemoryClass {
|
||||
<span class="kw">fn </span>ptr(<span class="kw-2">&</span><span class="self">self</span>) -> Address;
|
||||
<span class="kw">fn </span>new(ptr: Address) -> <span class="self">Self</span>;
|
||||
}</code></pre></div></section></main></body></html>
|
||||
10
docs/src/csflow/traits/mod.rs.html
Normal file
10
docs/src/csflow/traits/mod.rs.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `csflow/src/traits/mod.rs`."><title>mod.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="csflow" data-themes="" data-resource-suffix="" data-rustdoc-version="1.74.0 (79e9716c9 2023-11-13)" data-channel="1.74.0" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../src-files.js"></script><script defer src="../../../static.files/main-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><a class="sub-logo-container" href="../../../csflow/index.html"><img class="rust-logo" src="../../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
|
||||
<a href="#2" id="2">2</a>
|
||||
<a href="#3" id="3">3</a>
|
||||
<a href="#4" id="4">4</a>
|
||||
<a href="#5" id="5">5</a>
|
||||
</pre></div><pre class="rust"><code><span class="kw">mod </span>base_entity;
|
||||
<span class="kw">mod </span>memory_class;
|
||||
|
||||
<span class="kw">pub use </span>base_entity::BaseEntity;
|
||||
<span class="kw">pub use </span>memory_class::MemoryClass;</code></pre></div></section></main></body></html>
|
||||
228
docs/src/radarflow/cli.rs.html
Normal file
228
docs/src/radarflow/cli.rs.html
Normal file
@@ -0,0 +1,228 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `radarflow/src/cli.rs`."><title>cli.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="radarflow" data-themes="" data-resource-suffix="" data-rustdoc-version="1.74.0 (79e9716c9 2023-11-13)" data-channel="1.74.0" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../src-files.js"></script><script defer src="../../static.files/main-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><a class="sub-logo-container" href="../../radarflow/index.html"><img class="rust-logo" src="../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
|
||||
<a href="#2" id="2">2</a>
|
||||
<a href="#3" id="3">3</a>
|
||||
<a href="#4" id="4">4</a>
|
||||
<a href="#5" id="5">5</a>
|
||||
<a href="#6" id="6">6</a>
|
||||
<a href="#7" id="7">7</a>
|
||||
<a href="#8" id="8">8</a>
|
||||
<a href="#9" id="9">9</a>
|
||||
<a href="#10" id="10">10</a>
|
||||
<a href="#11" id="11">11</a>
|
||||
<a href="#12" id="12">12</a>
|
||||
<a href="#13" id="13">13</a>
|
||||
<a href="#14" id="14">14</a>
|
||||
<a href="#15" id="15">15</a>
|
||||
<a href="#16" id="16">16</a>
|
||||
<a href="#17" id="17">17</a>
|
||||
<a href="#18" id="18">18</a>
|
||||
<a href="#19" id="19">19</a>
|
||||
<a href="#20" id="20">20</a>
|
||||
<a href="#21" id="21">21</a>
|
||||
<a href="#22" id="22">22</a>
|
||||
<a href="#23" id="23">23</a>
|
||||
<a href="#24" id="24">24</a>
|
||||
<a href="#25" id="25">25</a>
|
||||
<a href="#26" id="26">26</a>
|
||||
<a href="#27" id="27">27</a>
|
||||
<a href="#28" id="28">28</a>
|
||||
<a href="#29" id="29">29</a>
|
||||
<a href="#30" id="30">30</a>
|
||||
<a href="#31" id="31">31</a>
|
||||
<a href="#32" id="32">32</a>
|
||||
<a href="#33" id="33">33</a>
|
||||
<a href="#34" id="34">34</a>
|
||||
<a href="#35" id="35">35</a>
|
||||
<a href="#36" id="36">36</a>
|
||||
<a href="#37" id="37">37</a>
|
||||
<a href="#38" id="38">38</a>
|
||||
<a href="#39" id="39">39</a>
|
||||
<a href="#40" id="40">40</a>
|
||||
<a href="#41" id="41">41</a>
|
||||
<a href="#42" id="42">42</a>
|
||||
<a href="#43" id="43">43</a>
|
||||
<a href="#44" id="44">44</a>
|
||||
<a href="#45" id="45">45</a>
|
||||
<a href="#46" id="46">46</a>
|
||||
<a href="#47" id="47">47</a>
|
||||
<a href="#48" id="48">48</a>
|
||||
<a href="#49" id="49">49</a>
|
||||
<a href="#50" id="50">50</a>
|
||||
<a href="#51" id="51">51</a>
|
||||
<a href="#52" id="52">52</a>
|
||||
<a href="#53" id="53">53</a>
|
||||
<a href="#54" id="54">54</a>
|
||||
<a href="#55" id="55">55</a>
|
||||
<a href="#56" id="56">56</a>
|
||||
<a href="#57" id="57">57</a>
|
||||
<a href="#58" id="58">58</a>
|
||||
<a href="#59" id="59">59</a>
|
||||
<a href="#60" id="60">60</a>
|
||||
<a href="#61" id="61">61</a>
|
||||
<a href="#62" id="62">62</a>
|
||||
<a href="#63" id="63">63</a>
|
||||
<a href="#64" id="64">64</a>
|
||||
<a href="#65" id="65">65</a>
|
||||
<a href="#66" id="66">66</a>
|
||||
<a href="#67" id="67">67</a>
|
||||
<a href="#68" id="68">68</a>
|
||||
<a href="#69" id="69">69</a>
|
||||
<a href="#70" id="70">70</a>
|
||||
<a href="#71" id="71">71</a>
|
||||
<a href="#72" id="72">72</a>
|
||||
<a href="#73" id="73">73</a>
|
||||
<a href="#74" id="74">74</a>
|
||||
<a href="#75" id="75">75</a>
|
||||
<a href="#76" id="76">76</a>
|
||||
<a href="#77" id="77">77</a>
|
||||
<a href="#78" id="78">78</a>
|
||||
<a href="#79" id="79">79</a>
|
||||
<a href="#80" id="80">80</a>
|
||||
<a href="#81" id="81">81</a>
|
||||
<a href="#82" id="82">82</a>
|
||||
<a href="#83" id="83">83</a>
|
||||
<a href="#84" id="84">84</a>
|
||||
<a href="#85" id="85">85</a>
|
||||
<a href="#86" id="86">86</a>
|
||||
<a href="#87" id="87">87</a>
|
||||
<a href="#88" id="88">88</a>
|
||||
<a href="#89" id="89">89</a>
|
||||
<a href="#90" id="90">90</a>
|
||||
<a href="#91" id="91">91</a>
|
||||
<a href="#92" id="92">92</a>
|
||||
<a href="#93" id="93">93</a>
|
||||
<a href="#94" id="94">94</a>
|
||||
<a href="#95" id="95">95</a>
|
||||
<a href="#96" id="96">96</a>
|
||||
<a href="#97" id="97">97</a>
|
||||
<a href="#98" id="98">98</a>
|
||||
<a href="#99" id="99">99</a>
|
||||
<a href="#100" id="100">100</a>
|
||||
<a href="#101" id="101">101</a>
|
||||
<a href="#102" id="102">102</a>
|
||||
<a href="#103" id="103">103</a>
|
||||
<a href="#104" id="104">104</a>
|
||||
<a href="#105" id="105">105</a>
|
||||
<a href="#106" id="106">106</a>
|
||||
<a href="#107" id="107">107</a>
|
||||
<a href="#108" id="108">108</a>
|
||||
<a href="#109" id="109">109</a>
|
||||
<a href="#110" id="110">110</a>
|
||||
<a href="#111" id="111">111</a>
|
||||
<a href="#112" id="112">112</a>
|
||||
<a href="#113" id="113">113</a>
|
||||
<a href="#114" id="114">114</a>
|
||||
</pre></div><pre class="rust"><code><span class="kw">use </span>std::path::PathBuf;
|
||||
|
||||
<span class="kw">use </span>clap::{Parser, ValueEnum};
|
||||
<span class="kw">use </span>csflow::{Connector, memflow::Inventory};
|
||||
|
||||
<span class="kw">const </span>PORT_RANGE: std::ops::RangeInclusive<usize> = <span class="number">8000</span>..=<span class="number">65535</span>;
|
||||
<span class="kw">const </span>POLL_RANGE: std::ops::RangeInclusive<usize> = <span class="number">1</span>..=<span class="number">1000</span>;
|
||||
|
||||
<span class="attr">#[derive(Parser)]
|
||||
#[command(author, version = version(), about, long_about = <span class="prelude-val">None</span>)]
|
||||
</span><span class="kw">pub struct </span>Cli {
|
||||
<span class="doccomment">/// Specifies the connector type for DMA
|
||||
</span><span class="attr">#[clap(value_enum, short, long, ignore_case = <span class="bool-val">true</span>, default_value_t = Connector::Qemu)]
|
||||
</span><span class="kw">pub </span>connector: Connector,
|
||||
|
||||
<span class="doccomment">/// Name of the Pcileech device
|
||||
</span><span class="attr">#[clap(long, default_value_t = String::from(<span class="string">"FPGA"</span>))]
|
||||
</span><span class="kw">pub </span>pcileech_device: String,
|
||||
|
||||
<span class="doccomment">/// Port number for the Webserver to run on
|
||||
</span><span class="attr">#[arg(short, long, default_value_t = <span class="number">8000</span>, value_parser = port_in_range)]
|
||||
</span><span class="kw">pub </span>port: u16,
|
||||
|
||||
<span class="doccomment">/// Path to the directory served by the Webserver
|
||||
</span><span class="attr">#[arg(short, long, default_value = <span class="string">"./webradar"</span>, value_parser = valid_path)]
|
||||
</span><span class="kw">pub </span>web_path: PathBuf,
|
||||
|
||||
<span class="doccomment">/// Polling frequency in times per second for the DMA thread
|
||||
</span><span class="attr">#[arg(short = <span class="string">'r'</span>, long, default_value_t = <span class="number">60</span>, value_parser = poll_in_range)]
|
||||
</span><span class="kw">pub </span>poll_rate: u16,
|
||||
|
||||
<span class="doccomment">/// Verbosity level for logging to the console
|
||||
</span><span class="attr">#[arg(value_enum, long, short, ignore_case = <span class="bool-val">true</span>, default_value_t = Loglevel::Warn)]
|
||||
</span><span class="kw">pub </span>loglevel: Loglevel,
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>version() -> String {
|
||||
<span class="kw">let </span>pkg_ver = <span class="macro">env!</span>(<span class="string">"CARGO_PKG_VERSION"</span>);
|
||||
<span class="kw">let </span>git_hash = <span class="macro">option_env!</span>(<span class="string">"VERGEN_GIT_SHA"</span>).unwrap_or(<span class="string">"unknown"</span>);
|
||||
<span class="kw">let </span>commit_date = <span class="macro">option_env!</span>(<span class="string">"VERGEN_GIT_COMMIT_DATE"</span>).unwrap_or(<span class="string">"unknown"</span>);
|
||||
<span class="kw">let </span>avail_cons = {
|
||||
<span class="kw">let </span>inventory = Inventory::scan();
|
||||
inventory.available_connectors().join(<span class="string">", "</span>)
|
||||
};
|
||||
|
||||
<span class="macro">format!</span>(<span class="string">" {pkg_ver} (rev {git_hash})\nCommit Date: {commit_date}\nAvailable Connectors: {avail_cons}"</span>)
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>port_in_range(s: <span class="kw-2">&</span>str) -> <span class="prelude-ty">Result</span><u16, String> {
|
||||
<span class="kw">let </span>port: usize = s
|
||||
.parse()
|
||||
.map_err(|<span class="kw">_</span>| <span class="macro">format!</span>(<span class="string">"`{s}` isn't a port number"</span>))<span class="question-mark">?</span>;
|
||||
<span class="kw">if </span>PORT_RANGE.contains(<span class="kw-2">&</span>port) {
|
||||
<span class="prelude-val">Ok</span>(port <span class="kw">as </span>u16)
|
||||
} <span class="kw">else </span>{
|
||||
<span class="prelude-val">Err</span>(<span class="macro">format!</span>(
|
||||
<span class="string">"port not in range {}-{}"</span>,
|
||||
PORT_RANGE.start(),
|
||||
PORT_RANGE.end()
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>valid_path(s: <span class="kw-2">&</span>str) -> <span class="prelude-ty">Result</span><PathBuf, String> {
|
||||
<span class="kw">let </span>path = PathBuf::from(s);
|
||||
|
||||
<span class="kw">if </span>!path.exists() {
|
||||
<span class="kw">return </span><span class="prelude-val">Err</span>(<span class="string">"Path does not exist"</span>.to_string())
|
||||
}
|
||||
|
||||
<span class="kw">if </span>!path.is_dir() {
|
||||
<span class="kw">return </span><span class="prelude-val">Err</span>(<span class="string">"Path is not a directory"</span>.to_string())
|
||||
}
|
||||
|
||||
<span class="prelude-val">Ok</span>(path)
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>poll_in_range(s: <span class="kw-2">&</span>str) -> <span class="prelude-ty">Result</span><u16, String> {
|
||||
<span class="kw">let </span>port: usize = s
|
||||
.parse()
|
||||
.map_err(|<span class="kw">_</span>| <span class="macro">format!</span>(<span class="string">"`{s}` isn't a valid number"</span>))<span class="question-mark">?</span>;
|
||||
<span class="kw">if </span>POLL_RANGE.contains(<span class="kw-2">&</span>port) {
|
||||
<span class="prelude-val">Ok</span>(port <span class="kw">as </span>u16)
|
||||
} <span class="kw">else </span>{
|
||||
<span class="prelude-val">Err</span>(<span class="macro">format!</span>(
|
||||
<span class="string">"not in range {}-{}"</span>,
|
||||
POLL_RANGE.start(),
|
||||
POLL_RANGE.end()
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
<span class="doccomment">/// Wrapper because log::LevelFilter doesn't implement ValueEnum
|
||||
</span><span class="attr">#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum, Default)]
|
||||
</span><span class="kw">pub enum </span>Loglevel {
|
||||
Error,
|
||||
<span class="attr">#[default]
|
||||
</span>Warn,
|
||||
Info,
|
||||
Debug,
|
||||
Trace,
|
||||
}
|
||||
|
||||
<span class="kw">impl </span>From<Loglevel> <span class="kw">for </span>log::LevelFilter {
|
||||
<span class="kw">fn </span>from(val: Loglevel) -> <span class="self">Self </span>{
|
||||
<span class="kw">match </span>val {
|
||||
Loglevel::Error => log::LevelFilter::Error,
|
||||
Loglevel::Warn => log::LevelFilter::Warn,
|
||||
Loglevel::Info => log::LevelFilter::Info,
|
||||
Loglevel::Debug => log::LevelFilter::Debug,
|
||||
Loglevel::Trace => log::LevelFilter::Trace,
|
||||
}
|
||||
}
|
||||
}</code></pre></div></section></main></body></html>
|
||||
136
docs/src/radarflow/comms.rs.html
Normal file
136
docs/src/radarflow/comms.rs.html
Normal file
@@ -0,0 +1,136 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `radarflow/src/comms.rs`."><title>comms.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="radarflow" data-themes="" data-resource-suffix="" data-rustdoc-version="1.74.0 (79e9716c9 2023-11-13)" data-channel="1.74.0" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../src-files.js"></script><script defer src="../../static.files/main-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><a class="sub-logo-container" href="../../radarflow/index.html"><img class="rust-logo" src="../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
|
||||
<a href="#2" id="2">2</a>
|
||||
<a href="#3" id="3">3</a>
|
||||
<a href="#4" id="4">4</a>
|
||||
<a href="#5" id="5">5</a>
|
||||
<a href="#6" id="6">6</a>
|
||||
<a href="#7" id="7">7</a>
|
||||
<a href="#8" id="8">8</a>
|
||||
<a href="#9" id="9">9</a>
|
||||
<a href="#10" id="10">10</a>
|
||||
<a href="#11" id="11">11</a>
|
||||
<a href="#12" id="12">12</a>
|
||||
<a href="#13" id="13">13</a>
|
||||
<a href="#14" id="14">14</a>
|
||||
<a href="#15" id="15">15</a>
|
||||
<a href="#16" id="16">16</a>
|
||||
<a href="#17" id="17">17</a>
|
||||
<a href="#18" id="18">18</a>
|
||||
<a href="#19" id="19">19</a>
|
||||
<a href="#20" id="20">20</a>
|
||||
<a href="#21" id="21">21</a>
|
||||
<a href="#22" id="22">22</a>
|
||||
<a href="#23" id="23">23</a>
|
||||
<a href="#24" id="24">24</a>
|
||||
<a href="#25" id="25">25</a>
|
||||
<a href="#26" id="26">26</a>
|
||||
<a href="#27" id="27">27</a>
|
||||
<a href="#28" id="28">28</a>
|
||||
<a href="#29" id="29">29</a>
|
||||
<a href="#30" id="30">30</a>
|
||||
<a href="#31" id="31">31</a>
|
||||
<a href="#32" id="32">32</a>
|
||||
<a href="#33" id="33">33</a>
|
||||
<a href="#34" id="34">34</a>
|
||||
<a href="#35" id="35">35</a>
|
||||
<a href="#36" id="36">36</a>
|
||||
<a href="#37" id="37">37</a>
|
||||
<a href="#38" id="38">38</a>
|
||||
<a href="#39" id="39">39</a>
|
||||
<a href="#40" id="40">40</a>
|
||||
<a href="#41" id="41">41</a>
|
||||
<a href="#42" id="42">42</a>
|
||||
<a href="#43" id="43">43</a>
|
||||
<a href="#44" id="44">44</a>
|
||||
<a href="#45" id="45">45</a>
|
||||
<a href="#46" id="46">46</a>
|
||||
<a href="#47" id="47">47</a>
|
||||
<a href="#48" id="48">48</a>
|
||||
<a href="#49" id="49">49</a>
|
||||
<a href="#50" id="50">50</a>
|
||||
<a href="#51" id="51">51</a>
|
||||
<a href="#52" id="52">52</a>
|
||||
<a href="#53" id="53">53</a>
|
||||
<a href="#54" id="54">54</a>
|
||||
<a href="#55" id="55">55</a>
|
||||
<a href="#56" id="56">56</a>
|
||||
<a href="#57" id="57">57</a>
|
||||
<a href="#58" id="58">58</a>
|
||||
<a href="#59" id="59">59</a>
|
||||
<a href="#60" id="60">60</a>
|
||||
<a href="#61" id="61">61</a>
|
||||
<a href="#62" id="62">62</a>
|
||||
<a href="#63" id="63">63</a>
|
||||
<a href="#64" id="64">64</a>
|
||||
<a href="#65" id="65">65</a>
|
||||
<a href="#66" id="66">66</a>
|
||||
<a href="#67" id="67">67</a>
|
||||
<a href="#68" id="68">68</a>
|
||||
</pre></div><pre class="rust"><code><span class="kw">use </span>csflow::{enums::PlayerType, structs::Vec3};
|
||||
<span class="kw">use </span>serde::{Serialize, Deserialize};
|
||||
|
||||
<span class="attr">#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
</span><span class="kw">pub struct </span>PlayerData {
|
||||
pos: Vec3,
|
||||
yaw: f32,
|
||||
<span class="attr">#[serde(rename = <span class="string">"playerType"</span>)]
|
||||
</span>player_type: PlayerType,
|
||||
|
||||
<span class="attr">#[serde(rename = <span class="string">"hasBomb"</span>)]
|
||||
</span>has_bomb: bool
|
||||
}
|
||||
|
||||
<span class="kw">impl </span>PlayerData {
|
||||
<span class="kw">pub fn </span>new(pos: Vec3, yaw: f32, player_type: PlayerType, has_bomb: bool) -> PlayerData {
|
||||
PlayerData { pos, yaw, player_type, has_bomb }
|
||||
}
|
||||
}
|
||||
|
||||
<span class="attr">#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
</span><span class="kw">pub struct </span>BombData {
|
||||
pos: Vec3,
|
||||
<span class="attr">#[serde(rename = <span class="string">"isPlanted"</span>)]
|
||||
</span>is_planted: bool
|
||||
}
|
||||
|
||||
<span class="attr">#[allow(dead_code)]
|
||||
</span><span class="kw">impl </span>BombData {
|
||||
<span class="kw">pub fn </span>new(pos: Vec3, is_planted: bool) -> BombData {
|
||||
BombData { pos, is_planted }
|
||||
}
|
||||
}
|
||||
|
||||
<span class="attr">#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
</span><span class="kw">pub enum </span>EntityData {
|
||||
Player(PlayerData),
|
||||
Bomb(BombData)
|
||||
}
|
||||
|
||||
<span class="attr">#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
</span><span class="kw">pub struct </span>RadarData {
|
||||
ingame: bool,
|
||||
|
||||
<span class="attr">#[serde(rename = <span class="string">"mapName"</span>)]
|
||||
</span>map_name: String,
|
||||
|
||||
<span class="attr">#[serde(rename(serialize = <span class="string">"entityData"</span>))]
|
||||
</span>player_data: Vec<EntityData>,
|
||||
|
||||
<span class="comment">//#[serde(rename(serialize = "localYaw"))]
|
||||
//local_yaw: f32,
|
||||
</span>}
|
||||
|
||||
<span class="kw">impl </span>RadarData {
|
||||
<span class="kw">pub fn </span>new(ingame: bool, map_name: String, player_data: Vec<EntityData>) -> RadarData {
|
||||
RadarData { ingame, map_name, player_data }
|
||||
}
|
||||
|
||||
<span class="doccomment">/// Returns empty RadarData, it's also the same data that gets sent to clients when not ingame
|
||||
</span><span class="kw">pub fn </span>empty() -> RadarData {
|
||||
RadarData {
|
||||
ingame: <span class="bool-val">false</span>,
|
||||
map_name: String::new(),
|
||||
player_data: Vec::new(),
|
||||
}
|
||||
}
|
||||
}</code></pre></div></section></main></body></html>
|
||||
170
docs/src/radarflow/dma/cache.rs.html
Normal file
170
docs/src/radarflow/dma/cache.rs.html
Normal file
@@ -0,0 +1,170 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `radarflow/src/dma/cache.rs`."><title>cache.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="radarflow" data-themes="" data-resource-suffix="" data-rustdoc-version="1.74.0 (79e9716c9 2023-11-13)" data-channel="1.74.0" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../src-files.js"></script><script defer src="../../../static.files/main-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><a class="sub-logo-container" href="../../../radarflow/index.html"><img class="rust-logo" src="../../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
|
||||
<a href="#2" id="2">2</a>
|
||||
<a href="#3" id="3">3</a>
|
||||
<a href="#4" id="4">4</a>
|
||||
<a href="#5" id="5">5</a>
|
||||
<a href="#6" id="6">6</a>
|
||||
<a href="#7" id="7">7</a>
|
||||
<a href="#8" id="8">8</a>
|
||||
<a href="#9" id="9">9</a>
|
||||
<a href="#10" id="10">10</a>
|
||||
<a href="#11" id="11">11</a>
|
||||
<a href="#12" id="12">12</a>
|
||||
<a href="#13" id="13">13</a>
|
||||
<a href="#14" id="14">14</a>
|
||||
<a href="#15" id="15">15</a>
|
||||
<a href="#16" id="16">16</a>
|
||||
<a href="#17" id="17">17</a>
|
||||
<a href="#18" id="18">18</a>
|
||||
<a href="#19" id="19">19</a>
|
||||
<a href="#20" id="20">20</a>
|
||||
<a href="#21" id="21">21</a>
|
||||
<a href="#22" id="22">22</a>
|
||||
<a href="#23" id="23">23</a>
|
||||
<a href="#24" id="24">24</a>
|
||||
<a href="#25" id="25">25</a>
|
||||
<a href="#26" id="26">26</a>
|
||||
<a href="#27" id="27">27</a>
|
||||
<a href="#28" id="28">28</a>
|
||||
<a href="#29" id="29">29</a>
|
||||
<a href="#30" id="30">30</a>
|
||||
<a href="#31" id="31">31</a>
|
||||
<a href="#32" id="32">32</a>
|
||||
<a href="#33" id="33">33</a>
|
||||
<a href="#34" id="34">34</a>
|
||||
<a href="#35" id="35">35</a>
|
||||
<a href="#36" id="36">36</a>
|
||||
<a href="#37" id="37">37</a>
|
||||
<a href="#38" id="38">38</a>
|
||||
<a href="#39" id="39">39</a>
|
||||
<a href="#40" id="40">40</a>
|
||||
<a href="#41" id="41">41</a>
|
||||
<a href="#42" id="42">42</a>
|
||||
<a href="#43" id="43">43</a>
|
||||
<a href="#44" id="44">44</a>
|
||||
<a href="#45" id="45">45</a>
|
||||
<a href="#46" id="46">46</a>
|
||||
<a href="#47" id="47">47</a>
|
||||
<a href="#48" id="48">48</a>
|
||||
<a href="#49" id="49">49</a>
|
||||
<a href="#50" id="50">50</a>
|
||||
<a href="#51" id="51">51</a>
|
||||
<a href="#52" id="52">52</a>
|
||||
<a href="#53" id="53">53</a>
|
||||
<a href="#54" id="54">54</a>
|
||||
<a href="#55" id="55">55</a>
|
||||
<a href="#56" id="56">56</a>
|
||||
<a href="#57" id="57">57</a>
|
||||
<a href="#58" id="58">58</a>
|
||||
<a href="#59" id="59">59</a>
|
||||
<a href="#60" id="60">60</a>
|
||||
<a href="#61" id="61">61</a>
|
||||
<a href="#62" id="62">62</a>
|
||||
<a href="#63" id="63">63</a>
|
||||
<a href="#64" id="64">64</a>
|
||||
<a href="#65" id="65">65</a>
|
||||
<a href="#66" id="66">66</a>
|
||||
<a href="#67" id="67">67</a>
|
||||
<a href="#68" id="68">68</a>
|
||||
<a href="#69" id="69">69</a>
|
||||
<a href="#70" id="70">70</a>
|
||||
<a href="#71" id="71">71</a>
|
||||
<a href="#72" id="72">72</a>
|
||||
<a href="#73" id="73">73</a>
|
||||
<a href="#74" id="74">74</a>
|
||||
<a href="#75" id="75">75</a>
|
||||
<a href="#76" id="76">76</a>
|
||||
<a href="#77" id="77">77</a>
|
||||
<a href="#78" id="78">78</a>
|
||||
<a href="#79" id="79">79</a>
|
||||
<a href="#80" id="80">80</a>
|
||||
<a href="#81" id="81">81</a>
|
||||
<a href="#82" id="82">82</a>
|
||||
<a href="#83" id="83">83</a>
|
||||
<a href="#84" id="84">84</a>
|
||||
<a href="#85" id="85">85</a>
|
||||
</pre></div><pre class="rust"><code><span class="kw">use </span>csflow::{memflow::Address, enums::PlayerType};
|
||||
|
||||
<span class="attr">#[derive(Clone, Copy)]
|
||||
</span><span class="kw">pub enum </span>CachedEntity {
|
||||
Bomb {ptr: Address},
|
||||
Player {ptr: Address, player_type: PlayerType},
|
||||
}
|
||||
|
||||
<span class="kw">pub struct </span>Cache {
|
||||
timestamp: std::time::Instant,
|
||||
entity_cache: Vec<CachedEntity>,
|
||||
map_name: String,
|
||||
entity_list: Address,
|
||||
}
|
||||
|
||||
<span class="kw">impl </span>Cache {
|
||||
<span class="kw">pub fn </span>is_valid(<span class="kw-2">&</span><span class="self">self</span>) -> bool {
|
||||
<span class="kw">if </span><span class="self">self</span>.timestamp.elapsed() > std::time::Duration::from_millis(<span class="number">250</span>) {
|
||||
<span class="kw">return </span><span class="bool-val">false</span>;
|
||||
}
|
||||
|
||||
<span class="bool-val">true
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub fn </span>new_invalid() -> Cache {
|
||||
Cache {
|
||||
timestamp: std::time::Instant::now().checked_sub(std::time::Duration::from_millis(<span class="number">500</span>)).unwrap(),
|
||||
entity_cache: Vec::new(),
|
||||
map_name: String::new(),
|
||||
entity_list: Address::null(),
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">pub fn </span>entity_cache(<span class="kw-2">&mut </span><span class="self">self</span>) -> Vec<CachedEntity> {
|
||||
<span class="self">self</span>.entity_cache.clone()
|
||||
}
|
||||
|
||||
<span class="kw">pub fn </span>map_name(<span class="kw-2">&</span><span class="self">self</span>) -> String {
|
||||
<span class="self">self</span>.map_name.clone()
|
||||
}
|
||||
|
||||
<span class="kw">pub fn </span>entity_list(<span class="kw-2">&</span><span class="self">self</span>) -> Address {
|
||||
<span class="self">self</span>.entity_list
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">pub struct </span>CacheBuilder {
|
||||
entity_cache: <span class="prelude-ty">Option</span><Vec<CachedEntity>>,
|
||||
map_name: <span class="prelude-ty">Option</span><String>,
|
||||
entity_list: <span class="prelude-ty">Option</span><Address>
|
||||
}
|
||||
|
||||
<span class="kw">impl </span>CacheBuilder {
|
||||
<span class="kw">pub fn </span>new() -> CacheBuilder {
|
||||
CacheBuilder {
|
||||
entity_cache: <span class="prelude-val">None</span>,
|
||||
map_name: <span class="prelude-val">None</span>,
|
||||
entity_list: <span class="prelude-val">None</span>,
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">pub fn </span>entity_cache(<span class="kw-2">mut </span><span class="self">self</span>, entity_cache: Vec<CachedEntity>) -> CacheBuilder {
|
||||
<span class="self">self</span>.entity_cache = <span class="prelude-val">Some</span>(entity_cache);
|
||||
<span class="self">self
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub fn </span>map_name(<span class="kw-2">mut </span><span class="self">self</span>, map_name: String) -> CacheBuilder {
|
||||
<span class="self">self</span>.map_name = <span class="prelude-val">Some</span>(map_name);
|
||||
<span class="self">self
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub fn </span>entity_list(<span class="kw-2">mut </span><span class="self">self</span>, entity_list: Address) -> CacheBuilder {
|
||||
<span class="self">self</span>.entity_list = <span class="prelude-val">Some</span>(entity_list);
|
||||
<span class="self">self
|
||||
</span>}
|
||||
|
||||
<span class="kw">pub fn </span>build(<span class="self">self</span>) -> anyhow::Result<Cache> {
|
||||
<span class="prelude-val">Ok</span>(Cache {
|
||||
timestamp: std::time::Instant::now(),
|
||||
entity_cache: <span class="self">self</span>.entity_cache.ok_or(<span class="macro">anyhow::anyhow!</span>(<span class="string">"entity_cache not set on builder"</span>))<span class="question-mark">?</span>,
|
||||
map_name: <span class="self">self</span>.map_name.ok_or(<span class="macro">anyhow::anyhow!</span>(<span class="string">"map_name not set on builder"</span>))<span class="question-mark">?</span>,
|
||||
entity_list: <span class="self">self</span>.entity_list.ok_or(<span class="macro">anyhow::anyhow!</span>(<span class="string">"entity_list not set on builder"</span>))<span class="question-mark">?</span>,
|
||||
})
|
||||
}
|
||||
}</code></pre></div></section></main></body></html>
|
||||
405
docs/src/radarflow/dma/mod.rs.html
Normal file
405
docs/src/radarflow/dma/mod.rs.html
Normal file
@@ -0,0 +1,405 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `radarflow/src/dma/mod.rs`."><title>mod.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="radarflow" data-themes="" data-resource-suffix="" data-rustdoc-version="1.74.0 (79e9716c9 2023-11-13)" data-channel="1.74.0" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../src-files.js"></script><script defer src="../../../static.files/main-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><a class="sub-logo-container" href="../../../radarflow/index.html"><img class="rust-logo" src="../../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
|
||||
<a href="#2" id="2">2</a>
|
||||
<a href="#3" id="3">3</a>
|
||||
<a href="#4" id="4">4</a>
|
||||
<a href="#5" id="5">5</a>
|
||||
<a href="#6" id="6">6</a>
|
||||
<a href="#7" id="7">7</a>
|
||||
<a href="#8" id="8">8</a>
|
||||
<a href="#9" id="9">9</a>
|
||||
<a href="#10" id="10">10</a>
|
||||
<a href="#11" id="11">11</a>
|
||||
<a href="#12" id="12">12</a>
|
||||
<a href="#13" id="13">13</a>
|
||||
<a href="#14" id="14">14</a>
|
||||
<a href="#15" id="15">15</a>
|
||||
<a href="#16" id="16">16</a>
|
||||
<a href="#17" id="17">17</a>
|
||||
<a href="#18" id="18">18</a>
|
||||
<a href="#19" id="19">19</a>
|
||||
<a href="#20" id="20">20</a>
|
||||
<a href="#21" id="21">21</a>
|
||||
<a href="#22" id="22">22</a>
|
||||
<a href="#23" id="23">23</a>
|
||||
<a href="#24" id="24">24</a>
|
||||
<a href="#25" id="25">25</a>
|
||||
<a href="#26" id="26">26</a>
|
||||
<a href="#27" id="27">27</a>
|
||||
<a href="#28" id="28">28</a>
|
||||
<a href="#29" id="29">29</a>
|
||||
<a href="#30" id="30">30</a>
|
||||
<a href="#31" id="31">31</a>
|
||||
<a href="#32" id="32">32</a>
|
||||
<a href="#33" id="33">33</a>
|
||||
<a href="#34" id="34">34</a>
|
||||
<a href="#35" id="35">35</a>
|
||||
<a href="#36" id="36">36</a>
|
||||
<a href="#37" id="37">37</a>
|
||||
<a href="#38" id="38">38</a>
|
||||
<a href="#39" id="39">39</a>
|
||||
<a href="#40" id="40">40</a>
|
||||
<a href="#41" id="41">41</a>
|
||||
<a href="#42" id="42">42</a>
|
||||
<a href="#43" id="43">43</a>
|
||||
<a href="#44" id="44">44</a>
|
||||
<a href="#45" id="45">45</a>
|
||||
<a href="#46" id="46">46</a>
|
||||
<a href="#47" id="47">47</a>
|
||||
<a href="#48" id="48">48</a>
|
||||
<a href="#49" id="49">49</a>
|
||||
<a href="#50" id="50">50</a>
|
||||
<a href="#51" id="51">51</a>
|
||||
<a href="#52" id="52">52</a>
|
||||
<a href="#53" id="53">53</a>
|
||||
<a href="#54" id="54">54</a>
|
||||
<a href="#55" id="55">55</a>
|
||||
<a href="#56" id="56">56</a>
|
||||
<a href="#57" id="57">57</a>
|
||||
<a href="#58" id="58">58</a>
|
||||
<a href="#59" id="59">59</a>
|
||||
<a href="#60" id="60">60</a>
|
||||
<a href="#61" id="61">61</a>
|
||||
<a href="#62" id="62">62</a>
|
||||
<a href="#63" id="63">63</a>
|
||||
<a href="#64" id="64">64</a>
|
||||
<a href="#65" id="65">65</a>
|
||||
<a href="#66" id="66">66</a>
|
||||
<a href="#67" id="67">67</a>
|
||||
<a href="#68" id="68">68</a>
|
||||
<a href="#69" id="69">69</a>
|
||||
<a href="#70" id="70">70</a>
|
||||
<a href="#71" id="71">71</a>
|
||||
<a href="#72" id="72">72</a>
|
||||
<a href="#73" id="73">73</a>
|
||||
<a href="#74" id="74">74</a>
|
||||
<a href="#75" id="75">75</a>
|
||||
<a href="#76" id="76">76</a>
|
||||
<a href="#77" id="77">77</a>
|
||||
<a href="#78" id="78">78</a>
|
||||
<a href="#79" id="79">79</a>
|
||||
<a href="#80" id="80">80</a>
|
||||
<a href="#81" id="81">81</a>
|
||||
<a href="#82" id="82">82</a>
|
||||
<a href="#83" id="83">83</a>
|
||||
<a href="#84" id="84">84</a>
|
||||
<a href="#85" id="85">85</a>
|
||||
<a href="#86" id="86">86</a>
|
||||
<a href="#87" id="87">87</a>
|
||||
<a href="#88" id="88">88</a>
|
||||
<a href="#89" id="89">89</a>
|
||||
<a href="#90" id="90">90</a>
|
||||
<a href="#91" id="91">91</a>
|
||||
<a href="#92" id="92">92</a>
|
||||
<a href="#93" id="93">93</a>
|
||||
<a href="#94" id="94">94</a>
|
||||
<a href="#95" id="95">95</a>
|
||||
<a href="#96" id="96">96</a>
|
||||
<a href="#97" id="97">97</a>
|
||||
<a href="#98" id="98">98</a>
|
||||
<a href="#99" id="99">99</a>
|
||||
<a href="#100" id="100">100</a>
|
||||
<a href="#101" id="101">101</a>
|
||||
<a href="#102" id="102">102</a>
|
||||
<a href="#103" id="103">103</a>
|
||||
<a href="#104" id="104">104</a>
|
||||
<a href="#105" id="105">105</a>
|
||||
<a href="#106" id="106">106</a>
|
||||
<a href="#107" id="107">107</a>
|
||||
<a href="#108" id="108">108</a>
|
||||
<a href="#109" id="109">109</a>
|
||||
<a href="#110" id="110">110</a>
|
||||
<a href="#111" id="111">111</a>
|
||||
<a href="#112" id="112">112</a>
|
||||
<a href="#113" id="113">113</a>
|
||||
<a href="#114" id="114">114</a>
|
||||
<a href="#115" id="115">115</a>
|
||||
<a href="#116" id="116">116</a>
|
||||
<a href="#117" id="117">117</a>
|
||||
<a href="#118" id="118">118</a>
|
||||
<a href="#119" id="119">119</a>
|
||||
<a href="#120" id="120">120</a>
|
||||
<a href="#121" id="121">121</a>
|
||||
<a href="#122" id="122">122</a>
|
||||
<a href="#123" id="123">123</a>
|
||||
<a href="#124" id="124">124</a>
|
||||
<a href="#125" id="125">125</a>
|
||||
<a href="#126" id="126">126</a>
|
||||
<a href="#127" id="127">127</a>
|
||||
<a href="#128" id="128">128</a>
|
||||
<a href="#129" id="129">129</a>
|
||||
<a href="#130" id="130">130</a>
|
||||
<a href="#131" id="131">131</a>
|
||||
<a href="#132" id="132">132</a>
|
||||
<a href="#133" id="133">133</a>
|
||||
<a href="#134" id="134">134</a>
|
||||
<a href="#135" id="135">135</a>
|
||||
<a href="#136" id="136">136</a>
|
||||
<a href="#137" id="137">137</a>
|
||||
<a href="#138" id="138">138</a>
|
||||
<a href="#139" id="139">139</a>
|
||||
<a href="#140" id="140">140</a>
|
||||
<a href="#141" id="141">141</a>
|
||||
<a href="#142" id="142">142</a>
|
||||
<a href="#143" id="143">143</a>
|
||||
<a href="#144" id="144">144</a>
|
||||
<a href="#145" id="145">145</a>
|
||||
<a href="#146" id="146">146</a>
|
||||
<a href="#147" id="147">147</a>
|
||||
<a href="#148" id="148">148</a>
|
||||
<a href="#149" id="149">149</a>
|
||||
<a href="#150" id="150">150</a>
|
||||
<a href="#151" id="151">151</a>
|
||||
<a href="#152" id="152">152</a>
|
||||
<a href="#153" id="153">153</a>
|
||||
<a href="#154" id="154">154</a>
|
||||
<a href="#155" id="155">155</a>
|
||||
<a href="#156" id="156">156</a>
|
||||
<a href="#157" id="157">157</a>
|
||||
<a href="#158" id="158">158</a>
|
||||
<a href="#159" id="159">159</a>
|
||||
<a href="#160" id="160">160</a>
|
||||
<a href="#161" id="161">161</a>
|
||||
<a href="#162" id="162">162</a>
|
||||
<a href="#163" id="163">163</a>
|
||||
<a href="#164" id="164">164</a>
|
||||
<a href="#165" id="165">165</a>
|
||||
<a href="#166" id="166">166</a>
|
||||
<a href="#167" id="167">167</a>
|
||||
<a href="#168" id="168">168</a>
|
||||
<a href="#169" id="169">169</a>
|
||||
<a href="#170" id="170">170</a>
|
||||
<a href="#171" id="171">171</a>
|
||||
<a href="#172" id="172">172</a>
|
||||
<a href="#173" id="173">173</a>
|
||||
<a href="#174" id="174">174</a>
|
||||
<a href="#175" id="175">175</a>
|
||||
<a href="#176" id="176">176</a>
|
||||
<a href="#177" id="177">177</a>
|
||||
<a href="#178" id="178">178</a>
|
||||
<a href="#179" id="179">179</a>
|
||||
<a href="#180" id="180">180</a>
|
||||
<a href="#181" id="181">181</a>
|
||||
<a href="#182" id="182">182</a>
|
||||
<a href="#183" id="183">183</a>
|
||||
<a href="#184" id="184">184</a>
|
||||
<a href="#185" id="185">185</a>
|
||||
<a href="#186" id="186">186</a>
|
||||
<a href="#187" id="187">187</a>
|
||||
<a href="#188" id="188">188</a>
|
||||
<a href="#189" id="189">189</a>
|
||||
<a href="#190" id="190">190</a>
|
||||
<a href="#191" id="191">191</a>
|
||||
<a href="#192" id="192">192</a>
|
||||
<a href="#193" id="193">193</a>
|
||||
<a href="#194" id="194">194</a>
|
||||
<a href="#195" id="195">195</a>
|
||||
<a href="#196" id="196">196</a>
|
||||
<a href="#197" id="197">197</a>
|
||||
<a href="#198" id="198">198</a>
|
||||
<a href="#199" id="199">199</a>
|
||||
<a href="#200" id="200">200</a>
|
||||
<a href="#201" id="201">201</a>
|
||||
<a href="#202" id="202">202</a>
|
||||
</pre></div><pre class="rust"><code><span class="kw">use </span>std::sync::Arc;
|
||||
|
||||
<span class="kw">use </span>csflow::{CheatCtx, Connector, memflow::Process, traits::{MemoryClass, BaseEntity}, enums::PlayerType, structs::{CBaseEntity, CPlayerController}};
|
||||
<span class="kw">use </span>tokio::{sync::RwLock, time::{Duration, Instant}};
|
||||
|
||||
<span class="kw">use crate</span>::{comms::{RadarData, EntityData, BombData, PlayerData}, dma::cache::CacheBuilder};
|
||||
|
||||
<span class="kw">use </span><span class="self">self</span>::cache::Cache;
|
||||
|
||||
<span class="kw">mod </span>cache;
|
||||
|
||||
<span class="kw">const </span>SECOND_AS_NANO: u64 = <span class="number">1000</span><span class="kw-2">*</span><span class="number">1000</span><span class="kw-2">*</span><span class="number">1000</span>;
|
||||
<span class="kw">static </span>ONCE: std::sync::Once = std::sync::Once::new();
|
||||
|
||||
<span class="kw">pub async fn </span>run(connector: Connector, pcileech_device: String, poll_rate: u16, data_lock: Arc<RwLock<RadarData>>) -> anyhow::Result<()> {
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>ctx = CheatCtx::setup(connector, pcileech_device)<span class="question-mark">?</span>;
|
||||
|
||||
<span class="macro">println!</span>(<span class="string">"---------------------------------------------------"</span>);
|
||||
<span class="macro">println!</span>(<span class="string">"Found cs2.exe at {:X}"</span>, ctx.process.info().address);
|
||||
<span class="macro">println!</span>(<span class="string">"Found engine module at cs2.exe+{:X}"</span>, ctx.engine_module.base);
|
||||
<span class="macro">println!</span>(<span class="string">"Found client module at cs2.exe+{:X}"</span>, ctx.client_module.base);
|
||||
<span class="macro">println!</span>(<span class="string">"---------------------------------------------------"</span>);
|
||||
|
||||
<span class="comment">// Avoid printing warnings and other stuff before the initial prints are complete
|
||||
</span>tokio::time::sleep(Duration::from_millis(<span class="number">500</span>)).<span class="kw">await</span>;
|
||||
|
||||
<span class="comment">// For poll rate timing
|
||||
</span><span class="kw">let </span>should_time = poll_rate != <span class="number">0</span>;
|
||||
|
||||
<span class="kw">let </span>target_interval = Duration::from_nanos(SECOND_AS_NANO / poll_rate <span class="kw">as </span>u64);
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>last_iteration_time = Instant::now();
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>missmatch_count = <span class="number">0</span>;
|
||||
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>cache = Cache::new_invalid();
|
||||
|
||||
<span class="kw">loop </span>{
|
||||
<span class="kw">if </span>ctx.process.state().is_dead() {
|
||||
<span class="kw">break</span>;
|
||||
}
|
||||
|
||||
<span class="kw">if </span>!cache.is_valid() {
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>cached_entities = Vec::new();
|
||||
|
||||
<span class="kw">let </span>globals = ctx.get_globals()<span class="question-mark">?</span>;
|
||||
<span class="kw">let </span>highest_index = ctx.highest_entity_index()<span class="question-mark">?</span>;
|
||||
<span class="kw">let </span>map_name = ctx.map_name(globals)<span class="question-mark">?</span>;
|
||||
<span class="kw">let </span>entity_list = ctx.get_entity_list()<span class="question-mark">?</span>;
|
||||
|
||||
<span class="kw">let </span>local = ctx.get_local()<span class="question-mark">?</span>;
|
||||
|
||||
<span class="kw">if </span>local.get_pawn(<span class="kw-2">&mut </span>ctx, entity_list)<span class="question-mark">?</span>.is_some() {
|
||||
cached_entities.push(cache::CachedEntity::Player {
|
||||
ptr: local.ptr(),
|
||||
player_type: PlayerType::Local
|
||||
});
|
||||
|
||||
<span class="kw">for </span>idx <span class="kw">in </span><span class="number">1</span>..=highest_index {
|
||||
<span class="kw">if let </span><span class="prelude-val">Some</span>(entity) = CBaseEntity::from_index(<span class="kw-2">&mut </span>ctx, entity_list, idx)<span class="question-mark">? </span>{
|
||||
|
||||
<span class="kw">let </span>class_name = entity.class_name(<span class="kw-2">&mut </span>ctx)<span class="question-mark">?</span>;
|
||||
|
||||
<span class="kw">match </span>class_name.as_str() {
|
||||
<span class="string">"weapon_c4" </span>=> {
|
||||
cached_entities.push(cache::CachedEntity::Bomb {
|
||||
ptr: entity.ptr()
|
||||
})
|
||||
},
|
||||
<span class="string">"cs_player_controller" </span>=> {
|
||||
<span class="kw">let </span>controller = entity.to_player_controller();
|
||||
|
||||
<span class="kw">let </span>player_type = {
|
||||
<span class="kw">match </span>controller.get_player_type(<span class="kw-2">&mut </span>ctx, <span class="kw-2">&</span>local)<span class="question-mark">? </span>{
|
||||
<span class="prelude-val">Some</span>(t) => {
|
||||
<span class="kw">if </span>t == PlayerType::Spectator { <span class="kw">continue </span>} <span class="kw">else </span>{ t }
|
||||
},
|
||||
<span class="prelude-val">None </span>=> { <span class="kw">continue </span>},
|
||||
}
|
||||
};
|
||||
|
||||
cached_entities.push(cache::CachedEntity::Player {
|
||||
ptr: entity.ptr(),
|
||||
player_type,
|
||||
})
|
||||
}
|
||||
<span class="kw">_ </span>=> {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cache = CacheBuilder::new()
|
||||
.entity_cache(cached_entities)
|
||||
.entity_list(entity_list)
|
||||
.map_name(map_name)
|
||||
.build()<span class="question-mark">?</span>;
|
||||
|
||||
<span class="macro">log::debug!</span>(<span class="string">"Rebuilt cache."</span>);
|
||||
}
|
||||
|
||||
<span class="kw">if </span>ctx.network_is_ingame()<span class="question-mark">? </span>{
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>radar_data = Vec::with_capacity(<span class="number">64</span>);
|
||||
|
||||
<span class="kw">if </span>ctx.is_bomb_planted()<span class="question-mark">? </span>{
|
||||
<span class="kw">let </span>bomb = ctx.get_plantedc4()<span class="question-mark">?</span>;
|
||||
<span class="kw">let </span>bomb_pos = bomb.pos(<span class="kw-2">&mut </span>ctx)<span class="question-mark">?</span>;
|
||||
radar_data.push(
|
||||
EntityData::Bomb(BombData::new(
|
||||
bomb_pos,
|
||||
<span class="bool-val">true
|
||||
</span>))
|
||||
);
|
||||
}
|
||||
|
||||
<span class="kw">for </span>cached_data <span class="kw">in </span>cache.entity_cache() {
|
||||
<span class="kw">match </span>cached_data {
|
||||
cache::CachedEntity::Bomb { ptr } => {
|
||||
<span class="kw">if </span>ctx.is_bomb_dropped()<span class="question-mark">? </span>{
|
||||
<span class="kw">let </span>bomb_entity = CBaseEntity::new(ptr);
|
||||
<span class="kw">let </span>pos = bomb_entity.pos(<span class="kw-2">&mut </span>ctx)<span class="question-mark">?</span>;
|
||||
|
||||
radar_data.push(
|
||||
EntityData::Bomb(
|
||||
BombData::new(
|
||||
pos,
|
||||
<span class="bool-val">false
|
||||
</span>)
|
||||
)
|
||||
);
|
||||
}
|
||||
},
|
||||
cache::CachedEntity::Player { ptr, player_type } => {
|
||||
<span class="kw">let </span>controller = CPlayerController::new(ptr);
|
||||
<span class="kw">if let </span><span class="prelude-val">Some</span>(pawn) = controller.get_pawn(<span class="kw-2">&mut </span>ctx, cache.entity_list())<span class="question-mark">? </span>{
|
||||
<span class="kw">if </span>pawn.is_alive(<span class="kw-2">&mut </span>ctx)<span class="question-mark">? </span>{
|
||||
<span class="kw">let </span>pos = pawn.pos(<span class="kw-2">&mut </span>ctx)<span class="question-mark">?</span>;
|
||||
<span class="kw">let </span>yaw = pawn.angles(<span class="kw-2">&mut </span>ctx)<span class="question-mark">?</span>.y;
|
||||
<span class="kw">let </span>has_bomb = pawn.has_c4(<span class="kw-2">&mut </span>ctx, cache.entity_list())<span class="question-mark">?</span>;
|
||||
|
||||
radar_data.push(
|
||||
EntityData::Player(
|
||||
PlayerData::new(
|
||||
pos,
|
||||
yaw,
|
||||
player_type,
|
||||
has_bomb
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>data = data_lock.write().<span class="kw">await</span>;
|
||||
<span class="kw">if </span>cache.map_name() == <span class="string">"<empty>" </span>|| cache.map_name().is_empty() {
|
||||
<span class="kw-2">*</span>data = RadarData::empty()
|
||||
} <span class="kw">else </span>{
|
||||
<span class="kw-2">*</span>data = RadarData::new(<span class="bool-val">true</span>, cache.map_name(), radar_data)
|
||||
}
|
||||
} <span class="kw">else </span>{
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>data = data_lock.write().<span class="kw">await</span>;
|
||||
<span class="kw-2">*</span>data = RadarData::empty()
|
||||
}
|
||||
|
||||
<span class="kw">if </span>should_time {
|
||||
<span class="kw">let </span>elapsed = last_iteration_time.elapsed();
|
||||
|
||||
<span class="kw">let </span>remaining = <span class="kw">match </span>target_interval.checked_sub(elapsed) {
|
||||
<span class="prelude-val">Some</span>(t) => t,
|
||||
<span class="prelude-val">None </span>=> {
|
||||
<span class="kw">if </span>missmatch_count >= <span class="number">25 </span>{
|
||||
ONCE.call_once(|| {
|
||||
<span class="macro">log::warn!</span>(<span class="string">"Remaining time till target interval was negative more than 25 times"</span>);
|
||||
<span class="macro">log::warn!</span>(<span class="string">"You should decrease your poll rate."</span>);
|
||||
<span class="macro">log::warn!</span>(<span class="string">"elapsed: {}ns"</span>, elapsed.as_nanos());
|
||||
<span class="macro">log::warn!</span>(<span class="string">"target: {}ns"</span>, target_interval.as_nanos());
|
||||
});
|
||||
} <span class="kw">else </span>{
|
||||
missmatch_count += <span class="number">1</span>;
|
||||
}
|
||||
Duration::from_nanos(<span class="number">0</span>)
|
||||
},
|
||||
};
|
||||
|
||||
<span class="attr">#[cfg(target_os = <span class="string">"linux"</span>)]
|
||||
</span>tokio_timerfd::sleep(remaining).<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
|
||||
<span class="attr">#[cfg(not(target_os = <span class="string">"linux"</span>))]
|
||||
</span>tokio::time::sleep(remaining).<span class="kw">await</span>;
|
||||
|
||||
<span class="macro">log::info!</span>(<span class="string">"poll rate: {:.2}Hz"</span>, SECOND_AS_NANO <span class="kw">as </span>f64 / last_iteration_time.elapsed().as_nanos() <span class="kw">as </span>f64);
|
||||
<span class="macro">log::trace!</span>(<span class="string">"elapsed: {}ns"</span>, elapsed.as_nanos());
|
||||
<span class="macro">log::trace!</span>(<span class="string">"target: {}ns"</span>, target_interval.as_nanos());
|
||||
<span class="macro">log::trace!</span>(<span class="string">"missmatch count: {}"</span>, missmatch_count);
|
||||
|
||||
last_iteration_time = Instant::now();
|
||||
}
|
||||
}
|
||||
|
||||
<span class="prelude-val">Ok</span>(())
|
||||
}
|
||||
</code></pre></div></section></main></body></html>
|
||||
115
docs/src/radarflow/main.rs.html
Normal file
115
docs/src/radarflow/main.rs.html
Normal file
@@ -0,0 +1,115 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `radarflow/src/main.rs`."><title>main.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="radarflow" data-themes="" data-resource-suffix="" data-rustdoc-version="1.74.0 (79e9716c9 2023-11-13)" data-channel="1.74.0" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../src-files.js"></script><script defer src="../../static.files/main-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><a class="sub-logo-container" href="../../radarflow/index.html"><img class="rust-logo" src="../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
|
||||
<a href="#2" id="2">2</a>
|
||||
<a href="#3" id="3">3</a>
|
||||
<a href="#4" id="4">4</a>
|
||||
<a href="#5" id="5">5</a>
|
||||
<a href="#6" id="6">6</a>
|
||||
<a href="#7" id="7">7</a>
|
||||
<a href="#8" id="8">8</a>
|
||||
<a href="#9" id="9">9</a>
|
||||
<a href="#10" id="10">10</a>
|
||||
<a href="#11" id="11">11</a>
|
||||
<a href="#12" id="12">12</a>
|
||||
<a href="#13" id="13">13</a>
|
||||
<a href="#14" id="14">14</a>
|
||||
<a href="#15" id="15">15</a>
|
||||
<a href="#16" id="16">16</a>
|
||||
<a href="#17" id="17">17</a>
|
||||
<a href="#18" id="18">18</a>
|
||||
<a href="#19" id="19">19</a>
|
||||
<a href="#20" id="20">20</a>
|
||||
<a href="#21" id="21">21</a>
|
||||
<a href="#22" id="22">22</a>
|
||||
<a href="#23" id="23">23</a>
|
||||
<a href="#24" id="24">24</a>
|
||||
<a href="#25" id="25">25</a>
|
||||
<a href="#26" id="26">26</a>
|
||||
<a href="#27" id="27">27</a>
|
||||
<a href="#28" id="28">28</a>
|
||||
<a href="#29" id="29">29</a>
|
||||
<a href="#30" id="30">30</a>
|
||||
<a href="#31" id="31">31</a>
|
||||
<a href="#32" id="32">32</a>
|
||||
<a href="#33" id="33">33</a>
|
||||
<a href="#34" id="34">34</a>
|
||||
<a href="#35" id="35">35</a>
|
||||
<a href="#36" id="36">36</a>
|
||||
<a href="#37" id="37">37</a>
|
||||
<a href="#38" id="38">38</a>
|
||||
<a href="#39" id="39">39</a>
|
||||
<a href="#40" id="40">40</a>
|
||||
<a href="#41" id="41">41</a>
|
||||
<a href="#42" id="42">42</a>
|
||||
<a href="#43" id="43">43</a>
|
||||
<a href="#44" id="44">44</a>
|
||||
<a href="#45" id="45">45</a>
|
||||
<a href="#46" id="46">46</a>
|
||||
<a href="#47" id="47">47</a>
|
||||
<a href="#48" id="48">48</a>
|
||||
<a href="#49" id="49">49</a>
|
||||
<a href="#50" id="50">50</a>
|
||||
<a href="#51" id="51">51</a>
|
||||
<a href="#52" id="52">52</a>
|
||||
<a href="#53" id="53">53</a>
|
||||
<a href="#54" id="54">54</a>
|
||||
<a href="#55" id="55">55</a>
|
||||
<a href="#56" id="56">56</a>
|
||||
<a href="#57" id="57">57</a>
|
||||
</pre></div><pre class="rust"><code><span class="kw">use </span>std::sync::Arc;
|
||||
|
||||
<span class="kw">use </span>clap::Parser;
|
||||
<span class="kw">use </span>cli::Cli;
|
||||
<span class="kw">use </span>comms::RadarData;
|
||||
<span class="kw">use </span>tokio::sync::RwLock;
|
||||
|
||||
<span class="kw">mod </span>comms;
|
||||
<span class="kw">mod </span>cli;
|
||||
|
||||
<span class="kw">mod </span>dma;
|
||||
<span class="kw">mod </span>websocket;
|
||||
|
||||
<span class="attr">#[tokio::main]
|
||||
</span><span class="kw">async fn </span>main() -> anyhow::Result<()> {
|
||||
<span class="kw">let </span>cli = Cli::parse();
|
||||
|
||||
simple_logger::SimpleLogger::new()
|
||||
.with_level(cli.loglevel.into())
|
||||
.init()
|
||||
.expect(<span class="string">"Initializing logger"</span>);
|
||||
|
||||
<span class="kw">let </span>rwlock = Arc::new(
|
||||
RwLock::new(
|
||||
RadarData::empty()
|
||||
)
|
||||
);
|
||||
|
||||
<span class="kw">let </span>rwlock_clone = rwlock.clone();
|
||||
<span class="kw">let </span>dma_handle = tokio::spawn(<span class="kw">async move </span>{
|
||||
<span class="kw">if let </span><span class="prelude-val">Err</span>(err) = dma::run(cli.connector, cli.pcileech_device, cli.poll_rate, rwlock_clone).<span class="kw">await </span>{
|
||||
<span class="macro">log::error!</span>(<span class="string">"Error in dma thread: [{}]"</span>, err.to_string());
|
||||
}
|
||||
});
|
||||
|
||||
tokio::spawn(<span class="kw">async move </span>{
|
||||
<span class="kw">let </span>future = websocket::run(cli.web_path, cli.port, rwlock);
|
||||
|
||||
<span class="kw">if let </span><span class="prelude-val">Ok</span>(my_local_ip) = local_ip_address::local_ip() {
|
||||
<span class="kw">let </span>address = <span class="macro">format!</span>(<span class="string">"http://{}:{}"</span>, my_local_ip, cli.port);
|
||||
<span class="macro">println!</span>(<span class="string">"Launched webserver at {}"</span>, address);
|
||||
} <span class="kw">else </span>{
|
||||
<span class="kw">let </span>address = <span class="macro">format!</span>(<span class="string">"http://0.0.0.0:{}"</span>, cli.port);
|
||||
<span class="macro">println!</span>(<span class="string">"launched webserver at! {}"</span>, address);
|
||||
}
|
||||
|
||||
<span class="kw">if let </span><span class="prelude-val">Err</span>(err) = future.<span class="kw">await </span>{
|
||||
<span class="macro">log::error!</span>(<span class="string">"Error in websocket server: [{}]"</span>, err.to_string());
|
||||
}
|
||||
});
|
||||
|
||||
<span class="kw">if let </span><span class="prelude-val">Err</span>(err) = dma_handle.<span class="kw">await </span>{
|
||||
<span class="macro">log::error!</span>(<span class="string">"Error when waiting for dma thread: {}"</span>, err.to_string());
|
||||
}
|
||||
|
||||
<span class="prelude-val">Ok</span>(())
|
||||
}
|
||||
</code></pre></div></section></main></body></html>
|
||||
132
docs/src/radarflow/websocket.rs.html
Normal file
132
docs/src/radarflow/websocket.rs.html
Normal file
@@ -0,0 +1,132 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `radarflow/src/websocket.rs`."><title>websocket.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="radarflow" data-themes="" data-resource-suffix="" data-rustdoc-version="1.74.0 (79e9716c9 2023-11-13)" data-channel="1.74.0" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../src-files.js"></script><script defer src="../../static.files/main-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><a class="sub-logo-container" href="../../radarflow/index.html"><img class="rust-logo" src="../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
|
||||
<a href="#2" id="2">2</a>
|
||||
<a href="#3" id="3">3</a>
|
||||
<a href="#4" id="4">4</a>
|
||||
<a href="#5" id="5">5</a>
|
||||
<a href="#6" id="6">6</a>
|
||||
<a href="#7" id="7">7</a>
|
||||
<a href="#8" id="8">8</a>
|
||||
<a href="#9" id="9">9</a>
|
||||
<a href="#10" id="10">10</a>
|
||||
<a href="#11" id="11">11</a>
|
||||
<a href="#12" id="12">12</a>
|
||||
<a href="#13" id="13">13</a>
|
||||
<a href="#14" id="14">14</a>
|
||||
<a href="#15" id="15">15</a>
|
||||
<a href="#16" id="16">16</a>
|
||||
<a href="#17" id="17">17</a>
|
||||
<a href="#18" id="18">18</a>
|
||||
<a href="#19" id="19">19</a>
|
||||
<a href="#20" id="20">20</a>
|
||||
<a href="#21" id="21">21</a>
|
||||
<a href="#22" id="22">22</a>
|
||||
<a href="#23" id="23">23</a>
|
||||
<a href="#24" id="24">24</a>
|
||||
<a href="#25" id="25">25</a>
|
||||
<a href="#26" id="26">26</a>
|
||||
<a href="#27" id="27">27</a>
|
||||
<a href="#28" id="28">28</a>
|
||||
<a href="#29" id="29">29</a>
|
||||
<a href="#30" id="30">30</a>
|
||||
<a href="#31" id="31">31</a>
|
||||
<a href="#32" id="32">32</a>
|
||||
<a href="#33" id="33">33</a>
|
||||
<a href="#34" id="34">34</a>
|
||||
<a href="#35" id="35">35</a>
|
||||
<a href="#36" id="36">36</a>
|
||||
<a href="#37" id="37">37</a>
|
||||
<a href="#38" id="38">38</a>
|
||||
<a href="#39" id="39">39</a>
|
||||
<a href="#40" id="40">40</a>
|
||||
<a href="#41" id="41">41</a>
|
||||
<a href="#42" id="42">42</a>
|
||||
<a href="#43" id="43">43</a>
|
||||
<a href="#44" id="44">44</a>
|
||||
<a href="#45" id="45">45</a>
|
||||
<a href="#46" id="46">46</a>
|
||||
<a href="#47" id="47">47</a>
|
||||
<a href="#48" id="48">48</a>
|
||||
<a href="#49" id="49">49</a>
|
||||
<a href="#50" id="50">50</a>
|
||||
<a href="#51" id="51">51</a>
|
||||
<a href="#52" id="52">52</a>
|
||||
<a href="#53" id="53">53</a>
|
||||
<a href="#54" id="54">54</a>
|
||||
<a href="#55" id="55">55</a>
|
||||
<a href="#56" id="56">56</a>
|
||||
<a href="#57" id="57">57</a>
|
||||
<a href="#58" id="58">58</a>
|
||||
<a href="#59" id="59">59</a>
|
||||
<a href="#60" id="60">60</a>
|
||||
<a href="#61" id="61">61</a>
|
||||
<a href="#62" id="62">62</a>
|
||||
<a href="#63" id="63">63</a>
|
||||
<a href="#64" id="64">64</a>
|
||||
<a href="#65" id="65">65</a>
|
||||
<a href="#66" id="66">66</a>
|
||||
</pre></div><pre class="rust"><code><span class="kw">use </span>std::{sync::Arc, path::PathBuf};
|
||||
|
||||
<span class="kw">use </span>axum::{
|
||||
extract::{ws::{WebSocketUpgrade, WebSocket, Message}, State},
|
||||
response::Response,
|
||||
routing::get,
|
||||
Router,
|
||||
};
|
||||
|
||||
<span class="kw">use </span>tokio::sync::RwLock;
|
||||
<span class="kw">use </span>tower_http::services::ServeDir;
|
||||
|
||||
<span class="kw">use </span><span class="kw">crate</span>::comms::RadarData;
|
||||
|
||||
<span class="attr">#[derive(Clone)]
|
||||
</span><span class="kw">struct </span>AppState {
|
||||
data_lock: Arc<RwLock<RadarData>>
|
||||
}
|
||||
|
||||
<span class="kw">async fn </span>ws_handler(ws: WebSocketUpgrade, State(state): State<AppState>) -> Response {
|
||||
ws.on_upgrade(|socket| handle_socket(socket, state))
|
||||
}
|
||||
|
||||
<span class="kw">async fn </span>handle_socket(<span class="kw-2">mut </span>socket: WebSocket, state: AppState) {
|
||||
<span class="kw">while let </span><span class="prelude-val">Some</span>(msg) = socket.recv().<span class="kw">await </span>{
|
||||
<span class="kw">if let </span><span class="prelude-val">Ok</span>(msg) = msg {
|
||||
<span class="kw">if </span>msg == Message::Text(<span class="string">"requestInfo"</span>.to_string()) {
|
||||
<span class="kw">let </span>data = state.data_lock.read().<span class="kw">await</span>;
|
||||
|
||||
<span class="kw">let </span>str = {
|
||||
<span class="kw">match </span>serde_json::to_string(<span class="kw-2">&*</span>data) {
|
||||
<span class="prelude-val">Ok</span>(json) => json,
|
||||
<span class="prelude-val">Err</span>(e) => {
|
||||
<span class="macro">log::error!</span>(<span class="string">"Could not serialize data into json: {}"</span>, e.to_string());
|
||||
<span class="macro">log::error!</span>(<span class="string">"Sending \"error\" instead"</span>);
|
||||
<span class="string">"error"</span>.to_string()
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
<span class="kw">if </span>socket.send(Message::Text(str)).<span class="kw">await</span>.is_err() {
|
||||
<span class="comment">// client disconnected
|
||||
</span><span class="kw">return</span>;
|
||||
}
|
||||
}
|
||||
} <span class="kw">else </span>{
|
||||
<span class="comment">// client disconnected
|
||||
</span><span class="kw">return</span>;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">pub async fn </span>run(path: PathBuf, port: u16, data_lock: Arc<RwLock<RadarData>>) -> anyhow::Result<()> {
|
||||
<span class="kw">let </span>app = Router::new()
|
||||
.nest_service(<span class="string">"/"</span>, ServeDir::new(path))
|
||||
.route(<span class="string">"/ws"</span>, get(ws_handler))
|
||||
.with_state(AppState { data_lock });
|
||||
|
||||
<span class="kw">let </span>address = <span class="macro">format!</span>(<span class="string">"0.0.0.0:{}"</span>, port);
|
||||
|
||||
axum::Server::bind(<span class="kw-2">&</span>address.parse()<span class="question-mark">?</span>)
|
||||
.serve(app.into_make_service())
|
||||
.<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
|
||||
<span class="prelude-val">Ok</span>(())
|
||||
}</code></pre></div></section></main></body></html>
|
||||
Reference in New Issue
Block a user