Skip to content

Commit dde1a04

Browse files
committed
BakkesMod 132 SDK
1 parent 0cd39a7 commit dde1a04

File tree

11 files changed

+98
-1
lines changed

11 files changed

+98
-1
lines changed

bakkes_patchplugin.py

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
"""Script to hotswap plugin from bakkesmod process.
2+
3+
1. Connects to BakkesMod rcon
4+
2. Unloads plugin
5+
3. Replaces DLL file
6+
4. Loads plugin
7+
8+
TODO: save config?
9+
"""
10+
import sys, os, shutil, websockets, time
11+
import asyncio
12+
13+
bakkesmod_plugin_folder = "F:/SteamLibrary/steamapps/common/rocketleague/Binaries/Win32/bakkesmod/plugins/"
14+
bakkesmod_server = 'ws://127.0.0.1:9002'
15+
rcon_password = 'password'
16+
swap_file = ""
17+
18+
def replace_plugin_file():
19+
filename = os.path.basename(swap_file)
20+
dst_file = bakkesmod_plugin_folder + filename
21+
print(dst_file)
22+
23+
if os.path.exists(dst_file):
24+
os.remove(dst_file)
25+
shutil.copyfile(swap_file, dst_file)
26+
27+
async def main_loop():
28+
try:
29+
async with websockets.connect(bakkesmod_server, timeout=.1) as websocket:
30+
await websocket.send('rcon_password ' + rcon_password)
31+
auth_status = await websocket.recv()
32+
assert auth_status == 'authyes'
33+
34+
filename = os.path.basename(swap_file)
35+
plugin_name = filename[0:filename.index('.')]
36+
print("Copying " + filename + "")
37+
await websocket.send("plugin unload " + plugin_name)
38+
time.sleep(0.1)
39+
replace_plugin_file()
40+
time.sleep(0.1)
41+
await websocket.send("plugin load " + plugin_name)
42+
except:
43+
replace_plugin_file()
44+
45+
46+
if __name__ == '__main__':
47+
if len(sys.argv) == 1:
48+
exit()
49+
50+
swap_file = sys.argv[1]
51+
asyncio.get_event_loop().run_until_complete(main_loop())
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#pragma once
2+
template<class T> class ArrayWrapper;
3+
template<typename T> class StructArrayWrapper;
4+
#include "WrapperStructs.h"
5+
#include "ControllerWrapper.h"
6+
7+
class BAKKESMOD_PLUGIN_IMPORT AIControllerWrapper : public ControllerWrapper {
8+
public:
9+
CONSTRUCTORS(AIControllerWrapper)
10+
11+
private:
12+
PIMPL
13+
};
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#pragma once
2+
template<class T> class ArrayWrapper;
3+
template<typename T> class StructArrayWrapper;
4+
#include "WrapperStructs.h"
5+
#include "./Engine/ActorWrapper.h"
6+
7+
class PlayerReplicationInfoWrapper;
8+
9+
class BAKKESMOD_PLUGIN_IMPORT ControllerWrapper : public ActorWrapper {
10+
public:
11+
CONSTRUCTORS(ControllerWrapper)
12+
13+
PlayerReplicationInfoWrapper GetPlayerReplicationInfo();
14+
15+
private:
16+
PIMPL
17+
};

