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

Networking API #163

Merged
merged 2 commits into from
Aug 10, 2020
Merged

Networking API #163

merged 2 commits into from
Aug 10, 2020

Conversation

xiaoxiao921
Copy link
Member

The original implementation was made by Rein, I just made the integration into R2API.
This API aim to fix multiples problems :

  • One less dependency for mod makers to add for their mods when they need networking (they usually relied on minirpclib, which, even if it was working great, made installation of mods a bit harder)
  • Add some builts in networked messages that can be expanded later on, the goal is to provide ready to use networking messages that facilitate the making of a mod, exemple : BuffMessage or DamageMessage, it becomes just a matter of
var buffMessage = new BuffMessage(body, buff, stacks, duration);
buffMessage.Send(NetworkDestination.Server);

to properly network and synchronize buffs across a multiplayer game
There is another kind of network message that can be used in this API : Request
It's basically a message that is associated with an answer to it.
The target will reply back to the caller as soon as it receive the message.
It's made using generics so it provides type safety while writing the code.

var sendRequest = new ExamplePing { Integer = 69 };
sendRequest.Send<ExamplePing, ExamplePingReply>(NetworkDestination.Server);

@xiaoxiao921
Copy link
Member Author

This API requires the UnityEngine.UNETModule.dll for it to work, should I give you a stubbed dll for it ?

@tristanmcpherson
Copy link
Member

tristanmcpherson commented Aug 4, 2020 via email

@tristanmcpherson tristanmcpherson merged commit 064d1e8 into risk-of-thunder:master Aug 10, 2020
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.

2 participants