Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matchcomms support #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Matchcomms support #15

wants to merge 1 commit into from

Conversation

Darxeal
Copy link
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