public override void Process(IXFireClient context) { var recipient = context.Server.Database.QueryUser(Username); var invite = new FriendInvite(context.User.Username, context.User.Nickname, Message); invite.Process(context); context.Server.Database.InsertFriendRequest(context.User, Username, Message); var recipientSession = context.Server.GetSession(recipient); recipientSession?.SendMessage(invite); }
public override async Task Process(IXFireClient context) { var recipient = await context.Server.Database.QueryUser(Username); var invite = new FriendInvite(context.User.Username, context.User.Nickname, Message); await invite.Process(context); await context.Server.Database.InsertFriendRequest(context.User, recipient, Message); var recipientSession = context.Server.GetSession(recipient); if (recipientSession != null) { await recipientSession.SendMessage(invite); } }
public void Process(Context context) { var recipient = context.Server.Database.QueryUser(Username); var invite = new FriendInvite(context.User.Username, context.User.Nickname, Message); invite.Process(context); context.Server.Database.InsertFriendRequest(context.User, Username, Message); var recipientSession = context.Server.GetSession(recipient); if (recipientSession != null) { recipientSession.SendMessage(invite); } }