to adjust socket server require ip

This commit is contained in:
zhongchao
2021-11-21 10:02:34 +08:00
parent 6cf6a0c9f1
commit 1bf3f5aea4

View File

@@ -11,6 +11,7 @@ import com.elegant.network.RequestOptions;
import com.elegant.network.utils.GsonUtil;
import com.elegant.network.utils.NetworkSdkUtils;
import com.elegant.utils.CommonUtils;
import com.mogo.cloud.httpdns.bean.HttpDnsSimpleLocation;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.cloud.socket.third.core.SocketConfig;
import com.mogo.cloud.socket.third.core.network.model.MessageCallbackData;
@@ -70,9 +71,17 @@ public class RequestManager {
sRequestingAddress = true;
double lat = 0;
double lon = 0;
HttpDnsSimpleLocation httpDnsSimpleLocation = MoGoAiCloudClientConfig.getInstance().getIHttpDnsCurrentLocation().getCurrentLocation();
if (httpDnsSimpleLocation != null) {
lat = httpDnsSimpleLocation.getLat();
lon = httpDnsSimpleLocation.getLon();
}
final Map<String, Object> params = ParamsBuilder.of(false)
.append("lat", 0)//required by server
.append("lon", 0)//required by server
.append("lat", lat)//required by server
.append("lon", lon)//required by server
.append("sn", SocketConfig.instance().getSn())
.append("versionCode", CommonUtils.getVersionCode(SocketConfig.instance().getAppContext()))
.append("versionName", CommonUtils.getVersionName(SocketConfig.instance().getAppContext()))