rocketleaguesdk 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/examples/basic.ts CHANGED
@@ -1,47 +1,23 @@
1
1
  /**
2
2
  * Basic SDK Usage Example
3
3
  *
4
- * This example demonstrates step-by-step how to read game data
5
- * from Rocket League using the generated SDK types.
6
- *
7
- * All memory reading logic is inline so you can see exactly how it works.
4
+ * This example demonstrates how to read game data from Rocket League
5
+ * using the generated SDK types and offsets.
8
6
  *
9
7
  * Run with: bun run examples/basic.ts
10
8
  */
11
9
 
12
10
  import Memory from 'bun-memory';
13
11
 
14
- // Import SDK types for type safety
12
+ // Import SDK types and offsets
15
13
  import type { Structs } from '..';
16
-
17
- // =============================================================================
18
- // OFFSETS (from SDK generation)
19
- // =============================================================================
20
-
21
- // GNames and GObjects offsets discovered during SDK generation
22
- // See: types/offsets.ts for the full list
23
- const GNAMES_OFFSET = 0x23ed570n;
24
- const GOBJECTS_OFFSET = 0x23ed5b8n;
25
-
26
- // UObject layout (UE3 structure)
27
- // These are the byte offsets to each field within a UObject
28
- const UObject = {
29
- Outer: 0x40, // Pointer to outer object (package/owner)
30
- Name: 0x48, // FName index - lookup in GNames to get string name
31
- Class: 0x50, // Pointer to the UClass that describes this object
32
- } as const;
33
-
34
- // FNameEntry layout - structure in GNames array
35
- const FNameEntry = {
36
- Name: 0x18, // Offset to the actual name string (wide string)
37
- } as const;
14
+ import { GNames, GObjects, UObject, FNameEntry } from '../types/offsets';
38
15
 
39
16
  // CarComponent_Boost_TA offsets
40
17
  // Found in: classes/TAGame.ts - search for "CarComponent_Boost_TA"
41
- // These offsets define where boost-related data is stored in the component
42
18
  const BoostOffsets = {
43
19
  CurrentBoostAmount: 0x0338, // float - current boost (0.0 to MaxBoostAmount)
44
- MaxBoostAmount: 0x032C, // float - maximum boost capacity
20
+ MaxBoostAmount: 0x032c, // float - maximum boost capacity
45
21
  } as const;
46
22
 
47
23
  // =============================================================================
@@ -59,8 +35,8 @@ if (!module) {
59
35
  const base = module.base;
60
36
 
61
37
  // Calculate absolute addresses from base + offset
62
- const gNamesPtr = rl.uPtr(base + GNAMES_OFFSET);
63
- const gObjectsPtr = rl.uPtr(base + GOBJECTS_OFFSET);
38
+ const gNamesPtr = rl.uPtr(base + GNames);
39
+ const gObjectsPtr = rl.uPtr(base + GObjects);
64
40
 
65
41
  console.log('=== Rocket League SDK Example ===');
66
42
  console.log(`Base: 0x${base.toString(16).toUpperCase()}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rocketleaguesdk",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "TypeScript SDK for Rocket League - Auto-generated type definitions",
5
5
  "type": "module",
6
6
  "main": "index.ts",
@@ -97,4 +97,4 @@
97
97
  "bun-memory": "^1",
98
98
  "typescript": "^5"
99
99
  }
100
- }
100
+ }
package/types/offsets.ts CHANGED
@@ -7,10 +7,10 @@
7
7
  */
8
8
 
9
9
  /** GNames offset from module base */
10
- export const GNAMES_OFFSET = 0x23ed570n;
10
+ export const GNames = 0x23ed570n;
11
11
 
12
12
  /** GObjects offset from module base */
13
- export const GOBJECTS_OFFSET = 0x23ed5b8n;
13
+ export const GObjects = 0x23ed5b8n;
14
14
 
15
15
  /** UObject layout offsets */
16
16
  export const UObject = {