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

Remote GI #3073

Merged
merged 1 commit into from
Dec 17, 2023
Merged

Remote GI #3073

merged 1 commit into from
Dec 17, 2023

Conversation

garrettjoecox
Copy link
Contributor

@garrettjoecox garrettjoecox commented Jul 8, 2023

This PR succeeds #2538

The main goal here is to generalize the pattern of communicating over TCP sockets to 3rd party servers.

Summary

  • Makes some adjustments to how ParameterizedGameInteractionEffect are handled
  • Splits the TCP incoming/outgoing messages into a GameInteractor_Remote class
  • Add an example implementation GameInteractor_Sail which uses the remote (Paired with the repo here https://github.com/HarbourMasters/sail)
  • Updates the CrowdControl implementation to use the remote

Another example of the remote usage can be seen in Anchor (garrettjoecox#52)

Build Artifacts

@Malkierian
Copy link
Contributor

It looks like the Switch build is failing on SDL_net inclusion. Does the Switch toolchain not have an equivalent?

@garrettjoecox
Copy link
Contributor Author

It looks like the Switch build is failing on SDL_net inclusion. Does the Switch toolchain not have an equivalent?

No idea. Unless someone else wants to step in, this week I'm going to work towards just disabling all networking stuff on switch, similar to how we did before

@garrettjoecox
Copy link
Contributor Author

Note to self: Crowd control isn’t working properly on this branch. Effects go through but are all refunded on the CrowdControl side

@garrettjoecox
Copy link
Contributor Author

The issues this caused with crowd control have been resolved 👍

Comment on lines -35 to -45
- name: Install latest SDL_net
if: ${{ !vars.LINUX_RUNNER }}
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
wget https://www.libsdl.org/projects/SDL_net/release/SDL2_net-2.2.0.tar.gz
tar -xzf SDL2_net-2.2.0.tar.gz
cd SDL2_net-2.2.0
./configure
make -j 10
sudo make install
sudo cp -av /usr/local/lib/libSDL* /lib/x86_64-linux-gnu/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wild that this has been in that step for so long

@@ -333,13 +282,13 @@ CrowdControl::Effect* CrowdControl::ParseMessage(char payload[512]) {
effect->category = kEffectCatDamageTaken;
effect->timeRemaining = 30000;
effect->giEffect = new GameInteractionEffect::ModifyDefenseModifier();
effect->giEffect->parameters[0] = 2;
dynamic_cast<ParameterizedGameInteractionEffect*>(effect->giEffect)->parameters[0] = 2;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generally good practice to throw a != nullptr in there somewhere when dynamic casting, can be a follow up PR if you want to make a code cleanup issue for it

Co-authored-by: David Chavez <david@dcvz.io>
@garrettjoecox garrettjoecox merged commit 86044a1 into HarbourMasters:develop Dec 17, 2023
8 checks passed
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.

4 participants