예제 #1
0
        private static void BroadcastEventRecived(byte[] dataBytes)
        {
            var data = dataBytes.ToObject <BroadcastData>();

            switch (data.Action)
            {
            case BroadcastType.Unknown:
                UnknownReceived.Invoke(data.IP);
                break;

            case BroadcastType.Login:
                LoginReceived.Invoke(data.IP);
                break;

            case BroadcastType.Logout:
                LogoutReceived.Invoke(data.IP);
                break;

            case BroadcastType.StillOnline:
                StillOnlineReceived.Invoke(data.IP);
                break;

            default:
                break;
            }
        }
 protected virtual void OnLoginReceived(LoginEventArgs e)
 {
     LoginReceived?.Invoke(this, e);
 }