private void OnPlayerInvitedToNewGame(object sender, InvitationEventArgs e) { var conn = _activeSessions.FirstOrDefault(x => x.Key.Identity.Name == e.Invitee.Name).Value; var msg = Message.InvitePlayerToGame(e); conn?.Send(msg.ToJson()); }
private void OnGameInvitationDeclined(object sender, InvitationEventArgs e) { var conn = _activeSessions.FirstOrDefault(x => x.Key.Identity.Name == e.Inviter.Name).Value; var msg = Message.InvitationDeclined(e); conn?.Send(msg.ToJson()); }
private void OnPlayerInvitedToNewGame(InvitationEventArgs e) { PlayerInvitedToNewGame?.Invoke(this, e); }
private void OnGameInvitationDeclined(InvitationEventArgs e) { GameInvitationDeclined?.Invoke(this, e); }
public static Message InvitePlayerToGame(InvitationEventArgs e) => new Message(Server.MessageType.GameInvitation, e);
public static Message InvitationDeclined(InvitationEventArgs e) => new Message(Server.MessageType.GameInvitationDeclined, e);
private static void OnInvitation(object sender, InvitationEventArgs invitationEventArgs) { var information = MethodBase.GetCurrentMethod().Name; try { var serverUser = GetServerUser(sender); Trace.WriteLine(information, serverUser.ToString()); } catch (Exception ex) { Console.WriteLine("{0} exception {1}", information, ex.Message); } }
protected void RaiseGotInvitation(InvitationEventArgs e) { Dispatch(GotInvitation, e); }
protected virtual void OnGotInvitation(InvitationEventArgs e) { RaiseGotInvitation(e); }