From 1bf3f5aea435a4ce0cfa96f686e52ef40c448d8b Mon Sep 17 00:00:00 2001 From: zhongchao Date: Sun, 21 Nov 2021 10:02:34 +0800 Subject: [PATCH] to adjust socket server require ip --- .../socket/third/core/network/RequestManager.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/foudations/mogo-socket/src/main/java/com/mogo/cloud/socket/third/core/network/RequestManager.java b/foudations/mogo-socket/src/main/java/com/mogo/cloud/socket/third/core/network/RequestManager.java index 76cb592..dc0e11e 100644 --- a/foudations/mogo-socket/src/main/java/com/mogo/cloud/socket/third/core/network/RequestManager.java +++ b/foudations/mogo-socket/src/main/java/com/mogo/cloud/socket/third/core/network/RequestManager.java @@ -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 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()))