yep
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
@implements IDisposable;
|
||||
|
||||
@using Shogi.Contracts.Socket;
|
||||
@using Shogi.Contracts.Types;
|
||||
@using System.ComponentModel.DataAnnotations;
|
||||
@using System.Net;
|
||||
@@ -98,7 +99,7 @@
|
||||
{
|
||||
base.OnInitialized();
|
||||
ShogiSocket.OnSessionCreated += FetchSessions;
|
||||
ShogiSocket.OnSessionJoined += FetchSessions;
|
||||
ShogiSocket.OnSessionJoined += OnSessionJoined_FetchSessions;
|
||||
Account.LoginChangedEvent += LoginChangedEvent_FetchSessions;
|
||||
}
|
||||
|
||||
@@ -109,6 +110,9 @@
|
||||
activeSession = s;
|
||||
ActiveSessionChanged?.Invoke(s);
|
||||
}
|
||||
|
||||
Task OnSessionJoined_FetchSessions(SessionJoinedByPlayerSocketMessage args) => FetchSessions();
|
||||
|
||||
Task LoginChangedEvent_FetchSessions(LoginEventArgs args)
|
||||
{
|
||||
if (args.User != null)
|
||||
@@ -137,7 +141,7 @@
|
||||
public void Dispose()
|
||||
{
|
||||
ShogiSocket.OnSessionCreated -= FetchSessions;
|
||||
ShogiSocket.OnSessionJoined -= FetchSessions;
|
||||
ShogiSocket.OnSessionJoined -= OnSessionJoined_FetchSessions;
|
||||
Account.LoginChangedEvent -= LoginChangedEvent_FetchSessions;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user