Player Invites #10

Merged
Moonbase merged 7 commits from invites into master 2025-03-18 16:25:23 -07:00
Showing only changes of commit bfc5b6a974 - Show all commits

View File

@ -45,12 +45,14 @@ public class MMOClientService : IHostedService
SFSClient.Connect(SFSConfig);
SFSClient.AddEventListener(SFSEvent.CONNECTION, OnConnectionEstablished);
SFSClient.AddEventListener(SFSEvent.CONNECTION_LOST, OnConnectionLost);
SFSClient.AddEventListener(SFSEvent.LOGIN, OnLogin);
// return completed task (SmartFox seems to be completely synchronous)
return Task.CompletedTask;
}
public Task SetRoomVarForRoom(int roomId, RoomVariable var)
{
if (IsLoggedIn)
@ -100,6 +102,12 @@ public class MMOClientService : IHostedService
}
}
private void OnConnectionLost(BaseEvent evt)
{
Console.WriteLine($"Connection To The MMO Server Was Lost. Reason - {(string)evt.Params["reason"]}");
Console.WriteLine("MMO Service Currently Not Ready.\nThis Required A Full API Restart For Realtime Communication To Be Reestablished.");
}
private void OnLogin(BaseEvent evt)
{
CurrentUser = (User)evt.Params["user"];