示例#1
0
 internal void OnAuthenticated(NetConnection con, UserHandle handle)
 {
     _awaitingActions.Enqueue(() => {
         var uID      = con.RemoteUniqueIdentifier;
         Handles[uID] = handle;
         _connections.Add(Handles[uID], con);
         Authenticated?.Invoke(this, new ConnectionEventArgs(Handles[uID]));
     });
 }
示例#2
0
 public AuthenticationStatus Authenticate(NetIncomingMessage msg, out UserHandle handle)
 {
     handle = new UserHandle()
     {
         UserID       = 0,
         ConnectionID = msg.SenderConnection.RemoteUniqueIdentifier
     };
     Authenticated?.Invoke(this, handle);
     return(AuthenticationStatus.OK);
 }
 public AuthenticationStatus Authenticate(NetIncomingMessage msg, out UserHandle handle)
 {
     handle = default(UserHandle);
     return(AuthenticationStatus.OK);
 }
示例#4
0
 public void Send(UserHandle handle, Packets.Packet p)
 {
     p.Connection = handle.ConnectionID;
     Sent?.Invoke(this, p);
 }
示例#5
0
 public ConnectionEventArgs(UserHandle sender, string data = "")
 {
     Data   = data;
     Sender = sender;
 }