예제 #1
0
 private void ConfigureConnectionApproval(ConnectionApprovalMessage msg, NetIncomingMessage im)
 {
     if (msg.Password == password)
     {
         im.SenderConnection.Approve();
         server.Out.Info($"Approved {msg.Sender} with Endpoint: {im.SenderEndPoint}");
         im.SenderConnection.Tag = msg.Sender;
         server.SendToAllExcept(server.ConvertToOutgoingMessage(
                                    new ServerNotification {
             Message = $"Say welcome to {msg.Sender}"
         }),
                                im.SenderConnection);
     }
     else
     {
         im.SenderConnection.Deny();
         server.Out.Info($"Denied {msg.Sender} : {im.SenderEndPoint}");
     }
 }