private static void HandleAkep2Message2(SksMessageReceivedEventArgs sksMessageReceivedEventArgs) { var user = GetUserByIpAndPort(sksMessageReceivedEventArgs.FromIp, sksMessageReceivedEventArgs.FromPort); Akep2 akep2; lock (akep2sLock) { akep2 = Akep2s.FirstOrDefault(a => a.User == user); } if (akep2 == null) { return; } var message = Akep2Message2.FromString(sksMessageReceivedEventArgs.Message, user.Key); akep2.NonceB = message.NonceB; var newMessage = new Akep2Message3(MyUsername, akep2.NonceB, user.Key); user.SendMessage(newMessage.ToString()); akep2.IncrementMessageCount(); }
public static Akep2 GetAkep2(User user) { lock (akep2sLock) { return(Akep2s.FirstOrDefault(a => a.User == user)); } }
private static void HandleAkep2Message3(SksMessageReceivedEventArgs sksMessageReceivedEventArgs) { var user = GetUserByIpAndPort(sksMessageReceivedEventArgs.FromIp, sksMessageReceivedEventArgs.FromPort); Akep2 akep2; lock (akep2sLock) { akep2 = Akep2s.FirstOrDefault(a => a.User == user); } if (akep2 == null) { return; } var message = Akep2Message3.FromString(sksMessageReceivedEventArgs.Message, user.Key); akep2.IncrementMessageCount(); }