Exemplo n.º 1
0
        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());
        }
Exemplo n.º 2
0
        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());
        }
Exemplo n.º 3
0
 private void OnPlayerInvitedToNewGame(InvitationEventArgs e)
 {
     PlayerInvitedToNewGame?.Invoke(this, e);
 }
Exemplo n.º 4
0
 private void OnGameInvitationDeclined(InvitationEventArgs e)
 {
     GameInvitationDeclined?.Invoke(this, e);
 }
Exemplo n.º 5
0
 public static Message InvitePlayerToGame(InvitationEventArgs e) => new Message(Server.MessageType.GameInvitation, e);
Exemplo n.º 6
0
 public static Message InvitationDeclined(InvitationEventArgs e) => new Message(Server.MessageType.GameInvitationDeclined, e);
Exemplo n.º 7
0
 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);
     }
 }
Exemplo n.º 8
0
 protected void RaiseGotInvitation(InvitationEventArgs e)
 {
     Dispatch(GotInvitation, e);
 }
Exemplo n.º 9
0
 protected virtual void OnGotInvitation(InvitationEventArgs e)
 {
     RaiseGotInvitation(e);
 }