using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using GameMessage;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Server.DB.Redis;
using StackExchange.Redis;
using MrWu.Debug;
using Server.Core;

namespace Server
{
    public static class IPLocation
    {
        public static async void UpdateDevice(DeviceInfo deviceInfo, string ip)
        {
            IPManager.IpInfo ipInfo = await IPManager.Instance.GetIpInfoAsync(ip);
            if (ipInfo != null)
            {
                deviceInfo.address = ipInfo.Address;
                deviceInfo.district = ipInfo.District;
                deviceInfo.province = ipInfo.Province;
                deviceInfo.jingdu = ipInfo.Longitude;
                deviceInfo.weidu = ipInfo.Latitude;
            }
        }
    }
}