include/bakkesmod/wrappers/GameEvent/GameEventWrapper.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ template<class T> class ArrayWrapper;
33
template<typename T> class StructArrayWrapper;
44
#include "../WrapperStructs.h"
55
#include ".././Engine/ActorWrapper.h"
6+
class ControllerWrapper;
67
class PlayerControllerWrapper;
78
class CarWrapper;
89
class UnrealStringWrapper;
@@ -63,6 +64,7 @@ class BAKKESMOD_PLUGIN_IMPORT GameEventWrapper : public ActorWrapper {
6364
void SetActivator(PlayerControllerWrapper newActivator);
6465
CarWrapper GetActivatorCar();
6566
void SetActivatorCar(CarWrapper newActivatorCar);
67+
ArrayWrapper<ControllerWrapper> GetPlayers();
6668
ArrayWrapper<PriWrapper> GetPRIs();
6769
ArrayWrapper<CarWrapper> GetCars();
6870
ArrayWrapper<PlayerControllerWrapper> GetLocalPlayers();

include/bakkesmod/wrappers/GameEvent/ServerWrapper.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ template<class T> class ArrayWrapper;
33
template<typename T> class StructArrayWrapper;
44
#include "../WrapperStructs.h"
55
#include ".././GameEvent/TeamGameEventWrapper.h"
6+
class ControllerWrapper;
67
class PlayerControllerWrapper;
78
class CarWrapper;
89
class ReplayDirectorWrapper;
@@ -220,6 +221,7 @@ class BAKKESMOD_PLUGIN_IMPORT ServerWrapper : public TeamGameEventWrapper {
220221
BallWrapper SpawnBall2(Vector& SpawnLoc, unsigned long bWake, unsigned long bSpawnCannon, std::string BallArch);
221222
int GetTotalScore();
222223
void HandleCarSet(PriWrapper InPRI);
224+
void RemovePlayer(ControllerWrapper Player);
223225
void RemovePRI(PriWrapper PRI);
224226
void AddPRI(PriWrapper PRI);
225227
void OnMatchWinnerSet();

include/bakkesmod/wrappers/GameObject/VehicleWrapper.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ template<class T> class ArrayWrapper;
33
template<typename T> class StructArrayWrapper;
44
#include "../WrapperStructs.h"
55
#include ".././GameObject/RBActorWrapper.h"
6+
class AIControllerWrapper;
67
class PlayerControllerWrapper;
78
class BoostWrapper;
89
class DodgeComponentWrapper;
@@ -46,6 +47,7 @@ class BAKKESMOD_PLUGIN_IMPORT VehicleWrapper : public RBActorWrapper {
4647
void SetReplicatedThrottle(unsigned char newReplicatedThrottle);
4748
unsigned char GetReplicatedSteer();
4849
void SetReplicatedSteer(unsigned char newReplicatedSteer);
50+
AIControllerWrapper GetAIController();
4951
PlayerControllerWrapper GetPlayerController();
5052
void SetPlayerController(PlayerControllerWrapper newPlayerController);
5153
PriWrapper GetPRI();

include/bakkesmod/wrappers/PlayerControllerWrapper.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ template<class T> class ArrayWrapper;
33
template<typename T> class StructArrayWrapper;
44
#include "WrapperStructs.h"
55
#include "./Engine/ActorWrapper.h"
6+
//#include "ControllerWrapper.h"
67
class BoostWrapper;
78
class UnrealStringWrapper;
89
class CarWrapper;
@@ -15,7 +16,7 @@ class PriWrapper;
1516
class EngineTAWrapper;
1617
class PlayerReplicationInfoWrapper;
1718

18-
class BAKKESMOD_PLUGIN_IMPORT PlayerControllerWrapper : public ActorWrapper {
19+
class BAKKESMOD_PLUGIN_IMPORT PlayerControllerWrapper : public ActorWrapper /*ControllerWrapper*/ {
1920
public:
2021
CONSTRUCTORS(PlayerControllerWrapper)
2122

include/bakkesmod/wrappers/UniqueIDWrapper.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ class BAKKESMOD_PLUGIN_IMPORT UniqueIDWrapper
2323
Will be the EpicID if nonempty. Uid otherwise
2424
*/
2525
std::string str() const;
26+
/// <summary>
27+
/// Returns the id in the following format platform|accountId|splitScreenId
28+
/// </summary>
29+
/// <returns></returns>
30+
std::string GetIdString() const;
2631
public:
2732
/*
2833
Not 100% with the internals here, think it depends on what the game reads.

include/bakkesmod/wrappers/arraywrapper.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class GoalWrapper;
2424
class BoostPickupWrapper;
2525
class SampleHistoryWrapper;
2626
class StatGraphWrapper;
27+
class ControllerWrapper;
2728
class PlayerControllerWrapper;
2829

2930
class SequenceWrapper;
@@ -109,6 +110,7 @@ template class BAKKESMOD_PLUGIN_IMPORT ArrayWrapper<GoalWrapper>;
109110
template class BAKKESMOD_PLUGIN_IMPORT ArrayWrapper<BoostPickupWrapper>;
110111
template class BAKKESMOD_PLUGIN_IMPORT ArrayWrapper<SampleHistoryWrapper>;
111112
template class BAKKESMOD_PLUGIN_IMPORT ArrayWrapper<StatGraphWrapper>;
113+
template class BAKKESMOD_PLUGIN_IMPORT ArrayWrapper<ControllerWrapper>;
112114
template class BAKKESMOD_PLUGIN_IMPORT ArrayWrapper<PlayerControllerWrapper>;
113115
template class BAKKESMOD_PLUGIN_IMPORT ArrayWrapper<wchar_t>;
114116
template class BAKKESMOD_PLUGIN_IMPORT ArrayWrapper<SequenceWrapper>;

include/bakkesmod/wrappers/includes.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@
7171
#include "./GameObject/TeamWrapper.h"
7272
#include "./GameObject/VehiclePickupWrapper.h"
7373
#include "./GameObject/VehicleWrapper.h"
74+
#include "./AIControllerWrapper.h"
75+
#include "./ControllerWrapper.h"
7476
#include "./PlayerControllerWrapper.h"
7577
#include "./ReplayServerWrapper.h"
7678
#include "./GameObject/ClubDetailsWrapper.h"

lib/pluginsdk.lib

9.43 KB
Binary file not shown.

0 commit comments

Comments
 (0)