Apian-Framework / BeamGameCode

Engine-independent C# core game code for Beam
0 stars 0 forks source link

Use async/await-style Apian and P2pNet APIs #25

Closed jimkberry closed 3 years ago

jimkberry commented 3 years ago

This is actually a sort of driver issue for adding async API calls to both P2pNet and Apian.

Game code should:

Not Apian or P2pNet, but:

jimkberry commented 3 years ago

Added async JoinBeamNet() to BeamApplication using TaskCompletionSource - but that was wrong. I shoulda done that to ApianGameNet.JoinNetwork() , and just added await to the Beam-specific stuff.

jimkberry commented 3 years ago

Other than WaitForGameNameSelectionAsync() these are all dealt with in Apian.Net#20

JoinNetWorkAsync() happens in GameNet rather than as a part of the P2pNet library - and maybe that should change in the future if P2pNet is ever used by a non-Apian client (but until the I don't care.)