Skip to content

Matchcomms support#15

Open
Darxeal wants to merge 1 commit intokipje13:masterfrom
Darxeal:matchcomms
Open

Matchcomms support#15
Darxeal wants to merge 1 commit intokipje13:masterfrom
Darxeal:matchcomms

Conversation

@Darxeal
Copy link
Copy Markdown
Contributor

@Darxeal Darxeal commented Dec 12, 2021

Getting and sending messages should be as simple as

std::vector<nlohmann::json> messages = matchcomms->GetIncomingBroadcast();

nlohmann::json message = ...
matchcomms->Send(message);

Libraries used are https://github.com/dhbaird/easywsclient and https://github.com/nlohmann/json/

This also should be backwards compatible with the example bot, meaning if someone updates their RLBotCPP submodule, it won't break their bot. However the matchcomms pointer would be nullptr, to actually use matchcomms they need to change one line in CppPythonAgent.py:

message = f"add\n{self.name}\n{self.team}\n{self.index}\n{game_interface.get_dll_directory()}\n{self.matchcomms_root.geturl()}"

I will add that in a PR when this is merged.

I'm not 100% sure about everything so feedback is welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant