Skip to content

Commit

Permalink
archive
Browse files Browse the repository at this point in the history
  • Loading branch information
trippyone committed May 30, 2024
1 parent 1cb1d89 commit 60f5a39
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Fika.Core/Networking/FikaClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ protected async void Start()

if (_netClient.ConnectedPeersCount == 0)
{
_netClient.Stop();

EFT.UI.ConsoleScreen.LogWarning("Connection to Stun endpoint failed, falling back to public ip");

GetHostRequest body = new(CoopHandler.GetServerId());
Expand Down
3 changes: 2 additions & 1 deletion Fika.Core/Networking/FikaServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ public async void Start()
IPv6Enabled = false,
DisconnectTimeout = FikaPlugin.ConnectionTimeout.Value * 1000,
UseNativeSockets = FikaPlugin.NativeSockets.Value,
EnableStatistics = true
EnableStatistics = true,
AllowPeerAddressChange = true
};

var natPunchServer = new FikaNatPunchServer(_netServer);
Expand Down
4 changes: 2 additions & 2 deletions Fika.Core/Networking/NatPunch/FikaNatPunchServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ public void Close()

private void WebSocket_OnOpen(object sender, EventArgs e)
{
//Logger.LogInfo($"Connected to NAT Helper");
EFT.UI.ConsoleScreen.Log("Connected to FikaNatPunchService as server");
}

Expand All @@ -83,6 +82,7 @@ private void WebSocket_OnError(object sender, ErrorEventArgs e)

private void ProcessMessage(string data)
{
EFT.UI.ConsoleScreen.Log($"data: {data}");
var msgObj = GetRequestObject(data);

var msgObjType = msgObj.GetType().Name;
Expand Down Expand Up @@ -117,7 +117,7 @@ private void ProcessMessage(string data)
private void Send<T1>(T1 o)
{
var data = JsonConvert.SerializeObject(o);
Send(data);
_webSocket.Send(data);
}

private object GetRequestObject(string data)
Expand Down
2 changes: 2 additions & 0 deletions Fika.Core/UI/Custom/MatchMakerUIScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ private IEnumerator JoinMatch(string profileId, string serverId, Button button)
yield return new WaitForSeconds(0.1f);
} while (!success && attempts < 50);

success = true;

if (!success)
{
Singleton<PreloaderUI>.Instance.ShowCriticalErrorScreen(
Expand Down

0 comments on commit 60f5a39

Please sign in to comment.