コード例 #1
0
        public static async void AttachLocationAsync(
            this SessionModel session,
            params ReportMessage.Session.Event[] items)
        {
            ReportMessage.Location location = Config.Global.CustomLocation;
            if (location == null)
            {
                session.AsyncLocationLock = true;
                await ServiceData.WaitExposeAsync();

                ReportMessage.Location location1 = location;
                location = await ServiceData.LocationTracker.Provide();

                session.AsyncLocationLock = false;
            }
            ((IEnumerable <ReportMessage.Session.Event>)items).ForEach <ReportMessage.Session.Event>((Action <ReportMessage.Session.Event>)(i => i.location = location));
        }
コード例 #2
0
ファイル: Config.cs プロジェクト: mvdfun/skymp5-launcher
 public void SetCustomLocation(YandexMetrica.Location location)
 {
     ReportMessage.Location location1;
     if (location != null)
     {
         location1 = new ReportMessage.Location()
         {
             lat       = location.Lat,
             lon       = location.Lon,
             speed     = new uint?(location.Speed),
             altitude  = new int?(location.Altitude),
             direction = new uint?(location.Direction),
             precision = new uint?(location.Precision),
             timestamp = new ulong?(location.Timestamp)
         }
     }
     ;
     else
     {
         location1 = (ReportMessage.Location)null;
     }
     this.CustomLocation = location1;
 }