gps房创建拦截
parent
7e9802346c
commit
94b7b5e517
|
|
@ -136,19 +136,24 @@ function M:PublicJoinRoom(cmd, roomid, tem, callback, group_id, pid)
|
||||||
--获得玩法配置定位信息,如果开启了配置则必须强制有定位才能进入房间
|
--获得玩法配置定位信息,如果开启了配置则必须强制有定位才能进入房间
|
||||||
local play = DataManager.groups:get(group_id):getPlay(pid)
|
local play = DataManager.groups:get(group_id):getPlay(pid)
|
||||||
local pos = ""
|
local pos = ""
|
||||||
if play and play.config and play.config.GPSDetection and play.config.GPSDetection > 0 then
|
if play and play.config then
|
||||||
|
local config = json.decode(play.config)
|
||||||
|
if config.GPSDetection and config.GPSDetection > 0 then
|
||||||
if not DataManager.SelfUser.location then
|
if not DataManager.SelfUser.location then
|
||||||
get_gps(function(cmd, roomid, tem, callback, group_id, pid)
|
get_gps(nil, {
|
||||||
if not DataManager.SelfUser.location then
|
_callback_lad = function(flag)
|
||||||
ViewUtil.ErrorMsg(nil, 55, "未开启gps定位,不能创建gps定位房")
|
if flag then
|
||||||
|
self:PublicJoinRoom(cmd, roomid, tem, callback, group_id, pid)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
self:PublicJoinRoom(cmd, roomid, tem, callback, group_id, pid)
|
ViewUtil.ErrorMsg(nil, 55, "未开启gps定位,不能创建gps定位房")
|
||||||
end)
|
end
|
||||||
|
})
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
pos = DataManager.SelfUser.location:Location2String()
|
pos = DataManager.SelfUser.location:Location2String()
|
||||||
end
|
end
|
||||||
|
end
|
||||||
_data["pos"] = pos
|
_data["pos"] = pos
|
||||||
elseif cmd == Protocol.WEB_FG_QUEUE_ROOM then
|
elseif cmd == Protocol.WEB_FG_QUEUE_ROOM then
|
||||||
_data["is_null"] = tem
|
_data["is_null"] = tem
|
||||||
|
|
|
||||||
|
|
@ -227,10 +227,12 @@ function ad2d(decimal)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 获取gps
|
-- 获取gps
|
||||||
function get_gps(callback)
|
function get_gps(callback, data)
|
||||||
|
local _localAddress = data and data._callback_lad or nil
|
||||||
if Application.platform == RuntimePlatform.IPhonePlayer or Application.platform == RuntimePlatform.Android then
|
if Application.platform == RuntimePlatform.IPhonePlayer or Application.platform == RuntimePlatform.Android then
|
||||||
local s, e = pcall(function()
|
local s, e = pcall(function()
|
||||||
Utils.LocalAddress(function(result, latitude, longitude)
|
Utils.LocalAddress(function(result, latitude, longitude)
|
||||||
|
if _localAddress then _localAddress(result, latitude, longitude) end
|
||||||
if not result or (latitude == 0 and longitude == 0) then return end
|
if not result or (latitude == 0 and longitude == 0) then return end
|
||||||
DataManager.SelfUser.location = Location.new(tostring(longitude) .. "," .. tostring(latitude))
|
DataManager.SelfUser.location = Location.new(tostring(longitude) .. "," .. tostring(latitude))
|
||||||
if callback then callback() end
|
if callback then callback() end
|
||||||
|
|
|
||||||
|
|
@ -32,10 +32,10 @@
|
||||||
"bundle": "extend/majiang/nancheng"
|
"bundle": "extend/majiang/nancheng"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ver": "1.0.33",
|
"ver": "1.0.34",
|
||||||
"name": "黎川麻将",
|
"name": "黎川麻将",
|
||||||
"check": true,
|
"check": true,
|
||||||
"version": "1.0.33",
|
"version": "1.0.34",
|
||||||
"game_id": "87",
|
"game_id": "87",
|
||||||
"bundle": "extend/majiang/lichuan"
|
"bundle": "extend/majiang/lichuan"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"lua_path": "/tolua_project,/base_project,/main_project",
|
"lua_path": "/tolua_project,/base_project,/main_project",
|
||||||
"ver": "1.0.8",
|
"ver": "1.0.6",
|
||||||
"name": "base_script",
|
"name": "base_script",
|
||||||
"check": true,
|
"check": true,
|
||||||
"bundle": "base/base_script",
|
"bundle": "base/base_script",
|
||||||
"version": "1.0.8"
|
"version": "1.0.6"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ver": "1.0.8",
|
"ver": "1.0.8",
|
||||||
|
|
@ -29,11 +29,11 @@
|
||||||
"version": "1.0.8"
|
"version": "1.0.8"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ver": "1.0.8",
|
"ver": "1.0.9",
|
||||||
"name": "Family",
|
"name": "Family",
|
||||||
"check": true,
|
"check": true,
|
||||||
"bundle": "base/Family",
|
"bundle": "base/Family",
|
||||||
"version": "1.0.8"
|
"version": "1.0.9"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ver": "1.0.8",
|
"ver": "1.0.8",
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue