全部放大

master
罗家炜 2025-04-11 12:49:08 +08:00
parent 944b9ed164
commit 9e830c82b5
157 changed files with 16807 additions and 17704 deletions

View File

@ -67,7 +67,7 @@ function NetClient.new(host, game, protocol)
-- self.responseMap = {} -- self.responseMap = {}
self.onevent = event("onevent", false) self.onevent = event("onevent", false)
self.onconnect = event("onconnect", false) self.onconnect = event("onconnect", false)
--print("222222222222222222222222222222222222222222 ",host," ",host," ",game," ",self.protocol) ---- print("222222222222222222222222222222222222222222 ",host," ",host," ",game," ",self.protocol)
self.c__netClient = LuaNetClient(host, game, self, self.protocol) self.c__netClient = LuaNetClient(host, game, self, self.protocol)
self.c__netClient:SetCallBackListener(R.c__ondata) self.c__netClient:SetCallBackListener(R.c__ondata)
@ -92,7 +92,7 @@ local NULL_JSON = "{}"
--- send --- send
function R.send(self, cmd, data, callback) function R.send(self, cmd, data, callback)
if (debug_print) then if (debug_print) then
print("send host:" .. self.host) -- print("send host:" .. self.host)
end end
if self.c__netClient == nil then if self.c__netClient == nil then
return return
@ -170,7 +170,7 @@ end
---c#网络层回调函数 ---c#网络层回调函数
function R.c__onconnect(self, code) function R.c__onconnect(self, code)
if (debug_print) then if (debug_print) then
print("codeccccccccccccccccccccccccccccccccccccccc" .. code) -- print("codeccccccccccccccccccccccccccccccccccccccc" .. code)
end end
self.onconnect(code) self.onconnect(code)
end end

View File

@ -20,8 +20,8 @@ function Queue:Enqueue(element)
self.queue[self.rear] = element self.queue[self.rear] = element
else else
local temp = (self.rear + 1) % self.capacity local temp = (self.rear + 1) % self.capacity
--print("1111111111111111111====>>>>") ---- print("1111111111111111111====>>>>")
--print(temp) ---- print(temp)
if temp == self.head then if temp == self.head then
error("Error: capacity is full.") error("Error: capacity is full.")
ViewUtil.ErrorTip(10001, "Error: capacity is full.") ViewUtil.ErrorTip(10001, "Error: capacity is full.")
@ -33,7 +33,6 @@ function Queue:Enqueue(element)
self.queue[self.rear] = element self.queue[self.rear] = element
self.size_ = self.size_ + 1 self.size_ = self.size_ + 1
end end
end end
function Queue:Dequeue() function Queue:Dequeue()
@ -84,6 +83,6 @@ function Queue:dump()
end end
str = str .. "," .. self.queue[r] .. "}" str = str .. "," .. self.queue[r] .. "}"
if (debug_print) then if (debug_print) then
print(str) -- print(str)
end end
end end

View File

@ -9,6 +9,7 @@ function bit.init32()
bit.data32[i] = 2 ^ (32 - i) bit.data32[i] = 2 ^ (32 - i)
end end
end end
bit.init32() bit.init32()
function bit:d2b(arg) --bit:d2b function bit:d2b(arg) --bit:d2b
@ -62,7 +63,6 @@ function bit:_and(a,b) --bit:_and
end end
end end
return self:b2d(r) return self:b2d(r)
end end
function bit:_or(a, b) --bit:_or function bit:_or(a, b) --bit:_or
@ -126,11 +126,10 @@ function bit:_lshift(a,n) --bit:_lshift
return self:b2d(r) return self:b2d(r)
end end
function bit:print(ta) function bit:print(ta)
local sr = "" local sr = ""
for i = 1, 32 do for i = 1, 32 do
sr = sr .. ta[i] sr = sr .. ta[i]
end end
print(sr) -- print(sr)
end end

View File

@ -1,5 +1,3 @@
string._htmlspecialchars_set = {} string._htmlspecialchars_set = {}
string._htmlspecialchars_set["&"] = "&" string._htmlspecialchars_set["&"] = "&"
string._htmlspecialchars_set["\""] = """ string._htmlspecialchars_set["\""] = """
@ -10,7 +8,7 @@ string._htmlspecialchars_set[">"] = ">"
--[[-- --[[--
HTML HTML
~~~ lua ~~~ lua
print(string.htmlspecialchars("<ABC>")) -- print(string.htmlspecialchars("<ABC>"))
-- 输出 &lt;ABC&gt; -- 输出 &lt;ABC&gt;
~~~ ~~~
@param string input @param string input
@ -26,7 +24,7 @@ end
--[[-- --[[--
HTML string.htmlspecialchars() HTML string.htmlspecialchars()
~~~ lua ~~~ lua
print(string.restorehtmlspecialchars("&lt;ABC&gt;")) -- print(string.restorehtmlspecialchars("&lt;ABC&gt;"))
-- 输出 <ABC> -- 输出 <ABC>
~~~ ~~~
@param string input @param string input
@ -42,7 +40,7 @@ end
--[[-- --[[--
\n HTML \n HTML
~~~ lua ~~~ lua
print(string.nl2br("Hello\nWorld")) -- print(string.nl2br("Hello\nWorld"))
-- 输出 -- 输出
-- Hello<br />World -- Hello<br />World
~~~ ~~~
@ -56,7 +54,7 @@ end
--[[-- --[[--
\n HTML \n HTML
~~~ lua ~~~ lua
print(string.nl2br("<Hello>\nWorld")) -- print(string.nl2br("<Hello>\nWorld"))
-- 输出 -- 输出
-- &lt;Hello&gt;<br />World -- &lt;Hello&gt;<br />World
~~~ ~~~
@ -103,7 +101,7 @@ end
~~~ lua ~~~ lua
local input = " ABC" local input = " ABC"
print(string.ltrim(input)) -- print(string.ltrim(input))
-- 输出 ABC输入字符串前面的两个空格被去掉了 -- 输出 ABC输入字符串前面的两个空格被去掉了
~~~ ~~~
@ -123,7 +121,7 @@ end
~~~ lua ~~~ lua
local input = "ABC " local input = "ABC "
print(string.ltrim(input)) -- print(string.ltrim(input))
-- 输出 ABC输入字符串最后的两个空格被去掉了 -- 输出 ABC输入字符串最后的两个空格被去掉了
~~~ ~~~
@param string input @param string input
@ -149,7 +147,7 @@ end
~~~ lua ~~~ lua
local input = "hello" local input = "hello"
print(string.ucfirst(input)) -- print(string.ucfirst(input))
-- 输出 Hello -- 输出 Hello
~~~ ~~~
@param string input @param string input
@ -167,7 +165,7 @@ end
URL URL
~~~ lua ~~~ lua
local input = "hello world" local input = "hello world"
print(string.urlencode(input)) -- print(string.urlencode(input))
-- 输出 -- 输出
-- hello%20world -- hello%20world
~~~ ~~~
@ -188,7 +186,7 @@ end
URL URL
~~~ lua ~~~ lua
local input = "hello%20world" local input = "hello%20world"
print(string.urldecode(input)) -- print(string.urldecode(input))
-- 输出 -- 输出
-- hello world -- hello world
~~~ ~~~
@ -207,7 +205,7 @@ end
UTF8 UTF8
~~~ lua ~~~ lua
local input = "你好World" local input = "你好World"
print(string.utf8len(input)) -- print(string.utf8len(input))
-- 输出 7 -- 输出 7
~~~ ~~~
@param string input @param string input
@ -278,7 +276,7 @@ end
--[[-- --[[--
~~~ lua ~~~ lua
print(string.formatnumberthousands(1924235)) -- print(string.formatnumberthousands(1924235))
-- 输出 1,924,235 -- 输出 1,924,235
~~~ ~~~
@param number num @param number num
@ -294,7 +292,6 @@ function string.formatnumberthousands(num)
return formatted return formatted
end end
function string.concat(...) function string.concat(...)
local str = {} local str = {}
local tem = { ... } local tem = { ... }

View File

@ -48,11 +48,11 @@ OnInit、DoHideAnimation、DoShowAnimation、OnShown、OnHide。
MyWinClass = fgui.window_class() MyWinClass = fgui.window_class()
function MyWinClass:ctor() function MyWinClass:ctor()
print('MyWinClass-ctor') -- print('MyWinClass-ctor')
self.contentPane = UIPackage.CreateObject("Basics", "WindowA") self.contentPane = UIPackage.CreateObject("Basics", "WindowA")
end end
function MyWinClass:OnShown() function MyWinClass:OnShown()
print('MyWinClass-onShown') -- print('MyWinClass-onShown')
end end
local win = MyWinClass.New() local win = MyWinClass.New()
win:Show() win:Show()
@ -92,12 +92,12 @@ MyButton = fgui.extension_class(GButton)
fgui.register_extension("ui://包名/我的按钮", MyButton) fgui.register_extension("ui://包名/我的按钮", MyButton)
function MyButton:ctor() --当组件构建完成时此方法被调用 function MyButton:ctor() --当组件构建完成时此方法被调用
print(self:GetChild("n1")) -- print(self:GetChild("n1"))
end end
--添加自定义的方法和字段 --添加自定义的方法和字段
function MyButton:Test() function MyButton:Test()
print('test') -- print('test')
end end
local get = tolua.initget(MyButton) local get = tolua.initget(MyButton)

View File

@ -71,8 +71,6 @@ function M:init(name)
self._eventmap[Protocol.GAME_EVT_CANCEL_READY_ENTRUST] = self.OnEvtCloseTupGTips self._eventmap[Protocol.GAME_EVT_CANCEL_READY_ENTRUST] = self.OnEvtCloseTupGTips
--self._eventmap[Protocol.GAME_AUTO_CARD] = self.OnEvtOpenGameHuTuoGtips --self._eventmap[Protocol.GAME_AUTO_CARD] = self.OnEvtOpenGameHuTuoGtips
end end
function DispatchEvent(_dispatcher, evt_name, ...) function DispatchEvent(_dispatcher, evt_name, ...)
@ -86,9 +84,8 @@ function M:AddEventListener(evt_name, func)
self._dispatcher[evt_name] = func self._dispatcher[evt_name] = func
end end
function M:ResetConnect() function M:ResetConnect()
-- print("断线重连================") -- -- print("断线重连================")
--ControllerManager.OnConnect(SocketCode.TimeoutDisconnect) --ControllerManager.OnConnect(SocketCode.TimeoutDisconnect)
ViewManager.refreshGameView() ViewManager.refreshGameView()
end end
@ -101,6 +98,7 @@ function M:PlayerReady()
if not _client then if not _client then
return return
end end
print("====================================1发送准备")
_client:send(Protocol.GAME_READY) _client:send(Protocol.GAME_READY)
end end
@ -178,7 +176,7 @@ function M:DismissRoomVote(agree)
if not _client then if not _client then
return return
end end
-- print(agree) -- -- print(agree)
local _data = {} local _data = {}
_data['result'] = agree _data['result'] = agree
_client:send(Protocol.GAME_DISMISS_ROOM_VOTE, _data) _client:send(Protocol.GAME_DISMISS_ROOM_VOTE, _data)
@ -261,7 +259,7 @@ end
-- 玩家进 -- 玩家进
function M:OnEventPlayerEnter(evt_data) function M:OnEventPlayerEnter(evt_data)
--print("进入房间++++++++++++++++++++++++++++++++++++++") ---- print("进入房间++++++++++++++++++++++++++++++++++++++")
self._cacheEvent:Enqueue( self._cacheEvent:Enqueue(
function() function()
local p = self._room:NewPlayer() local p = self._room:NewPlayer()
@ -286,7 +284,6 @@ function M:OnEventPlayerEnter(evt_data)
p.line_state = 1 p.line_state = 1
DataManager.CurrenRoom:AddPlayer(p) DataManager.CurrenRoom:AddPlayer(p)
DispatchEvent(self._dispatcher, GameEvent.PlayerEnter, p) DispatchEvent(self._dispatcher, GameEvent.PlayerEnter, p)
end end
) )
end end
@ -331,7 +328,6 @@ function M:OnEventPlayerReady(evt_data)
else else
p.isSendCardState = false p.isSendCardState = false
end end
else else
p.isSendCardState = false p.isSendCardState = false
end end
@ -341,7 +337,6 @@ function M:OnEventPlayerReady(evt_data)
) )
end end
function M:OnEventPlayerXiPaiReady(evt_data) function M:OnEventPlayerXiPaiReady(evt_data)
self._cacheEvent:Enqueue( self._cacheEvent:Enqueue(
function() function()
@ -354,7 +349,6 @@ function M:OnEventPlayerXiPaiReady(evt_data)
else else
p.isSendCardState = false p.isSendCardState = false
end end
else else
p.isSendCardState = false p.isSendCardState = false
end end
@ -364,8 +358,6 @@ function M:OnEventPlayerXiPaiReady(evt_data)
) )
end end
-- 聊天事件 -- 聊天事件
function M:OnEventInteraction(evt_data) function M:OnEventInteraction(evt_data)
if self._room.ban_chat1 == false or self._room.ban_chat2 == false then if self._room.ban_chat1 == false or self._room.ban_chat2 == false then
@ -396,7 +388,6 @@ function M:OnEventUpdateGPS(evt_data)
) )
end end
-- 被踢出房间事件 -- 被踢出房间事件
function M:OnEventKicked() function M:OnEventKicked()
if ViewManager.GetCurrenView().dview_class == LobbyView then if ViewManager.GetCurrenView().dview_class == LobbyView then
@ -544,7 +535,7 @@ end
function M:OnEnter() function M:OnEnter()
if (debug_print) then if (debug_print) then
print(self._name .. '进入Game控制器') -- print(self._name .. '进入Game控制器')
end end
self._room = DataManager.CurrenRoom self._room = DataManager.CurrenRoom
local _client = ControllerManager.GameNetClinet local _client = ControllerManager.GameNetClinet
@ -555,14 +546,14 @@ end
function M:OnExit() function M:OnExit()
if (debug_print) then if (debug_print) then
print(self._name .. ' 离开Game控制器') -- print(self._name .. ' 离开Game控制器')
end end
ControllerManager.SetGameNetClient(nil) ControllerManager.SetGameNetClient(nil)
self._cacheEvent:Clear() self._cacheEvent:Clear()
end end
function M:__OnNetEvent(msg) function M:__OnNetEvent(msg)
--print("Game消息ID===>>"..msg.Command) ---- print("Game消息ID===>>"..msg.Command)
local func = self._eventmap[msg.Command] local func = self._eventmap[msg.Command]
if (func ~= nil) then if (func ~= nil) then
func(self, msg.Data) func(self, msg.Data)
@ -586,12 +577,10 @@ function M:ReturnToRoom()
end, end,
self.tmpGroupID self.tmpGroupID
) )
end end
function M:OnEvtOpenTupGTips(msg) function M:OnEvtOpenTupGTips(msg)
--print("显示托管倒计时=====================") ---- print("显示托管倒计时=====================")
pt(msg) pt(msg)
local pid = msg['aid'] local pid = msg['aid']
local p = self._room:GetPlayerById(pid) local p = self._room:GetPlayerById(pid)
@ -599,9 +588,8 @@ function M:OnEvtOpenTupGTips(msg)
DispatchEvent(self._dispatcher, GameEvent.TupGuanOpen, p, true, t) DispatchEvent(self._dispatcher, GameEvent.TupGuanOpen, p, true, t)
end end
function M:OnEvtCloseTupGTips(msg) function M:OnEvtCloseTupGTips(msg)
--print("关闭托管倒计时=================") ---- print("关闭托管倒计时=================")
--pt(msg) --pt(msg)
local pid = msg['aid'] local pid = msg['aid']
local p = self._room:GetPlayerById(pid) local p = self._room:GetPlayerById(pid)
@ -609,13 +597,10 @@ function M:OnEvtCloseTupGTips(msg)
DispatchEvent(self._dispatcher, GameEvent.TupGuanOpen, p, false, t) DispatchEvent(self._dispatcher, GameEvent.TupGuanOpen, p, false, t)
end end
function M:DispatchEventTuoGuan(p, isShow, t) function M:DispatchEventTuoGuan(p, isShow, t)
DispatchEvent(self._dispatcher, GameEvent.TupGuanOpen, p, isShow, t) DispatchEvent(self._dispatcher, GameEvent.TupGuanOpen, p, isShow, t)
end end
function M:OnEvtOpenGameHuTuoGtips(isAuto) function M:OnEvtOpenGameHuTuoGtips(isAuto)
local _client = ControllerManager.GameNetClinet local _client = ControllerManager.GameNetClinet
if not _client then if not _client then

View File

@ -72,7 +72,7 @@ function M:connect(host, groupId, callback)
self._mgr_client:destroy() self._mgr_client:destroy()
self._mgr_client = nil self._mgr_client = nil
end end
print("666666666666666666666666666 ", host) -- print("666666666666666666666666666 ", host)
local _mgr_client = NetClient.new(self.host, "mgr_group") local _mgr_client = NetClient.new(self.host, "mgr_group")
self._mgr_client = _mgr_client self._mgr_client = _mgr_client
_mgr_client:connect() _mgr_client:connect()
@ -186,7 +186,7 @@ end
-- 更新玩法 -- 更新玩法
function M:OnEvtUpdatePlay(evt_data) function M:OnEvtUpdatePlay(evt_data)
--print("更新玩法=============》》》") ---- print("更新玩法=============》》》")
--pt(evt_data) --pt(evt_data)
local pid = evt_data.pid local pid = evt_data.pid
local group = DataManager.groups:get(self.groupId) local group = DataManager.groups:get(self.groupId)
@ -354,7 +354,7 @@ function M:OnExit()
end end
function M:__OnNetEvent(msg) function M:__OnNetEvent(msg)
--print("消息ID===>>"..msg.Command) ---- print("消息ID===>>"..msg.Command)
local func = self._eventmap[msg.Command] local func = self._eventmap[msg.Command]
if (func ~= nil) then func(self, msg.Data) end if (func ~= nil) then func(self, msg.Data) end
end end

View File

@ -1,4 +1,3 @@
LoddyController = {} LoddyController = {}
local M = {} local M = {}
@ -14,11 +13,11 @@ function LoddyController.new()
end end
function M.OnEnter(self) function M.OnEnter(self)
--print(vardump(self,"loddy controller enter")) ---- print(vardump(self,"loddy controller enter"))
end end
function M.OnExit(self) function M.OnExit(self)
--print(vardump(self,"loddy controller exit")) ---- print(vardump(self,"loddy controller exit"))
end end
local function __FillRoomData(s2croom) local function __FillRoomData(s2croom)
@ -48,7 +47,6 @@ local function __ConntectGameServer(cmd,room, host, _data,callback)
end end
callback(response) callback(response)
end) end)
else else
if ControllerManager.GameNetClinet == _game_client then if ControllerManager.GameNetClinet == _game_client then
ControllerManager.GameNetClinet = nil ControllerManager.GameNetClinet = nil
@ -118,7 +116,7 @@ function M:CreateRoom(game_id, _data, callback)
local extend = ExtendManager.GetExtendConfig(room.game_id) local extend = ExtendManager.GetExtendConfig(room.game_id)
extend:FillRoomData(_s2croom) extend:FillRoomData(_s2croom)
ControllerManager.ChangeController(GameController) ControllerManager.ChangeController(GameController)
-- print("create room:"..(os.clock()-runtime)) -- -- print("create room:"..(os.clock()-runtime))
callback(response) callback(response)
return return
end end
@ -182,7 +180,7 @@ function M:PublicJoinRoom(cmd,room_id,callback,group_id,group_layer)
end end
j_data["pos"] = DataManager.SelfUser.location:Location2String() j_data["pos"] = DataManager.SelfUser.location:Location2String()
-- local game_net = nil -- local game_net = nil
--print(vardump(room)) ---- print(vardump(room))
-- game_net = -- game_net =
__ConntectGameServer(Protocol.GAME_JOIN_ROOM, room, room.server_host, j_data, function(res1) __ConntectGameServer(Protocol.GAME_JOIN_ROOM, room, room.server_host, j_data, function(res1)
if (res1.ReturnCode ~= 0) then if (res1.ReturnCode ~= 0) then
@ -215,7 +213,6 @@ function M:JoinRoom(room_id,callback,group_id,group_layer)
self:PublicJoinRoom(Protocol.WEB_JOIN_ROOM, room_id, callback, group_id, group_layer) self:PublicJoinRoom(Protocol.WEB_JOIN_ROOM, room_id, callback, group_id, group_layer)
end end
function M:ResetJionRoom(callback) function M:ResetJionRoom(callback)
local _game = ControllerManager.GetController(GameController) local _game = ControllerManager.GetController(GameController)
local o_room = DataManager.CurrenRoom local o_room = DataManager.CurrenRoom
@ -277,7 +274,7 @@ function M:UpdateNotice(id,callback)
local _data = {} local _data = {}
_data.id = id _data.id = id
_client:send(Protocol.WEB_UPDATE_NOTICE, _data, function(res) _client:send(Protocol.WEB_UPDATE_NOTICE, _data, function(res)
--print("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ",res) ---- print("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ",res)
--pt(res) --pt(res)
if res.ReturnCode == 0 and #res.Data.notice_list > 0 then if res.ReturnCode == 0 and #res.Data.notice_list > 0 then
callback(true, res.Data) callback(true, res.Data)
@ -300,7 +297,7 @@ function M:RequestRecordList(callback, roomid)
end end
_client:send(proto, _data, function(res) _client:send(proto, _data, function(res)
self.recordList = nil self.recordList = nil
-- print(vardump(res)) -- -- print(vardump(res))
if (res.ReturnCode == 0 or res.ReturnCode == 19) then if (res.ReturnCode == 0 or res.ReturnCode == 19) then
--self:RequestRankList(callback) --self:RequestRankList(callback)
self.recordList = {} self.recordList = {}
@ -359,7 +356,6 @@ function M:RequestRecordList(callback, roomid)
end) end)
end end
function M:RequestPlayBack(_data, callback, game_info) function M:RequestPlayBack(_data, callback, game_info)
if game_info and ExtendHotupdate.CheckVersion(game_info) ~= ExtendHotupdate.VERSION_NORMAL then if game_info and ExtendHotupdate.CheckVersion(game_info) ~= ExtendHotupdate.VERSION_NORMAL then
ExtendHotupdate.UpdateGame(game_info, function() ExtendHotupdate.UpdateGame(game_info, function()
@ -385,13 +381,10 @@ function M:RequestPlayBack(_data,callback,game_info)
else else
callback(res.ReturnCode, nil) callback(res.ReturnCode, nil)
end end
end) end)
end end
end end
--获取手机验证码 --获取手机验证码
function M:GetPhoneCode(phone, callback) function M:GetPhoneCode(phone, callback)
local _client = ControllerManager.WebClient local _client = ControllerManager.WebClient
@ -402,7 +395,6 @@ function M:GetPhoneCode(phone,callback)
end) end)
end end
function M:GetUserInfo(callback) function M:GetUserInfo(callback)
local _client = ControllerManager.WebClient local _client = ControllerManager.WebClient
_client:send(Protocol.WEB_GET_USER_INFO, nil, function(res) _client:send(Protocol.WEB_GET_USER_INFO, nil, function(res)

View File

@ -61,7 +61,7 @@ local function __Login(cmd, _data, callBack)
end end
_client:setSession(data["session_id"] .. "," .. data["token"]) _client:setSession(data["session_id"] .. "," .. data["token"])
print("11111111111111111111111111111111") -- print("11111111111111111111111111111111")
pt(data) pt(data)
ControllerManager.GroupClient = NetClient.new(data.groupWeb, "web_group", ConnectionProtocol.Web) ControllerManager.GroupClient = NetClient.new(data.groupWeb, "web_group", ConnectionProtocol.Web)
ControllerManager.GroupClient:setSession((data["session_id"] .. "," .. data["token"])) ControllerManager.GroupClient:setSession((data["session_id"] .. "," .. data["token"]))
@ -129,11 +129,11 @@ function M:QuickLogin(session_id, callback)
end end
function M.OnEnter(self) function M.OnEnter(self)
--print("login controller enter") ---- print("login controller enter")
end end
function M.OnExit(self) function M.OnExit(self)
--print("login controller exit") ---- print("login controller exit")
end end
--字符串类json格式转化为表 --字符串类json格式转化为表

View File

@ -1,4 +1,3 @@
NewGroupController = {} NewGroupController = {}
local M = {} local M = {}
@ -14,7 +13,6 @@ function NewGroupController.new()
return self return self
end end
--获取圈列表 --获取圈列表
function M:FG_GroupList(callback) function M:FG_GroupList(callback)
local _client = ControllerManager.GroupClient local _client = ControllerManager.GroupClient
@ -131,7 +129,8 @@ function M:FG_TopGroup(group_id,top,callback)
end) end)
end end
function M:FG_UpdateGroupInfo(id, name, notice, ban, dissolve_opt, kick_opt, apply, ban_chat1, ban_chat2, option, showNum, callback) function M:FG_UpdateGroupInfo(id, name, notice, ban, dissolve_opt, kick_opt, apply, ban_chat1, ban_chat2, option, showNum,
callback)
local _client = ControllerManager.GroupClient local _client = ControllerManager.GroupClient
local data = {} local data = {}
data.id = id data.id = id
@ -181,9 +180,9 @@ function M:FG_GroupMembers(group_id, limit, num, minus_only, sort_type, callback
data.num = num data.num = num
data.minus_only = minus_only data.minus_only = minus_only
data.type = sort_type data.type = sort_type
--print(debug.traceback()) ---- print(debug.traceback())
_client:send(Protocol.WEB_FG_GROUP_MEMBERS, data, function(res) _client:send(Protocol.WEB_FG_GROUP_MEMBERS, data, function(res)
--print("查询圈子玩家列表============") ---- print("查询圈子玩家列表============")
--pt(res) --pt(res)
if res.ReturnCode == 0 then if res.ReturnCode == 0 then
local group = DataManager.groups:get(group_id) local group = DataManager.groups:get(group_id)
@ -194,11 +193,9 @@ function M:FG_GroupMembers(group_id, limit, num, minus_only, sort_type, callback
end end
end end
callback(res) callback(res)
end) end)
end end
function M:FG_GroupMembers11(group_id, limit, num, minus_only, sort_type, callback) function M:FG_GroupMembers11(group_id, limit, num, minus_only, sort_type, callback)
local _client = ControllerManager.GroupClient local _client = ControllerManager.GroupClient
local data = {} local data = {}
@ -209,9 +206,9 @@ function M:FG_GroupMembers11(group_id, limit, num, minus_only, sort_type, callba
data.type = sort_type data.type = sort_type
self.currentGroupMembersData = data self.currentGroupMembersData = data
self.currentGroupMembersCallBack = callback self.currentGroupMembersCallBack = callback
--print(debug.traceback()) ---- print(debug.traceback())
_client:send(Protocol.WEB_FG_GROUP_MEMBERS, data, function(res) _client:send(Protocol.WEB_FG_GROUP_MEMBERS, data, function(res)
--print("查询圈子玩家列表============") ---- print("查询圈子玩家列表============")
--pt(res) --pt(res)
if res.ReturnCode == 0 then if res.ReturnCode == 0 then
local group = DataManager.groups:get(group_id) local group = DataManager.groups:get(group_id)
@ -222,7 +219,6 @@ function M:FG_GroupMembers11(group_id, limit, num, minus_only, sort_type, callba
end end
end end
callback(res) callback(res)
end) end)
end end
@ -238,9 +234,9 @@ function M:FG_GroupMembers12(group_id, limit, num,type,online, callback)
--data.type = sort_type --data.type = sort_type
self.currentGroupMembersData = data self.currentGroupMembersData = data
self.currentGroupMembersCallBack = callback self.currentGroupMembersCallBack = callback
--print(debug.traceback()) ---- print(debug.traceback())
_client:send(Protocol.WEB_FG_GROUP_MEMBERS1, data, function(res) _client:send(Protocol.WEB_FG_GROUP_MEMBERS1, data, function(res)
--print("查询圈子玩家列表============") ---- print("查询圈子玩家列表============")
--pt(res) --pt(res)
if res.ReturnCode == 0 then if res.ReturnCode == 0 then
local group = DataManager.groups:get(group_id) local group = DataManager.groups:get(group_id)
@ -251,7 +247,6 @@ function M:FG_GroupMembers12(group_id, limit, num,type,online, callback)
end end
end end
callback(res) callback(res)
end) end)
end end
@ -269,12 +264,11 @@ function M:FG_GroupTiChu(group_id,limit, num,callback)
end) end)
end end
function M:SendGetGroupMembersInfo() function M:SendGetGroupMembersInfo()
local _client = ControllerManager.GroupClient local _client = ControllerManager.GroupClient
if self.currentGroupMembersData and self.currentGroupMembersCallBack then if self.currentGroupMembersData and self.currentGroupMembersCallBack then
_client:send(Protocol.WEB_FG_GROUP_MEMBERS1, self.currentGroupMembersData, function(res) _client:send(Protocol.WEB_FG_GROUP_MEMBERS1, self.currentGroupMembersData, function(res)
--print("查询圈子玩家列表============") ---- print("查询圈子玩家列表============")
--pt(res) --pt(res)
if res.ReturnCode == 0 then if res.ReturnCode == 0 then
local group = DataManager.groups:get(self.currentGroupMembersData.id) local group = DataManager.groups:get(self.currentGroupMembersData.id)
@ -285,10 +279,8 @@ function M:SendGetGroupMembersInfo()
end end
end end
self.currentGroupMembersCallBack(res) self.currentGroupMembersCallBack(res)
end) end)
end end
end end
-- 查询成员 -- 查询成员
@ -300,7 +292,7 @@ function M:FG_FindMember(group_id, member_id, callback, tag_name,tag_type)
data.tagName = tag_name data.tagName = tag_name
data.tagType = tag_type data.tagType = tag_type
_client:send(Protocol.WEB_FG_FIND_MEMBER, data, function(res) _client:send(Protocol.WEB_FG_FIND_MEMBER, data, function(res)
--print("查询圈子单个玩家列表============") ---- print("查询圈子单个玩家列表============")
--pt(res) --pt(res)
if res.ReturnCode == 0 then if res.ReturnCode == 0 then
local group = DataManager.groups:get(group_id) local group = DataManager.groups:get(group_id)
@ -315,8 +307,6 @@ function M:FG_FindMember(group_id, member_id, callback, tag_name,tag_type)
end) end)
end end
-- 强制提取 -- 强制提取
function M:FG_TakeHp1(group_id, tagId, callback) function M:FG_TakeHp1(group_id, tagId, callback)
local _client = ControllerManager.GroupClient local _client = ControllerManager.GroupClient
@ -325,7 +315,7 @@ function M:FG_TakeHp1(group_id, tagId, callback)
data.tagId = tagId data.tagId = tagId
_client:send(Protocol.WEB_FG_TAKE_HP, data, function(res) _client:send(Protocol.WEB_FG_TAKE_HP, data, function(res)
--print("查询圈子单个玩家列表============") ---- print("查询圈子单个玩家列表============")
--pt(res) --pt(res)
callback(res) callback(res)
end) end)
@ -388,7 +378,6 @@ function M:FG_QueryPartnerList(group_id, query_id, query_nick, callback)
end end
function M:FG_GetMemberStat(group_id, query_id, partner_id, limit, num, time_type, begin_time, end_time, callback) function M:FG_GetMemberStat(group_id, query_id, partner_id, limit, num, time_type, begin_time, end_time, callback)
local _client = ControllerManager.GroupClient local _client = ControllerManager.GroupClient
local data = {} local data = {}
data.id = group_id data.id = group_id
@ -406,9 +395,7 @@ function M:FG_GetMemberStat(group_id,query_id,partner_id,limit,num,time_type,beg
end) end)
end end
function M:FG_GetPartnerStat(group_id, limit, num, time_type, begin_time, end_time, callback) function M:FG_GetPartnerStat(group_id, limit, num, time_type, begin_time, end_time, callback)
local _client = ControllerManager.GroupClient local _client = ControllerManager.GroupClient
local data = {} local data = {}
data.id = group_id data.id = group_id
@ -425,7 +412,6 @@ function M:FG_GetPartnerStat(group_id,limit,num,time_type,begin_time,end_time,ca
end end
function M:FG_GetZuanShiStat(group_id, limit, num, time_type, begin_time, end_time, callback) function M:FG_GetZuanShiStat(group_id, limit, num, time_type, begin_time, end_time, callback)
local _client = ControllerManager.GroupClient local _client = ControllerManager.GroupClient
local data = {} local data = {}
data.id = group_id data.id = group_id
@ -481,7 +467,8 @@ end
--find_partner_stat_member --find_partner_stat_member
-- WEB_FG_FIND_PARTNER_STAT -- WEB_FG_FIND_PARTNER_STAT
function M:FG_FindPartnerStatMember(group_id,uid,root_uid,member_id,limit,num,time_type,begin_time,end_time,callback) function M:FG_FindPartnerStatMember(group_id, uid, root_uid, member_id, limit, num, time_type, begin_time, end_time,
callback)
local _client = ControllerManager.GroupClient local _client = ControllerManager.GroupClient
local data = {} local data = {}
data.id = group_id data.id = group_id
@ -501,7 +488,8 @@ function M:FG_FindPartnerStatMember(group_id,uid,root_uid,member_id,limit,num,ti
end) end)
end end
function M:FG_FindPartnerZuanShiMember(group_id,uid,root_uid,member_id,limit,num,time_type,begin_time,end_time,callback) function M:FG_FindPartnerZuanShiMember(group_id, uid, root_uid, member_id, limit, num, time_type, begin_time, end_time,
callback)
local _client = ControllerManager.GroupClient local _client = ControllerManager.GroupClient
local data = {} local data = {}
data.id = group_id data.id = group_id
@ -522,7 +510,6 @@ function M:FG_FindPartnerZuanShiMember(group_id,uid,root_uid,member_id,limit,num
end end
function M:FG_GetXingYunStat(group_id, limit, num, time_type, begin_time, end_time, callback) function M:FG_GetXingYunStat(group_id, limit, num, time_type, begin_time, end_time, callback)
local _client = ControllerManager.GroupClient local _client = ControllerManager.GroupClient
local data = {} local data = {}
data.id = group_id data.id = group_id
@ -549,7 +536,6 @@ function M:FG_GetMembersCount(group_id,callback)
end end
function M:FG_GetPartnerStatMember(group_id, uid, root_uid, limit, num, time_type, begin_time, end_time, callback) function M:FG_GetPartnerStatMember(group_id, uid, root_uid, limit, num, time_type, begin_time, end_time, callback)
local _client = ControllerManager.GroupClient local _client = ControllerManager.GroupClient
local data = {} local data = {}
@ -588,7 +574,6 @@ function M:FG_GetDirectMemberStat(group_id,uid,root_uid,limit,num,time_type,begi
end end
function M:FG_GetPartnerZuanShiMember(group_id, uid, root_uid, limit, num, time_type, begin_time, end_time, callback) function M:FG_GetPartnerZuanShiMember(group_id, uid, root_uid, limit, num, time_type, begin_time, end_time, callback)
local _client = ControllerManager.GroupClient local _client = ControllerManager.GroupClient
local data = {} local data = {}
@ -627,7 +612,6 @@ function M:FG_GetDirectZuanShiStat(group_id,uid,root_uid,limit,num,time_type,beg
end end
function M:FG_GetPartnerStatPlay(group_id, uid, parent_id, limit, num, time_type, begin_time, end_time, callback) function M:FG_GetPartnerStatPlay(group_id, uid, parent_id, limit, num, time_type, begin_time, end_time, callback)
local _client = ControllerManager.GroupClient local _client = ControllerManager.GroupClient
local data = {} local data = {}
@ -648,7 +632,6 @@ function M:FG_GetPartnerStatPlay(group_id,uid,parent_id,limit,num,time_type,begi
end) end)
end end
-- 获取合伙人成员列表 -- 获取合伙人成员列表
function M:FG_GetPartnerMembers(group_id, partner_id, limit, num, quary_id, callback) function M:FG_GetPartnerMembers(group_id, partner_id, limit, num, quary_id, callback)
local _client = ControllerManager.GroupClient local _client = ControllerManager.GroupClient
@ -772,8 +755,6 @@ function M:FG_GetRewards(group_id, pid, lev, callback)
end) end)
end end
-- 设置推广奖励值 -- 设置推广奖励值
function M:FG_SetRewards(group_id, tag, lev, partner_id, all, val, single, callback) function M:FG_SetRewards(group_id, tag, lev, partner_id, all, val, single, callback)
local _client = ControllerManager.GroupClient local _client = ControllerManager.GroupClient
@ -820,7 +801,6 @@ function M:FG_SetANCHOU(group_id, tag, lev, partner_id, all, val, single,callba
end) end)
end end
-- 获取奖励日志 -- 获取奖励日志
function M:FG_GetRewardsLog(group_id, limit, num, begin_time, end_time, tag, callback) function M:FG_GetRewardsLog(group_id, limit, num, begin_time, end_time, tag, callback)
local _client = ControllerManager.GroupClient local _client = ControllerManager.GroupClient
@ -943,7 +923,8 @@ function M:FG_GetGroupRecord(group_id, platform, qid, limit, num, callback)
end end
-- 获取战绩 -- 获取战绩
function M:FG_GetGroupRecordSpe(group_id, platform, qid, includeMembers, limit, num, begin_time, end_time, time_type, callback) function M:FG_GetGroupRecordSpe(group_id, platform, qid, includeMembers, limit, num, begin_time, end_time, time_type,
callback)
local _client = ControllerManager.GroupClient local _client = ControllerManager.GroupClient
local data = {} local data = {}
data.id = group_id data.id = group_id
@ -979,7 +960,6 @@ function M:FG_GetGroupPersonRecord(group_id, platform, qid, time_type, begin_tim
end) end)
end end
-- 根据房间号查询战绩 -- 根据房间号查询战绩
function M:FG_GetRecordByRoomid(group_id, roomid, platform, callback) function M:FG_GetRecordByRoomid(group_id, roomid, platform, callback)
local _client = ControllerManager.GroupClient local _client = ControllerManager.GroupClient
@ -1003,7 +983,6 @@ function M:FG_GetTakeInfo(group_id, tagId,callback)
end) end)
end end
-- 获取银行信息 -- 获取银行信息
function M:FG_GetBankInfo(group_id, tagId, callback) function M:FG_GetBankInfo(group_id, tagId, callback)
local _client = ControllerManager.GroupClient local _client = ControllerManager.GroupClient
@ -1015,8 +994,6 @@ function M:FG_GetBankInfo(group_id, tagId,callback)
end) end)
end end
function M:FG_TakeBankInfo(group_id, gethp, tagId, callback) function M:FG_TakeBankInfo(group_id, gethp, tagId, callback)
local _client = ControllerManager.GroupClient local _client = ControllerManager.GroupClient
local data = {} local data = {}
@ -1028,7 +1005,6 @@ function M:FG_TakeBankInfo(group_id, gethp,tagId,callback)
end) end)
end end
function M:FG_SAVEBankInfo(group_id, gethp, tagId, callback) function M:FG_SAVEBankInfo(group_id, gethp, tagId, callback)
local _client = ControllerManager.GroupClient local _client = ControllerManager.GroupClient
local data = {} local data = {}
@ -1040,10 +1016,6 @@ function M:FG_SAVEBankInfo(group_id, gethp,tagId,callback)
end) end)
end end
-- 提取体力值 -- 提取体力值
function M:FG_TakeHp(group_id, num, tagId, callback) function M:FG_TakeHp(group_id, num, tagId, callback)
local _client = ControllerManager.GroupClient local _client = ControllerManager.GroupClient
@ -1071,7 +1043,6 @@ function M:FG_GetTakeLog(group_id, limit, num, begin_time, end_time, tagId,callb
end) end)
end end
-- 获取提取记录 -- 获取提取记录
function M:FG_GetBankLog(group_id, limit, num, begin_time, end_time, tagId, callback) function M:FG_GetBankLog(group_id, limit, num, begin_time, end_time, tagId, callback)
local _client = ControllerManager.GroupClient local _client = ControllerManager.GroupClient
@ -1087,7 +1058,6 @@ function M:FG_GetBankLog(group_id, limit, num, begin_time, end_time, tagId,callb
end) end)
end end
-- 获取能量包统计 -- 获取能量包统计
function M:FG_GetFagPackInfo(group_id, callback) function M:FG_GetFagPackInfo(group_id, callback)
local _client = ControllerManager.GroupClient local _client = ControllerManager.GroupClient
@ -1112,6 +1082,7 @@ function M:FG_GroupRemoveMember(id,tagId,callback)
callback(res) callback(res)
end) end)
end end
function M:FG_GroupSetVip(group_id, member_id, isvip, callback) function M:FG_GroupSetVip(group_id, member_id, isvip, callback)
local _client = ControllerManager.GroupClient local _client = ControllerManager.GroupClient
local _data = {} local _data = {}
@ -1129,6 +1100,7 @@ function M:FG_GroupSetVip(group_id, member_id, isvip, callback)
callback(res) callback(res)
end) end)
end end
function M:FG_EnterGroup(group_id, callback) function M:FG_EnterGroup(group_id, callback)
local _client = ControllerManager.GroupClient local _client = ControllerManager.GroupClient
local _data = {} local _data = {}
@ -1153,7 +1125,6 @@ function M:FG_EnterGroup(group_id,callback)
else else
callback(res) callback(res)
end end
end) end)
end end
@ -1221,7 +1192,6 @@ function M:FG_BanMember(group_id, member_id, ban, opType, callback)
end) end)
end end
-- 获取成员调度 -- 获取成员调度
function M:FG_GetBanMemberHB(group_id, member_id, callback) function M:FG_GetBanMemberHB(group_id, member_id, callback)
local _client = ControllerManager.GroupClient local _client = ControllerManager.GroupClient
@ -1230,11 +1200,9 @@ function M:FG_GetBanMemberHB(group_id, member_id,callback)
_data.tagId = member_id _data.tagId = member_id
_client:send(Protocol.GROUP_GET_BLACK_MEMBER, _data, function(res) _client:send(Protocol.GROUP_GET_BLACK_MEMBER, _data, function(res)
callback(res) callback(res)
end) end)
end end
-- 设置成员调度 -- 设置成员调度
function M:FG_BanMemberHB(group_id, member_id, opt, ban_rate, black_max_value, callback) function M:FG_BanMemberHB(group_id, member_id, opt, ban_rate, black_max_value, callback)
local _client = ControllerManager.GroupClient local _client = ControllerManager.GroupClient
@ -1255,11 +1223,9 @@ function M:FG_BanMemberHB(group_id, member_id,opt,ban_rate,black_max_value,callb
end end
end end
callback(res) callback(res)
end) end)
end end
-- 设置禁止同桌 -- 设置禁止同桌
function M:FG_SetBanTable(group_id, member_id, list, del_list, callback) function M:FG_SetBanTable(group_id, member_id, list, del_list, callback)
if #list == 0 then table.insert(list, 0) end if #list == 0 then table.insert(list, 0) end
@ -1285,7 +1251,6 @@ function M:FG_GetBanTable(group_id, member_id, callback)
end) end)
end end
function M:GetAddMember(group_id, member_id, callback) function M:GetAddMember(group_id, member_id, callback)
local _client = ControllerManager.GroupClient local _client = ControllerManager.GroupClient
local _data = {} local _data = {}
@ -1296,7 +1261,6 @@ function M:GetAddMember(group_id,member_id,callback)
end) end)
end end
--添加成员 --添加成员
function M:FG_AddMember(group_id, member_id, callback) function M:FG_AddMember(group_id, member_id, callback)
local _client = ControllerManager.GroupClient local _client = ControllerManager.GroupClient

View File

@ -102,7 +102,7 @@ function M:CreateRoom(game_id, _data, callback)
local extend = ExtendManager.GetExtendConfig(room.game_id) local extend = ExtendManager.GetExtendConfig(room.game_id)
extend:FillRoomData(_s2croom) extend:FillRoomData(_s2croom)
ControllerManager.ChangeController(GameController) ControllerManager.ChangeController(GameController)
-- print("create room:"..(os.clock()-runtime)) -- -- print("create room:"..(os.clock()-runtime))
callback(response) callback(response)
return return
end end

View File

@ -31,7 +31,7 @@ function ControllerManager.Init()
local hostIp = GetGameInfo("login_url") local hostIp = GetGameInfo("login_url")
if (debug_print) then if (debug_print) then
print("hostIp:::" .. hostIp) -- print("hostIp:::" .. hostIp)
end end
ControllerManager.WebClient = NetClient.new(hostIp, "majiang", ConnectionProtocol.Web) ControllerManager.WebClient = NetClient.new(hostIp, "majiang", ConnectionProtocol.Web)
--ControllerManager.GroupClient = nil--NetClient.new("http://192.168.0.1:8081/", "web_group", ConnectionProtocol.Web) --ControllerManager.GroupClient = nil--NetClient.new("http://192.168.0.1:8081/", "web_group", ConnectionProtocol.Web)
@ -76,7 +76,7 @@ function ControllerManager.SetGameNetClient(client)
end end
function ControllerManager.OnConnect(code) function ControllerManager.OnConnect(code)
print("=======================================ControllerManager", code) -- print("=======================================ControllerManager", code)
if (code ~= SocketCode.Connect) then if (code ~= SocketCode.Connect) then
ControllerManager.SetGameNetClient(nil) ControllerManager.SetGameNetClient(nil)
if code ~= SocketCode.DisconnectByServer then if code ~= SocketCode.DisconnectByServer then

View File

@ -49,7 +49,7 @@ end
function TableBG.GetTableBG(game_id) function TableBG.GetTableBG(game_id)
local id = -1 local id = -1
local json_data = Utils.LoadLocalFile(DataManager.SelfUser.account_id .. DataManager.SelfUser.invite_code) local json_data = Utils.LoadLocalFile(DataManager.SelfUser.account_id .. DataManager.SelfUser.invite_code)
-- print(DataManager.SelfUser.invite_code, DataManager.SelfUser.account_id) -- -- print(DataManager.SelfUser.invite_code, DataManager.SelfUser.account_id)
if json_data ~= nil then if json_data ~= nil then
local config_data = json.decode(json_data) local config_data = json.decode(json_data)
id = GetBG(config_data, game_id) id = GetBG(config_data, game_id)

View File

@ -18,7 +18,7 @@ local function __ShowTip(_version_view, text, callback)
end end
local function __update_check(data, onback, _version_view) local function __update_check(data, onback, _version_view)
print("===================updateCheck") -- print("===================updateCheck")
local tex_tip = _version_view:GetChild("tex_info") local tex_tip = _version_view:GetChild("tex_info")
for k, game_data in ipairs(data) do for k, game_data in ipairs(data) do
local asset_path = game_data["bundle"]:gsub("\r\n", "") local asset_path = game_data["bundle"]:gsub("\r\n", "")

View File

@ -13,7 +13,7 @@ local _isInit = false
local function __new_config(data) local function __new_config(data)
local ec = reimport(data.bundle .. ".ExtendConfig") local ec = reimport(data.bundle .. ".ExtendConfig")
print("初始化ExtendManager===>>>" .. data.bundle) -- print("初始化ExtendManager===>>>" .. data.bundle)
--pt(data) --pt(data)
local config = ec.new() local config = ec.new()
ec.game_data = data ec.game_data = data

View File

@ -120,7 +120,7 @@ end
-- 显示窗口 -- 显示窗口
function M:Show() function M:Show()
print("===========================================entershow",M.class) -- print("===========================================entershow",M.class)
local contentPane = self._root_view:GetChild("contentPane") local contentPane = self._root_view:GetChild("contentPane")
if self._anim_pop == 1 then if self._anim_pop == 1 then
contentPane:GetTransition("left_pop"):Play() contentPane:GetTransition("left_pop"):Play()

View File

@ -84,13 +84,13 @@ function M:CreatePlay()
local loddyCtr = ControllerManager.GetController(LoddyController) local loddyCtr = ControllerManager.GetController(LoddyController)
local gameId = PlayInfo[1].playList[self.playNameCtr.selectedIndex + 1].playeId local gameId = PlayInfo[1].playList[self.playNameCtr.selectedIndex + 1].playeId
local config = ExtendManager.GetExtendConfig(gameId) local config = ExtendManager.GetExtendConfig(gameId)
print("==============================config") -- print("==============================config")
pt(config) pt(config)
local mode = config:GetGameInfo() local mode = config:GetGameInfo()
print("==============================mode") -- print("==============================mode")
pt(mode) pt(mode)
local _data = mode:SelectedConfigData() local _data = mode:SelectedConfigData()
print("==============================_data") -- print("==============================_data")
pt(_data) pt(_data)
-- loddyCtr:CreateRoom(gameId,_data, function (res) -- loddyCtr:CreateRoom(gameId,_data, function (res)
-- self:__OnCreateRoomAction(res) -- self:__OnCreateRoomAction(res)

View File

@ -258,7 +258,7 @@ function M:ChangeNumber(fgCtr, group_id, limit, num, minus_only, sort_type)
list_familyNumber:SetVirtual() list_familyNumber:SetVirtual()
fgCtr:FG_GroupMembers(group_id, limit, num, minus_only, sort_type, function(res) fgCtr:FG_GroupMembers(group_id, limit, num, minus_only, sort_type, function(res)
local members = res.Data.members local members = res.Data.members
print("==========================res.Data.members") -- print("==========================res.Data.members")
pt(res.Data.members) pt(res.Data.members)
ViewUtil:CloseModalWait() ViewUtil:CloseModalWait()
if res.ReturnCode ~= 0 then if res.ReturnCode ~= 0 then
@ -303,7 +303,7 @@ function M:UpdateFamilyRoom(fgCtr, id)
} }
end end
local roomList = self._group.rooms local roomList = self._group.rooms
print("=========================playList,rooms") -- print("=========================playList,rooms")
pt(playList) pt(playList)
pt(roomList) pt(roomList)
local roomCtr = ControllerManager.GetController(RoomController) local roomCtr = ControllerManager.GetController(RoomController)
@ -405,7 +405,7 @@ function M:UpdateFamilyRoom(fgCtr, id)
end) end)
end end
local all_num = #playList + #roomList local all_num = #playList + #roomList
print("=================================================list_room", list_room, list_room.numItems, all_num) -- print("=================================================list_room", list_room, list_room.numItems, all_num)
pt(list_room) pt(list_room)
list_room.numItems = all_num list_room.numItems = all_num
list_gamePlay.numItems = #playList + 1 list_gamePlay.numItems = #playList + 1
@ -418,7 +418,7 @@ function M:ConnetFamily(index, groups, isCreate)
local list_family = self._view:GetChild('list_family') local list_family = self._view:GetChild('list_family')
list_family:SetVirtual() list_family:SetVirtual()
self._group = DataManager.groups:get(groups[index].id) self._group = DataManager.groups:get(groups[index].id)
print("===================================self._group") -- print("===================================self._group")
pt(self._group) pt(self._group)
self._roomNum = self._group.room_num self._roomNum = self._group.room_num
@ -533,7 +533,7 @@ function M:OnUpdate()
self._group.update_room = false self._group.update_room = false
self._fristRoom = true self._fristRoom = true
end end
print("====================================UpdateFamilyRoom", fgCtr, self._group.id) -- print("====================================UpdateFamilyRoom", fgCtr, self._group.id)
self:UpdateFamilyRoom(fgCtr, self._group.id) self:UpdateFamilyRoom(fgCtr, self._group.id)
end end
end end

View File

@ -36,7 +36,7 @@ function M:OnCreateRoom(mode_data)
local mode = mode_data.data local mode = mode_data.data
--点击建房按钮后保存当前游戏的config --点击建房按钮后保存当前游戏的config
local _data = mode:SelectedConfigData() local _data = mode:SelectedConfigData()
--print("OnCreateRoom================") ---- print("OnCreateRoom================")
--pt(_data) --pt(_data)
if not _data["stamina"] then _data["stamina"] = 0 end if not _data["stamina"] then _data["stamina"] = 0 end
local user_id = DataManager.SelfUser.account_id local user_id = DataManager.SelfUser.account_id

View File

@ -1,4 +1,3 @@
--进入房间View对象 --进入房间View对象
@ -43,7 +42,7 @@ function M:OnNumButtonAction(context)
if (self._currenIndex > 0) then if (self._currenIndex > 0) then
self._currenIndex = self._currenIndex - 1 self._currenIndex = self._currenIndex - 1
printlog("==================test=================") printlog("==================test=================")
print("ok") -- print("ok")
printlog(#self._texnum_str) printlog(#self._texnum_str)
printlog(self._currenIndex) printlog(self._currenIndex)
printlog("==================test=================") printlog("==================test=================")

View File

@ -21,9 +21,9 @@ function M:init(url)
local view = self._view local view = self._view
local user = self.user; local user = self.user;
print("================phone=====================") -- print("================phone=====================")
for k, v in pairs(user) do for k, v in pairs(user) do
print(string.format("k:%s|v:%s", k, v)) -- print(string.format("k:%s|v:%s", k, v))
end end
--show --show

View File

@ -46,19 +46,16 @@ function M:init(url)
--发送购买给后端 --发送购买给后端
else else
--假数据 --假数据
print("===================shop====================") -- print("===================shop====================")
print(SHOP_LIST[index].num) -- print(SHOP_LIST[index].num)
print(DataManager.SelfUser.diamo) -- print(DataManager.SelfUser.diamo)
DataManager.SelfUser.diamo = DataManager.SelfUser.diamo + SHOP_LIST[index].num DataManager.SelfUser.diamo = DataManager.SelfUser.diamo + SHOP_LIST[index].num
print(DataManager.SelfUser.diamo) -- print(DataManager.SelfUser.diamo)
self.UpdateDiamo() self.UpdateDiamo()
end end
end) end)
shopList:AddChild(shopChild) shopList:AddChild(shopChild)
end end
end end
return M return M

View File

@ -40,7 +40,6 @@ function M:FillData(data)
end end
list.selectedIndex = 0 list.selectedIndex = 0
self:ShowIndex(1) self:ShowIndex(1)
end end
function M:ShowIndex(index) function M:ShowIndex(index)
@ -56,9 +55,7 @@ function M:ShowIndex(index)
-- pic.text = "<img src=\""..notices[index].picture.."\"></img>" -- pic.text = "<img src=\""..notices[index].picture.."\"></img>"
-- pic.text = "<img src=\"".."http://www.w3school.com.cn/i/eg_tulip.jpg".."\"></img>" -- pic.text = "<img src=\"".."http://www.w3school.com.cn/i/eg_tulip.jpg".."\"></img>"
-- print(pic.text) -- -- print(pic.text)
end end
function M:Destroy(flag) function M:Destroy(flag)

View File

@ -18,7 +18,7 @@ function M:init(url)
self.ctr_update = self._view:GetController("update") self.ctr_update = self._view:GetController("update")
if DataManager.SelfUser.password then if DataManager.SelfUser.password then
--self.ctr_update.selectedIndex = 1 --self.ctr_update.selectedIndex = 1
--print("DataManager.SelfUser.account_idDataManager.SelfUser.account_idDataManager.SelfUser.account_id ",DataManager.SelfUser.account_id) ---- print("DataManager.SelfUser.account_idDataManager.SelfUser.account_idDataManager.SelfUser.account_id ",DataManager.SelfUser.account_id)
--self._view:GetChild("tex_phone").text = DataManager.SelfUser.account_id--ViewUtil.phone_hide(DataManager.SelfUser.phone) --self._view:GetChild("tex_phone").text = DataManager.SelfUser.account_id--ViewUtil.phone_hide(DataManager.SelfUser.phone)
end end
@ -75,7 +75,6 @@ end
--绑定 --绑定
function M:Bind() function M:Bind()
local tex_passwd = self._view:GetChild("tex_passwd") local tex_passwd = self._view:GetChild("tex_passwd")
local password = tex_passwd.text local password = tex_passwd.text
if string.len(password) < 6 then if string.len(password) < 6 then
@ -110,7 +109,6 @@ function M:Bind()
end) end)
end end
function M:CheckInputCode() function M:CheckInputCode()
local code = self._view:GetChild("tex_code").text local code = self._view:GetChild("tex_code").text
if not (string.len(code) == 6) then if not (string.len(code) == 6) then

View File

@ -25,7 +25,6 @@ function RankView.new( main_view,video )
end end
function M:init(url) function M:init(url)
BaseWindow.init(self, url) BaseWindow.init(self, url)
self._view:GetController("tab").selectedIndex = self._video and 1 or 0 self._view:GetController("tab").selectedIndex = self._video and 1 or 0
@ -37,15 +36,12 @@ function M:init( url )
for i = 0, 9 do for i = 0, 9 do
local btn = develop_panel:GetChild("btn_" .. i) local btn = develop_panel:GetChild("btn_" .. i)
btn.onClick:Add(function() btn.onClick:Add(function()
if self._curren_len < 6 then if self._curren_len < 6 then
self._curren_tex = self._curren_tex .. i self._curren_tex = self._curren_tex .. i
self._curren_len = self._curren_len + 1 self._curren_len = self._curren_len + 1
self.tex_roomid.text = self._curren_tex self.tex_roomid.text = self._curren_tex
if self._curren_len == 6 then if self._curren_len == 6 then
ViewUtil.ShowModalWait(self._root_view) ViewUtil.ShowModalWait(self._root_view)
local loddyCtr1 = ControllerManager.GetController(LoddyController) local loddyCtr1 = ControllerManager.GetController(LoddyController)
loddyCtr1:RequestRecordList(function(result) loddyCtr1:RequestRecordList(function(result)
@ -79,8 +75,6 @@ function M:init( url )
self._curren_len = 0 self._curren_len = 0
self.tex_roomid.text = self._curren_tex self.tex_roomid.text = self._curren_tex
end) end)
end end
function M:readData() function M:readData()
@ -101,7 +95,6 @@ function M:readData()
self:InitRecord1(loddyCtr1.recordList) self:InitRecord1(loddyCtr1.recordList)
end) end)
end end
@ -118,21 +111,18 @@ end
local load_head_num = 0 local load_head_num = 0
function M:InitRecord1(recordList, develop_tool) function M:InitRecord1(recordList, develop_tool)
---- print("InitRecord1=========")
--print("InitRecord1=========")
pt(recordList) pt(recordList)
local main_view = self._view local main_view = self._view
-- 战绩 list -- 战绩 list
local record_list_1, ctr_recored, ctr_no_record local record_list_1, ctr_recored, ctr_no_record
if develop_tool then if develop_tool then
ctr_recored = main_view:GetController("developer") ctr_recored = main_view:GetController("developer")
ctr_recored.selectedIndex = 1 ctr_recored.selectedIndex = 1
record_list_1 = main_view:GetChild("lst_record") record_list_1 = main_view:GetChild("lst_record")
local btn_backto_search = main_view:GetChild("btn_backto_search") local btn_backto_search = main_view:GetChild("btn_backto_search")
btn_backto_search.onClick:Set(function() btn_backto_search.onClick:Set(function()
ctr_recored.selectedIndex = 0 ctr_recored.selectedIndex = 0
self._curren_tex = "" self._curren_tex = ""
@ -147,7 +137,6 @@ function M:InitRecord1(recordList, develop_tool)
record_list_1:RemoveChildrenToPool() record_list_1:RemoveChildrenToPool()
ctr_no_record.selectedIndex = #recordList == 0 and 1 or 0 ctr_no_record.selectedIndex = #recordList == 0 and 1 or 0
for i = 1, #recordList do for i = 1, #recordList do
local record_list_item = recordList[i] local record_list_item = recordList[i]
local total_score_list = record_list_item.TotalScoreList local total_score_list = record_list_item.TotalScoreList
local item = record_list_1:AddItemFromPool() local item = record_list_1:AddItemFromPool()
@ -208,8 +197,8 @@ function M:InitRecord1(recordList, develop_tool)
end end
-- 点击事件 -- 点击事件
item.onClick:Add(function() item.onClick:Add(function()
self:ShowRecord2(play_back_id, room_type_str, room_id_str, room_time_str, item_score_list, game_id,
self:ShowRecord2(play_back_id, room_type_str, room_id_str, room_time_str,item_score_list, game_id, develop_tool, record_list_item) develop_tool, record_list_item)
end) end)
-- 分享 -- 分享
item:GetChild("btn_screenshot").onClick:Set(function() item:GetChild("btn_screenshot").onClick:Set(function()
@ -266,7 +255,8 @@ function M:InitRecord1(recordList, develop_tool)
end) end)
item:GetChild("btn_link").onClick:Set(function() item:GetChild("btn_link").onClick:Set(function()
local group_id = record_list_item.group_id and tonumber(record_list_item.group_id) or 0 local group_id = record_list_item.group_id and tonumber(record_list_item.group_id) or 0
ShareChatRoom(record_list_item.RoomId, tostring(os.time()), #item_score_list, room_type_str, group_id, player_list, self._root_view) ShareChatRoom(record_list_item.RoomId, tostring(os.time()), #item_score_list, room_type_str, group_id,
player_list, self._root_view)
end) end)
end end
end end
@ -308,7 +298,6 @@ function M:ShowRecord2(playback_id, room_type, room_id, room_time, item_score, g
player_item_list:RemoveChildrenToPool() player_item_list:RemoveChildrenToPool()
for j = 1, #player_score do for j = 1, #player_score do
local player_item = player_item_list:AddItemFromPool() local player_item = player_item_list:AddItemFromPool()
player_item:GetChild("n0").text = player_score[j].Name player_item:GetChild("n0").text = player_score[j].Name
local player_score_text = player_item:GetChild("n1") local player_score_text = player_item:GetChild("n1")
@ -322,13 +311,12 @@ function M:ShowRecord2(playback_id, room_type, room_id, room_time, item_score, g
player_item:GetController("num_color").selectedIndex = 0 player_item:GetController("num_color").selectedIndex = 0
end end
player_score_text.text = score >= 0 and "+" .. score or score player_score_text.text = score >= 0 and "+" .. score or score
end end
local btn_play_back = record_item_2:GetChild("btn_play_back") local btn_play_back = record_item_2:GetChild("btn_play_back")
btn_play_back.onClick:Set(function() btn_play_back.onClick:Set(function()
--print("点击进入回放=====") ---- print("点击进入回放=====")
if DataManager.SelfUser.playback[playback_id] ~= nil and DataManager.SelfUser.playback[playback_id][i] ~= nil then if DataManager.SelfUser.playback[playback_id] ~= nil and DataManager.SelfUser.playback[playback_id][i] ~= nil then
--print("1111111111111111") ---- print("1111111111111111")
local room = ExtendManager.GetExtendConfig(game_id):NewRoom() local room = ExtendManager.GetExtendConfig(game_id):NewRoom()
DataManager.CurrenRoom = room DataManager.CurrenRoom = room
room.game_id = game_id room.game_id = game_id
@ -343,7 +331,7 @@ function M:ShowRecord2(playback_id, room_type, room_id, room_time, item_score, g
main._totalRound = #item_score main._totalRound = #item_score
main:FillRoomData(DataManager.SelfUser.playback[playback_id][i]) main:FillRoomData(DataManager.SelfUser.playback[playback_id][i])
else else
--print("2222222222222") ---- print("2222222222222")
ViewUtil.ShowModalWait(self._view) ViewUtil.ShowModalWait(self._view)
local _data = {} local _data = {}
_data["military_id"] = playback_id _data["military_id"] = playback_id
@ -364,14 +352,13 @@ function M:ShowRecord2(playback_id, room_type, room_id, room_time, item_score, g
main._currentId = playback_id main._currentId = playback_id
main._currentRound = i main._currentRound = i
main._totalRound = #item_score main._totalRound = #item_score
--print(main) ---- print(main)
main:FillRoomData(data) main:FillRoomData(data)
elseif code == 25 then elseif code == 25 then
ViewUtil.ErrorTip(code, "回放未找到!") ViewUtil.ErrorTip(code, "回放未找到!")
btn_play_back.grayed = true btn_play_back.grayed = true
end end
end, record_item.GameInfo) end, record_item.GameInfo)
end end
end) end)
end end
@ -383,7 +370,7 @@ function M:GenaratePlayBack(id, game_id, ...)
if not dview_class then if not dview_class then
local exconfig = ExtendManager.GetExtendConfig(game_id) local exconfig = ExtendManager.GetExtendConfig(game_id)
dview_class = exconfig:GetView(id) dview_class = exconfig:GetView(id)
--print(dview_class) ---- print(dview_class)
end end
if not dview_class then if not dview_class then
return return

View File

@ -42,7 +42,7 @@ function M:init(url)
btn_edit_portrait.onClick:Set(function() btn_edit_portrait.onClick:Set(function()
-- local edit_portrait_view = EditPortraitView.new(function() -- local edit_portrait_view = EditPortraitView.new(function()
-- ImageLoad.Load(DataManager.SelfUser.head_url, btn_head._iconObject) -- ImageLoad.Load(DataManager.SelfUser.head_url, btn_head._iconObject)
-- --print(DataManager.SelfUser.head_url) -- ---- print(DataManager.SelfUser.head_url)
-- self._callback() -- self._callback()
-- end) -- end)
-- edit_portrait_view:Show() -- edit_portrait_view:Show()

View File

@ -23,7 +23,7 @@ LobbyView = {}
local M = {} local M = {}
function LobbyView.new() function LobbyView.new()
-- print("new lobbyView!!!!") -- -- print("new lobbyView!!!!")
setmetatable(M, { __index = BaseView }) setmetatable(M, { __index = BaseView })
local self = setmetatable({}, { __index = M }) local self = setmetatable({}, { __index = M })
self.class = "LobbyView" self.class = "LobbyView"
@ -38,7 +38,7 @@ function LobbyView.new()
end end
function M:InitView(url) function M:InitView(url)
-- print("init lobbyView!!!!") -- -- print("init lobbyView!!!!")
BaseView.InitView(self, url) BaseView.InitView(self, url)
self._full_offset = false self._full_offset = false
local view = self._view local view = self._view
@ -338,7 +338,7 @@ function M:__show_service()
end end
function M:__GetMessage(data) function M:__GetMessage(data)
-- print("on GetMessage~~~~~~~~~~~~~~~~~~~~~~~~~~~") -- -- print("on GetMessage~~~~~~~~~~~~~~~~~~~~~~~~~~~")
if not data or not data.notice_list then if not data or not data.notice_list then
self._mesList = "" self._mesList = ""
else else
@ -364,7 +364,7 @@ function M:__PopMsg(index)
end end
function M:__moveMsg(index) function M:__moveMsg(index)
-- print("on moveMsg!!!!!!!!!!!!!!!!!!!!!!!!!") -- -- print("on moveMsg!!!!!!!!!!!!!!!!!!!!!!!!!")
if not self._tex_message then return end if not self._tex_message then return end
index, self._tex_message.text = self:__PopMsg(index) index, self._tex_message.text = self:__PopMsg(index)
self._tex_message.x = self._message.width self._tex_message.x = self._message.width
@ -392,8 +392,8 @@ end
function M:__ShowShare() function M:__ShowShare()
local pop_share = self._view:GetChild("pop_share") local pop_share = self._view:GetChild("pop_share")
local shareUrl = GetGameInfo("invite_link") .. "?uid=" .. DataManager.SelfUser.account_id local shareUrl = GetGameInfo("invite_link") .. "?uid=" .. DataManager.SelfUser.account_id
--print("shareUrl=================") ---- print("shareUrl=================")
--print(shareUrl) ---- print(shareUrl)
local btn_wx_session = pop_share:GetChild("btn_wx_session") local btn_wx_session = pop_share:GetChild("btn_wx_session")
btn_wx_session.onClick:Add(function() btn_wx_session.onClick:Add(function()
shareQRCodePicture(shareUrl, 0) shareQRCodePicture(shareUrl, 0)
@ -437,7 +437,7 @@ function M:Destroy()
end end
function M:Show() function M:Show()
--print("on lobbyView show~~~~~~") ---- print("on lobbyView show~~~~~~")
BaseView.Show(self) BaseView.Show(self)
ViewUtil.PlaySoundBg() ViewUtil.PlaySoundBg()
UpdateBeat:Add(self.OnUpdate, self) UpdateBeat:Add(self.OnUpdate, self)

View File

@ -26,7 +26,7 @@ function M:init()
local view = self._view local view = self._view
-- view:GetChild("tex_version").text = "Version" .. GetGameInfoPlatform("version") -- view:GetChild("tex_version").text = "Version" .. GetGameInfoPlatform("version")
-- print(GameApplication.Instance.accountTest and 1 or 0) -- -- print(GameApplication.Instance.accountTest and 1 or 0)
view:GetController("test").selectedIndex = GameApplication.Instance.accountTest and 1 or 0 view:GetController("test").selectedIndex = GameApplication.Instance.accountTest and 1 or 0
self.agree = view:GetController("agree"); self.agree = view:GetController("agree");
-- Utils.LoadBg("loginbg", view) -- Utils.LoadBg("loginbg", view)
@ -70,7 +70,7 @@ function M:init()
Utils.SaveLocalFile(key, json.encode(_data)) Utils.SaveLocalFile(key, json.encode(_data))
end) end)
if not s then if not s then
print("Error:" .. e) -- print("Error:" .. e)
end end
DataManager.SelfUser.acc = utez DataManager.SelfUser.acc = utez
@ -218,7 +218,7 @@ end
function M:QuickLogin() function M:QuickLogin()
if (not GameApplication.Instance.accountTest) then if (not GameApplication.Instance.accountTest) then
local session_id = PlayerPrefs.GetString("session_id") local session_id = PlayerPrefs.GetString("session_id")
print("session_id:" .. session_id) -- print("session_id:" .. session_id)
if session_id and string.len(session_id) > 3 then if session_id and string.len(session_id) > 3 then
ViewUtil.ShowModalWait(self._root_view, "正在登录游戏...") ViewUtil.ShowModalWait(self._root_view, "正在登录游戏...")
local loginCtr = ControllerManager.GetController(LoginController) local loginCtr = ControllerManager.GetController(LoginController)
@ -231,8 +231,8 @@ end
function M:LoginCallBack(result, data) function M:LoginCallBack(result, data)
self.isWXCallBackMark = true self.isWXCallBackMark = true
--print("微信登录返回================================================================") ---- print("微信登录返回================================================================")
--print("result===>"..result) ---- print("result===>"..result)
--pt(data) --pt(data)
if (not result) or result ~= 0 then if (not result) or result ~= 0 then
if result == 10 then if result == 10 then

View File

@ -57,9 +57,9 @@ function M:SetTuoGuanState()
end end
function M:InitView(url, isHideIpAdds) function M:InitView(url, isHideIpAdds)
--print("url===>>>") ---- print("url===>>>")
--print(url) ---- print(url)
--print(debug.traceback()) ---- print(debug.traceback())
BaseView.InitView(self, url) BaseView.InitView(self, url)
-- --
@ -668,7 +668,7 @@ function M:EventInit()
_gamectr:AddEventListener( _gamectr:AddEventListener(
GameEvent.TupGuanOpen, GameEvent.TupGuanOpen,
function(...) function(...)
--print("刷新托管数据=====") ---- print("刷新托管数据=====")
local arg = { ... } local arg = { ... }
local p = arg[1] local p = arg[1]
local info = self._player_info[self:GetPos(p.seat)] local info = self._player_info[self:GetPos(p.seat)]
@ -802,17 +802,17 @@ function M:OnPlayerReady(...)
if p.isSendCardState ~= nil and p.isSendCardState == true then if p.isSendCardState ~= nil and p.isSendCardState == true then
p.isSendCardState = false p.isSendCardState = false
ControllerManager.IsSendCard = false ControllerManager.IsSendCard = false
--print("进入设置计时器控制==========") ---- print("进入设置计时器控制==========")
coroutine.start(function() coroutine.start(function()
--print("计时器倒计时5s=============") ---- print("计时器倒计时5s=============")
coroutine.wait(5) coroutine.wait(5)
--print("当前状态==============") ---- print("当前状态==============")
--print(ControllerManager.IsSendCard) ---- print(ControllerManager.IsSendCard)
if ControllerManager.IsSendCard == true then if ControllerManager.IsSendCard == true then
--print("以发送开牌======================") ---- print("以发送开牌======================")
return return
else else
--print("开始断线重连") ---- print("开始断线重连")
--ControllerManager.OnConnect(SocketCode.TimeoutDisconnect) --ControllerManager.OnConnect(SocketCode.TimeoutDisconnect)
ViewManager.refreshGameView() ViewManager.refreshGameView()
end end
@ -1097,7 +1097,7 @@ end
--游戏激活 --游戏激活
function M:OnApplicationActive() function M:OnApplicationActive()
--print("游戏激活================") ---- print("游戏激活================")
if os.time() - last_pause_time > 15 then if os.time() - last_pause_time > 15 then
last_pause_time = os.time() last_pause_time = os.time()
ControllerManager.WebClient:clearActionQueue() ControllerManager.WebClient:clearActionQueue()

View File

@ -238,7 +238,6 @@ local function __fillRoomItem(self, index, item, room)
local hp = p.hp / 1000 local hp = p.hp / 1000
p_head.text_score.text = str1 .. hp p_head.text_score.text = str1 .. hp
end end
else else
p_head.tex_name.text = "智能" p_head.tex_name.text = "智能"
p_head.tex_id.text = "防作弊" p_head.tex_id.text = "防作弊"
@ -345,7 +344,6 @@ local function __fillRoomItem(self, index, item, room)
self.fg_info[key] = room.pid self.fg_info[key] = room.pid
local filename = 'fginfo_' .. DataManager.SelfUser.account_id local filename = 'fginfo_' .. DataManager.SelfUser.account_id
Utils.SaveLocalFile(filename, json.encode(self.fg_info)) Utils.SaveLocalFile(filename, json.encode(self.fg_info))
end end
) )
end end
@ -412,10 +410,7 @@ local function __fillRoomData(self)
table.insert(trooms, room) table.insert(trooms, room)
end end
end end
end end
end end
self.curRooms = membe_clone(trooms) self.curRooms = membe_clone(trooms)
@ -446,11 +441,9 @@ local function __fillRoomData(self)
table.insert(self.curRooms, room) table.insert(self.curRooms, room)
end end
----- -----
end end
else else
if currentGameID == 0 then if currentGameID == 0 then
--printlog("aaaaaaaaaaaaaaaaa222222222222222222222222222") --printlog("aaaaaaaaaaaaaaaaa222222222222222222222222222")
@ -491,9 +484,7 @@ local function __fillRoomData(self)
table.insert(trooms, room) table.insert(trooms, room)
end end
end end
end end
end end
self.curRooms = membe_clone(trooms) self.curRooms = membe_clone(trooms)
@ -527,7 +518,6 @@ local function __fillRoomData(self)
for i = 1, totalNum do for i = 1, totalNum do
self.curRooms[#self.curRooms + 1] = defaultRoom self.curRooms[#self.curRooms + 1] = defaultRoom
end end
end end
end end
else else
@ -587,7 +577,6 @@ local function __fillRoomData(self)
for j = 1, totalNum do for j = 1, totalNum do
self.curRooms[#self.curRooms + 1] = self.curGroup.default_rooms[i] self.curRooms[#self.curRooms + 1] = self.curGroup.default_rooms[i]
end end
end end
end end
end end
@ -601,7 +590,6 @@ local function __fillRoomData(self)
self.lst_room.numItems = #self.curRooms self.lst_room.numItems = #self.curRooms
else else
if self.curGroup.show_num > 0 and #self.curRooms > self.curGroup.show_num then if self.curGroup.show_num > 0 and #self.curRooms > self.curGroup.show_num then
local tr = {} local tr = {}
for j = 1, #self.curRooms do for j = 1, #self.curRooms do
@ -694,7 +682,6 @@ local function __fillPlayItem(self, index, item)
if (index == 0) then if (index == 0) then
tex_game.text = __getLayerName(self, 0) tex_game.text = __getLayerName(self, 0)
else else
pipeijoin.onClick:Add( pipeijoin.onClick:Add(
function() function()
local currentPlayID = self:GetSelectedPlayID() local currentPlayID = self:GetSelectedPlayID()
@ -726,7 +713,6 @@ end
local _iconMap = {} local _iconMap = {}
local function __fillExtendIcon(id, callback) local function __fillExtendIcon(id, callback)
local File = System.IO.File local File = System.IO.File
local path = Application.persistentDataPath .. '/UserData/Icon' local path = Application.persistentDataPath .. '/UserData/Icon'
if not System.IO.Directory.Exists(path) then if not System.IO.Directory.Exists(path) then
@ -814,7 +800,6 @@ local function __fillGameItem(self, index, item)
item:GetChild("n11").text = gameName item:GetChild("n11").text = gameName
end end
item:GetChild("n22").text = index + 1 item:GetChild("n22").text = index + 1
end end
local function __analysePlayListData(self) local function __analysePlayListData(self)
@ -1105,7 +1090,6 @@ function M:InitView(url)
local btn_start2 = self._view:GetChild('btn_start2') local btn_start2 = self._view:GetChild('btn_start2')
btn_start2.onClick:Set( btn_start2.onClick:Set(
function() function()
local currentPlayID = self:GetSelectedPlayID() local currentPlayID = self:GetSelectedPlayID()
if currentPlayID == 0 then if currentPlayID == 0 then
if self.lst_layer.selectedIndex == 0 and self.lst_game.selectedIndex > 0 then if self.lst_layer.selectedIndex == 0 and self.lst_game.selectedIndex > 0 then
@ -1140,7 +1124,6 @@ function M:InitView(url)
else else
self.lst_game:TweenMove(Vector2.New(3, 760), 0.3) self.lst_game:TweenMove(Vector2.New(3, 760), 0.3)
end end
end end
-- function() -- function()
-- local sgv = -- local sgv =
@ -1567,11 +1550,13 @@ function M:_evtUpdateMsg()
self:_setHongDian(true) self:_setHongDian(true)
end end
end end
function M:_setHongDian(isShow) function M:_setHongDian(isShow)
--红点提示 --红点提示
local member_tips = self._view:GetChild('member_tips') local member_tips = self._view:GetChild('member_tips')
member_tips.visible = isShow member_tips.visible = isShow
end end
function M:_evtInvited(...) function M:_evtInvited(...)
local arg = { ... } local arg = { ... }
local data = arg[1] local data = arg[1]
@ -1589,7 +1574,6 @@ end
-- 更新牌友圈事件 -- 更新牌友圈事件
function M:_evtUpdateGroup(...) function M:_evtUpdateGroup(...)
-- local btn_remit = self._view:GetChild('btn_remit') -- local btn_remit = self._view:GetChild('btn_remit')
-- local option = self.curGroup.option or 0 -- local option = self.curGroup.option or 0
@ -1630,7 +1614,7 @@ function M:__refreshManager()
local btn_partner = self._view:GetChild('btn_partner') local btn_partner = self._view:GetChild('btn_partner')
btn_partner.onClick:Set( btn_partner.onClick:Set(
function() function()
--print("成员..........................................") ---- print("成员..........................................")
if not self.mng_view3 then if not self.mng_view3 then
self.mng_view3 = GroupManagerView.new(self._root_view, self.curGroup.id, 5) self.mng_view3 = GroupManagerView.new(self._root_view, self.curGroup.id, 5)
self.mng_view3:SetCurrentGroupInfoViewIns(function() self.mng_view3:SetCurrentGroupInfoViewIns(function()
@ -1662,7 +1646,6 @@ function M:__refreshManager()
) )
end end
function M:OnclickMember() function M:OnclickMember()
if not self.mng_view3 then if not self.mng_view3 then
self.mng_view3 = GroupManagerView.new(self._root_view, self.curGroup.id, 5) self.mng_view3 = GroupManagerView.new(self._root_view, self.curGroup.id, 5)
@ -1861,7 +1844,8 @@ function M:__loadGroupData()
ctrNum = 2 ctrNum = 2
end end
ctrNum = 2 ctrNum = 2
local gmv = GroupMngFagPackView.new(self.curGroup.id, self._root_view,ctrNum,DataManager.SelfUser.account_id) local gmv = GroupMngFagPackView.new(self.curGroup.id, self._root_view, ctrNum,
DataManager.SelfUser.account_id)
gmv:SetCallback( gmv:SetCallback(
function() function()
btn_bxx.selected = false btn_bxx.selected = false
@ -1980,15 +1964,16 @@ function M:showPipei(play)
end end
self._pipeiTime = 20 self._pipeiTime = 20
end end
function M:hidePipei() function M:hidePipei()
--print("hidePipei=============") ---- print("hidePipei=============")
--print(self._view) ---- print(self._view)
--print(self._view:GetController('pipei')) ---- print(self._view:GetController('pipei'))
if self._view:GetController('pipei') then if self._view:GetController('pipei') then
self._view:GetController('pipei').selectedIndex = 0 self._view:GetController('pipei').selectedIndex = 0
end end
end end
function M:SetCallBack(callback) function M:SetCallBack(callback)
self._callback = nil self._callback = nil
self._callback = callback self._callback = callback
@ -2055,4 +2040,3 @@ function M:Destroy()
end end
return M return M

View File

@ -9,7 +9,7 @@ local GroupMainView = {}
local M = GroupMainView local M = GroupMainView
function GroupMainView.new(main_view, root_view, par_veiw) function GroupMainView.new(main_view, root_view, par_veiw)
--print(debug.traceback()) ---- print(debug.traceback())
local self = setmetatable({}, { __index = M }) local self = setmetatable({}, { __index = M })
self.class = 'GroupMainView' self.class = 'GroupMainView'
UIPackage.AddPackage('base/newgroup/ui/NewGroup') UIPackage.AddPackage('base/newgroup/ui/NewGroup')
@ -21,7 +21,7 @@ function GroupMainView.new(main_view, root_view,par_veiw)
end end
function M:InitView(url) function M:InitView(url)
--print(url) ---- print(url)
-- BlurView(self._view:GetChild("bg"),true) -- BlurView(self._view:GetChild("bg"),true)
if DataManager.SelfUser.agent > 0 then if DataManager.SelfUser.agent > 0 then
self._view:GetController('agent').selectedIndex = 1 self._view:GetController('agent').selectedIndex = 1
@ -147,7 +147,6 @@ function M:DEnterGroup()
end end
end end
local function SortGroups(a, b) local function SortGroups(a, b)
local sort_a = 0 local sort_a = 0
local sort_b = 0 local sort_b = 0
@ -294,7 +293,6 @@ function M:Show(fg_id,callback)
callback(-1) callback(-1)
end end
end end
end) end)
end end

View File

@ -57,7 +57,7 @@ function M:init(url, btn_type)
-- 初始化标题列表 -- 初始化标题列表
for i = 1, #self.page_config do for i = 1, #self.page_config do
-- print("page_config:"..self.page_config[i]) -- -- print("page_config:"..self.page_config[i])
local page = getPageConfig(self.page_config[i]) local page = getPageConfig(self.page_config[i])
--如果界面无show_key或圈子中对应的key为true才显示界面 --如果界面无show_key或圈子中对应的key为true才显示界面
if not page.show_key or (page.show_key and group[page.show_key]) then if not page.show_key or (page.show_key and group[page.show_key]) then
@ -138,13 +138,12 @@ function M:init(url, btn_type)
local index = self.ctr_index.selectedIndex local index = self.ctr_index.selectedIndex
local page_info = getPageConfig(self.page_config[index + 1]) local page_info = getPageConfig(self.page_config[index + 1])
if not self._view_map[index + 1] then if not self._view_map[index + 1] then
local tem = page_info.view.new(self.group_id, self._root_view) local tem = page_info.view.new(self.group_id, self._root_view)
-- anchor:AddRelation(self._root_view, RelationType.Size,true) -- anchor:AddRelation(self._root_view, RelationType.Size,true)
--tem._view:Center(true) --tem._view:Center(true)
--print("222222222222222",anchor._view) ---- print("222222222222222",anchor._view)
anchor:AddChild(tem._view) anchor:AddChild(tem._view)
-- tem._view.parent = anchor -- tem._view.parent = anchor
@ -176,12 +175,10 @@ function M:init(url, btn_type)
end) end)
end end
function M:SetCurrentGroupInfoViewIns(groupInfoViewCallBack) function M:SetCurrentGroupInfoViewIns(groupInfoViewCallBack)
self.groupInfoViewCallBack = groupInfoViewCallBack self.groupInfoViewCallBack = groupInfoViewCallBack
end end
-- 获取指定ID的页面 -- 获取指定ID的页面
function M:GetPageByID(id) function M:GetPageByID(id)
for i, v in pairs(self._view_map) do for i, v in pairs(self._view_map) do

View File

@ -456,7 +456,7 @@ function M:FillFagData()
local tex_name = self._view:GetChild("tex_name") local tex_name = self._view:GetChild("tex_name")
local name = tex_name.text local name = tex_name.text
print("jefe:") -- print("jefe:")
pt(self.hpData) pt(self.hpData)
local fgCtr = ControllerManager.GetController(NewGroupController) local fgCtr = ControllerManager.GetController(NewGroupController)
@ -469,7 +469,7 @@ function M:FillFagData()
return return
end end
ViewUtil.CloseModalWait() ViewUtil.CloseModalWait()
--print("======新增玩法=============") ---- print("======新增玩法=============")
--pt(res) --pt(res)
if res.ReturnCode == 0 then if res.ReturnCode == 0 then
local play = {} local play = {}
@ -510,7 +510,7 @@ function M:FillFagData()
return return
end end
ViewUtil.CloseModalWait() ViewUtil.CloseModalWait()
--print("======修改玩法=============") ---- print("======修改玩法=============")
--pt(res) --pt(res)
if res.ReturnCode == 0 then if res.ReturnCode == 0 then
local play = {} local play = {}

View File

@ -52,7 +52,6 @@ function M:init(url)
end end
self.lst_fag.scrollPane.onPullUpRelease:Set(function() self.lst_fag.scrollPane.onPullUpRelease:Set(function()
self:GetData(self.lst_fag.numItems + self.m_index) self:GetData(self.lst_fag.numItems + self.m_index)
end) end)
if not self.not_manager then if not self.not_manager then
self._view:GetController("manager").selectedIndex = 1 self._view:GetController("manager").selectedIndex = 1
@ -75,7 +74,8 @@ function M:init(url)
end end
end) end)
self.time_panel = TimeSettingPanel.new(self._view, self._view:GetChild("btn_date1"), self._view:GetChild("btn_date2"), -308, 0) self.time_panel = TimeSettingPanel.new(self._view, self._view:GetChild("btn_date1"), self._view:GetChild("btn_date2"),
-308, 0)
self.begin_time, self.end_time = self.time_panel:GetDate() self.begin_time, self.end_time = self.time_panel:GetDate()
self._view:GetChild("btn_search").onClick:Set(function() self._view:GetChild("btn_search").onClick:Set(function()
@ -93,7 +93,7 @@ function M:GetFilter()
local filter = 0 local filter = 0
for i = 1, 8 do for i = 1, 8 do
local tem = math.pow(2, i - 1) local tem = math.pow(2, i - 1)
--print("aaaaaaaaaaaaaaaaaaaaaaaa ",tem) ---- print("aaaaaaaaaaaaaaaaaaaaaaaa ",tem)
local btn_filter = self._view:GetChild("btn_filter" .. tem) local btn_filter = self._view:GetChild("btn_filter" .. tem)
if btn_filter and btn_filter.selected then if btn_filter and btn_filter.selected then
filter = filter + tem filter = filter + tem
@ -150,7 +150,8 @@ function M:GetData(index)
if filter == 0 then return end if filter == 0 then return end
ViewUtil.ShowModalWait() ViewUtil.ShowModalWait()
local fgCtr = ControllerManager.GetController(NewGroupController) local fgCtr = ControllerManager.GetController(NewGroupController)
fgCtr:FG_GetMemberHpLog(self.group_id, self.member.uid, index, 6, filter, self.begin_time, self.end_time, function(res) fgCtr:FG_GetMemberHpLog(self.group_id, self.member.uid, index, 6, filter, self.begin_time, self.end_time,
function(res)
if self._is_destroy then if self._is_destroy then
return return
end end
@ -160,7 +161,7 @@ function M:GetData(index)
else else
local data = res.Data.hp_logs local data = res.Data.hp_logs
if #data == 0 then return end if #data == 0 then return end
-- print("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") -- -- print("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
-- pt(data) -- pt(data)
-- pt(self.member) -- pt(self.member)
for i = 1, #data do for i = 1, #data do
@ -217,7 +218,6 @@ function M:GuoLv(data)
end end
self.m_index = #data - #m_data_other + self.m_index self.m_index = #data - #m_data_other + self.m_index
end end
end end
local function fillItem(data, obj) local function fillItem(data, obj)

View File

@ -18,7 +18,7 @@ function GroupMemberOperateView.new(group_id, member, callBack,callBack1)
self.class = "GroupMemberOperateView" self.class = "GroupMemberOperateView"
self._close_destroy = true self._close_destroy = true
-- self._blur_view = blur_view -- self._blur_view = blur_view
--print("GroupMemberOperateView==============") ---- print("GroupMemberOperateView==============")
--pt(member) --pt(member)
self.member = member self.member = member
self.group_id = group_id self.group_id = group_id
@ -50,7 +50,7 @@ function M:init(url)
local member = self.member local member = self.member
local group = DataManager.groups:get(self.group_id) local group = DataManager.groups:get(self.group_id)
--print("DataManager.groups:get(self.group_id)") ---- print("DataManager.groups:get(self.group_id)")
--pt(group) --pt(group)
local perm_array = MngPermission.getPermData(group.permission) local perm_array = MngPermission.getPermData(group.permission)
@ -105,7 +105,6 @@ function M:init(url)
local fgCtr = ControllerManager.GetController(NewGroupController) local fgCtr = ControllerManager.GetController(NewGroupController)
self._view:GetChild("btn_deploy").onClick:Set(function() self._view:GetChild("btn_deploy").onClick:Set(function()
local gniv = GroupNumberInputView.new(nil, function(num) local gniv = GroupNumberInputView.new(nil, function(num)
ViewUtil.ShowModalWait() ViewUtil.ShowModalWait()
local parent_id = tonumber(num) local parent_id = tonumber(num)
@ -192,7 +191,6 @@ function M:init(url)
end) end)
end) end)
_curren_msg:Show() _curren_msg:Show()
end) end)
end end
@ -232,8 +230,8 @@ function M:init(url)
end) end)
end end
--print("group.type=====================") ---- print("group.type=====================")
--print(group.type) ---- print(group.type)
--pt(group) --pt(group)
if member.partnerLev > 0 and group.type == 2 and member.uid ~= DataManager.SelfUser.account_id then if member.partnerLev > 0 and group.type == 2 and member.uid ~= DataManager.SelfUser.account_id then
local btn_ban = lst_mng:AddItemFromPool() local btn_ban = lst_mng:AddItemFromPool()
@ -309,11 +307,8 @@ function M:init(url)
else else
ViewUtil.ErrorTip(res.ReturnCode, "获取整组调度失败!") ViewUtil.ErrorTip(res.ReturnCode, "获取整组调度失败!")
end end
end) end)
end) end)
end end
@ -504,5 +499,4 @@ function M:MovePartner(parent_id, member, obj)
end) end)
end end
return M return M

View File

@ -65,7 +65,7 @@ function M:OnRenderItem(index, obj)
local hpStr local hpStr
local hpData = json.decode(play.hpData) local hpData = json.decode(play.hpData)
if play.hpOnOff == 1 then if play.hpOnOff == 1 then
-- print(vardump(play)) -- -- print(vardump(play))
local str_reward_type = play.rewardType == 1 and "赢家返点" or (play.rewardType == 2 and "人头返点") local str_reward_type = play.rewardType == 1 and "赢家返点" or (play.rewardType == 2 and "人头返点")
local str_reward_val = play.rewardValueType == 1 and "百分比返点" or "固定值返点" local str_reward_val = play.rewardValueType == 1 and "百分比返点" or "固定值返点"
local str_hp_type = hpData.type == 1 and "固定抽水" or "浮动抽水" local str_hp_type = hpData.type == 1 and "固定抽水" or "浮动抽水"

View File

@ -62,15 +62,15 @@ function M:FillView()
end end
self.lst_member.scrollPane.onPullUpRelease:Set( self.lst_member.scrollPane.onPullUpRelease:Set(
function() function()
--print("aaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbb ",self.lst_member.numItems) ---- print("aaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbb ",self.lst_member.numItems)
self:GetMemberData(self.lst_member.numItems) self:GetMemberData(self.lst_member.numItems)
end end
) )
--local n50=self._view:GetChild('n50') --local n50=self._view:GetChild('n50')
--print(n50) ---- print(n50)
--n50.displayObject.gameObject.transform.localPosition.x=214 --n50.displayObject.gameObject.transform.localPosition.x=214
--print(n50.displayObject.gameObject.transform.localPosition.x) ---- print(n50.displayObject.gameObject.transform.localPosition.x)
-- 搜索玩家 -- 搜索玩家
local ctr_search = self._view:GetController('search') local ctr_search = self._view:GetController('search')
self._view:GetChild('btn_search').onClick:Set( self._view:GetChild('btn_search').onClick:Set(
@ -174,9 +174,6 @@ function M:FillView()
self:initData() self:initData()
end end
) )
end end
-- 快速访问 -- 快速访问
@ -187,8 +184,8 @@ end
-- 获取成员数据 -- 获取成员数据
function M:GetMemberData(index) function M:GetMemberData(index)
--print("11111111111111111111") ---- print("11111111111111111111")
--print(debug.traceback()) ---- print(debug.traceback())
local group = DataManager.groups:get(self.group_id) local group = DataManager.groups:get(self.group_id)
if index == 0 then if index == 0 then
group:clearMember() group:clearMember()

View File

@ -71,7 +71,6 @@ function M:FillView()
self.online = tonumber(rtype.value) self.online = tonumber(rtype.value)
self:GetMemberData(0) self:GetMemberData(0)
--printlog("aaaaaaaa222222222222222222222222222222") --printlog("aaaaaaaa222222222222222222222222222222")
end) end)
-- 初始化成员列表 -- 初始化成员列表
@ -88,9 +87,9 @@ function M:FillView()
) )
--local n50=self._view:GetChild('n50') --local n50=self._view:GetChild('n50')
--print(n50) ---- print(n50)
--n50.displayObject.gameObject.transform.localPosition.x=214 --n50.displayObject.gameObject.transform.localPosition.x=214
--print(n50.displayObject.gameObject.transform.localPosition.x) ---- print(n50.displayObject.gameObject.transform.localPosition.x)
-- 搜索玩家 -- 搜索玩家
local ctr_search = self._view:GetController('search') local ctr_search = self._view:GetController('search')
self._view:GetChild('btn_search').onClick:Set( self._view:GetChild('btn_search').onClick:Set(
@ -200,13 +199,10 @@ function M:FillView()
--self._view:GetChild("n50").selected = true --self._view:GetChild("n50").selected = true
ctr_page.onChanged:Set( ctr_page.onChanged:Set(
function() function()
self.stype = ctr_page.selectedIndex + 1 self.stype = ctr_page.selectedIndex + 1
self:initData() self:initData()
end end
) )
end end
-- 快速访问 -- 快速访问
@ -217,8 +213,8 @@ end
-- 获取成员数据 -- 获取成员数据
function M:GetMemberData(index) function M:GetMemberData(index)
--print("11111111111111111111") ---- print("11111111111111111111")
--print(debug.traceback()) ---- print(debug.traceback())
-- local iClear = false -- local iClear = false
-- local rtype = self._view:GetChild("n132").value -- local rtype = self._view:GetChild("n132").value
-- if tostring(self.online) ~= rtype then -- if tostring(self.online) ~= rtype then
@ -324,7 +320,7 @@ function M:FillItem(obj, member, refresh)
-- else -- else
-- obj:GetChild('tex_last_login').text = os.date('%Y/%m/%d', member.last_time) -- obj:GetChild('tex_last_login').text = os.date('%Y/%m/%d', member.last_time)
-- end -- end
--print("11111aaaaaaaaaaaaaaaaaaaa ",os.date('%Y/%m/%d', member.last_time)) ---- print("11111aaaaaaaaaaaaaaaaaaaa ",os.date('%Y/%m/%d', member.last_time))
obj:GetChild('tex_last_login').text = "最近登录:" .. os.date('%Y/%m/%d', member.last_time) obj:GetChild('tex_last_login').text = "最近登录:" .. os.date('%Y/%m/%d', member.last_time)
else else
obj:GetChild('tex_last_login').text = '加入时间\n' .. os.date('%Y/%m/%d', member.join_time) obj:GetChild('tex_last_login').text = '加入时间\n' .. os.date('%Y/%m/%d', member.join_time)
@ -451,7 +447,8 @@ function M:FillItem(obj, member, refresh)
) )
local btnBxx = obj:GetChild('btn_bxx') local btnBxx = obj:GetChild('btn_bxx')
btnBxx.visible = (not (member.lev == 3 and member.partnerLev == 0)) and not (DataManager.SelfUser.account_id == member.uid) btnBxx.visible = (not (member.lev == 3 and member.partnerLev == 0)) and
not (DataManager.SelfUser.account_id == member.uid)
--btnBxx.visible = not (DataManager.SelfUser.account_id == member.uid) --btnBxx.visible = not (DataManager.SelfUser.account_id == member.uid)
obj:GetChild('btn_bxx').onClick:Set( obj:GetChild('btn_bxx').onClick:Set(
function() function()

View File

@ -87,10 +87,8 @@ function M:init()
if self.PlayerTGTips and self.PlayerTGTips.displayObject.gameObject then if self.PlayerTGTips and self.PlayerTGTips.displayObject.gameObject then
self.PlayerTGTips.displayObject.gameObject:SetActive(false) self.PlayerTGTips.displayObject.gameObject:SetActive(false)
end end
end end
function M:IsShowTGTips(isShow, time) function M:IsShowTGTips(isShow, time)
--printlog("isShowisShowisShow==== ",isShow," time ",time) --printlog("isShowisShowisShow==== ",isShow," time ",time)
if time == nil then time = 0 end if time == nil then time = 0 end
@ -116,10 +114,8 @@ function M:IsShowTGTips(isShow,time)
--UpdateBeat:Remove(self.OnUpdate,self) --UpdateBeat:Remove(self.OnUpdate,self)
TimerManager.RemoveTimer(self.OnUpdate, self) TimerManager.RemoveTimer(self.OnUpdate, self)
end end
end end
function M:OnUpdate() function M:OnUpdate()
--printlog("OnUpdate=====================") --printlog("OnUpdate=====================")
if self.isShowTGTimer then if self.isShowTGTimer then
@ -144,7 +140,6 @@ function M:OnUpdate()
self:muShiPlayerUpdate() self:muShiPlayerUpdate()
end end
end end
end end
function M:FillData(player) function M:FillData(player)
@ -208,7 +203,7 @@ function M:UpdateScore(score)
local room = DataManager.CurrenRoom local room = DataManager.CurrenRoom
if room:checkHpNonnegative() then if room:checkHpNonnegative() then
if self._player.cur_hp then if self._player.cur_hp then
-- print(self._player.total_hp) -- -- print(self._player.total_hp)
-- if self._player.total_hp then -- if self._player.total_hp then
-- score = d2ad(self._player.total_hp).."/"..d2ad(self._player.cur_hp) -- score = d2ad(self._player.total_hp).."/"..d2ad(self._player.cur_hp)
-- else -- else
@ -339,9 +334,11 @@ function M:MarkTuoguan()
local com_tuoguan = UIPackage.CreateObjectFromURL('ui://Common/com_tuoguan') local com_tuoguan = UIPackage.CreateObjectFromURL('ui://Common/com_tuoguan')
self:AddMarkToHead(com_tuoguan, 'mark_tuoguan') self:AddMarkToHead(com_tuoguan, 'mark_tuoguan')
end end
function M:UnmarkTuoguan() function M:UnmarkTuoguan()
self:RemoveMarkFromHead('mark_tuoguan') self:RemoveMarkFromHead('mark_tuoguan')
end end
-- 动态的往头像上加载组件 -- 动态的往头像上加载组件
function M:AddMarkToHead(com, key) function M:AddMarkToHead(com, key)
if key then if key then
@ -354,6 +351,7 @@ function M:AddMarkToHead(com, key)
com.touchable = false com.touchable = false
com.xy = self:GetHeadCenter() com.xy = self:GetHeadCenter()
end end
-- 动态移除组件 -- 动态移除组件
function M:RemoveMarkFromHead(key) function M:RemoveMarkFromHead(key)
if self[key] then if self[key] then
@ -369,5 +367,4 @@ function M:Destroy()
self.muShiPlayerUpdate = nil self.muShiPlayerUpdate = nil
end end
return M return M

View File

@ -128,7 +128,7 @@ function M:FillData(player)
end end
end end
print("============================playinfoview") -- print("============================playinfoview")
pt(player) pt(player)
if isHidden if isHidden

View File

@ -129,8 +129,8 @@ end
function ViewUtil.HandCardSort2(a, b) function ViewUtil.HandCardSort2(a, b)
a = tonumber(string.sub(a, 2)) a = tonumber(string.sub(a, 2))
b = tonumber(string.sub(b, 2)) b = tonumber(string.sub(b, 2))
--print(a) ---- print(a)
--print(b) ---- print(b)
return a < b return a < b
end end
@ -242,7 +242,7 @@ function get_gps(callback)
end) end)
end) end)
if not s then if not s then
--print("Error" .. e) ---- print("Error" .. e)
end end
elseif Application.platform == RuntimePlatform.WindowsPlayer or Application.platform == RuntimePlatform.WindowsEditor then elseif Application.platform == RuntimePlatform.WindowsPlayer or Application.platform == RuntimePlatform.WindowsEditor then
-- DataManager.SelfUser.location = Location.new(string.format("%s,%s", math.random(10,20), math.random(10,20))) -- DataManager.SelfUser.location = Location.new(string.format("%s,%s", math.random(10,20), math.random(10,20)))

View File

@ -53,7 +53,7 @@ local function __NetTip(txt_msg)
end end
local function __OnGameConnectAction(state) local function __OnGameConnectAction(state)
--print("state:"..state) ---- print("state:"..state)
NetResetConnectWindow.CloseNetReset() NetResetConnectWindow.CloseNetReset()
if state == SocketCode.Connect then if state == SocketCode.Connect then
ViewManager.ChangeView(ViewManager.View_Main, DataManager.CurrenRoom.game_id) ViewManager.ChangeView(ViewManager.View_Main, DataManager.CurrenRoom.game_id)
@ -150,14 +150,14 @@ function ViewManager.ChangeView(id, game_id, callback)
end end
function ViewManager.OnApplicationPause() function ViewManager.OnApplicationPause()
-- print("game pause") -- -- print("game pause")
if (_currenView ~= nil) then if (_currenView ~= nil) then
_currenView:OnApplicationPause() _currenView:OnApplicationPause()
end end
end end
function ViewManager.OnApplicationActive() function ViewManager.OnApplicationActive()
-- print("game active") -- -- print("game active")
if (_currenView ~= nil) then if (_currenView ~= nil) then
_currenView:OnApplicationActive() _currenView:OnApplicationActive()
end end

View File

@ -392,6 +392,7 @@ local function createJson()
function json.null() function json.null()
return json.null -- so json.null() will also return null ;-) return json.null -- so json.null() will also return null ;-)
end end
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- Internal, PRIVATE functions. -- Internal, PRIVATE functions.
-- Following a Python-like convention, I have prefixed all these 'PRIVATE' -- Following a Python-like convention, I have prefixed all these 'PRIVATE'
@ -817,6 +818,7 @@ function luaIdePrintWarn(...)
end end
end end
end end
function luaIdePrintErr(...) function luaIdePrintErr(...)
if (LuaDebugger.isProntToConsole == 1 or LuaDebugger.isProntToConsole == 3) then if (LuaDebugger.isProntToConsole == 1 or LuaDebugger.isProntToConsole == 3) then
debugger_print(...) debugger_print(...)
@ -840,6 +842,7 @@ function luaIdePrintErr(...)
end end
end end
end end
--@endregion --@endregion
--@region 辅助方法 --@region 辅助方法
@ -977,7 +980,7 @@ local function debugger_dump(value, desciption, nesting)
return tostring(v) return tostring(v)
end end
local traceback = debugger_strSplit(debug.traceback("", 2), "\n") local traceback = debugger_strSplit(debug.traceback("", 2), "\n")
print("dump from: " .. debugger_strTrim(traceback[3])) -- print("dump from: " .. debugger_strTrim(traceback[3]))
local function _dump(value, desciption, indent, nest, keylen) local function _dump(value, desciption, indent, nest, keylen)
desciption = desciption or "<var>" desciption = desciption or "<var>"
local spc = "" local spc = ""
@ -1026,7 +1029,7 @@ local function debugger_dump(value, desciption, nesting)
end end
_dump(value, desciption, "- ", 1) _dump(value, desciption, "- ", 1)
for i, line in ipairs(result) do for i, line in ipairs(result) do
print(line) -- print(line)
end end
end end
--@endregion --@endregion
@ -1035,9 +1038,7 @@ local function debugger_valueToString(v)
local vstr = nil local vstr = nil
if (vtype == "userdata") then if (vtype == "userdata") then
if (LuaDebugger.isFoxGloryProject) then if (LuaDebugger.isFoxGloryProject) then
return "userdata", vtype return "userdata", vtype
else else
return tostring(v), vtype return tostring(v), vtype
end end
@ -1167,7 +1168,7 @@ local function debugger_receiveDebugBreakInfo()
if (jit) then if (jit) then
if (LuaDebugger.debugLuaType ~= "jit") then if (LuaDebugger.debugLuaType ~= "jit") then
local msg = "当前luajit版本为: " .. jit.version .. " 请使用LuaDebugjit 进行调试!" local msg = "当前luajit版本为: " .. jit.version .. " 请使用LuaDebugjit 进行调试!"
print(msg) -- print(msg)
end end
end end
if (breakInfoSocket) then if (breakInfoSocket) then
@ -1187,7 +1188,7 @@ local function debugger_receiveDebugBreakInfo()
LuaDebugger.reLoadFileBody = netData.data LuaDebugger.reLoadFileBody = netData.data
LuaDebugger.isReLoadFile = false LuaDebugger.isReLoadFile = false
LuaDebugger.reLoadFileBody.isReLoad = debugger_reLoadFile(LuaDebugger.reLoadFileBody) LuaDebugger.reLoadFileBody.isReLoad = debugger_reLoadFile(LuaDebugger.reLoadFileBody)
print("重载结果:",LuaDebugger.reLoadFileBody.isReLoad) -- print("重载结果:",LuaDebugger.reLoadFileBody.isReLoad)
LuaDebugger.reLoadFileBody.script = nil LuaDebugger.reLoadFileBody.script = nil
debugger_sendMsg( debugger_sendMsg(
breakInfoSocket, breakInfoSocket,
@ -1332,18 +1333,17 @@ function debugger_conditionStr(condition, vars, callBack)
xpcall( xpcall(
loadScript, loadScript,
function(error) function(error)
print(error) -- print(error)
end end
) )
if (status and msg) then if (status and msg) then
callBack() callBack()
end end
end end
--执行lua字符串 --执行lua字符串
debugger_exeLuaString = function() debugger_exeLuaString = function()
local function loadScript() local function loadScript()
local script = LuaDebugger.loadScriptBody.script local script = LuaDebugger.loadScriptBody.script
if (LuaDebugger.loadScriptBody.isBreak) then if (LuaDebugger.loadScriptBody.isBreak) then
local currentTabble = { _G = _G } local currentTabble = { _G = _G }
@ -1374,18 +1374,17 @@ debugger_exeLuaString = function()
xpcall( xpcall(
loadScript, loadScript,
function(error) function(error)
-- debugger_sendMsg(debug_server, LuaDebugger.event.C2S_LoadLuaScript, LuaDebugger.loadScriptBody) -- debugger_sendMsg(debug_server, LuaDebugger.event.C2S_LoadLuaScript, LuaDebugger.loadScriptBody)
end end
) )
LuaDebugger.loadScriptBody.script = nil LuaDebugger.loadScriptBody.script = nil
if (LuaDebugger.loadScriptBody.isBreak) then if (LuaDebugger.loadScriptBody.isBreak) then
LuaDebugger.serVarLevel = LuaDebugger.serVarLevel + 1 LuaDebugger.serVarLevel = LuaDebugger.serVarLevel + 1
LuaDebugger.currentDebuggerData = debugger_stackInfo(LuaDebugger.serVarLevel, LuaDebugger.event.C2S_HITBreakPoint) LuaDebugger.currentDebuggerData = debugger_stackInfo(LuaDebugger.serVarLevel, LuaDebugger.event
.C2S_HITBreakPoint)
LuaDebugger.loadScriptBody.stack = LuaDebugger.currentDebuggerData.stack LuaDebugger.loadScriptBody.stack = LuaDebugger.currentDebuggerData.stack
end end
LuaDebugger.loadScriptBody.complete = true LuaDebugger.loadScriptBody.complete = true
end end
--@region 调试中修改变量值 --@region 调试中修改变量值
@ -1410,12 +1409,10 @@ local function debugger_getTablekey(key,keyType,value)
end end
end end
end end
end end
end end
local function debugger_setVarValue(server, data) local function debugger_setVarValue(server, data)
local newValue = nil local newValue = nil
local level = LuaDebugger.serVarLevel + LuaDebugger.setVarBody.frameId local level = LuaDebugger.serVarLevel + LuaDebugger.setVarBody.frameId
local firstKeyName = data.keys[1] local firstKeyName = data.keys[1]
@ -1490,7 +1487,7 @@ local function debugger_setVarValue(server, data)
xpcall( xpcall(
loadScript, loadScript,
function(error) function(error)
print(error, "============================") -- print(error, "============================")
end end
) )
@ -1501,7 +1498,6 @@ local function debugger_setVarValue(server, data)
if (keyLength == 1) then if (keyLength == 1) then
if (localValueChangeIndex ~= -1) then if (localValueChangeIndex ~= -1) then
debug.setlocal(level, localValueChangeIndex, newValue) debug.setlocal(level, localValueChangeIndex, newValue)
elseif (upValueFun ~= nil) then elseif (upValueFun ~= nil) then
debug.setupvalue(upValueFun, upValueChangeIndex, newValue) debug.setupvalue(upValueFun, upValueChangeIndex, newValue)
@ -1531,7 +1527,6 @@ local function debugger_setVarValue(server, data)
data.varInfo = varInfo data.varInfo = varInfo
LuaDebugger.serVarLevel = LuaDebugger.serVarLevel + 1 LuaDebugger.serVarLevel = LuaDebugger.serVarLevel + 1
LuaDebugger.currentDebuggerData = debugger_stackInfo(LuaDebugger.serVarLevel, LuaDebugger.event.C2S_HITBreakPoint) LuaDebugger.currentDebuggerData = debugger_stackInfo(LuaDebugger.serVarLevel, LuaDebugger.event.C2S_HITBreakPoint)
end end
--@endregion --@endregion
@ -1549,7 +1544,7 @@ checkSetVar =
xpcall( xpcall(
checkSetVar, checkSetVar,
function(error) function(error)
print("设置变量", error) -- print("设置变量", error)
end end
) )
elseif (LuaDebugger.isLoadLuaScript) then elseif (LuaDebugger.isLoadLuaScript) then
@ -1560,20 +1555,20 @@ checkSetVar =
xpcall( xpcall(
checkSetVar, checkSetVar,
function(error) function(error)
print("执行代码", error) -- print("执行代码", error)
end end
) )
elseif (LuaDebugger.isReLoadFile) then elseif (LuaDebugger.isReLoadFile) then
LuaDebugger.isReLoadFile = false LuaDebugger.isReLoadFile = false
LuaDebugger.reLoadFileBody.isReLoad = debugger_reLoadFile(LuaDebugger.reLoadFileBody) LuaDebugger.reLoadFileBody.isReLoad = debugger_reLoadFile(LuaDebugger.reLoadFileBody)
print("重载结果:",LuaDebugger.reLoadFileBody.isReLoad) -- print("重载结果:",LuaDebugger.reLoadFileBody.isReLoad)
LuaDebugger.reLoadFileBody.script = nil LuaDebugger.reLoadFileBody.script = nil
LuaDebugger.serVarLevel = LuaDebugger.serVarLevel + 1 LuaDebugger.serVarLevel = LuaDebugger.serVarLevel + 1
_resume(coro_debugger, LuaDebugger.reLoadFileBody) _resume(coro_debugger, LuaDebugger.reLoadFileBody)
xpcall( xpcall(
checkSetVar, checkSetVar,
function(error) function(error)
print("重新加载文件", error) -- print("重新加载文件", error)
end end
) )
end end
@ -1627,7 +1622,7 @@ local function debugger_getValueByScript(value, script)
val = fun() val = fun()
end, end,
function(error) function(error)
print(error, "====>") -- print(error, "====>")
val = nil val = nil
end end
) )
@ -1894,7 +1889,6 @@ local function debugger_sendTableValues(value, server, variablesReference, debug
vinfos = {} vinfos = {}
end end
end end
end end
else else
m = getmetatable(value) m = getmetatable(value)
@ -1944,7 +1938,6 @@ local function debugger_getBreakVar(body, server)
if (value) then if (value) then
local valueType = type(value) local valueType = type(value)
if (valueType == "table" or valueType == "userdata") then if (valueType == "table" or valueType == "userdata") then
debugger_sendTableValues(value, server, variablesReference, debugSpeedIndex) debugger_sendTableValues(value, server, variablesReference, debugSpeedIndex)
else else
if (valueType == "function") then if (valueType == "function") then
@ -1979,9 +1972,9 @@ local function debugger_getBreakVar(body, server)
xpcall( xpcall(
exe, exe,
function(error) function(error)
-- print("获取变量错误 错误消息-----------------") -- -- print("获取变量错误 错误消息-----------------")
-- print(error) -- -- print(error)
-- print(debug.traceback("", 2)) -- -- print(debug.traceback("", 2))
debugger_sendMsg( debugger_sendMsg(
server, server,
LuaDebugger.event.C2S_ReqVar, LuaDebugger.event.C2S_ReqVar,
@ -2036,7 +2029,6 @@ local function debugger_loop(server)
debug.sethook() debug.sethook()
coroutine.yield() coroutine.yield()
end end
elseif event == LuaDebugger.event.S2C_SetBreakPoints then elseif event == LuaDebugger.event.S2C_SetBreakPoints then
--设置断点信息 --设置断点信息
local function setB() local function setB()
@ -2045,7 +2037,7 @@ local function debugger_loop(server)
xpcall( xpcall(
setB, setB,
function(error) function(error)
print(error) -- print(error)
end end
) )
elseif event == LuaDebugger.event.S2C_RUN then --开始运行 elseif event == LuaDebugger.event.S2C_RUN then --开始运行
@ -2156,7 +2148,6 @@ local function debugger_loop(server)
end end
coro_debugger = coroutine.create(debugger_loop) coro_debugger = coroutine.create(debugger_loop)
debug_hook = function(event, line) debug_hook = function(event, line)
if (not LuaDebugger.isHook) then if (not LuaDebugger.isHook) then
return return
end end
@ -2165,9 +2156,7 @@ debug_hook = function(event, line)
if (event == "line") then if (event == "line") then
local isCheck = false local isCheck = false
for k, breakInfo in pairs(LuaDebugger.breakInfos) do for k, breakInfo in pairs(LuaDebugger.breakInfos) do
for bk, linesInfo in pairs(breakInfo) do for bk, linesInfo in pairs(breakInfo) do
if (linesInfo.lines and linesInfo.lines[line]) then if (linesInfo.lines and linesInfo.lines[line]) then
isCheck = true isCheck = true
break break
@ -2209,7 +2198,7 @@ debug_hook = function(event, line)
return return
end end
-- debugger_dump(LuaDebugger,"LuaDebugger") -- debugger_dump(LuaDebugger,"LuaDebugger")
-- print(LuaDebugger.StepNextLevel,"LuaDebugger.StepNextLevel") -- -- print(LuaDebugger.StepNextLevel,"LuaDebugger.StepNextLevel")
local file = nil local file = nil
if (event == "call") then if (event == "call") then
-- end -- end
@ -2217,7 +2206,7 @@ debug_hook = function(event, line)
if (not LuaDebugger.Run) then if (not LuaDebugger.Run) then
LuaDebugger.StepNextLevel = LuaDebugger.StepNextLevel + 1 LuaDebugger.StepNextLevel = LuaDebugger.StepNextLevel + 1
end end
-- print("stepIn",LuaDebugger.StepNextLevel) -- -- print("stepIn",LuaDebugger.StepNextLevel)
local stepInfo = getinfo(2, "S") local stepInfo = getinfo(2, "S")
local source = stepInfo.source local source = stepInfo.source
@ -2259,7 +2248,6 @@ debug_hook = function(event, line)
local breakInfo = LuaDebugger.breakInfos[file] local breakInfo = LuaDebugger.breakInfos[file]
local breakData = nil local breakData = nil
if (breakInfo) then if (breakInfo) then
local ischeck = false local ischeck = false
for k, lineInfo in pairs(breakInfo) do for k, lineInfo in pairs(breakInfo) do
local lines = lineInfo.lines local lines = lineInfo.lines
@ -2396,8 +2384,8 @@ local function start()
local fullName, dirName, fileName = debugger_getFilePathInfo(getinfo(1).source) local fullName, dirName, fileName = debugger_getFilePathInfo(getinfo(1).source)
LuaDebugger.DebugLuaFie = fileName LuaDebugger.DebugLuaFie = fileName
local socket = createSocket() local socket = createSocket()
print(controller_host) -- print(controller_host)
print(controller_port) -- print(controller_port)
local server = socket.connect(controller_host, controller_port) local server = socket.connect(controller_host, controller_port)
debug_server = server debug_server = server
@ -2427,15 +2415,15 @@ local function start()
debug.sethook(debug_hook, "lrc") debug.sethook(debug_hook, "lrc")
end, end,
function(error) function(error)
print("error:", error) -- print("error:", error)
end end
) )
if (jit) then if (jit) then
if (LuaDebugger.debugLuaType ~= "jit") then if (LuaDebugger.debugLuaType ~= "jit") then
print("error======================================================") -- print("error======================================================")
local msg = "当前luajit版本为: " .. jit.version .. " 请使用LuaDebugjit 进行调试!" local msg = "当前luajit版本为: " .. jit.version .. " 请使用LuaDebugjit 进行调试!"
print(msg) -- print(msg)
end end
end end
_resume(coro_debugger, server) _resume(coro_debugger, server)
@ -2444,16 +2432,16 @@ local function start()
end end
function StartDebug(host, port) function StartDebug(host, port)
if (not host) then if (not host) then
print("error host nil") -- print("error host nil")
end end
if (not port) then if (not port) then
print("error prot nil") -- print("error prot nil")
end end
if (type(host) ~= "string") then if (type(host) ~= "string") then
print("error host not string") -- print("error host not string")
end end
if (type(port) ~= "number") then if (type(port) ~= "number") then
print("error host not number") -- print("error host not number")
end end
controller_host = host controller_host = host
controller_port = port controller_port = port
@ -2461,7 +2449,7 @@ function StartDebug(host, port)
start, start,
function(error) function(error)
-- body -- body
print(error) -- print(error)
end end
) )
return debugger_receiveDebugBreakInfo, debugger_xpcall return debugger_receiveDebugBreakInfo, debugger_xpcall
@ -2611,7 +2599,4 @@ function ZZBase64.__decodeLeft2(res, index, text, len)
res[index] = string.char(num) res[index] = string.char(num)
end end
return StartDebug return StartDebug

View File

@ -366,6 +366,7 @@ local function createJson()
function json.null() function json.null()
return json.null -- so json.null() will also return null ;-) return json.null -- so json.null() will also return null ;-)
end end
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- Internal, PRIVATE functions. -- Internal, PRIVATE functions.
-- Following a Python-like convention, I have prefixed all these 'PRIVATE' -- Following a Python-like convention, I have prefixed all these 'PRIVATE'
@ -788,6 +789,7 @@ function luaIdePrintWarn(...)
end end
end end
end end
function luaIdePrintErr(...) function luaIdePrintErr(...)
if (LuaDebugger.isProntToConsole == 1 or LuaDebugger.isProntToConsole == 3) then if (LuaDebugger.isProntToConsole == 1 or LuaDebugger.isProntToConsole == 3) then
debugger_print(...) debugger_print(...)
@ -811,6 +813,7 @@ function luaIdePrintErr(...)
end end
end end
end end
--@endregion --@endregion
--@region 辅助方法 --@region 辅助方法
@ -948,7 +951,7 @@ local function debugger_dump(value, desciption, nesting)
return tostring(v) return tostring(v)
end end
local traceback = debugger_strSplit(debug.traceback("", 2), "\n") local traceback = debugger_strSplit(debug.traceback("", 2), "\n")
print("dump from: " .. debugger_strTrim(traceback[3])) -- print("dump from: " .. debugger_strTrim(traceback[3]))
local function _dump(value, desciption, indent, nest, keylen) local function _dump(value, desciption, indent, nest, keylen)
desciption = desciption or "<var>" desciption = desciption or "<var>"
local spc = "" local spc = ""
@ -997,7 +1000,7 @@ local function debugger_dump(value, desciption, nesting)
end end
_dump(value, desciption, "- ", 1) _dump(value, desciption, "- ", 1)
for i, line in ipairs(result) do for i, line in ipairs(result) do
print(line) -- print(line)
end end
end end
--@endregion --@endregion
@ -1006,9 +1009,7 @@ local function debugger_valueToString(v)
local vstr = nil local vstr = nil
if (vtype == "userdata") then if (vtype == "userdata") then
if (LuaDebugger.isFoxGloryProject) then if (LuaDebugger.isFoxGloryProject) then
return "userdata", vtype return "userdata", vtype
else else
return tostring(v), vtype return tostring(v), vtype
end end
@ -1020,7 +1021,6 @@ local function debugger_valueToString(v)
else else
value = tostring(v) value = tostring(v)
end end
end, function() end, function()
value = vtype value = vtype
end) end)
@ -1142,9 +1142,9 @@ local debugger_setBreak = nil
local function debugger_receiveDebugBreakInfo() local function debugger_receiveDebugBreakInfo()
if (not jit) then if (not jit) then
if (_VERSION) then if (_VERSION) then
print("当前lua版本为: ".._VERSION.." 请使用 -----LuaDebug.lua----- 进行调试!") -- print("当前lua版本为: ".._VERSION.." 请使用 -----LuaDebug.lua----- 进行调试!")
else else
print("当前为lua版本,请使用-----LuaDebug.lua-----进行调试!") -- print("当前为lua版本,请使用-----LuaDebug.lua-----进行调试!")
end end
end end
if (breakInfoSocket) then if (breakInfoSocket) then
@ -1309,18 +1309,17 @@ function debugger_conditionStr(condition, vars, callBack)
xpcall( xpcall(
loadScript, loadScript,
function(error) function(error)
print(error) -- print(error)
end end
) )
if (status and msg) then if (status and msg) then
callBack() callBack()
end end
end end
--执行lua字符串 --执行lua字符串
debugger_exeLuaString = function() debugger_exeLuaString = function()
local function loadScript() local function loadScript()
local script = LuaDebugger.loadScriptBody.script local script = LuaDebugger.loadScriptBody.script
if (LuaDebugger.loadScriptBody.isBreak) then if (LuaDebugger.loadScriptBody.isBreak) then
local currentTabble = { _G = _G } local currentTabble = { _G = _G }
@ -1351,18 +1350,17 @@ debugger_exeLuaString = function()
xpcall( xpcall(
loadScript, loadScript,
function(error) function(error)
-- debugger_sendMsg(debug_server, LuaDebugger.event.C2S_LoadLuaScript, LuaDebugger.loadScriptBody) -- debugger_sendMsg(debug_server, LuaDebugger.event.C2S_LoadLuaScript, LuaDebugger.loadScriptBody)
end end
) )
LuaDebugger.loadScriptBody.script = nil LuaDebugger.loadScriptBody.script = nil
if (LuaDebugger.loadScriptBody.isBreak) then if (LuaDebugger.loadScriptBody.isBreak) then
LuaDebugger.serVarLevel = LuaDebugger.serVarLevel + 1 LuaDebugger.serVarLevel = LuaDebugger.serVarLevel + 1
LuaDebugger.currentDebuggerData = debugger_stackInfo(LuaDebugger.serVarLevel, LuaDebugger.event.C2S_HITBreakPoint) LuaDebugger.currentDebuggerData = debugger_stackInfo(LuaDebugger.serVarLevel, LuaDebugger.event
.C2S_HITBreakPoint)
LuaDebugger.loadScriptBody.stack = LuaDebugger.currentDebuggerData.stack LuaDebugger.loadScriptBody.stack = LuaDebugger.currentDebuggerData.stack
end end
LuaDebugger.loadScriptBody.complete = true LuaDebugger.loadScriptBody.complete = true
end end
--@region 调试中修改变量值 --@region 调试中修改变量值
@ -1387,12 +1385,10 @@ local function debugger_getTablekey(key,keyType,value)
end end
end end
end end
end end
end end
local function debugger_setVarValue(server, data) local function debugger_setVarValue(server, data)
local newValue = nil local newValue = nil
local level = LuaDebugger.serVarLevel + LuaDebugger.setVarBody.frameId local level = LuaDebugger.serVarLevel + LuaDebugger.setVarBody.frameId
local firstKeyName = data.keys[1] local firstKeyName = data.keys[1]
@ -1467,7 +1463,7 @@ local function debugger_setVarValue(server, data)
xpcall( xpcall(
loadScript, loadScript,
function(error) function(error)
print(error, "============================") -- print(error, "============================")
end end
) )
@ -1478,7 +1474,6 @@ local function debugger_setVarValue(server, data)
if (keyLength == 1) then if (keyLength == 1) then
if (localValueChangeIndex ~= -1) then if (localValueChangeIndex ~= -1) then
debug.setlocal(level, localValueChangeIndex, newValue) debug.setlocal(level, localValueChangeIndex, newValue)
elseif (upValueFun ~= nil) then elseif (upValueFun ~= nil) then
debug.setupvalue(upValueFun, upValueChangeIndex, newValue) debug.setupvalue(upValueFun, upValueChangeIndex, newValue)
@ -1508,7 +1503,6 @@ local function debugger_setVarValue(server, data)
data.varInfo = varInfo data.varInfo = varInfo
LuaDebugger.serVarLevel = LuaDebugger.serVarLevel + 1 LuaDebugger.serVarLevel = LuaDebugger.serVarLevel + 1
LuaDebugger.currentDebuggerData = debugger_stackInfo(LuaDebugger.serVarLevel, LuaDebugger.event.C2S_HITBreakPoint) LuaDebugger.currentDebuggerData = debugger_stackInfo(LuaDebugger.serVarLevel, LuaDebugger.event.C2S_HITBreakPoint)
end end
--@endregion --@endregion
@ -1526,7 +1520,7 @@ checkSetVar =
xpcall( xpcall(
checkSetVar, checkSetVar,
function(error) function(error)
print("设置变量", error) -- print("设置变量", error)
end end
) )
elseif (LuaDebugger.isLoadLuaScript) then elseif (LuaDebugger.isLoadLuaScript) then
@ -1537,20 +1531,20 @@ checkSetVar =
xpcall( xpcall(
checkSetVar, checkSetVar,
function(error) function(error)
print("执行代码", error) -- print("执行代码", error)
end end
) )
elseif (LuaDebugger.isReLoadFile) then elseif (LuaDebugger.isReLoadFile) then
LuaDebugger.isReLoadFile = false LuaDebugger.isReLoadFile = false
LuaDebugger.reLoadFileBody.isReLoad = debugger_reLoadFile(LuaDebugger.reLoadFileBody) LuaDebugger.reLoadFileBody.isReLoad = debugger_reLoadFile(LuaDebugger.reLoadFileBody)
print("重载结果:",LuaDebugger.reLoadFileBody.isReLoad) -- print("重载结果:",LuaDebugger.reLoadFileBody.isReLoad)
LuaDebugger.reLoadFileBody.script = nil LuaDebugger.reLoadFileBody.script = nil
LuaDebugger.serVarLevel = LuaDebugger.serVarLevel + 1 LuaDebugger.serVarLevel = LuaDebugger.serVarLevel + 1
_resume(coro_debugger, LuaDebugger.reLoadFileBody) _resume(coro_debugger, LuaDebugger.reLoadFileBody)
xpcall( xpcall(
checkSetVar, checkSetVar,
function(error) function(error)
print("重新加载文件", error) -- print("重新加载文件", error)
end end
) )
end end
@ -1604,7 +1598,7 @@ local function debugger_getValueByScript(value, script)
val = fun() val = fun()
end, end,
function(error) function(error)
print(error, "====>") -- print(error, "====>")
val = nil val = nil
end end
) )
@ -1745,7 +1739,6 @@ end
return return
]] ]]
local function debugger_getmetatable(value, metatable, vinfos, server, variablesReference, debugSpeedIndex, metatables) local function debugger_getmetatable(value, metatable, vinfos, server, variablesReference, debugSpeedIndex, metatables)
for i, mtable in ipairs(metatables) do for i, mtable in ipairs(metatables) do
if (metatable == mtable) then if (metatable == mtable) then
return vinfos return vinfos
@ -1801,7 +1794,6 @@ local function debugger_getmetatable(value, metatable, vinfos, server, variables
else else
return vinfos return vinfos
end end
end end
local function debugger_sendTableField(luatable, vinfos, server, variablesReference, debugSpeedIndex, valueType) local function debugger_sendTableField(luatable, vinfos, server, variablesReference, debugSpeedIndex, valueType)
if (valueType == "userdata") then if (valueType == "userdata") then
@ -1874,7 +1866,6 @@ local function debugger_sendTableValues(value, server, variablesReference, debug
vinfos = {} vinfos = {}
end end
end end
end end
else else
m = getmetatable(value) m = getmetatable(value)
@ -1924,7 +1915,6 @@ local function debugger_getBreakVar(body, server)
if (value) then if (value) then
local valueType = type(value) local valueType = type(value)
if (valueType == "table" or valueType == "userdata") then if (valueType == "table" or valueType == "userdata") then
debugger_sendTableValues(value, server, variablesReference, debugSpeedIndex) debugger_sendTableValues(value, server, variablesReference, debugSpeedIndex)
else else
if (valueType == "function") then if (valueType == "function") then
@ -1963,9 +1953,9 @@ local function debugger_getBreakVar(body, server)
xpcall( xpcall(
exe, exe,
function(error) function(error)
-- print("获取变量错误 错误消息-----------------") -- -- print("获取变量错误 错误消息-----------------")
-- print(error) -- -- print(error)
-- print(debug.traceback("", 2)) -- -- print(debug.traceback("", 2))
debugger_sendMsg( debugger_sendMsg(
server, server,
LuaDebugger.event.C2S_ReqVar, LuaDebugger.event.C2S_ReqVar,
@ -1991,7 +1981,6 @@ local function ResetDebugInfo()
LuaDebugger.StepIn = false LuaDebugger.StepIn = false
LuaDebugger.StepNext = false LuaDebugger.StepNext = false
LuaDebugger.StepOut = false LuaDebugger.StepOut = false
end end
local function debugger_loop(server) local function debugger_loop(server)
server = debug_server server = debug_server
@ -2020,7 +2009,6 @@ local function debugger_loop(server)
debug.sethook() debug.sethook()
coroutine.yield() coroutine.yield()
end end
elseif event == LuaDebugger.event.S2C_SetBreakPoints then elseif event == LuaDebugger.event.S2C_SetBreakPoints then
--设置断点信息 --设置断点信息
local function setB() local function setB()
@ -2029,7 +2017,7 @@ local function debugger_loop(server)
xpcall( xpcall(
setB, setB,
function(error) function(error)
print(error) -- print(error)
end end
) )
elseif event == LuaDebugger.event.S2C_RUN then --开始运行 elseif event == LuaDebugger.event.S2C_RUN then --开始运行
@ -2142,7 +2130,6 @@ local function debugger_loop(server)
end end
coro_debugger = coroutine.create(debugger_loop) coro_debugger = coroutine.create(debugger_loop)
debug_hook = function(event, line) debug_hook = function(event, line)
if (not LuaDebugger.isHook) then if (not LuaDebugger.isHook) then
return return
end end
@ -2151,9 +2138,7 @@ debug_hook = function(event, line)
if (event == "line") then if (event == "line") then
local isCheck = false local isCheck = false
for k, breakInfo in pairs(LuaDebugger.breakInfos) do for k, breakInfo in pairs(LuaDebugger.breakInfos) do
for bk, linesInfo in pairs(breakInfo) do for bk, linesInfo in pairs(breakInfo) do
if (linesInfo.lines and linesInfo.lines[line]) then if (linesInfo.lines and linesInfo.lines[line]) then
isCheck = true isCheck = true
break break
@ -2167,14 +2152,12 @@ debug_hook = function(event, line)
if (not isCheck) then if (not isCheck) then
return return
end end
end end
end end
local file = nil local file = nil
if (event == "line") then if (event == "line") then
local funs = nil local funs = nil
local funlength = 0 local funlength = 0
if (LuaDebugger.currentDebuggerData) then if (LuaDebugger.currentDebuggerData) then
@ -2193,7 +2176,6 @@ debug_hook = function(event, line)
local breakData = nil local breakData = nil
local ischeck = false local ischeck = false
if (breakInfo) then if (breakInfo) then
for k, lineInfo in pairs(breakInfo) do for k, lineInfo in pairs(breakInfo) do
local lines = lineInfo.lines local lines = lineInfo.lines
if (lines and lines[line]) then if (lines and lines[line]) then
@ -2204,7 +2186,6 @@ debug_hook = function(event, line)
end end
local isHit = false local isHit = false
if (ischeck) then if (ischeck) then
--并且在断点中 --并且在断点中
local info = stepInfo local info = stepInfo
local source = string.lower(info.source) local source = string.lower(info.source)
@ -2214,7 +2195,6 @@ debug_hook = function(event, line)
local hitCounts = {} local hitCounts = {}
local debugHitCounts = nil local debugHitCounts = nil
for k, lineInfo in pairs(breakInfo) do for k, lineInfo in pairs(breakInfo) do
local lines = lineInfo.lines local lines = lineInfo.lines
local pathNames = lineInfo.pathNames local pathNames = lineInfo.pathNames
debugHitCounts = lineInfo.hitCounts debugHitCounts = lineInfo.hitCounts
@ -2257,7 +2237,6 @@ debug_hook = function(event, line)
local hitPathNamesLength = #hitPathNames local hitPathNamesLength = #hitPathNames
if (hitPathNamesLength == 1 or (hitPathNamesLength > 1 and maxCount > 1)) then if (hitPathNamesLength == 1 or (hitPathNamesLength > 1 and maxCount > 1)) then
if (hitFieName ~= "") then if (hitFieName ~= "") then
local hitCount = breakData.hitCondition local hitCount = breakData.hitCondition
local clientHitCount = debugHitCounts[breakData.line] local clientHitCount = debugHitCounts[breakData.line]
clientHitCount = clientHitCount + 1 clientHitCount = clientHitCount + 1
@ -2270,7 +2249,6 @@ debug_hook = function(event, line)
elseif (clientHitCount >= hitCount) then elseif (clientHitCount >= hitCount) then
isHit = true isHit = true
end end
end end
end end
end end
@ -2283,7 +2261,7 @@ debug_hook = function(event, line)
else else
if (funs[2] == tempFunc) then if (funs[2] == tempFunc) then
local data = debugger_stackInfo(3, LuaDebugger.event.C2S_StepInResponse) local data = debugger_stackInfo(3, LuaDebugger.event.C2S_StepInResponse)
-- print("StepIn 挂起") -- -- print("StepIn 挂起")
--挂起等待调试器作出反应 --挂起等待调试器作出反应
_resume(coro_debugger, data) _resume(coro_debugger, data)
checkSetVar() checkSetVar()
@ -2297,7 +2275,7 @@ debug_hook = function(event, line)
return return
end end
local data = debugger_stackInfo(3, LuaDebugger.event.C2S_StepInResponse) local data = debugger_stackInfo(3, LuaDebugger.event.C2S_StepInResponse)
-- print("StepIn 挂起") -- -- print("StepIn 挂起")
--挂起等待调试器作出反应 --挂起等待调试器作出反应
_resume(coro_debugger, data) _resume(coro_debugger, data)
checkSetVar() checkSetVar()
@ -2317,7 +2295,6 @@ debug_hook = function(event, line)
end end
end end
else else
isNext = true isNext = true
end end
if (isNext) then if (isNext) then
@ -2336,8 +2313,6 @@ debug_hook = function(event, line)
--断点判断 --断点判断
if (isHit) then if (isHit) then
LuaDebugger.runLineCount = 0 LuaDebugger.runLineCount = 0
LuaDebugger.currentLine = line LuaDebugger.currentLine = line
sevent = LuaDebugger.event.C2S_HITBreakPoint sevent = LuaDebugger.event.C2S_HITBreakPoint
@ -2371,10 +2346,9 @@ local function debugger_xpcall()
end end
--调试开始 --调试开始
local function start() local function start()
local socket = createSocket() local socket = createSocket()
print(controller_host) -- print(controller_host)
print(controller_port) -- print(controller_port)
local fullName, dirName, fileName = debugger_getFilePathInfo(getinfo(1).source) local fullName, dirName, fileName = debugger_getFilePathInfo(getinfo(1).source)
LuaDebugger.DebugLuaFie = fileName LuaDebugger.DebugLuaFie = fileName
@ -2399,46 +2373,41 @@ local function start()
xpcall(function() xpcall(function()
sethook(debug_hook, "lrc") sethook(debug_hook, "lrc")
end, function(error) end, function(error)
print("error:", error) -- print("error:", error)
end) end)
if (not jit) then if (not jit) then
if (_VERSION) then if (_VERSION) then
print("当前lua版本为: ".._VERSION.." 请使用LuaDebug 进行调试!") -- print("当前lua版本为: ".._VERSION.." 请使用LuaDebug 进行调试!")
else else
print("当前为lua版本,请使用LuaDebug 进行调试!") -- print("当前为lua版本,请使用LuaDebug 进行调试!")
end end
end end
_resume(coro_debugger, server) _resume(coro_debugger, server)
end end
end end
end end
function StartDebug(host, port) function StartDebug(host, port)
if (not host) then if (not host) then
print("error host nil") -- print("error host nil")
end end
if (not port) then if (not port) then
print("error prot nil") -- print("error prot nil")
end end
if (type(host) ~= "string") then if (type(host) ~= "string") then
print("error host not string") -- print("error host not string")
end end
if (type(port) ~= "number") then if (type(port) ~= "number") then
print("error host not number") -- print("error host not number")
end end
controller_host = host controller_host = host
controller_port = port controller_port = port
xpcall(start, function(error) xpcall(start, function(error)
-- body -- body
print(error) -- print(error)
end) end)
return debugger_receiveDebugBreakInfo, debugger_xpcall return debugger_receiveDebugBreakInfo, debugger_xpcall
end end
--base64 --base64
local string = string local string = string
@ -2583,7 +2552,4 @@ function ZZBase64.__decodeLeft2(res, index, text, len)
res[index] = string.char(num) res[index] = string.char(num)
end end
return StartDebug return StartDebug

View File

@ -1,6 +1,7 @@
local breakSocketHandle, debugXpCall = require("LuaDebugjit")("localhost", 7003) local breakSocketHandle, debugXpCall = require("LuaDebugjit")("localhost", 7003)
local timer = Timer.New(function() local timer = Timer.New(function()
breakSocketHandle() end, 1, -1, false) breakSocketHandle()
end, 1, -1, false)
timer:Start(); timer:Start();
require "Core.init" require "Core.init"
@ -37,7 +38,8 @@ oldGameVersion=2 --1 原始 2 老游戏新加功能
function Main() function Main()
--PlayerPrefs.DeleteKey('session_id') --PlayerPrefs.DeleteKey('session_id')
Application.targetFrameRate = 60 Application.targetFrameRate = 60
FairyGUI.UIConfig.buttonSound =FairyGUI.NAudioClip(ResourcesManager.LoadObject("base/common/sound/click.mp3",typeof(UnityEngine.AudioClip))) FairyGUI.UIConfig.buttonSound = FairyGUI.NAudioClip(ResourcesManager.LoadObject("base/common/sound/click.mp3",
typeof(UnityEngine.AudioClip)))
FairyGUI.UIConfig.defaultFont = "FZDaBiaoSong-B06S" FairyGUI.UIConfig.defaultFont = "FZDaBiaoSong-B06S"
FairyGUI.FontManager.RegisterFont(FairyGUI.DynamicFont.New("SIYUAN", "base/static/fonts/SIYUAN.TTF"), null) FairyGUI.FontManager.RegisterFont(FairyGUI.DynamicFont.New("SIYUAN", "base/static/fonts/SIYUAN.TTF"), null)
--FairyGUI.FontManager.RegisterFont(FairyGUI.DynamicFont.New("FZCuYuan-M03","base/static/fonts/FZCuYuan-M03.TTF"),null) --FairyGUI.FontManager.RegisterFont(FairyGUI.DynamicFont.New("FZCuYuan-M03","base/static/fonts/FZCuYuan-M03.TTF"),null)
@ -89,10 +91,8 @@ function Main()
end end
end end
end) end)
end end
function GetGameInfo(key) function GetGameInfo(key)
return _game_info[key] return _game_info[key]
end end
@ -153,38 +153,37 @@ function ShareScreenShot(n, callback)
end end
function shareQRCodePicture(url, secene) function shareQRCodePicture(url, secene)
--print(debug.traceback()) ---- print(debug.traceback())
print(url) -- print(url)
print(secene) -- print(secene)
local json_data = {} local json_data = {}
json_data["title"] = "湘北联赛" json_data["title"] = "湘北联赛"
local mediaObject = {} local mediaObject = {}
local filename = "qrcode" .. DataManager.SelfUser.account_id local filename = "qrcode" .. DataManager.SelfUser.account_id
print(Application.persistentDataPath) -- print(Application.persistentDataPath)
mediaObject["path"] = Application.persistentDataPath mediaObject["path"] = Application.persistentDataPath
mediaObject["filename"] = filename mediaObject["filename"] = filename
mediaObject["type"] = 1 mediaObject["type"] = 1
json_data["mediaObject"] = mediaObject json_data["mediaObject"] = mediaObject
json_data["description"] = "一款现实中朋友约局休闲娱乐的场所!速度约朋友一起来玩吧!" json_data["description"] = "一款现实中朋友约局休闲娱乐的场所!速度约朋友一起来玩吧!"
json_data["scene"] = secene json_data["scene"] = secene
print("json_data==================") -- print("json_data==================")
local json_str = json.encode(json_data) local json_str = json.encode(json_data)
pt(json_str) pt(json_str)
local tex2 = QRCodePicture.GenerateQRcode(url, 250, 250) local tex2 = QRCodePicture.GenerateQRcode(url, 250, 250)
local tex1 = ResourcesManager.LoadObject("base/lobby/bg/bg.png", typeof(UnityEngine.Texture2D)) local tex1 = ResourcesManager.LoadObject("base/lobby/bg/bg.png", typeof(UnityEngine.Texture2D))
filename = filename .. ".jpg" filename = filename .. ".jpg"
print("text2==========") -- print("text2==========")
print(tex2) -- print(tex2)
print("text1==========") -- print("text1==========")
print(tex1) -- print(tex1)
print("filename==========") -- print("filename==========")
print(filename) -- print(filename)
QRCodePicture.CombanitePicture(tex1, tex2, 393, 1334 - 802 - 250, filename) QRCodePicture.CombanitePicture(tex1, tex2, 393, 1334 - 802 - 250, filename)
GameApplication.Instance:ShareLink(1, json_str, nil) GameApplication.Instance:ShareLink(1, json_str, nil)
end end
function ShareChatRoom(room_id, share_time, round, game_name, group_id, player_list, _root_view, play_name) function ShareChatRoom(room_id, share_time, round, game_name, group_id, player_list, _root_view, play_name)
end end
@ -203,8 +202,8 @@ function LoadGameBg(url, main_view)
local win_mode = main_view:GetChild("win_mode") local win_mode = main_view:GetChild("win_mode")
win_mode:RemoveChildren(0, -1, true) win_mode:RemoveChildren(0, -1, true)
local tex_bg = ResourcesManager.LoadObjectByGroup(url .. ".png", typeof(UnityEngine.Texture), url) local tex_bg = ResourcesManager.LoadObjectByGroup(url .. ".png", typeof(UnityEngine.Texture), url)
print("===========================mainbg") -- print("===========================mainbg")
print(url..".png",typeof(UnityEngine.Texture), url) -- print(url..".png",typeof(UnityEngine.Texture), url)
local bg = GImage() local bg = GImage()
bg.texture = FairyGUI.NTexture(tex_bg) bg.texture = FairyGUI.NTexture(tex_bg)
bg.width = win_mode.width bg.width = win_mode.width
@ -261,8 +260,6 @@ function OnApplicationActive()
ViewManager.OnApplicationActive() ViewManager.OnApplicationActive()
end end
function pt(...) function pt(...)
if debug_print then if debug_print then
local arg = { ... } local arg = { ... }
@ -274,7 +271,7 @@ function pt(...)
end end
end end
if not has then if not has then
print(...) -- print(...)
end end
local content = "" local content = ""
@ -284,12 +281,10 @@ function pt(...)
else else
content = content .. "==>[T]:" .. LuaPrint(v, limit), debug.traceback() .. "\n" content = content .. "==>[T]:" .. LuaPrint(v, limit), debug.traceback() .. "\n"
end end
print(content) -- print(content)
end end
end end
end end
function LuaPrint(lua_table, limit, indent, step) function LuaPrint(lua_table, limit, indent, step)
step = step or 0 step = step or 0
@ -325,7 +320,8 @@ function LuaPrint(lua_table,limit,indent,step)
if Typev == "table" and v._fields then if Typev == "table" and v._fields then
local kk, vv = next(v._fields) local kk, vv = next(v._fields)
if type(vv) == "table" then if type(vv) == "table" then
content=content.."\n\t"..kk.name.."={"..LuaPrint(vv._fields,5,indent+1,step+1).."}" content = content .. "\n\t" .. kk.name .. "={" .. LuaPrint(vv._fields, 5, indent + 1, step + 1) ..
"}"
else else
content = content .. "\n\t" .. kk.name .. "=" .. vv content = content .. "\n\t" .. kk.name .. "=" .. vv
end end
@ -343,7 +339,6 @@ function LuaPrint(lua_table,limit,indent,step)
content = content .. tmp content = content .. tmp
end end
end end
elseif type(k) == "function" then elseif type(k) == "function" then
content = content .. "\n fun=function" content = content .. "\n fun=function"
else else
@ -362,17 +357,14 @@ function LuaPrint(lua_table,limit,indent,step)
content = content .. "\n" .. formatting .. (szValue or "nil") .. "," content = content .. "\n" .. formatting .. (szValue or "nil") .. ","
end end
end end
end end
end end
end end
return content return content
end end
function printlog(...) function printlog(...)
if debug_print then if debug_print then
print(...) -- print(...)
end end
end end

View File

@ -392,6 +392,7 @@ local function createJson()
function json.null() function json.null()
return json.null -- so json.null() will also return null ;-) return json.null -- so json.null() will also return null ;-)
end end
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- Internal, PRIVATE functions. -- Internal, PRIVATE functions.
-- Following a Python-like convention, I have prefixed all these 'PRIVATE' -- Following a Python-like convention, I have prefixed all these 'PRIVATE'
@ -817,6 +818,7 @@ function luaIdePrintWarn(...)
end end
end end
end end
function luaIdePrintErr(...) function luaIdePrintErr(...)
if (LuaDebugger.isProntToConsole == 1 or LuaDebugger.isProntToConsole == 3) then if (LuaDebugger.isProntToConsole == 1 or LuaDebugger.isProntToConsole == 3) then
debugger_print(...) debugger_print(...)
@ -840,6 +842,7 @@ function luaIdePrintErr(...)
end end
end end
end end
--@endregion --@endregion
--@region 辅助方法 --@region 辅助方法
@ -977,7 +980,7 @@ local function debugger_dump(value, desciption, nesting)
return tostring(v) return tostring(v)
end end
local traceback = debugger_strSplit(debug.traceback("", 2), "\n") local traceback = debugger_strSplit(debug.traceback("", 2), "\n")
print("dump from: " .. debugger_strTrim(traceback[3])) -- print("dump from: " .. debugger_strTrim(traceback[3]))
local function _dump(value, desciption, indent, nest, keylen) local function _dump(value, desciption, indent, nest, keylen)
desciption = desciption or "<var>" desciption = desciption or "<var>"
local spc = "" local spc = ""
@ -1026,7 +1029,7 @@ local function debugger_dump(value, desciption, nesting)
end end
_dump(value, desciption, "- ", 1) _dump(value, desciption, "- ", 1)
for i, line in ipairs(result) do for i, line in ipairs(result) do
print(line) -- print(line)
end end
end end
--@endregion --@endregion
@ -1035,9 +1038,7 @@ local function debugger_valueToString(v)
local vstr = nil local vstr = nil
if (vtype == "userdata") then if (vtype == "userdata") then
if (LuaDebugger.isFoxGloryProject) then if (LuaDebugger.isFoxGloryProject) then
return "userdata", vtype return "userdata", vtype
else else
return tostring(v), vtype return tostring(v), vtype
end end
@ -1167,7 +1168,7 @@ local function debugger_receiveDebugBreakInfo()
if (jit) then if (jit) then
if (LuaDebugger.debugLuaType ~= "jit") then if (LuaDebugger.debugLuaType ~= "jit") then
local msg = "当前luajit版本为: " .. jit.version .. " 请使用LuaDebugjit 进行调试!" local msg = "当前luajit版本为: " .. jit.version .. " 请使用LuaDebugjit 进行调试!"
print(msg) -- print(msg)
end end
end end
if (breakInfoSocket) then if (breakInfoSocket) then
@ -1187,7 +1188,7 @@ local function debugger_receiveDebugBreakInfo()
LuaDebugger.reLoadFileBody = netData.data LuaDebugger.reLoadFileBody = netData.data
LuaDebugger.isReLoadFile = false LuaDebugger.isReLoadFile = false
LuaDebugger.reLoadFileBody.isReLoad = debugger_reLoadFile(LuaDebugger.reLoadFileBody) LuaDebugger.reLoadFileBody.isReLoad = debugger_reLoadFile(LuaDebugger.reLoadFileBody)
print("重载结果:",LuaDebugger.reLoadFileBody.isReLoad) -- print("重载结果:",LuaDebugger.reLoadFileBody.isReLoad)
LuaDebugger.reLoadFileBody.script = nil LuaDebugger.reLoadFileBody.script = nil
debugger_sendMsg( debugger_sendMsg(
breakInfoSocket, breakInfoSocket,
@ -1332,18 +1333,17 @@ function debugger_conditionStr(condition, vars, callBack)
xpcall( xpcall(
loadScript, loadScript,
function(error) function(error)
print(error) -- print(error)
end end
) )
if (status and msg) then if (status and msg) then
callBack() callBack()
end end
end end
--执行lua字符串 --执行lua字符串
debugger_exeLuaString = function() debugger_exeLuaString = function()
local function loadScript() local function loadScript()
local script = LuaDebugger.loadScriptBody.script local script = LuaDebugger.loadScriptBody.script
if (LuaDebugger.loadScriptBody.isBreak) then if (LuaDebugger.loadScriptBody.isBreak) then
local currentTabble = { _G = _G } local currentTabble = { _G = _G }
@ -1374,18 +1374,17 @@ debugger_exeLuaString = function()
xpcall( xpcall(
loadScript, loadScript,
function(error) function(error)
-- debugger_sendMsg(debug_server, LuaDebugger.event.C2S_LoadLuaScript, LuaDebugger.loadScriptBody) -- debugger_sendMsg(debug_server, LuaDebugger.event.C2S_LoadLuaScript, LuaDebugger.loadScriptBody)
end end
) )
LuaDebugger.loadScriptBody.script = nil LuaDebugger.loadScriptBody.script = nil
if (LuaDebugger.loadScriptBody.isBreak) then if (LuaDebugger.loadScriptBody.isBreak) then
LuaDebugger.serVarLevel = LuaDebugger.serVarLevel + 1 LuaDebugger.serVarLevel = LuaDebugger.serVarLevel + 1
LuaDebugger.currentDebuggerData = debugger_stackInfo(LuaDebugger.serVarLevel, LuaDebugger.event.C2S_HITBreakPoint) LuaDebugger.currentDebuggerData = debugger_stackInfo(LuaDebugger.serVarLevel, LuaDebugger.event
.C2S_HITBreakPoint)
LuaDebugger.loadScriptBody.stack = LuaDebugger.currentDebuggerData.stack LuaDebugger.loadScriptBody.stack = LuaDebugger.currentDebuggerData.stack
end end
LuaDebugger.loadScriptBody.complete = true LuaDebugger.loadScriptBody.complete = true
end end
--@region 调试中修改变量值 --@region 调试中修改变量值
@ -1410,12 +1409,10 @@ local function debugger_getTablekey(key,keyType,value)
end end
end end
end end
end end
end end
local function debugger_setVarValue(server, data) local function debugger_setVarValue(server, data)
local newValue = nil local newValue = nil
local level = LuaDebugger.serVarLevel + LuaDebugger.setVarBody.frameId local level = LuaDebugger.serVarLevel + LuaDebugger.setVarBody.frameId
local firstKeyName = data.keys[1] local firstKeyName = data.keys[1]
@ -1490,7 +1487,7 @@ local function debugger_setVarValue(server, data)
xpcall( xpcall(
loadScript, loadScript,
function(error) function(error)
print(error, "============================") -- print(error, "============================")
end end
) )
@ -1501,7 +1498,6 @@ local function debugger_setVarValue(server, data)
if (keyLength == 1) then if (keyLength == 1) then
if (localValueChangeIndex ~= -1) then if (localValueChangeIndex ~= -1) then
debug.setlocal(level, localValueChangeIndex, newValue) debug.setlocal(level, localValueChangeIndex, newValue)
elseif (upValueFun ~= nil) then elseif (upValueFun ~= nil) then
debug.setupvalue(upValueFun, upValueChangeIndex, newValue) debug.setupvalue(upValueFun, upValueChangeIndex, newValue)
@ -1531,7 +1527,6 @@ local function debugger_setVarValue(server, data)
data.varInfo = varInfo data.varInfo = varInfo
LuaDebugger.serVarLevel = LuaDebugger.serVarLevel + 1 LuaDebugger.serVarLevel = LuaDebugger.serVarLevel + 1
LuaDebugger.currentDebuggerData = debugger_stackInfo(LuaDebugger.serVarLevel, LuaDebugger.event.C2S_HITBreakPoint) LuaDebugger.currentDebuggerData = debugger_stackInfo(LuaDebugger.serVarLevel, LuaDebugger.event.C2S_HITBreakPoint)
end end
--@endregion --@endregion
@ -1549,7 +1544,7 @@ checkSetVar =
xpcall( xpcall(
checkSetVar, checkSetVar,
function(error) function(error)
print("设置变量", error) -- print("设置变量", error)
end end
) )
elseif (LuaDebugger.isLoadLuaScript) then elseif (LuaDebugger.isLoadLuaScript) then
@ -1560,20 +1555,20 @@ checkSetVar =
xpcall( xpcall(
checkSetVar, checkSetVar,
function(error) function(error)
print("执行代码", error) -- print("执行代码", error)
end end
) )
elseif (LuaDebugger.isReLoadFile) then elseif (LuaDebugger.isReLoadFile) then
LuaDebugger.isReLoadFile = false LuaDebugger.isReLoadFile = false
LuaDebugger.reLoadFileBody.isReLoad = debugger_reLoadFile(LuaDebugger.reLoadFileBody) LuaDebugger.reLoadFileBody.isReLoad = debugger_reLoadFile(LuaDebugger.reLoadFileBody)
print("重载结果:",LuaDebugger.reLoadFileBody.isReLoad) -- print("重载结果:",LuaDebugger.reLoadFileBody.isReLoad)
LuaDebugger.reLoadFileBody.script = nil LuaDebugger.reLoadFileBody.script = nil
LuaDebugger.serVarLevel = LuaDebugger.serVarLevel + 1 LuaDebugger.serVarLevel = LuaDebugger.serVarLevel + 1
_resume(coro_debugger, LuaDebugger.reLoadFileBody) _resume(coro_debugger, LuaDebugger.reLoadFileBody)
xpcall( xpcall(
checkSetVar, checkSetVar,
function(error) function(error)
print("重新加载文件", error) -- print("重新加载文件", error)
end end
) )
end end
@ -1627,7 +1622,7 @@ local function debugger_getValueByScript(value, script)
val = fun() val = fun()
end, end,
function(error) function(error)
print(error, "====>") -- print(error, "====>")
val = nil val = nil
end end
) )
@ -1894,7 +1889,6 @@ local function debugger_sendTableValues(value, server, variablesReference, debug
vinfos = {} vinfos = {}
end end
end end
end end
else else
m = getmetatable(value) m = getmetatable(value)
@ -1944,7 +1938,6 @@ local function debugger_getBreakVar(body, server)
if (value) then if (value) then
local valueType = type(value) local valueType = type(value)
if (valueType == "table" or valueType == "userdata") then if (valueType == "table" or valueType == "userdata") then
debugger_sendTableValues(value, server, variablesReference, debugSpeedIndex) debugger_sendTableValues(value, server, variablesReference, debugSpeedIndex)
else else
if (valueType == "function") then if (valueType == "function") then
@ -1979,9 +1972,9 @@ local function debugger_getBreakVar(body, server)
xpcall( xpcall(
exe, exe,
function(error) function(error)
-- print("获取变量错误 错误消息-----------------") -- -- print("获取变量错误 错误消息-----------------")
-- print(error) -- -- print(error)
-- print(debug.traceback("", 2)) -- -- print(debug.traceback("", 2))
debugger_sendMsg( debugger_sendMsg(
server, server,
LuaDebugger.event.C2S_ReqVar, LuaDebugger.event.C2S_ReqVar,
@ -2036,7 +2029,6 @@ local function debugger_loop(server)
debug.sethook() debug.sethook()
coroutine.yield() coroutine.yield()
end end
elseif event == LuaDebugger.event.S2C_SetBreakPoints then elseif event == LuaDebugger.event.S2C_SetBreakPoints then
--设置断点信息 --设置断点信息
local function setB() local function setB()
@ -2045,7 +2037,7 @@ local function debugger_loop(server)
xpcall( xpcall(
setB, setB,
function(error) function(error)
print(error) -- print(error)
end end
) )
elseif event == LuaDebugger.event.S2C_RUN then --开始运行 elseif event == LuaDebugger.event.S2C_RUN then --开始运行
@ -2156,7 +2148,6 @@ local function debugger_loop(server)
end end
coro_debugger = coroutine.create(debugger_loop) coro_debugger = coroutine.create(debugger_loop)
debug_hook = function(event, line) debug_hook = function(event, line)
if (not LuaDebugger.isHook) then if (not LuaDebugger.isHook) then
return return
end end
@ -2165,9 +2156,7 @@ debug_hook = function(event, line)
if (event == "line") then if (event == "line") then
local isCheck = false local isCheck = false
for k, breakInfo in pairs(LuaDebugger.breakInfos) do for k, breakInfo in pairs(LuaDebugger.breakInfos) do
for bk, linesInfo in pairs(breakInfo) do for bk, linesInfo in pairs(breakInfo) do
if (linesInfo.lines and linesInfo.lines[line]) then if (linesInfo.lines and linesInfo.lines[line]) then
isCheck = true isCheck = true
break break
@ -2209,7 +2198,7 @@ debug_hook = function(event, line)
return return
end end
-- debugger_dump(LuaDebugger,"LuaDebugger") -- debugger_dump(LuaDebugger,"LuaDebugger")
-- print(LuaDebugger.StepNextLevel,"LuaDebugger.StepNextLevel") -- -- print(LuaDebugger.StepNextLevel,"LuaDebugger.StepNextLevel")
local file = nil local file = nil
if (event == "call") then if (event == "call") then
-- end -- end
@ -2217,7 +2206,7 @@ debug_hook = function(event, line)
if (not LuaDebugger.Run) then if (not LuaDebugger.Run) then
LuaDebugger.StepNextLevel = LuaDebugger.StepNextLevel + 1 LuaDebugger.StepNextLevel = LuaDebugger.StepNextLevel + 1
end end
-- print("stepIn",LuaDebugger.StepNextLevel) -- -- print("stepIn",LuaDebugger.StepNextLevel)
local stepInfo = getinfo(2, "S") local stepInfo = getinfo(2, "S")
local source = stepInfo.source local source = stepInfo.source
@ -2259,7 +2248,6 @@ debug_hook = function(event, line)
local breakInfo = LuaDebugger.breakInfos[file] local breakInfo = LuaDebugger.breakInfos[file]
local breakData = nil local breakData = nil
if (breakInfo) then if (breakInfo) then
local ischeck = false local ischeck = false
for k, lineInfo in pairs(breakInfo) do for k, lineInfo in pairs(breakInfo) do
local lines = lineInfo.lines local lines = lineInfo.lines
@ -2396,8 +2384,8 @@ local function start()
local fullName, dirName, fileName = debugger_getFilePathInfo(getinfo(1).source) local fullName, dirName, fileName = debugger_getFilePathInfo(getinfo(1).source)
LuaDebugger.DebugLuaFie = fileName LuaDebugger.DebugLuaFie = fileName
local socket = createSocket() local socket = createSocket()
print(controller_host) -- print(controller_host)
print(controller_port) -- print(controller_port)
local server = socket.connect(controller_host, controller_port) local server = socket.connect(controller_host, controller_port)
debug_server = server debug_server = server
@ -2427,15 +2415,15 @@ local function start()
debug.sethook(debug_hook, "lrc") debug.sethook(debug_hook, "lrc")
end, end,
function(error) function(error)
print("error:", error) -- print("error:", error)
end end
) )
if (jit) then if (jit) then
if (LuaDebugger.debugLuaType ~= "jit") then if (LuaDebugger.debugLuaType ~= "jit") then
print("error======================================================") -- print("error======================================================")
local msg = "当前luajit版本为: " .. jit.version .. " 请使用LuaDebugjit 进行调试!" local msg = "当前luajit版本为: " .. jit.version .. " 请使用LuaDebugjit 进行调试!"
print(msg) -- print(msg)
end end
end end
_resume(coro_debugger, server) _resume(coro_debugger, server)
@ -2444,16 +2432,16 @@ local function start()
end end
function StartDebug(host, port) function StartDebug(host, port)
if (not host) then if (not host) then
print("error host nil") -- print("error host nil")
end end
if (not port) then if (not port) then
print("error prot nil") -- print("error prot nil")
end end
if (type(host) ~= "string") then if (type(host) ~= "string") then
print("error host not string") -- print("error host not string")
end end
if (type(port) ~= "number") then if (type(port) ~= "number") then
print("error host not number") -- print("error host not number")
end end
controller_host = host controller_host = host
controller_port = port controller_port = port
@ -2461,7 +2449,7 @@ function StartDebug(host, port)
start, start,
function(error) function(error)
-- body -- body
print(error) -- print(error)
end end
) )
return debugger_receiveDebugBreakInfo, debugger_xpcall return debugger_receiveDebugBreakInfo, debugger_xpcall
@ -2611,7 +2599,4 @@ function ZZBase64.__decodeLeft2(res, index, text, len)
res[index] = string.char(num) res[index] = string.char(num)
end end
return StartDebug return StartDebug

View File

@ -366,6 +366,7 @@ local function createJson()
function json.null() function json.null()
return json.null -- so json.null() will also return null ;-) return json.null -- so json.null() will also return null ;-)
end end
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- Internal, PRIVATE functions. -- Internal, PRIVATE functions.
-- Following a Python-like convention, I have prefixed all these 'PRIVATE' -- Following a Python-like convention, I have prefixed all these 'PRIVATE'
@ -788,6 +789,7 @@ function luaIdePrintWarn(...)
end end
end end
end end
function luaIdePrintErr(...) function luaIdePrintErr(...)
if (LuaDebugger.isProntToConsole == 1 or LuaDebugger.isProntToConsole == 3) then if (LuaDebugger.isProntToConsole == 1 or LuaDebugger.isProntToConsole == 3) then
debugger_print(...) debugger_print(...)
@ -811,6 +813,7 @@ function luaIdePrintErr(...)
end end
end end
end end
--@endregion --@endregion
--@region 辅助方法 --@region 辅助方法
@ -948,7 +951,7 @@ local function debugger_dump(value, desciption, nesting)
return tostring(v) return tostring(v)
end end
local traceback = debugger_strSplit(debug.traceback("", 2), "\n") local traceback = debugger_strSplit(debug.traceback("", 2), "\n")
print("dump from: " .. debugger_strTrim(traceback[3])) -- print("dump from: " .. debugger_strTrim(traceback[3]))
local function _dump(value, desciption, indent, nest, keylen) local function _dump(value, desciption, indent, nest, keylen)
desciption = desciption or "<var>" desciption = desciption or "<var>"
local spc = "" local spc = ""
@ -997,7 +1000,7 @@ local function debugger_dump(value, desciption, nesting)
end end
_dump(value, desciption, "- ", 1) _dump(value, desciption, "- ", 1)
for i, line in ipairs(result) do for i, line in ipairs(result) do
print(line) -- print(line)
end end
end end
--@endregion --@endregion
@ -1006,9 +1009,7 @@ local function debugger_valueToString(v)
local vstr = nil local vstr = nil
if (vtype == "userdata") then if (vtype == "userdata") then
if (LuaDebugger.isFoxGloryProject) then if (LuaDebugger.isFoxGloryProject) then
return "userdata", vtype return "userdata", vtype
else else
return tostring(v), vtype return tostring(v), vtype
end end
@ -1020,7 +1021,6 @@ local function debugger_valueToString(v)
else else
value = tostring(v) value = tostring(v)
end end
end, function() end, function()
value = vtype value = vtype
end) end)
@ -1142,9 +1142,9 @@ local debugger_setBreak = nil
local function debugger_receiveDebugBreakInfo() local function debugger_receiveDebugBreakInfo()
if (not jit) then if (not jit) then
if (_VERSION) then if (_VERSION) then
print("当前lua版本为: ".._VERSION.." 请使用 -----LuaDebug.lua----- 进行调试!") -- print("当前lua版本为: ".._VERSION.." 请使用 -----LuaDebug.lua----- 进行调试!")
else else
print("当前为lua版本,请使用-----LuaDebug.lua-----进行调试!") -- print("当前为lua版本,请使用-----LuaDebug.lua-----进行调试!")
end end
end end
if (breakInfoSocket) then if (breakInfoSocket) then
@ -1309,18 +1309,17 @@ function debugger_conditionStr(condition, vars, callBack)
xpcall( xpcall(
loadScript, loadScript,
function(error) function(error)
print(error) -- print(error)
end end
) )
if (status and msg) then if (status and msg) then
callBack() callBack()
end end
end end
--执行lua字符串 --执行lua字符串
debugger_exeLuaString = function() debugger_exeLuaString = function()
local function loadScript() local function loadScript()
local script = LuaDebugger.loadScriptBody.script local script = LuaDebugger.loadScriptBody.script
if (LuaDebugger.loadScriptBody.isBreak) then if (LuaDebugger.loadScriptBody.isBreak) then
local currentTabble = { _G = _G } local currentTabble = { _G = _G }
@ -1351,18 +1350,17 @@ debugger_exeLuaString = function()
xpcall( xpcall(
loadScript, loadScript,
function(error) function(error)
-- debugger_sendMsg(debug_server, LuaDebugger.event.C2S_LoadLuaScript, LuaDebugger.loadScriptBody) -- debugger_sendMsg(debug_server, LuaDebugger.event.C2S_LoadLuaScript, LuaDebugger.loadScriptBody)
end end
) )
LuaDebugger.loadScriptBody.script = nil LuaDebugger.loadScriptBody.script = nil
if (LuaDebugger.loadScriptBody.isBreak) then if (LuaDebugger.loadScriptBody.isBreak) then
LuaDebugger.serVarLevel = LuaDebugger.serVarLevel + 1 LuaDebugger.serVarLevel = LuaDebugger.serVarLevel + 1
LuaDebugger.currentDebuggerData = debugger_stackInfo(LuaDebugger.serVarLevel, LuaDebugger.event.C2S_HITBreakPoint) LuaDebugger.currentDebuggerData = debugger_stackInfo(LuaDebugger.serVarLevel, LuaDebugger.event
.C2S_HITBreakPoint)
LuaDebugger.loadScriptBody.stack = LuaDebugger.currentDebuggerData.stack LuaDebugger.loadScriptBody.stack = LuaDebugger.currentDebuggerData.stack
end end
LuaDebugger.loadScriptBody.complete = true LuaDebugger.loadScriptBody.complete = true
end end
--@region 调试中修改变量值 --@region 调试中修改变量值
@ -1387,12 +1385,10 @@ local function debugger_getTablekey(key,keyType,value)
end end
end end
end end
end end
end end
local function debugger_setVarValue(server, data) local function debugger_setVarValue(server, data)
local newValue = nil local newValue = nil
local level = LuaDebugger.serVarLevel + LuaDebugger.setVarBody.frameId local level = LuaDebugger.serVarLevel + LuaDebugger.setVarBody.frameId
local firstKeyName = data.keys[1] local firstKeyName = data.keys[1]
@ -1467,7 +1463,7 @@ local function debugger_setVarValue(server, data)
xpcall( xpcall(
loadScript, loadScript,
function(error) function(error)
print(error, "============================") -- print(error, "============================")
end end
) )
@ -1478,7 +1474,6 @@ local function debugger_setVarValue(server, data)
if (keyLength == 1) then if (keyLength == 1) then
if (localValueChangeIndex ~= -1) then if (localValueChangeIndex ~= -1) then
debug.setlocal(level, localValueChangeIndex, newValue) debug.setlocal(level, localValueChangeIndex, newValue)
elseif (upValueFun ~= nil) then elseif (upValueFun ~= nil) then
debug.setupvalue(upValueFun, upValueChangeIndex, newValue) debug.setupvalue(upValueFun, upValueChangeIndex, newValue)
@ -1508,7 +1503,6 @@ local function debugger_setVarValue(server, data)
data.varInfo = varInfo data.varInfo = varInfo
LuaDebugger.serVarLevel = LuaDebugger.serVarLevel + 1 LuaDebugger.serVarLevel = LuaDebugger.serVarLevel + 1
LuaDebugger.currentDebuggerData = debugger_stackInfo(LuaDebugger.serVarLevel, LuaDebugger.event.C2S_HITBreakPoint) LuaDebugger.currentDebuggerData = debugger_stackInfo(LuaDebugger.serVarLevel, LuaDebugger.event.C2S_HITBreakPoint)
end end
--@endregion --@endregion
@ -1526,7 +1520,7 @@ checkSetVar =
xpcall( xpcall(
checkSetVar, checkSetVar,
function(error) function(error)
print("设置变量", error) -- print("设置变量", error)
end end
) )
elseif (LuaDebugger.isLoadLuaScript) then elseif (LuaDebugger.isLoadLuaScript) then
@ -1537,20 +1531,20 @@ checkSetVar =
xpcall( xpcall(
checkSetVar, checkSetVar,
function(error) function(error)
print("执行代码", error) -- print("执行代码", error)
end end
) )
elseif (LuaDebugger.isReLoadFile) then elseif (LuaDebugger.isReLoadFile) then
LuaDebugger.isReLoadFile = false LuaDebugger.isReLoadFile = false
LuaDebugger.reLoadFileBody.isReLoad = debugger_reLoadFile(LuaDebugger.reLoadFileBody) LuaDebugger.reLoadFileBody.isReLoad = debugger_reLoadFile(LuaDebugger.reLoadFileBody)
print("重载结果:",LuaDebugger.reLoadFileBody.isReLoad) -- print("重载结果:",LuaDebugger.reLoadFileBody.isReLoad)
LuaDebugger.reLoadFileBody.script = nil LuaDebugger.reLoadFileBody.script = nil
LuaDebugger.serVarLevel = LuaDebugger.serVarLevel + 1 LuaDebugger.serVarLevel = LuaDebugger.serVarLevel + 1
_resume(coro_debugger, LuaDebugger.reLoadFileBody) _resume(coro_debugger, LuaDebugger.reLoadFileBody)
xpcall( xpcall(
checkSetVar, checkSetVar,
function(error) function(error)
print("重新加载文件", error) -- print("重新加载文件", error)
end end
) )
end end
@ -1604,7 +1598,7 @@ local function debugger_getValueByScript(value, script)
val = fun() val = fun()
end, end,
function(error) function(error)
print(error, "====>") -- print(error, "====>")
val = nil val = nil
end end
) )
@ -1745,7 +1739,6 @@ end
return return
]] ]]
local function debugger_getmetatable(value, metatable, vinfos, server, variablesReference, debugSpeedIndex, metatables) local function debugger_getmetatable(value, metatable, vinfos, server, variablesReference, debugSpeedIndex, metatables)
for i, mtable in ipairs(metatables) do for i, mtable in ipairs(metatables) do
if (metatable == mtable) then if (metatable == mtable) then
return vinfos return vinfos
@ -1801,7 +1794,6 @@ local function debugger_getmetatable(value, metatable, vinfos, server, variables
else else
return vinfos return vinfos
end end
end end
local function debugger_sendTableField(luatable, vinfos, server, variablesReference, debugSpeedIndex, valueType) local function debugger_sendTableField(luatable, vinfos, server, variablesReference, debugSpeedIndex, valueType)
if (valueType == "userdata") then if (valueType == "userdata") then
@ -1874,7 +1866,6 @@ local function debugger_sendTableValues(value, server, variablesReference, debug
vinfos = {} vinfos = {}
end end
end end
end end
else else
m = getmetatable(value) m = getmetatable(value)
@ -1924,7 +1915,6 @@ local function debugger_getBreakVar(body, server)
if (value) then if (value) then
local valueType = type(value) local valueType = type(value)
if (valueType == "table" or valueType == "userdata") then if (valueType == "table" or valueType == "userdata") then
debugger_sendTableValues(value, server, variablesReference, debugSpeedIndex) debugger_sendTableValues(value, server, variablesReference, debugSpeedIndex)
else else
if (valueType == "function") then if (valueType == "function") then
@ -1963,9 +1953,9 @@ local function debugger_getBreakVar(body, server)
xpcall( xpcall(
exe, exe,
function(error) function(error)
-- print("获取变量错误 错误消息-----------------") -- -- print("获取变量错误 错误消息-----------------")
-- print(error) -- -- print(error)
-- print(debug.traceback("", 2)) -- -- print(debug.traceback("", 2))
debugger_sendMsg( debugger_sendMsg(
server, server,
LuaDebugger.event.C2S_ReqVar, LuaDebugger.event.C2S_ReqVar,
@ -1991,7 +1981,6 @@ local function ResetDebugInfo()
LuaDebugger.StepIn = false LuaDebugger.StepIn = false
LuaDebugger.StepNext = false LuaDebugger.StepNext = false
LuaDebugger.StepOut = false LuaDebugger.StepOut = false
end end
local function debugger_loop(server) local function debugger_loop(server)
server = debug_server server = debug_server
@ -2020,7 +2009,6 @@ local function debugger_loop(server)
debug.sethook() debug.sethook()
coroutine.yield() coroutine.yield()
end end
elseif event == LuaDebugger.event.S2C_SetBreakPoints then elseif event == LuaDebugger.event.S2C_SetBreakPoints then
--设置断点信息 --设置断点信息
local function setB() local function setB()
@ -2029,7 +2017,7 @@ local function debugger_loop(server)
xpcall( xpcall(
setB, setB,
function(error) function(error)
print(error) -- print(error)
end end
) )
elseif event == LuaDebugger.event.S2C_RUN then --开始运行 elseif event == LuaDebugger.event.S2C_RUN then --开始运行
@ -2142,7 +2130,6 @@ local function debugger_loop(server)
end end
coro_debugger = coroutine.create(debugger_loop) coro_debugger = coroutine.create(debugger_loop)
debug_hook = function(event, line) debug_hook = function(event, line)
if (not LuaDebugger.isHook) then if (not LuaDebugger.isHook) then
return return
end end
@ -2151,9 +2138,7 @@ debug_hook = function(event, line)
if (event == "line") then if (event == "line") then
local isCheck = false local isCheck = false
for k, breakInfo in pairs(LuaDebugger.breakInfos) do for k, breakInfo in pairs(LuaDebugger.breakInfos) do
for bk, linesInfo in pairs(breakInfo) do for bk, linesInfo in pairs(breakInfo) do
if (linesInfo.lines and linesInfo.lines[line]) then if (linesInfo.lines and linesInfo.lines[line]) then
isCheck = true isCheck = true
break break
@ -2167,14 +2152,12 @@ debug_hook = function(event, line)
if (not isCheck) then if (not isCheck) then
return return
end end
end end
end end
local file = nil local file = nil
if (event == "line") then if (event == "line") then
local funs = nil local funs = nil
local funlength = 0 local funlength = 0
if (LuaDebugger.currentDebuggerData) then if (LuaDebugger.currentDebuggerData) then
@ -2193,7 +2176,6 @@ debug_hook = function(event, line)
local breakData = nil local breakData = nil
local ischeck = false local ischeck = false
if (breakInfo) then if (breakInfo) then
for k, lineInfo in pairs(breakInfo) do for k, lineInfo in pairs(breakInfo) do
local lines = lineInfo.lines local lines = lineInfo.lines
if (lines and lines[line]) then if (lines and lines[line]) then
@ -2204,7 +2186,6 @@ debug_hook = function(event, line)
end end
local isHit = false local isHit = false
if (ischeck) then if (ischeck) then
--并且在断点中 --并且在断点中
local info = stepInfo local info = stepInfo
local source = string.lower(info.source) local source = string.lower(info.source)
@ -2214,7 +2195,6 @@ debug_hook = function(event, line)
local hitCounts = {} local hitCounts = {}
local debugHitCounts = nil local debugHitCounts = nil
for k, lineInfo in pairs(breakInfo) do for k, lineInfo in pairs(breakInfo) do
local lines = lineInfo.lines local lines = lineInfo.lines
local pathNames = lineInfo.pathNames local pathNames = lineInfo.pathNames
debugHitCounts = lineInfo.hitCounts debugHitCounts = lineInfo.hitCounts
@ -2257,7 +2237,6 @@ debug_hook = function(event, line)
local hitPathNamesLength = #hitPathNames local hitPathNamesLength = #hitPathNames
if (hitPathNamesLength == 1 or (hitPathNamesLength > 1 and maxCount > 1)) then if (hitPathNamesLength == 1 or (hitPathNamesLength > 1 and maxCount > 1)) then
if (hitFieName ~= "") then if (hitFieName ~= "") then
local hitCount = breakData.hitCondition local hitCount = breakData.hitCondition
local clientHitCount = debugHitCounts[breakData.line] local clientHitCount = debugHitCounts[breakData.line]
clientHitCount = clientHitCount + 1 clientHitCount = clientHitCount + 1
@ -2270,7 +2249,6 @@ debug_hook = function(event, line)
elseif (clientHitCount >= hitCount) then elseif (clientHitCount >= hitCount) then
isHit = true isHit = true
end end
end end
end end
end end
@ -2283,7 +2261,7 @@ debug_hook = function(event, line)
else else
if (funs[2] == tempFunc) then if (funs[2] == tempFunc) then
local data = debugger_stackInfo(3, LuaDebugger.event.C2S_StepInResponse) local data = debugger_stackInfo(3, LuaDebugger.event.C2S_StepInResponse)
-- print("StepIn 挂起") -- -- print("StepIn 挂起")
--挂起等待调试器作出反应 --挂起等待调试器作出反应
_resume(coro_debugger, data) _resume(coro_debugger, data)
checkSetVar() checkSetVar()
@ -2297,7 +2275,7 @@ debug_hook = function(event, line)
return return
end end
local data = debugger_stackInfo(3, LuaDebugger.event.C2S_StepInResponse) local data = debugger_stackInfo(3, LuaDebugger.event.C2S_StepInResponse)
-- print("StepIn 挂起") -- -- print("StepIn 挂起")
--挂起等待调试器作出反应 --挂起等待调试器作出反应
_resume(coro_debugger, data) _resume(coro_debugger, data)
checkSetVar() checkSetVar()
@ -2317,7 +2295,6 @@ debug_hook = function(event, line)
end end
end end
else else
isNext = true isNext = true
end end
if (isNext) then if (isNext) then
@ -2336,8 +2313,6 @@ debug_hook = function(event, line)
--断点判断 --断点判断
if (isHit) then if (isHit) then
LuaDebugger.runLineCount = 0 LuaDebugger.runLineCount = 0
LuaDebugger.currentLine = line LuaDebugger.currentLine = line
sevent = LuaDebugger.event.C2S_HITBreakPoint sevent = LuaDebugger.event.C2S_HITBreakPoint
@ -2371,10 +2346,9 @@ local function debugger_xpcall()
end end
--调试开始 --调试开始
local function start() local function start()
local socket = createSocket() local socket = createSocket()
print(controller_host) -- print(controller_host)
print(controller_port) -- print(controller_port)
local fullName, dirName, fileName = debugger_getFilePathInfo(getinfo(1).source) local fullName, dirName, fileName = debugger_getFilePathInfo(getinfo(1).source)
LuaDebugger.DebugLuaFie = fileName LuaDebugger.DebugLuaFie = fileName
@ -2399,46 +2373,41 @@ local function start()
xpcall(function() xpcall(function()
sethook(debug_hook, "lrc") sethook(debug_hook, "lrc")
end, function(error) end, function(error)
print("error:", error) -- print("error:", error)
end) end)
if (not jit) then if (not jit) then
if (_VERSION) then if (_VERSION) then
print("当前lua版本为: ".._VERSION.." 请使用LuaDebug 进行调试!") -- print("当前lua版本为: ".._VERSION.." 请使用LuaDebug 进行调试!")
else else
print("当前为lua版本,请使用LuaDebug 进行调试!") -- print("当前为lua版本,请使用LuaDebug 进行调试!")
end end
end end
_resume(coro_debugger, server) _resume(coro_debugger, server)
end end
end end
end end
function StartDebug(host, port) function StartDebug(host, port)
if (not host) then if (not host) then
print("error host nil") -- print("error host nil")
end end
if (not port) then if (not port) then
print("error prot nil") -- print("error prot nil")
end end
if (type(host) ~= "string") then if (type(host) ~= "string") then
print("error host not string") -- print("error host not string")
end end
if (type(port) ~= "number") then if (type(port) ~= "number") then
print("error host not number") -- print("error host not number")
end end
controller_host = host controller_host = host
controller_port = port controller_port = port
xpcall(start, function(error) xpcall(start, function(error)
-- body -- body
print(error) -- print(error)
end) end)
return debugger_receiveDebugBreakInfo, debugger_xpcall return debugger_receiveDebugBreakInfo, debugger_xpcall
end end
--base64 --base64
local string = string local string = string
@ -2583,7 +2552,4 @@ function ZZBase64.__decodeLeft2(res, index, text, len)
res[index] = string.char(num) res[index] = string.char(num)
end end
return StartDebug return StartDebug

View File

@ -48,8 +48,6 @@ function M:InitView(url)
end end
end end
function M:SetReconnentLaiziTips() function M:SetReconnentLaiziTips()
local room = DataManager.CurrenRoom local room = DataManager.CurrenRoom
if room.beforelaiziCardId and room.beforelaiziCardId > 0 then if room.beforelaiziCardId and room.beforelaiziCardId > 0 then
@ -57,17 +55,14 @@ function M:SetReconnentLaiziTips()
end end
end end
function M:SetLaiZiCard(btn, cardId) function M:SetLaiZiCard(btn, cardId)
btn.icon = 'ui://Main_Majiang/' .. get_majiang_prefix(DataManager.CurrenRoom.game_id) .. "201_" .. cardId btn.icon = 'ui://Main_Majiang/' .. get_majiang_prefix(DataManager.CurrenRoom.game_id) .. "201_" .. cardId
end end
function M:IsShowLaiZi(btn, isShow) function M:IsShowLaiZi(btn, isShow)
btn.visible = isShow btn.visible = isShow
end end
function M:HideAllLaiZiCard() function M:HideAllLaiZiCard()
self.Laizi1Btn.visible = false self.Laizi1Btn.visible = false
self.Laizi2Btn.visible = false self.Laizi2Btn.visible = false
@ -80,9 +75,9 @@ function M:SetShowLaiZiProcess(beforeLaiziID,currentLaizi1ID,currentLaizi2ID,isS
if isShowAnim == nil then isShowAnim = false end if isShowAnim == nil then isShowAnim = false end
printlog("当前赋值结果为====>>>") printlog("当前赋值结果为====>>>")
--print(beforeLaiziID) ---- print(beforeLaiziID)
--print(currentLaizi1ID) ---- print(currentLaizi1ID)
--print(currentLaizi2ID) ---- print(currentLaizi2ID)
self:HideAllLaiZiCard() self:HideAllLaiZiCard()
self:SetLaiZiCard(self.selectLaiziBtn, beforeLaiziID) self:SetLaiZiCard(self.selectLaiziBtn, beforeLaiziID)
self:SetLaiZiCard(self.Laizi1Btn, currentLaizi1ID) self:SetLaiZiCard(self.Laizi1Btn, currentLaizi1ID)
@ -102,7 +97,6 @@ function M:SetShowLaiZiProcess(beforeLaiziID,currentLaizi1ID,currentLaizi2ID,isS
if currentLaizi2ID then if currentLaizi2ID then
self:IsShowLaiZi(self.Laizi2Btn, true) self:IsShowLaiZi(self.Laizi2Btn, true)
end end
end end
) )
else else
@ -115,7 +109,6 @@ function M:SetShowLaiZiProcess(beforeLaiziID,currentLaizi1ID,currentLaizi2ID,isS
self.LaiziBG.visible = true self.LaiziBG.visible = true
end end
function M:UpdateRound() function M:UpdateRound()
self._view:GetChild("tex_round1").text = self._room.curren_round self._view:GetChild("tex_round1").text = self._room.curren_round
self._view:GetChild("tex_round2").text = self._room.room_config.round self._view:GetChild("tex_round2").text = self._room.room_config.round
@ -310,7 +303,6 @@ function M:EventInit()
local item = he_list:GetChild("list"):AddItemFromPool("ui://Extend_MJ_100Zhang/" .. com_name) local item = he_list:GetChild("list"):AddItemFromPool("ui://Extend_MJ_100Zhang/" .. com_name)
coroutine.wait(0.3) coroutine.wait(0.3)
end end
end end
coroutine.wait(2) coroutine.wait(2)
@ -319,7 +311,6 @@ function M:EventInit()
he_list:Dispose() he_list:Dispose()
self._popEvent = true self._popEvent = true
end) end)
end) end)
_gamectr:AddEventListener(TX_GameEvent.EventNiao, function(...) _gamectr:AddEventListener(TX_GameEvent.EventNiao, function(...)
@ -555,7 +546,8 @@ function M:_ChiView(tiplist, callback)
callback(tiplist[i].id) callback(tiplist[i].id)
end) end)
end end
_pop_tip_choice.xy = Vector2((self._view.width - _pop_tip_choice.width)/2, (self._view.height - _pop_tip_choice.height)/2) _pop_tip_choice.xy = Vector2((self._view.width - _pop_tip_choice.width) / 2,
(self._view.height - _pop_tip_choice.height) / 2)
self._view:AddChild(_pop_tip_choice) self._view:AddChild(_pop_tip_choice)
self._pop_tip_choice = _pop_tip_choice self._pop_tip_choice = _pop_tip_choice
end end
@ -577,7 +569,6 @@ function M:OnFangziAction(...)
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "") effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "")
-- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "碰框") -- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "碰框")
else else
self:PlaySound("100Zhang_MJ", player.self_user.sex, "gang" .. math.random(1, 2)) self:PlaySound("100Zhang_MJ", player.self_user.sex, "gang" .. math.random(1, 2))
effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "") effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "")
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "") effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "")

View File

@ -156,7 +156,7 @@ function M:FillPlayBackData(pd_data)
p.ready = _jp["ready"] == 1 and true or false p.ready = _jp["ready"] == 1 and true or false
local pid = _jp["aid"] local pid = _jp["aid"]
p.piao_niao = _jp["piao_niao"] p.piao_niao = _jp["piao_niao"]
-- print(DataManager.SelfUser.account_id,pid) -- -- print(DataManager.SelfUser.account_id,pid)
-- if (278 == pid) then -- if (278 == pid) then
-- room.self_player = p -- room.self_player = p
-- p.self_user = DataManager.SelfUser -- p.self_user = DataManager.SelfUser

View File

@ -16,7 +16,8 @@ function M.new(view,mainView)
end end
function M:ShowHuTip(card_list) function M:ShowHuTip(card_list)
local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui, DataManager.CurrenRoom.room_config.Laizi) local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui,
DataManager.CurrenRoom.room_config.Laizi)
if #tingList > 0 then if #tingList > 0 then
if DataManager.CurrenRoom.laiziInfo and #DataManager.CurrenRoom.laiziInfo > 0 then if DataManager.CurrenRoom.laiziInfo and #DataManager.CurrenRoom.laiziInfo > 0 then
for i = 1, #DataManager.CurrenRoom.laiziInfo do for i = 1, #DataManager.CurrenRoom.laiziInfo do
@ -25,7 +26,6 @@ function M:ShowHuTip(card_list)
end end
end end
end end
end end
self._mainView._hu_tip:FillData(tingList) self._mainView._hu_tip:FillData(tingList)
end end
@ -43,7 +43,6 @@ function M:UpdateHandCard(getcard, mp)
if obj.card:GetController("laizi") then if obj.card:GetController("laizi") then
obj.card:GetController("laizi").selectedIndex = 1 obj.card:GetController("laizi").selectedIndex = 1
end end
end end
else else
if obj.card.GetController then if obj.card.GetController then
@ -52,11 +51,8 @@ function M:UpdateHandCard(getcard, mp)
end end
end end
end end
end end
end end
end end
@ -72,7 +68,8 @@ function M:UpdateHandCard(getcard, mp)
local btn = _carViewList[i].card local btn = _carViewList[i].card
local card = self:GetCard(btn) local card = self:GetCard(btn)
list_remove(card_list, card) list_remove(card_list, card)
local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui, DataManager.CurrenRoom.room_config.Laizi) local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true,
DataManager.CurrenRoom.room_config.Qidui, DataManager.CurrenRoom.room_config.Laizi)
if #tingList > 0 then if #tingList > 0 then
local count = 0 local count = 0
for j = 1, #tingList do for j = 1, #tingList do
@ -108,7 +105,6 @@ function M:UpdateHandCard(getcard, mp)
end end
self._out_card = false self._out_card = false
end end
end end
function M:__OnClickHandCard(context) function M:__OnClickHandCard(context)
@ -169,7 +165,7 @@ function M:__OnDragEnd(context)
local card = button.data local card = button.data
local _room = DataManager.CurrenRoom local _room = DataManager.CurrenRoom
-- print("button.y"..button.y .. "_room.curren_outcard_seat".._room.curren_outcard_seat) -- -- print("button.y"..button.y .. "_room.curren_outcard_seat".._room.curren_outcard_seat)
if (button.y - card.old_postion.y < -50 and _room.curren_outcard_seat == _room.self_player.seat and card.card_item ~= 0) then if (button.y - card.old_postion.y < -50 and _room.curren_outcard_seat == _room.self_player.seat and card.card_item ~= 0) then
self._mainView:OutCard(card.card_item) self._mainView:OutCard(card.card_item)
button.touchable = false button.touchable = false
@ -189,6 +185,7 @@ function M:CheckPlayerOnlineState()
end end
return true return true
end end
function M:Clear(bskip) function M:Clear(bskip)
--self._ctr_state.selectedIndex = 0 --self._ctr_state.selectedIndex = 0
self._area_fz_list.x = self._src_fz_list.x self._area_fz_list.x = self._src_fz_list.x
@ -207,6 +204,6 @@ function M:Clear(bskip)
self._carViewList[i].card:Dispose() self._carViewList[i].card:Dispose()
end end
self._carViewList = {} self._carViewList = {}
end end
return M return M

View File

@ -22,7 +22,6 @@ function CS_ClearingView.new(blur_view)
return self return self
end end
function M:InitMaPai() function M:InitMaPai()
self.maPaiCtr = self._view:GetController("mapai") self.maPaiCtr = self._view:GetController("mapai")
self.maPaiCtr.selectedIndex = 0 self.maPaiCtr.selectedIndex = 0
@ -33,17 +32,14 @@ function M:InitMaPai()
local tempMP = self._view:GetChild("niao" .. i) local tempMP = self._view:GetChild("niao" .. i)
table.insert(self.maPaiList, tempMP) table.insert(self.maPaiList, tempMP)
end end
end end
function M:IsMapaiShow(niao, isShow) function M:IsMapaiShow(niao, isShow)
if niao then if niao then
niao.visible = isShow niao.visible = isShow
end end
end end
function M:SetMaPaiValue(niao, value) function M:SetMaPaiValue(niao, value)
if niao then if niao then
niao.icon = 'ui://Main_Majiang/' .. get_majiang_prefix(DataManager.CurrenRoom.game_id) .. "201_" .. value niao.icon = 'ui://Main_Majiang/' .. get_majiang_prefix(DataManager.CurrenRoom.game_id) .. "201_" .. value
@ -61,8 +57,6 @@ function M:HideAllMapai()
end end
end end
function M:ShowSelectMaPai(niaoList) function M:ShowSelectMaPai(niaoList)
if niaoList and #niaoList > 0 then if niaoList and #niaoList > 0 then
self.maPaiCtr.selectedIndex = 1 self.maPaiCtr.selectedIndex = 1
@ -79,7 +73,6 @@ function M:ShowSelectMaPai(niaoList)
end end
end end
function M:InitData(over, room, result, total_result, callback) function M:InitData(over, room, result, total_result, callback)
self._callback = callback self._callback = callback
local _overCtr = self._view:GetController("over") local _overCtr = self._view:GetController("over")
@ -89,7 +82,8 @@ function M:InitData(over, room, result, total_result, callback)
local _btnCtr = self._view:GetController("button") local _btnCtr = self._view:GetController("button")
local _sdkCtr = self._view:GetController("sdk") local _sdkCtr = self._view:GetController("sdk")
local ctr_type = self._view:GetController("type") local ctr_type = self._view:GetController("type")
self._view:GetChild("tex_roominfo").text = string.format("房号%s 局%s/%s %s", room.room_id, room.curren_round, room.room_config.round, os.date("%Y-%m-%d %H:%M:%S", os.time())) self._view:GetChild("tex_roominfo").text = string.format("房号%s 局%s/%s %s", room.room_id, room.curren_round,
room.room_config.round, os.date("%Y-%m-%d %H:%M:%S", os.time()))
self._view:GetChild("tex_gameinfo").text = string.gsub(room.room_config:GetDes(), "\r", "") self._view:GetChild("tex_gameinfo").text = string.gsub(room.room_config:GetDes(), "\r", "")
-- self._view:GetChild("tex_roomnum").text = room.room_id -- self._view:GetChild("tex_roomnum").text = room.room_id
-- self._view:GetChild("tex_data").text = os.date("%Y-%m-%d %H:%M", os.time()) -- self._view:GetChild("tex_data").text = os.date("%Y-%m-%d %H:%M", os.time())
@ -342,7 +336,7 @@ function M:FillItemData(room, data, item, active_player)
local is_win = data["is_win"] or false local is_win = data["is_win"] or false
item:GetController("win").selectedIndex = is_win and 0 or 1 item:GetController("win").selectedIndex = is_win and 0 or 1
--print(p.self_user.account_id, active_player) ---- print(p.self_user.account_id, active_player)
if p.self_user.account_id == active_player and is_win == false and not data["liuju"] then if p.self_user.account_id == active_player and is_win == false and not data["liuju"] then
item:GetController("win").selectedIndex = 2 item:GetController("win").selectedIndex = 2
end end
@ -408,7 +402,8 @@ function M:FillItemData2(room, data, list)
-- self:SetGSListlineGap(-10) -- self:SetGSListlineGap(-10)
local big_result = self._view:GetChild("big_result") local big_result = self._view:GetChild("big_result")
big_result:GetChild("txt_room_info").text = string.format("%s 房号%s 局%s/%s", os.date("%Y/%m/%d", os.time()), room.room_id, room.curren_round, room.room_config.round) big_result:GetChild("txt_room_info").text = string.format("%s 房号%s 局%s/%s", os.date("%Y/%m/%d", os.time()),
room.room_id, room.curren_round, room.room_config.round)
local lst_p = big_result:GetChild("player_list") local lst_p = big_result:GetChild("player_list")
if #player_list == 3 then if #player_list == 3 then
lst_p.columnGap = 108 lst_p.columnGap = 108

View File

@ -68,7 +68,7 @@ function M:InitView(url)
self._hu_tip = HuTipView.new(self) self._hu_tip = HuTipView.new(self)
self:PlayerChangeLineState() self:PlayerChangeLineState()
--print("CS_MainView") ---- print("CS_MainView")
if (room.playing or room.curren_round > 0) or room.status == 1 then if (room.playing or room.curren_round > 0) or room.status == 1 then
self:ReloadRoom() self:ReloadRoom()
end end
@ -535,7 +535,7 @@ function M:OutCard(card)
-- 防止同一帧内执行两次OutCard事件 -- 防止同一帧内执行两次OutCard事件
local last_discard_frame = discard_frame local last_discard_frame = discard_frame
discard_frame = Time.frameCount discard_frame = Time.frameCount
--print("帧数:-------------------------",discard_frame, last_discard_frame, discard_frame == last_discard_frame) ---- print("帧数:-------------------------",discard_frame, last_discard_frame, discard_frame == last_discard_frame)
if discard_frame == last_discard_frame then if discard_frame == last_discard_frame then
return return
end end

View File

@ -89,8 +89,8 @@ function M:UpdateHandCard(getcard, mp, opcard)
local outcard_list = self._mask_data["outcard_list"] local outcard_list = self._mask_data["outcard_list"]
local comp = handcard_list["comp"] local comp = handcard_list["comp"]
local card = outcard_list["card"] local card = outcard_list["card"]
--print("comp"..comp) ---- print("comp"..comp)
-- print(vardump(_player.card_list)) -- -- print(vardump(_player.card_list))
if self._current_card_type == 2 then if self._current_card_type == 2 then
comp = comp .. "_3d" comp = comp .. "_3d"

View File

@ -36,7 +36,8 @@ function M:UpdateHandCard(getcard, mp, opcard)
local btn = _carViewList[i].card local btn = _carViewList[i].card
local card = self:GetCard(btn) local card = self:GetCard(btn)
list_remove(card_list, card) list_remove(card_list, card)
local tingList = CardCheck.tingPai(card_list, DataManager.CurrenRoom.self_player.fz_list, DataManager.CurrenRoom.room_config.no_jiang) local tingList = CardCheck.tingPai(card_list, DataManager.CurrenRoom.self_player.fz_list,
DataManager.CurrenRoom.room_config.no_jiang)
if #tingList > 0 then if #tingList > 0 then
local count = 0 local count = 0
for j = 1, #tingList do for j = 1, #tingList do
@ -162,8 +163,8 @@ function M:__OnDragEnd(context, offset)
local card = button.data local card = button.data
local _room = DataManager.CurrenRoom local _room = DataManager.CurrenRoom
-- print("button.y"..button.y .. "_room.curren_outcard_seat".._room.curren_outcard_seat) -- -- print("button.y"..button.y .. "_room.curren_outcard_seat".._room.curren_outcard_seat)
-- print(button.y - card.old_postion.y) -- -- print(button.y - card.old_postion.y)
-- if (button.y < -55 and _room.curren_outcard_seat == _room.self_player.seat) and self:CheckPlayerOnlineState() then -- if (button.y < -55 and _room.curren_outcard_seat == _room.self_player.seat) and self:CheckPlayerOnlineState() then
if (button.y - card.old_postion.y < -50 and _room.curren_outcard_seat == _room.self_player.seat) then if (button.y - card.old_postion.y < -50 and _room.curren_outcard_seat == _room.self_player.seat) then
self._mainView:OutCard(card.card_item) self._mainView:OutCard(card.card_item)
@ -184,6 +185,7 @@ function M:CheckPlayerOnlineState()
end end
return true return true
end end
function M:Clear(bskip) function M:Clear(bskip)
--self._ctr_state.selectedIndex = 0 --self._ctr_state.selectedIndex = 0
self._area_fz_list.x = self._src_fz_list.x self._area_fz_list.x = self._src_fz_list.x
@ -202,6 +204,6 @@ function M:Clear(bskip)
self._carViewList[i].card:Dispose() self._carViewList[i].card:Dispose()
end end
self._carViewList = {} self._carViewList = {}
end end
return M return M

View File

@ -48,8 +48,6 @@ function M:InitView(url)
end end
end end
function M:SetReconnentLaiziTips() function M:SetReconnentLaiziTips()
local room = DataManager.CurrenRoom local room = DataManager.CurrenRoom
if room.beforelaiziCardId and room.beforelaiziCardId > 0 then if room.beforelaiziCardId and room.beforelaiziCardId > 0 then
@ -57,17 +55,14 @@ function M:SetReconnentLaiziTips()
end end
end end
function M:SetLaiZiCard(btn, cardId) function M:SetLaiZiCard(btn, cardId)
btn.icon = 'ui://Main_Majiang/' .. get_majiang_prefix(DataManager.CurrenRoom.game_id) .. "201_" .. cardId btn.icon = 'ui://Main_Majiang/' .. get_majiang_prefix(DataManager.CurrenRoom.game_id) .. "201_" .. cardId
end end
function M:IsShowLaiZi(btn, isShow) function M:IsShowLaiZi(btn, isShow)
btn.visible = isShow btn.visible = isShow
end end
function M:HideAllLaiZiCard() function M:HideAllLaiZiCard()
self.Laizi1Btn.visible = false self.Laizi1Btn.visible = false
self.Laizi2Btn.visible = false self.Laizi2Btn.visible = false
@ -80,9 +75,9 @@ function M:SetShowLaiZiProcess(beforeLaiziID,currentLaizi1ID,currentLaizi2ID,isS
if isShowAnim == nil then isShowAnim = false end if isShowAnim == nil then isShowAnim = false end
printlog("当前赋值结果为====>>>") printlog("当前赋值结果为====>>>")
print(beforeLaiziID) -- print(beforeLaiziID)
print(currentLaizi1ID) -- print(currentLaizi1ID)
print(currentLaizi2ID) -- print(currentLaizi2ID)
self:HideAllLaiZiCard() self:HideAllLaiZiCard()
self:SetLaiZiCard(self.selectLaiziBtn, beforeLaiziID) self:SetLaiZiCard(self.selectLaiziBtn, beforeLaiziID)
self:SetLaiZiCard(self.Laizi1Btn, currentLaizi1ID) self:SetLaiZiCard(self.Laizi1Btn, currentLaizi1ID)
@ -102,7 +97,6 @@ function M:SetShowLaiZiProcess(beforeLaiziID,currentLaizi1ID,currentLaizi2ID,isS
if currentLaizi2ID then if currentLaizi2ID then
self:IsShowLaiZi(self.Laizi2Btn, true) self:IsShowLaiZi(self.Laizi2Btn, true)
end end
end end
) )
else else
@ -115,7 +109,6 @@ function M:SetShowLaiZiProcess(beforeLaiziID,currentLaizi1ID,currentLaizi2ID,isS
self.LaiziBG.visible = true self.LaiziBG.visible = true
end end
function M:UpdateRound() function M:UpdateRound()
self._view:GetChild("tex_round1").text = self._room.curren_round self._view:GetChild("tex_round1").text = self._room.curren_round
self._view:GetChild("tex_round2").text = self._room.room_config.round self._view:GetChild("tex_round2").text = self._room.room_config.round
@ -310,7 +303,6 @@ function M:EventInit()
local item = he_list:GetChild("list"):AddItemFromPool("ui://Extend_MJ_ChaoShan/" .. com_name) local item = he_list:GetChild("list"):AddItemFromPool("ui://Extend_MJ_ChaoShan/" .. com_name)
coroutine.wait(0.3) coroutine.wait(0.3)
end end
end end
coroutine.wait(2) coroutine.wait(2)
@ -319,7 +311,6 @@ function M:EventInit()
he_list:Dispose() he_list:Dispose()
self._popEvent = true self._popEvent = true
end) end)
end) end)
_gamectr:AddEventListener(TX_GameEvent.EventNiao, function(...) _gamectr:AddEventListener(TX_GameEvent.EventNiao, function(...)
@ -555,7 +546,8 @@ function M:_ChiView(tiplist, callback)
callback(tiplist[i].id) callback(tiplist[i].id)
end) end)
end end
_pop_tip_choice.xy = Vector2((self._view.width - _pop_tip_choice.width)/2, (self._view.height - _pop_tip_choice.height)/2) _pop_tip_choice.xy = Vector2((self._view.width - _pop_tip_choice.width) / 2,
(self._view.height - _pop_tip_choice.height) / 2)
self._view:AddChild(_pop_tip_choice) self._view:AddChild(_pop_tip_choice)
self._pop_tip_choice = _pop_tip_choice self._pop_tip_choice = _pop_tip_choice
end end
@ -577,7 +569,6 @@ function M:OnFangziAction(...)
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "") effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "")
-- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "碰框") -- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "碰框")
else else
self:PlaySound("ChaoShan_MJ", player.self_user.sex, "gang" .. math.random(1, 2)) self:PlaySound("ChaoShan_MJ", player.self_user.sex, "gang" .. math.random(1, 2))
effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "") effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "")
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "") effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "")

View File

@ -156,7 +156,7 @@ function M:FillPlayBackData(pd_data)
p.ready = _jp["ready"] == 1 and true or false p.ready = _jp["ready"] == 1 and true or false
local pid = _jp["aid"] local pid = _jp["aid"]
p.piao_niao = _jp["piao_niao"] p.piao_niao = _jp["piao_niao"]
-- print(DataManager.SelfUser.account_id,pid) -- -- print(DataManager.SelfUser.account_id,pid)
-- if (278 == pid) then -- if (278 == pid) then
-- room.self_player = p -- room.self_player = p
-- p.self_user = DataManager.SelfUser -- p.self_user = DataManager.SelfUser

View File

@ -16,7 +16,8 @@ function M.new(view,mainView)
end end
function M:ShowHuTip(card_list) function M:ShowHuTip(card_list)
local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui, DataManager.CurrenRoom.room_config.Laizi) local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui,
DataManager.CurrenRoom.room_config.Laizi)
if #tingList > 0 then if #tingList > 0 then
if DataManager.CurrenRoom.laiziInfo and #DataManager.CurrenRoom.laiziInfo > 0 then if DataManager.CurrenRoom.laiziInfo and #DataManager.CurrenRoom.laiziInfo > 0 then
for i = 1, #DataManager.CurrenRoom.laiziInfo do for i = 1, #DataManager.CurrenRoom.laiziInfo do
@ -25,7 +26,6 @@ function M:ShowHuTip(card_list)
end end
end end
end end
end end
self._mainView._hu_tip:FillData(tingList) self._mainView._hu_tip:FillData(tingList)
end end
@ -43,7 +43,6 @@ function M:UpdateHandCard(getcard, mp)
if obj.card:GetController("laizi") then if obj.card:GetController("laizi") then
obj.card:GetController("laizi").selectedIndex = 1 obj.card:GetController("laizi").selectedIndex = 1
end end
end end
else else
if obj.card.GetController then if obj.card.GetController then
@ -52,11 +51,8 @@ function M:UpdateHandCard(getcard, mp)
end end
end end
end end
end end
end end
end end
@ -72,7 +68,8 @@ function M:UpdateHandCard(getcard, mp)
local btn = _carViewList[i].card local btn = _carViewList[i].card
local card = self:GetCard(btn) local card = self:GetCard(btn)
list_remove(card_list, card) list_remove(card_list, card)
local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui, DataManager.CurrenRoom.room_config.Laizi) local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true,
DataManager.CurrenRoom.room_config.Qidui, DataManager.CurrenRoom.room_config.Laizi)
if #tingList > 0 then if #tingList > 0 then
local count = 0 local count = 0
for j = 1, #tingList do for j = 1, #tingList do
@ -108,7 +105,6 @@ function M:UpdateHandCard(getcard, mp)
end end
self._out_card = false self._out_card = false
end end
end end
function M:__OnClickHandCard(context) function M:__OnClickHandCard(context)
@ -169,7 +165,7 @@ function M:__OnDragEnd(context)
local card = button.data local card = button.data
local _room = DataManager.CurrenRoom local _room = DataManager.CurrenRoom
-- print("button.y"..button.y .. "_room.curren_outcard_seat".._room.curren_outcard_seat) -- -- print("button.y"..button.y .. "_room.curren_outcard_seat".._room.curren_outcard_seat)
if (button.y - card.old_postion.y < -50 and _room.curren_outcard_seat == _room.self_player.seat and card.card_item ~= 0) then if (button.y - card.old_postion.y < -50 and _room.curren_outcard_seat == _room.self_player.seat and card.card_item ~= 0) then
self._mainView:OutCard(card.card_item) self._mainView:OutCard(card.card_item)
button.touchable = false button.touchable = false
@ -189,6 +185,7 @@ function M:CheckPlayerOnlineState()
end end
return true return true
end end
function M:Clear(bskip) function M:Clear(bskip)
--self._ctr_state.selectedIndex = 0 --self._ctr_state.selectedIndex = 0
self._area_fz_list.x = self._src_fz_list.x self._area_fz_list.x = self._src_fz_list.x
@ -207,6 +204,6 @@ function M:Clear(bskip)
self._carViewList[i].card:Dispose() self._carViewList[i].card:Dispose()
end end
self._carViewList = {} self._carViewList = {}
end end
return M return M

View File

@ -48,8 +48,6 @@ function M:InitView(url)
end end
end end
function M:SetReconnentLaiziTips() function M:SetReconnentLaiziTips()
local room = DataManager.CurrenRoom local room = DataManager.CurrenRoom
if room.beforelaiziCardId and room.beforelaiziCardId > 0 then if room.beforelaiziCardId and room.beforelaiziCardId > 0 then
@ -57,17 +55,14 @@ function M:SetReconnentLaiziTips()
end end
end end
function M:SetLaiZiCard(btn, cardId) function M:SetLaiZiCard(btn, cardId)
btn.icon = 'ui://Main_Majiang/' .. get_majiang_prefix(DataManager.CurrenRoom.game_id) .. "201_" .. cardId btn.icon = 'ui://Main_Majiang/' .. get_majiang_prefix(DataManager.CurrenRoom.game_id) .. "201_" .. cardId
end end
function M:IsShowLaiZi(btn, isShow) function M:IsShowLaiZi(btn, isShow)
btn.visible = isShow btn.visible = isShow
end end
function M:HideAllLaiZiCard() function M:HideAllLaiZiCard()
self.Laizi1Btn.visible = false self.Laizi1Btn.visible = false
self.Laizi2Btn.visible = false self.Laizi2Btn.visible = false
@ -80,9 +75,9 @@ function M:SetShowLaiZiProcess(beforeLaiziID,currentLaizi1ID,currentLaizi2ID,isS
if isShowAnim == nil then isShowAnim = false end if isShowAnim == nil then isShowAnim = false end
printlog("当前赋值结果为====>>>") printlog("当前赋值结果为====>>>")
print(beforeLaiziID) -- print(beforeLaiziID)
print(currentLaizi1ID) -- print(currentLaizi1ID)
print(currentLaizi2ID) -- print(currentLaizi2ID)
self:HideAllLaiZiCard() self:HideAllLaiZiCard()
self:SetLaiZiCard(self.selectLaiziBtn, beforeLaiziID) self:SetLaiZiCard(self.selectLaiziBtn, beforeLaiziID)
self:SetLaiZiCard(self.Laizi1Btn, currentLaizi1ID) self:SetLaiZiCard(self.Laizi1Btn, currentLaizi1ID)
@ -102,7 +97,6 @@ function M:SetShowLaiZiProcess(beforeLaiziID,currentLaizi1ID,currentLaizi2ID,isS
if currentLaizi2ID then if currentLaizi2ID then
self:IsShowLaiZi(self.Laizi2Btn, true) self:IsShowLaiZi(self.Laizi2Btn, true)
end end
end end
) )
else else
@ -115,7 +109,6 @@ function M:SetShowLaiZiProcess(beforeLaiziID,currentLaizi1ID,currentLaizi2ID,isS
self.LaiziBG.visible = true self.LaiziBG.visible = true
end end
function M:UpdateRound() function M:UpdateRound()
self._view:GetChild("tex_round1").text = self._room.curren_round self._view:GetChild("tex_round1").text = self._room.curren_round
self._view:GetChild("tex_round2").text = self._room.room_config.round self._view:GetChild("tex_round2").text = self._room.room_config.round
@ -310,7 +303,6 @@ function M:EventInit()
local item = he_list:GetChild("list"):AddItemFromPool("ui://Extend_MJ_ChaoZhou/" .. com_name) local item = he_list:GetChild("list"):AddItemFromPool("ui://Extend_MJ_ChaoZhou/" .. com_name)
coroutine.wait(0.3) coroutine.wait(0.3)
end end
end end
coroutine.wait(2) coroutine.wait(2)
@ -319,7 +311,6 @@ function M:EventInit()
he_list:Dispose() he_list:Dispose()
self._popEvent = true self._popEvent = true
end) end)
end) end)
_gamectr:AddEventListener(TX_GameEvent.EventNiao, function(...) _gamectr:AddEventListener(TX_GameEvent.EventNiao, function(...)
@ -496,7 +487,6 @@ function M:__FangziTip(tip, weight)
for k = 1, #_tlist do for k = 1, #_tlist do
local td = tip.tip_map_type[_tlist[k]][1] local td = tip.tip_map_type[_tlist[k]][1]
local url = "ui://Main_Majiang/Btn_fztip" local url = "ui://Main_Majiang/Btn_fztip"
local td_weight = td.weight local td_weight = td.weight
@ -509,14 +499,12 @@ function M:__FangziTip(tip, weight)
btn_t.data = { tip, td } btn_t.data = { tip, td }
btn_t.onClick:Add(self.__TipAction, self) btn_t.onClick:Add(self.__TipAction, self)
end end
else else
local btn_t = _lit_fanzi:AddItemFromPool(url) local btn_t = _lit_fanzi:AddItemFromPool(url)
btn_t.icon = "ui://Main_Majiang/fztip_" .. td_weight btn_t.icon = "ui://Main_Majiang/fztip_" .. td_weight
btn_t.data = { tip, td } btn_t.data = { tip, td }
btn_t.onClick:Add(self.__TipAction, self) btn_t.onClick:Add(self.__TipAction, self)
end end
end end
if tip_hu == false then if tip_hu == false then
@ -539,7 +527,6 @@ function M:__FangziTip(tip, weight)
end end
end) end)
end end
else else
local tip_hu = false local tip_hu = false
local count = #_tlist local count = #_tlist
@ -575,8 +562,6 @@ function M:__FangziTip(tip, weight)
end end
end) end)
-- end -- end
end end
@ -626,7 +611,8 @@ function M:_ChiView(tiplist, callback)
callback(tiplist[i].id) callback(tiplist[i].id)
end) end)
end end
_pop_tip_choice.xy = Vector2((self._view.width - _pop_tip_choice.width)/2, (self._view.height - _pop_tip_choice.height)/2) _pop_tip_choice.xy = Vector2((self._view.width - _pop_tip_choice.width) / 2,
(self._view.height - _pop_tip_choice.height) / 2)
self._view:AddChild(_pop_tip_choice) self._view:AddChild(_pop_tip_choice)
self._pop_tip_choice = _pop_tip_choice self._pop_tip_choice = _pop_tip_choice
end end
@ -648,7 +634,6 @@ function M:OnFangziAction(...)
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "") effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "")
-- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "碰框") -- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "碰框")
else else
self:PlaySound("ChaoZhou_MJ", player.self_user.sex, "gang" .. math.random(1, 2)) self:PlaySound("ChaoZhou_MJ", player.self_user.sex, "gang" .. math.random(1, 2))
effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "") effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "")
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "") effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "")

View File

@ -156,7 +156,7 @@ function M:FillPlayBackData(pd_data)
p.ready = _jp["ready"] == 1 and true or false p.ready = _jp["ready"] == 1 and true or false
local pid = _jp["aid"] local pid = _jp["aid"]
p.piao_niao = _jp["piao_niao"] p.piao_niao = _jp["piao_niao"]
-- print(DataManager.SelfUser.account_id,pid) -- -- print(DataManager.SelfUser.account_id,pid)
-- if (278 == pid) then -- if (278 == pid) then
-- room.self_player = p -- room.self_player = p
-- p.self_user = DataManager.SelfUser -- p.self_user = DataManager.SelfUser

View File

@ -16,7 +16,8 @@ function M.new(view,mainView)
end end
function M:ShowHuTip(card_list) function M:ShowHuTip(card_list)
local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui, DataManager.CurrenRoom.room_config.Laizi) local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui,
DataManager.CurrenRoom.room_config.Laizi)
if #tingList > 0 then if #tingList > 0 then
if DataManager.CurrenRoom.laiziInfo and #DataManager.CurrenRoom.laiziInfo > 0 then if DataManager.CurrenRoom.laiziInfo and #DataManager.CurrenRoom.laiziInfo > 0 then
for i = 1, #DataManager.CurrenRoom.laiziInfo do for i = 1, #DataManager.CurrenRoom.laiziInfo do
@ -25,7 +26,6 @@ function M:ShowHuTip(card_list)
end end
end end
end end
end end
self._mainView._hu_tip:FillData(tingList) self._mainView._hu_tip:FillData(tingList)
end end
@ -43,7 +43,6 @@ function M:UpdateHandCard(getcard, mp)
if obj.card:GetController("laizi") then if obj.card:GetController("laizi") then
obj.card:GetController("laizi").selectedIndex = 1 obj.card:GetController("laizi").selectedIndex = 1
end end
end end
else else
if obj.card.GetController then if obj.card.GetController then
@ -52,11 +51,8 @@ function M:UpdateHandCard(getcard, mp)
end end
end end
end end
end end
end end
end end
@ -72,7 +68,8 @@ function M:UpdateHandCard(getcard, mp)
local btn = _carViewList[i].card local btn = _carViewList[i].card
local card = self:GetCard(btn) local card = self:GetCard(btn)
list_remove(card_list, card) list_remove(card_list, card)
local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui, DataManager.CurrenRoom.room_config.Laizi) local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true,
DataManager.CurrenRoom.room_config.Qidui, DataManager.CurrenRoom.room_config.Laizi)
if #tingList > 0 then if #tingList > 0 then
local count = 0 local count = 0
for j = 1, #tingList do for j = 1, #tingList do
@ -108,7 +105,6 @@ function M:UpdateHandCard(getcard, mp)
end end
self._out_card = false self._out_card = false
end end
end end
function M:__OnClickHandCard(context) function M:__OnClickHandCard(context)
@ -169,7 +165,7 @@ function M:__OnDragEnd(context)
local card = button.data local card = button.data
local _room = DataManager.CurrenRoom local _room = DataManager.CurrenRoom
-- print("button.y"..button.y .. "_room.curren_outcard_seat".._room.curren_outcard_seat) -- -- print("button.y"..button.y .. "_room.curren_outcard_seat".._room.curren_outcard_seat)
if (button.y - card.old_postion.y < -50 and _room.curren_outcard_seat == _room.self_player.seat and card.card_item ~= 0) then if (button.y - card.old_postion.y < -50 and _room.curren_outcard_seat == _room.self_player.seat and card.card_item ~= 0) then
self._mainView:OutCard(card.card_item) self._mainView:OutCard(card.card_item)
button.touchable = false button.touchable = false
@ -189,6 +185,7 @@ function M:CheckPlayerOnlineState()
end end
return true return true
end end
function M:Clear(bskip) function M:Clear(bskip)
--self._ctr_state.selectedIndex = 0 --self._ctr_state.selectedIndex = 0
self._area_fz_list.x = self._src_fz_list.x self._area_fz_list.x = self._src_fz_list.x
@ -207,6 +204,6 @@ function M:Clear(bskip)
self._carViewList[i].card:Dispose() self._carViewList[i].card:Dispose()
end end
self._carViewList = {} self._carViewList = {}
end end
return M return M

View File

@ -48,8 +48,6 @@ function M:InitView(url)
end end
end end
function M:SetReconnentLaiziTips() function M:SetReconnentLaiziTips()
local room = DataManager.CurrenRoom local room = DataManager.CurrenRoom
if room.beforelaiziCardId and room.beforelaiziCardId > 0 then if room.beforelaiziCardId and room.beforelaiziCardId > 0 then
@ -57,17 +55,14 @@ function M:SetReconnentLaiziTips()
end end
end end
function M:SetLaiZiCard(btn, cardId) function M:SetLaiZiCard(btn, cardId)
btn.icon = 'ui://Main_Majiang/' .. get_majiang_prefix(DataManager.CurrenRoom.game_id) .. "201_" .. cardId btn.icon = 'ui://Main_Majiang/' .. get_majiang_prefix(DataManager.CurrenRoom.game_id) .. "201_" .. cardId
end end
function M:IsShowLaiZi(btn, isShow) function M:IsShowLaiZi(btn, isShow)
btn.visible = isShow btn.visible = isShow
end end
function M:HideAllLaiZiCard() function M:HideAllLaiZiCard()
self.Laizi1Btn.visible = false self.Laizi1Btn.visible = false
self.Laizi2Btn.visible = false self.Laizi2Btn.visible = false
@ -80,9 +75,9 @@ function M:SetShowLaiZiProcess(beforeLaiziID,currentLaizi1ID,currentLaizi2ID,isS
if isShowAnim == nil then isShowAnim = false end if isShowAnim == nil then isShowAnim = false end
printlog("当前赋值结果为====>>>") printlog("当前赋值结果为====>>>")
print(beforeLaiziID) -- print(beforeLaiziID)
print(currentLaizi1ID) -- print(currentLaizi1ID)
print(currentLaizi2ID) -- print(currentLaizi2ID)
self:HideAllLaiZiCard() self:HideAllLaiZiCard()
self:SetLaiZiCard(self.selectLaiziBtn, beforeLaiziID) self:SetLaiZiCard(self.selectLaiziBtn, beforeLaiziID)
self:SetLaiZiCard(self.Laizi1Btn, currentLaizi1ID) self:SetLaiZiCard(self.Laizi1Btn, currentLaizi1ID)
@ -102,7 +97,6 @@ function M:SetShowLaiZiProcess(beforeLaiziID,currentLaizi1ID,currentLaizi2ID,isS
if currentLaizi2ID then if currentLaizi2ID then
self:IsShowLaiZi(self.Laizi2Btn, true) self:IsShowLaiZi(self.Laizi2Btn, true)
end end
end end
) )
else else
@ -115,7 +109,6 @@ function M:SetShowLaiZiProcess(beforeLaiziID,currentLaizi1ID,currentLaizi2ID,isS
self.LaiziBG.visible = true self.LaiziBG.visible = true
end end
function M:UpdateRound() function M:UpdateRound()
self._view:GetChild("tex_round1").text = self._room.curren_round self._view:GetChild("tex_round1").text = self._room.curren_round
self._view:GetChild("tex_round2").text = self._room.room_config.round self._view:GetChild("tex_round2").text = self._room.room_config.round
@ -310,7 +303,6 @@ function M:EventInit()
local item = he_list:GetChild("list"):AddItemFromPool("ui://Extend_MJ_ChaoZhouGui/" .. com_name) local item = he_list:GetChild("list"):AddItemFromPool("ui://Extend_MJ_ChaoZhouGui/" .. com_name)
coroutine.wait(0.3) coroutine.wait(0.3)
end end
end end
coroutine.wait(2) coroutine.wait(2)
@ -319,7 +311,6 @@ function M:EventInit()
he_list:Dispose() he_list:Dispose()
self._popEvent = true self._popEvent = true
end) end)
end) end)
_gamectr:AddEventListener(TX_GameEvent.EventNiao, function(...) _gamectr:AddEventListener(TX_GameEvent.EventNiao, function(...)
@ -496,7 +487,6 @@ function M:__FangziTip(tip, weight)
for k = 1, #_tlist do for k = 1, #_tlist do
local td = tip.tip_map_type[_tlist[k]][1] local td = tip.tip_map_type[_tlist[k]][1]
local url = "ui://Main_Majiang/Btn_fztip" local url = "ui://Main_Majiang/Btn_fztip"
local td_weight = td.weight local td_weight = td.weight
@ -509,14 +499,12 @@ function M:__FangziTip(tip, weight)
btn_t.data = { tip, td } btn_t.data = { tip, td }
btn_t.onClick:Add(self.__TipAction, self) btn_t.onClick:Add(self.__TipAction, self)
end end
else else
local btn_t = _lit_fanzi:AddItemFromPool(url) local btn_t = _lit_fanzi:AddItemFromPool(url)
btn_t.icon = "ui://Main_Majiang/fztip_" .. td_weight btn_t.icon = "ui://Main_Majiang/fztip_" .. td_weight
btn_t.data = { tip, td } btn_t.data = { tip, td }
btn_t.onClick:Add(self.__TipAction, self) btn_t.onClick:Add(self.__TipAction, self)
end end
end end
if tip_hu == false then if tip_hu == false then
@ -539,7 +527,6 @@ function M:__FangziTip(tip, weight)
end end
end) end)
end end
else else
local tip_hu = false local tip_hu = false
local count = #_tlist local count = #_tlist
@ -575,8 +562,6 @@ function M:__FangziTip(tip, weight)
end end
end) end)
-- end -- end
end end
@ -626,7 +611,8 @@ function M:_ChiView(tiplist, callback)
callback(tiplist[i].id) callback(tiplist[i].id)
end) end)
end end
_pop_tip_choice.xy = Vector2((self._view.width - _pop_tip_choice.width)/2, (self._view.height - _pop_tip_choice.height)/2) _pop_tip_choice.xy = Vector2((self._view.width - _pop_tip_choice.width) / 2,
(self._view.height - _pop_tip_choice.height) / 2)
self._view:AddChild(_pop_tip_choice) self._view:AddChild(_pop_tip_choice)
self._pop_tip_choice = _pop_tip_choice self._pop_tip_choice = _pop_tip_choice
end end
@ -648,7 +634,6 @@ function M:OnFangziAction(...)
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "") effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "")
-- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "碰框") -- effect:GetChild("kuang").icon = UIPackage.GetItemURL("Main_Majiang", "碰框")
else else
self:PlaySound("ChaoZhouGui_MJ", player.self_user.sex, "gang" .. math.random(1, 2)) self:PlaySound("ChaoZhouGui_MJ", player.self_user.sex, "gang" .. math.random(1, 2))
effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "") effect:GetChild("word1").icon = UIPackage.GetItemURL("Main_Majiang", "")
effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "") effect:GetChild("word2").icon = UIPackage.GetItemURL("Main_Majiang", "")

View File

@ -156,7 +156,7 @@ function M:FillPlayBackData(pd_data)
p.ready = _jp["ready"] == 1 and true or false p.ready = _jp["ready"] == 1 and true or false
local pid = _jp["aid"] local pid = _jp["aid"]
p.piao_niao = _jp["piao_niao"] p.piao_niao = _jp["piao_niao"]
-- print(DataManager.SelfUser.account_id,pid) -- -- print(DataManager.SelfUser.account_id,pid)
-- if (278 == pid) then -- if (278 == pid) then
-- room.self_player = p -- room.self_player = p
-- p.self_user = DataManager.SelfUser -- p.self_user = DataManager.SelfUser

View File

@ -16,7 +16,8 @@ function M.new(view,mainView)
end end
function M:ShowHuTip(card_list) function M:ShowHuTip(card_list)
local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui, DataManager.CurrenRoom.room_config.Laizi) local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui,
DataManager.CurrenRoom.room_config.Laizi)
if #tingList > 0 then if #tingList > 0 then
if DataManager.CurrenRoom.laiziInfo and #DataManager.CurrenRoom.laiziInfo > 0 then if DataManager.CurrenRoom.laiziInfo and #DataManager.CurrenRoom.laiziInfo > 0 then
for i = 1, #DataManager.CurrenRoom.laiziInfo do for i = 1, #DataManager.CurrenRoom.laiziInfo do
@ -25,7 +26,6 @@ function M:ShowHuTip(card_list)
end end
end end
end end
end end
self._mainView._hu_tip:FillData(tingList) self._mainView._hu_tip:FillData(tingList)
end end
@ -43,7 +43,6 @@ function M:UpdateHandCard(getcard, mp)
if obj.card:GetController("laizi") then if obj.card:GetController("laizi") then
obj.card:GetController("laizi").selectedIndex = 1 obj.card:GetController("laizi").selectedIndex = 1
end end
end end
else else
if obj.card.GetController then if obj.card.GetController then
@ -52,11 +51,8 @@ function M:UpdateHandCard(getcard, mp)
end end
end end
end end
end end
end end
end end
@ -72,7 +68,8 @@ function M:UpdateHandCard(getcard, mp)
local btn = _carViewList[i].card local btn = _carViewList[i].card
local card = self:GetCard(btn) local card = self:GetCard(btn)
list_remove(card_list, card) list_remove(card_list, card)
local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui, DataManager.CurrenRoom.room_config.Laizi) local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true,
DataManager.CurrenRoom.room_config.Qidui, DataManager.CurrenRoom.room_config.Laizi)
if #tingList > 0 then if #tingList > 0 then
local count = 0 local count = 0
for j = 1, #tingList do for j = 1, #tingList do
@ -108,7 +105,6 @@ function M:UpdateHandCard(getcard, mp)
end end
self._out_card = false self._out_card = false
end end
end end
function M:__OnClickHandCard(context) function M:__OnClickHandCard(context)
@ -169,7 +165,7 @@ function M:__OnDragEnd(context)
local card = button.data local card = button.data
local _room = DataManager.CurrenRoom local _room = DataManager.CurrenRoom
-- print("button.y"..button.y .. "_room.curren_outcard_seat".._room.curren_outcard_seat) -- -- print("button.y"..button.y .. "_room.curren_outcard_seat".._room.curren_outcard_seat)
if (button.y - card.old_postion.y < -50 and _room.curren_outcard_seat == _room.self_player.seat and card.card_item ~= 0) then if (button.y - card.old_postion.y < -50 and _room.curren_outcard_seat == _room.self_player.seat and card.card_item ~= 0) then
self._mainView:OutCard(card.card_item) self._mainView:OutCard(card.card_item)
button.touchable = false button.touchable = false
@ -189,6 +185,7 @@ function M:CheckPlayerOnlineState()
end end
return true return true
end end
function M:Clear(bskip) function M:Clear(bskip)
--self._ctr_state.selectedIndex = 0 --self._ctr_state.selectedIndex = 0
self._area_fz_list.x = self._src_fz_list.x self._area_fz_list.x = self._src_fz_list.x
@ -207,6 +204,6 @@ function M:Clear(bskip)
self._carViewList[i].card:Dispose() self._carViewList[i].card:Dispose()
end end
self._carViewList = {} self._carViewList = {}
end end
return M return M

View File

@ -140,7 +140,7 @@ function M:FillPlayBackData(pd_data)
p.ready = _jp["ready"] == 1 and true or false p.ready = _jp["ready"] == 1 and true or false
local pid = _jp["aid"] local pid = _jp["aid"]
p.piao_niao = _jp["piao_niao"] p.piao_niao = _jp["piao_niao"]
-- print(DataManager.SelfUser.account_id,pid) -- -- print(DataManager.SelfUser.account_id,pid)
-- if (278 == pid) then -- if (278 == pid) then
-- room.self_player = p -- room.self_player = p
-- p.self_user = DataManager.SelfUser -- p.self_user = DataManager.SelfUser

View File

@ -17,7 +17,8 @@ end
function M:ShowHuTip(card_list) function M:ShowHuTip(card_list)
printlog("ShowHuTip") printlog("ShowHuTip")
local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui, DataManager.CurrenRoom.room_config.Laizi) local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui,
DataManager.CurrenRoom.room_config.Laizi)
if #tingList > 0 then if #tingList > 0 then
if DataManager.CurrenRoom.laiziInfo and #DataManager.CurrenRoom.laiziInfo > 0 then if DataManager.CurrenRoom.laiziInfo and #DataManager.CurrenRoom.laiziInfo > 0 then
for i = 1, #DataManager.CurrenRoom.laiziInfo do for i = 1, #DataManager.CurrenRoom.laiziInfo do
@ -26,7 +27,6 @@ function M:ShowHuTip(card_list)
end end
end end
end end
end end
self._mainView._hu_tip:FillData(tingList) self._mainView._hu_tip:FillData(tingList)
end end
@ -44,7 +44,6 @@ function M:UpdateHandCard(getcard, mp)
if obj.card:GetController("laizi") then if obj.card:GetController("laizi") then
obj.card:GetController("laizi").selectedIndex = 1 obj.card:GetController("laizi").selectedIndex = 1
end end
end end
else else
if obj.card.GetController then if obj.card.GetController then
@ -53,11 +52,8 @@ function M:UpdateHandCard(getcard, mp)
end end
end end
end end
end end
end end
end end
@ -73,7 +69,8 @@ function M:UpdateHandCard(getcard, mp)
local btn = _carViewList[i].card local btn = _carViewList[i].card
local card = self:GetCard(btn) local card = self:GetCard(btn)
list_remove(card_list, card) list_remove(card_list, card)
local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui, DataManager.CurrenRoom.room_config.Laizi) local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true,
DataManager.CurrenRoom.room_config.Qidui, DataManager.CurrenRoom.room_config.Laizi)
if #tingList > 0 then if #tingList > 0 then
local count = 0 local count = 0
for j = 1, #tingList do for j = 1, #tingList do
@ -109,7 +106,6 @@ function M:UpdateHandCard(getcard, mp)
end end
self._out_card = false self._out_card = false
end end
end end
function M:__OnClickHandCard(context) function M:__OnClickHandCard(context)
@ -170,7 +166,7 @@ function M:__OnDragEnd(context)
local card = button.data local card = button.data
local _room = DataManager.CurrenRoom local _room = DataManager.CurrenRoom
-- print("button.y"..button.y .. "_room.curren_outcard_seat".._room.curren_outcard_seat) -- -- print("button.y"..button.y .. "_room.curren_outcard_seat".._room.curren_outcard_seat)
if (button.y - card.old_postion.y < -50 and _room.curren_outcard_seat == _room.self_player.seat and card.card_item ~= 0) then if (button.y - card.old_postion.y < -50 and _room.curren_outcard_seat == _room.self_player.seat and card.card_item ~= 0) then
self._mainView:OutCard(card.card_item) self._mainView:OutCard(card.card_item)
button.touchable = false button.touchable = false
@ -190,6 +186,7 @@ function M:CheckPlayerOnlineState()
end end
return true return true
end end
function M:Clear(bskip) function M:Clear(bskip)
--self._ctr_state.selectedIndex = 0 --self._ctr_state.selectedIndex = 0
self._area_fz_list.x = self._src_fz_list.x self._area_fz_list.x = self._src_fz_list.x
@ -208,6 +205,6 @@ function M:Clear(bskip)
self._carViewList[i].card:Dispose() self._carViewList[i].card:Dispose()
end end
self._carViewList = {} self._carViewList = {}
end end
return M return M

View File

@ -140,7 +140,7 @@ function M:FillPlayBackData(pd_data)
p.ready = _jp["ready"] == 1 and true or false p.ready = _jp["ready"] == 1 and true or false
local pid = _jp["aid"] local pid = _jp["aid"]
p.piao_niao = _jp["piao_niao"] p.piao_niao = _jp["piao_niao"]
-- print(DataManager.SelfUser.account_id,pid) -- -- print(DataManager.SelfUser.account_id,pid)
-- if (278 == pid) then -- if (278 == pid) then
-- room.self_player = p -- room.self_player = p
-- p.self_user = DataManager.SelfUser -- p.self_user = DataManager.SelfUser

View File

@ -17,7 +17,8 @@ end
function M:ShowHuTip(card_list) function M:ShowHuTip(card_list)
printlog("ShowHuTip") printlog("ShowHuTip")
local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui, DataManager.CurrenRoom.room_config.Laizi) local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui,
DataManager.CurrenRoom.room_config.Laizi)
if #tingList > 0 then if #tingList > 0 then
if DataManager.CurrenRoom.laiziInfo and #DataManager.CurrenRoom.laiziInfo > 0 then if DataManager.CurrenRoom.laiziInfo and #DataManager.CurrenRoom.laiziInfo > 0 then
for i = 1, #DataManager.CurrenRoom.laiziInfo do for i = 1, #DataManager.CurrenRoom.laiziInfo do
@ -26,7 +27,6 @@ function M:ShowHuTip(card_list)
end end
end end
end end
end end
self._mainView._hu_tip:FillData(tingList) self._mainView._hu_tip:FillData(tingList)
end end
@ -44,7 +44,6 @@ function M:UpdateHandCard(getcard, mp)
if obj.card:GetController("laizi") then if obj.card:GetController("laizi") then
obj.card:GetController("laizi").selectedIndex = 1 obj.card:GetController("laizi").selectedIndex = 1
end end
end end
else else
if obj.card.GetController then if obj.card.GetController then
@ -53,11 +52,8 @@ function M:UpdateHandCard(getcard, mp)
end end
end end
end end
end end
end end
end end
@ -73,7 +69,8 @@ function M:UpdateHandCard(getcard, mp)
local btn = _carViewList[i].card local btn = _carViewList[i].card
local card = self:GetCard(btn) local card = self:GetCard(btn)
list_remove(card_list, card) list_remove(card_list, card)
local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui, DataManager.CurrenRoom.room_config.Laizi) local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true,
DataManager.CurrenRoom.room_config.Qidui, DataManager.CurrenRoom.room_config.Laizi)
if #tingList > 0 then if #tingList > 0 then
local count = 0 local count = 0
for j = 1, #tingList do for j = 1, #tingList do
@ -109,7 +106,6 @@ function M:UpdateHandCard(getcard, mp)
end end
self._out_card = false self._out_card = false
end end
end end
function M:__OnClickHandCard(context) function M:__OnClickHandCard(context)
@ -170,7 +166,7 @@ function M:__OnDragEnd(context)
local card = button.data local card = button.data
local _room = DataManager.CurrenRoom local _room = DataManager.CurrenRoom
-- print("button.y"..button.y .. "_room.curren_outcard_seat".._room.curren_outcard_seat) -- -- print("button.y"..button.y .. "_room.curren_outcard_seat".._room.curren_outcard_seat)
if (button.y - card.old_postion.y < -50 and _room.curren_outcard_seat == _room.self_player.seat and card.card_item ~= 0) then if (button.y - card.old_postion.y < -50 and _room.curren_outcard_seat == _room.self_player.seat and card.card_item ~= 0) then
self._mainView:OutCard(card.card_item) self._mainView:OutCard(card.card_item)
button.touchable = false button.touchable = false
@ -190,6 +186,7 @@ function M:CheckPlayerOnlineState()
end end
return true return true
end end
function M:Clear(bskip) function M:Clear(bskip)
--self._ctr_state.selectedIndex = 0 --self._ctr_state.selectedIndex = 0
self._area_fz_list.x = self._src_fz_list.x self._area_fz_list.x = self._src_fz_list.x
@ -208,6 +205,6 @@ function M:Clear(bskip)
self._carViewList[i].card:Dispose() self._carViewList[i].card:Dispose()
end end
self._carViewList = {} self._carViewList = {}
end end
return M return M

View File

@ -137,7 +137,7 @@ function M:FillPlayBackData(pd_data)
p.ready = _jp["ready"] == 1 and true or false p.ready = _jp["ready"] == 1 and true or false
local pid = _jp["aid"] local pid = _jp["aid"]
p.piao_niao = _jp["piao_niao"] p.piao_niao = _jp["piao_niao"]
-- print(DataManager.SelfUser.account_id,pid) -- -- print(DataManager.SelfUser.account_id,pid)
-- if (278 == pid) then -- if (278 == pid) then
-- room.self_player = p -- room.self_player = p
-- p.self_user = DataManager.SelfUser -- p.self_user = DataManager.SelfUser

View File

@ -16,7 +16,8 @@ function M.new(view,mainView)
end end
function M:ShowHuTip(card_list) function M:ShowHuTip(card_list)
local tingList = CardCheck.tingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui, DataManager.CurrenRoom.room_config.Laizi) local tingList = CardCheck.tingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui,
DataManager.CurrenRoom.room_config.Laizi)
if #tingList > 0 then if #tingList > 0 then
table.insert(tingList, 412) table.insert(tingList, 412)
end end
@ -38,7 +39,8 @@ function M:UpdateHandCard(getcard, mp)
local btn = _carViewList[i].card local btn = _carViewList[i].card
local card = self:GetCard(btn) local card = self:GetCard(btn)
list_remove(card_list, card) list_remove(card_list, card)
local tingList = CardCheck.tingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui, DataManager.CurrenRoom.room_config.Laizi) local tingList = CardCheck.tingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui,
DataManager.CurrenRoom.room_config.Laizi)
if #tingList > 0 then if #tingList > 0 then
local count = 0 local count = 0
for j = 1, #tingList do for j = 1, #tingList do
@ -134,7 +136,7 @@ function M:__OnDragEnd(context)
local card = button.data local card = button.data
local _room = DataManager.CurrenRoom local _room = DataManager.CurrenRoom
-- print("button.y"..button.y .. "_room.curren_outcard_seat".._room.curren_outcard_seat) -- -- print("button.y"..button.y .. "_room.curren_outcard_seat".._room.curren_outcard_seat)
if (button.y - card.old_postion.y < -50 and _room.curren_outcard_seat == _room.self_player.seat and card.card_item ~= 412) then if (button.y - card.old_postion.y < -50 and _room.curren_outcard_seat == _room.self_player.seat and card.card_item ~= 412) then
self._mainView:OutCard(card.card_item) self._mainView:OutCard(card.card_item)
button.touchable = false button.touchable = false
@ -154,6 +156,7 @@ function M:CheckPlayerOnlineState()
end end
return true return true
end end
function M:Clear(bskip) function M:Clear(bskip)
--self._ctr_state.selectedIndex = 0 --self._ctr_state.selectedIndex = 0
self._area_fz_list.x = self._src_fz_list.x self._area_fz_list.x = self._src_fz_list.x
@ -172,6 +175,6 @@ function M:Clear(bskip)
self._carViewList[i].card:Dispose() self._carViewList[i].card:Dispose()
end end
self._carViewList = {} self._carViewList = {}
end end
return M return M

View File

@ -140,7 +140,7 @@ function M:FillPlayBackData(pd_data)
p.ready = _jp["ready"] == 1 and true or false p.ready = _jp["ready"] == 1 and true or false
local pid = _jp["aid"] local pid = _jp["aid"]
p.piao_niao = _jp["piao_niao"] p.piao_niao = _jp["piao_niao"]
-- print(DataManager.SelfUser.account_id,pid) -- -- print(DataManager.SelfUser.account_id,pid)
-- if (278 == pid) then -- if (278 == pid) then
-- room.self_player = p -- room.self_player = p
-- p.self_user = DataManager.SelfUser -- p.self_user = DataManager.SelfUser

View File

@ -17,7 +17,8 @@ end
function M:ShowHuTip(card_list) function M:ShowHuTip(card_list)
printlog("ShowHuTip") printlog("ShowHuTip")
local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui, DataManager.CurrenRoom.room_config.Laizi) local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui,
DataManager.CurrenRoom.room_config.Laizi)
if #tingList > 0 then if #tingList > 0 then
if DataManager.CurrenRoom.laiziInfo and #DataManager.CurrenRoom.laiziInfo > 0 then if DataManager.CurrenRoom.laiziInfo and #DataManager.CurrenRoom.laiziInfo > 0 then
for i = 1, #DataManager.CurrenRoom.laiziInfo do for i = 1, #DataManager.CurrenRoom.laiziInfo do
@ -26,7 +27,6 @@ function M:ShowHuTip(card_list)
end end
end end
end end
end end
self._mainView._hu_tip:FillData(tingList) self._mainView._hu_tip:FillData(tingList)
end end
@ -44,7 +44,6 @@ function M:UpdateHandCard(getcard, mp)
if obj.card:GetController("laizi") then if obj.card:GetController("laizi") then
obj.card:GetController("laizi").selectedIndex = 1 obj.card:GetController("laizi").selectedIndex = 1
end end
end end
else else
if obj.card.GetController then if obj.card.GetController then
@ -53,11 +52,8 @@ function M:UpdateHandCard(getcard, mp)
end end
end end
end end
end end
end end
end end
@ -73,7 +69,8 @@ function M:UpdateHandCard(getcard, mp)
local btn = _carViewList[i].card local btn = _carViewList[i].card
local card = self:GetCard(btn) local card = self:GetCard(btn)
list_remove(card_list, card) list_remove(card_list, card)
local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui, DataManager.CurrenRoom.room_config.Laizi) local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true,
DataManager.CurrenRoom.room_config.Qidui, DataManager.CurrenRoom.room_config.Laizi)
if #tingList > 0 then if #tingList > 0 then
local count = 0 local count = 0
for j = 1, #tingList do for j = 1, #tingList do
@ -109,7 +106,6 @@ function M:UpdateHandCard(getcard, mp)
end end
self._out_card = false self._out_card = false
end end
end end
function M:__OnClickHandCard(context) function M:__OnClickHandCard(context)
@ -170,7 +166,7 @@ function M:__OnDragEnd(context)
local card = button.data local card = button.data
local _room = DataManager.CurrenRoom local _room = DataManager.CurrenRoom
-- print("button.y"..button.y .. "_room.curren_outcard_seat".._room.curren_outcard_seat) -- -- print("button.y"..button.y .. "_room.curren_outcard_seat".._room.curren_outcard_seat)
if (button.y - card.old_postion.y < -50 and _room.curren_outcard_seat == _room.self_player.seat and card.card_item ~= 0) then if (button.y - card.old_postion.y < -50 and _room.curren_outcard_seat == _room.self_player.seat and card.card_item ~= 0) then
self._mainView:OutCard(card.card_item) self._mainView:OutCard(card.card_item)
button.touchable = false button.touchable = false
@ -190,6 +186,7 @@ function M:CheckPlayerOnlineState()
end end
return true return true
end end
function M:Clear(bskip) function M:Clear(bskip)
--self._ctr_state.selectedIndex = 0 --self._ctr_state.selectedIndex = 0
self._area_fz_list.x = self._src_fz_list.x self._area_fz_list.x = self._src_fz_list.x
@ -208,6 +205,6 @@ function M:Clear(bskip)
self._carViewList[i].card:Dispose() self._carViewList[i].card:Dispose()
end end
self._carViewList = {} self._carViewList = {}
end end
return M return M

View File

@ -121,7 +121,7 @@ function M:OnEventSendCards(evt_data)
_room.jing = jing _room.jing = jing
self._cacheEvent:Enqueue(function() self._cacheEvent:Enqueue(function()
_room.banker_seat = seat _room.banker_seat = seat
print("========================fuzhijing") -- print("========================fuzhijing")
for i = 1, #_room.player_list do for i = 1, #_room.player_list do
_room.player_list[i].hand_left_count = 13 _room.player_list[i].hand_left_count = 13
_room.player_list[i].fz_list = {} _room.player_list[i].fz_list = {}
@ -275,7 +275,7 @@ function M:OnEventFzAction(evt_data)
end end
function M:OnEventHu(evt_data) function M:OnEventHu(evt_data)
print("===========================OnEventHu") -- print("===========================OnEventHu")
local cards = evt_data["card"] local cards = evt_data["card"]
local win_p = self._room:GetPlayerBySeat(evt_data["seat"]) local win_p = self._room:GetPlayerBySeat(evt_data["seat"])
local lose_p = self._room:GetPlayerBySeat(evt_data["from_seat"]) local lose_p = self._room:GetPlayerBySeat(evt_data["from_seat"])

View File

@ -315,7 +315,7 @@ function M:EventInit()
local tem = win_list[i] local tem = win_list[i]
if tem.type > 0 and tem.type < 32 then if tem.type > 0 and tem.type < 32 then
local com_name = "he" .. tem.type local com_name = "he" .. tem.type
print("===================================com_name", com_name) -- print("===================================com_name", com_name)
local item = he_list:GetChild("list"):AddItemFromPool("ui://Extend_MJ_LiChuan/" .. com_name) local item = he_list:GetChild("list"):AddItemFromPool("ui://Extend_MJ_LiChuan/" .. com_name)
coroutine.wait(0.3) coroutine.wait(0.3)
end end

View File

@ -109,7 +109,7 @@ function M:FillRoomData(s2croom)
p.fz_list[#p.fz_list + 1] = fz p.fz_list[#p.fz_list + 1] = fz
end end
if not playing and room.curren_round > 0 then if not playing and room.curren_round > 0 then
print("=======================在此进入") -- print("=======================在此进入")
self.GetGameController():PlayerReady() self.GetGameController():PlayerReady()
end end
end end
@ -141,7 +141,7 @@ function M:FillPlayBackData(pd_data)
p.ready = _jp["ready"] == 1 and true or false p.ready = _jp["ready"] == 1 and true or false
local pid = _jp["aid"] local pid = _jp["aid"]
p.piao_niao = _jp["piao_niao"] p.piao_niao = _jp["piao_niao"]
-- print(DataManager.SelfUser.account_id,pid) -- -- print(DataManager.SelfUser.account_id,pid)
-- if (278 == pid) then -- if (278 == pid) then
-- room.self_player = p -- room.self_player = p
-- p.self_user = DataManager.SelfUser -- p.self_user = DataManager.SelfUser

View File

@ -110,7 +110,7 @@ function M:UpdateHandCard(getcard, mp)
end end
function M:__OnClickHandCard(context) function M:__OnClickHandCard(context)
print("==========================__OnClickHandCard") -- print("==========================__OnClickHandCard")
local button = context.sender local button = context.sender
local _carViewList = self._carViewList local _carViewList = self._carViewList
local refresh = true local refresh = true
@ -168,7 +168,7 @@ function M:__OnDragEnd(context)
local card = button.data local card = button.data
local _room = DataManager.CurrenRoom local _room = DataManager.CurrenRoom
-- print("button.y"..button.y .. "_room.curren_outcard_seat".._room.curren_outcard_seat) -- -- print("button.y"..button.y .. "_room.curren_outcard_seat".._room.curren_outcard_seat)
if (button.y - card.old_postion.y < -50 and _room.curren_outcard_seat == _room.self_player.seat and card.card_item ~= 0) then if (button.y - card.old_postion.y < -50 and _room.curren_outcard_seat == _room.self_player.seat and card.card_item ~= 0) then
self._mainView:OutCard(card.card_item) self._mainView:OutCard(card.card_item)
button.touchable = false button.touchable = false

View File

@ -109,7 +109,6 @@ function M:FillRoomData(s2croom)
p.fz_list[#p.fz_list + 1] = fz p.fz_list[#p.fz_list + 1] = fz
end end
if not playing and room.curren_round > 0 then if not playing and room.curren_round > 0 then
print("=======================================自动开始")
self.GetGameController():PlayerReady() self.GetGameController():PlayerReady()
end end
end end
@ -141,7 +140,7 @@ function M:FillPlayBackData(pd_data)
p.ready = _jp["ready"] == 1 and true or false p.ready = _jp["ready"] == 1 and true or false
local pid = _jp["aid"] local pid = _jp["aid"]
p.piao_niao = _jp["piao_niao"] p.piao_niao = _jp["piao_niao"]
-- print(DataManager.SelfUser.account_id,pid) -- -- print(DataManager.SelfUser.account_id,pid)
-- if (278 == pid) then -- if (278 == pid) then
-- room.self_player = p -- room.self_player = p
-- p.self_user = DataManager.SelfUser -- p.self_user = DataManager.SelfUser

View File

@ -166,7 +166,7 @@ function M:__OnDragEnd(context)
local card = button.data local card = button.data
local _room = DataManager.CurrenRoom local _room = DataManager.CurrenRoom
-- print("button.y"..button.y .. "_room.curren_outcard_seat".._room.curren_outcard_seat) -- -- print("button.y"..button.y .. "_room.curren_outcard_seat".._room.curren_outcard_seat)
if (button.y - card.old_postion.y < -50 and _room.curren_outcard_seat == _room.self_player.seat and card.card_item ~= 0) then if (button.y - card.old_postion.y < -50 and _room.curren_outcard_seat == _room.self_player.seat and card.card_item ~= 0) then
self._mainView:OutCard(card.card_item) self._mainView:OutCard(card.card_item)
button.touchable = false button.touchable = false

View File

@ -48,8 +48,6 @@ function M:InitView(url)
end end
end end
function M:SetReconnentLaiziTips() function M:SetReconnentLaiziTips()
local room = DataManager.CurrenRoom local room = DataManager.CurrenRoom
if room.laiziInfo and room.laiziInfo[3] and tonumber(room.laiziInfo[3]) > 0 then if room.laiziInfo and room.laiziInfo[3] and tonumber(room.laiziInfo[3]) > 0 then
@ -57,17 +55,14 @@ function M:SetReconnentLaiziTips()
end end
end end
function M:SetLaiZiCard(btn, cardId) function M:SetLaiZiCard(btn, cardId)
btn.icon = 'ui://Main_PokeMaJiang/' .. get_majiang_prefix(DataManager.CurrenRoom.game_id) .. "201_" .. cardId btn.icon = 'ui://Main_PokeMaJiang/' .. get_majiang_prefix(DataManager.CurrenRoom.game_id) .. "201_" .. cardId
end end
function M:IsShowLaiZi(btn, isShow) function M:IsShowLaiZi(btn, isShow)
btn.visible = isShow btn.visible = isShow
end end
function M:HideAllLaiZiCard() function M:HideAllLaiZiCard()
self.Laizi1Btn.visible = false self.Laizi1Btn.visible = false
self.Laizi2Btn.visible = false self.Laizi2Btn.visible = false
@ -80,9 +75,9 @@ function M:SetShowLaiZiProcess(beforeLaiziID,currentLaizi1ID,currentLaizi2ID,isS
if isShowAnim == nil then isShowAnim = false end if isShowAnim == nil then isShowAnim = false end
printlog("当前赋值结果为====>>>") printlog("当前赋值结果为====>>>")
print(beforeLaiziID) -- print(beforeLaiziID)
print(currentLaizi1ID) -- print(currentLaizi1ID)
print(currentLaizi2ID) -- print(currentLaizi2ID)
self:HideAllLaiZiCard() self:HideAllLaiZiCard()
self:SetLaiZiCard(self.selectLaiziBtn, beforeLaiziID) self:SetLaiZiCard(self.selectLaiziBtn, beforeLaiziID)
self:SetLaiZiCard(self.Laizi1Btn, currentLaizi1ID) self:SetLaiZiCard(self.Laizi1Btn, currentLaizi1ID)
@ -102,7 +97,6 @@ function M:SetShowLaiZiProcess(beforeLaiziID,currentLaizi1ID,currentLaizi2ID,isS
if currentLaizi2ID > 0 then if currentLaizi2ID > 0 then
self:IsShowLaiZi(self.Laizi2Btn, true) self:IsShowLaiZi(self.Laizi2Btn, true)
end end
end end
) )
else else
@ -115,7 +109,6 @@ function M:SetShowLaiZiProcess(beforeLaiziID,currentLaizi1ID,currentLaizi2ID,isS
self.LaiziBG.visible = true self.LaiziBG.visible = true
end end
function M:UpdateRound() function M:UpdateRound()
self._view:GetChild("tex_round1").text = self._room.curren_round self._view:GetChild("tex_round1").text = self._room.curren_round
self._view:GetChild("tex_round2").text = self._room.room_config.round self._view:GetChild("tex_round2").text = self._room.room_config.round
@ -312,7 +305,6 @@ function M:EventInit()
local item = he_list:GetChild("list"):AddItemFromPool("ui://Extend_MJ_QiZhiBa/" .. com_name) local item = he_list:GetChild("list"):AddItemFromPool("ui://Extend_MJ_QiZhiBa/" .. com_name)
coroutine.wait(0.3) coroutine.wait(0.3)
end end
end end
coroutine.wait(2) coroutine.wait(2)
@ -321,7 +313,6 @@ function M:EventInit()
he_list:Dispose() he_list:Dispose()
self._popEvent = true self._popEvent = true
end) end)
end) end)
_gamectr:AddEventListener(TX_GameEvent.EventNiao, function(...) _gamectr:AddEventListener(TX_GameEvent.EventNiao, function(...)
@ -484,8 +475,6 @@ function M:__FangziTip(tip, weight)
table.sort(_tlist) table.sort(_tlist)
local isHu = false local isHu = false
for k = 1, #_tlist do for k = 1, #_tlist do
local td = tip.tip_map_type[_tlist[k]][1] local td = tip.tip_map_type[_tlist[k]][1]
local url = "ui://Main_PokeMaJiang/Btn_fztip" local url = "ui://Main_PokeMaJiang/Btn_fztip"
local td_weight = td.weight local td_weight = td.weight
@ -495,7 +484,6 @@ function M:__FangziTip(tip, weight)
btn_t.icon = "ui://Main_PokeMaJiang/fztip_" .. td_weight btn_t.icon = "ui://Main_PokeMaJiang/fztip_" .. td_weight
btn_t.data = { tip, td } btn_t.data = { tip, td }
btn_t.onClick:Add(self.__TipAction, self) btn_t.onClick:Add(self.__TipAction, self)
end end
local _btn_pass = _lit_fanzi:AddItemFromPool("ui://Main_PokeMaJiang/Btn_pass") local _btn_pass = _lit_fanzi:AddItemFromPool("ui://Main_PokeMaJiang/Btn_pass")
@ -520,9 +508,6 @@ function M:__FangziTip(tip, weight)
_chipeng_tip:Center() _chipeng_tip:Center()
end end
function M:__TipAction(context) function M:__TipAction(context)
local data = context.sender.data local data = context.sender.data
local _gamectr = self._gamectr local _gamectr = self._gamectr
@ -544,14 +529,14 @@ function M:__TipAction(context)
self._chipeng_tip = nil self._chipeng_tip = nil
end end
function M:_ChiView(tiplist, callback) function M:_ChiView(tiplist, callback)
self._chipeng_tip.visible = false self._chipeng_tip.visible = false
local _pop_tip_choice = UIPackage.CreateObject("Main_PokeMaJiang", "Pop_tip_choice") local _pop_tip_choice = UIPackage.CreateObject("Main_PokeMaJiang", "Pop_tip_choice")
local list_choose1 = _pop_tip_choice:GetChild("Lst_choose") local list_choose1 = _pop_tip_choice:GetChild("Lst_choose")
local list_choose2 = _pop_tip_choice:GetChild("Lst_choose2") local list_choose2 = _pop_tip_choice:GetChild("Lst_choose2")
local crossCtr = _pop_tip_choice:GetController("state") local crossCtr = _pop_tip_choice:GetController("state")
crossCtr.selectedIndex = #tiplist == 3 and 0 or (#tiplist == 2 and 1 or (#tiplist == 4 and 2 or (#tiplist == 5 and 3 or 4))) crossCtr.selectedIndex = #tiplist == 3 and 0 or
(#tiplist == 2 and 1 or (#tiplist == 4 and 2 or (#tiplist == 5 and 3 or 4)))
_pop_tip_choice:GetChild("Btn_cross").onClick:Add(function() _pop_tip_choice:GetChild("Btn_cross").onClick:Add(function()
_pop_tip_choice:Dispose() _pop_tip_choice:Dispose()
self._chipeng_tip.visible = true self._chipeng_tip.visible = true
@ -564,7 +549,8 @@ function M:_ChiView(tiplist, callback)
item_choose:GetController("type").selectedIndex = (1 == tiplist[i].weight or 2 == tiplist[i].weight) and 1 or 0 item_choose:GetController("type").selectedIndex = (1 == tiplist[i].weight or 2 == tiplist[i].weight) and 1 or 0
if tiplist[i].weight ~= 1 then if tiplist[i].weight ~= 1 then
for j = 1, 4 do for j = 1, 4 do
item_choose:GetChild("card"..j).icon = UIPackage.GetItemURL("Main_PokeMaJiang", self:GetPrefix() .. "201_"..tiplist[i].card) item_choose:GetChild("card" .. j).icon = UIPackage.GetItemURL("Main_PokeMaJiang",
self:GetPrefix() .. "201_" .. tiplist[i].card)
end end
else else
local tem = {} local tem = {}
@ -575,9 +561,12 @@ function M:_ChiView(tiplist, callback)
table.sort(tem, function(a, b) table.sort(tem, function(a, b)
return a < b return a < b
end) end)
item_choose:GetChild("card1").icon = UIPackage.GetItemURL("Main_PokeMaJiang", self:GetPrefix() .. "201_"..tem[1]) item_choose:GetChild("card1").icon = UIPackage.GetItemURL("Main_PokeMaJiang",
item_choose:GetChild("card2").icon = UIPackage.GetItemURL("Main_PokeMaJiang", self:GetPrefix() .. "201_"..tem[2]) self:GetPrefix() .. "201_" .. tem[1])
item_choose:GetChild("card4").icon = UIPackage.GetItemURL("Main_PokeMaJiang", self:GetPrefix() .. "201_"..tem[3]) item_choose:GetChild("card2").icon = UIPackage.GetItemURL("Main_PokeMaJiang",
self:GetPrefix() .. "201_" .. tem[2])
item_choose:GetChild("card4").icon = UIPackage.GetItemURL("Main_PokeMaJiang",
self:GetPrefix() .. "201_" .. tem[3])
local cardpos = tem[2] > tcard and 1 or (tem[2] < tcard and 4 or 2) local cardpos = tem[2] > tcard and 1 or (tem[2] < tcard and 4 or 2)
item_choose:GetChild("card" .. cardpos):GetController("color").selectedIndex = 1 item_choose:GetChild("card" .. cardpos):GetController("color").selectedIndex = 1
end end
@ -585,7 +574,8 @@ function M:_ChiView(tiplist, callback)
callback(tiplist[i].id) callback(tiplist[i].id)
end) end)
end end
_pop_tip_choice.xy = Vector2((self._view.width - _pop_tip_choice.width)/2, (self._view.height - _pop_tip_choice.height)/2) _pop_tip_choice.xy = Vector2((self._view.width - _pop_tip_choice.width) / 2,
(self._view.height - _pop_tip_choice.height) / 2)
self._view:AddChild(_pop_tip_choice) self._view:AddChild(_pop_tip_choice)
self._pop_tip_choice = _pop_tip_choice self._pop_tip_choice = _pop_tip_choice
end end

View File

@ -160,7 +160,7 @@ function M:FillPlayBackData(pd_data)
p.ready = _jp["ready"] == 1 and true or false p.ready = _jp["ready"] == 1 and true or false
local pid = _jp["aid"] local pid = _jp["aid"]
p.piao_niao = _jp["piao_niao"] p.piao_niao = _jp["piao_niao"]
-- print(DataManager.SelfUser.account_id,pid) -- -- print(DataManager.SelfUser.account_id,pid)
-- if (278 == pid) then -- if (278 == pid) then
-- room.self_player = p -- room.self_player = p
-- p.self_user = DataManager.SelfUser -- p.self_user = DataManager.SelfUser

View File

@ -25,13 +25,11 @@ function M:ShowHuTip(card_list,currentOnclickCard)
self._mainView._hu_tip:HideHuTipsPanel() self._mainView._hu_tip:HideHuTipsPanel()
end end
end end
else else
--[[if DataManager.CurrenRoom.self_player.allTingPaiList and #DataManager.CurrenRoom.self_player.allTingPaiList>0 then --[[if DataManager.CurrenRoom.self_player.allTingPaiList and #DataManager.CurrenRoom.self_player.allTingPaiList>0 then
self._mainView._hu_tip:FillData(DataManager.CurrenRoom.self_player.allTingPaiList) self._mainView._hu_tip:FillData(DataManager.CurrenRoom.self_player.allTingPaiList)
end--]] end--]]
end end
end end
function M:UpdateHandCard(getcard, mp) function M:UpdateHandCard(getcard, mp)
@ -47,7 +45,6 @@ function M:UpdateHandCard(getcard, mp)
if obj.card:GetController("laizi") then if obj.card:GetController("laizi") then
obj.card:GetController("laizi").selectedIndex = 1 obj.card:GetController("laizi").selectedIndex = 1
end end
end end
else else
if obj.card.GetController then if obj.card.GetController then
@ -56,11 +53,8 @@ function M:UpdateHandCard(getcard, mp)
end end
end end
end end
end end
end end
end end
@ -71,7 +65,8 @@ function M:UpdateHandCard(getcard, mp)
if DataManager.CurrenRoom.self_player.tingPaiList and #DataManager.CurrenRoom.self_player.tingPaiList > 0 then if DataManager.CurrenRoom.self_player.tingPaiList and #DataManager.CurrenRoom.self_player.tingPaiList > 0 then
for i = 1, #_carViewList do for i = 1, #_carViewList do
local btn = _carViewList[i].card local btn = _carViewList[i].card
local isTing,curIndex=CheckDictionaryFromContent(_carViewList[i].card_item,DataManager.CurrenRoom.self_player.tingPaiList) local isTing, curIndex = CheckDictionaryFromContent(_carViewList[i].card_item,
DataManager.CurrenRoom.self_player.tingPaiList)
if isTing then if isTing then
--printlog("听牌提示===》》》",curIndex) --printlog("听牌提示===》》》",curIndex)
--pt(DataManager.CurrenRoom.self_player.tingPaiList[curIndex]) --pt(DataManager.CurrenRoom.self_player.tingPaiList[curIndex])
@ -81,14 +76,11 @@ function M:UpdateHandCard(getcard, mp)
else else
btn:GetController("mark_ting").selectedIndex = 1 btn:GetController("mark_ting").selectedIndex = 1
end end
end end
end end
end end
--DataManager.CurrenRoom.self_player.tingPaiList=nil --DataManager.CurrenRoom.self_player.tingPaiList=nil
else else
for i = 1, #_carViewList do for i = 1, #_carViewList do
local btn = _carViewList[i].card local btn = _carViewList[i].card
@ -98,12 +90,8 @@ function M:UpdateHandCard(getcard, mp)
end end
self._out_card = false self._out_card = false
end end
end end
function M:__OnClickHandCard(context) function M:__OnClickHandCard(context)
local button = context.sender local button = context.sender
local _carViewList = self._carViewList local _carViewList = self._carViewList
@ -163,7 +151,7 @@ function M:__OnDragEnd(context)
local card = button.data local card = button.data
local _room = DataManager.CurrenRoom local _room = DataManager.CurrenRoom
-- print("button.y"..button.y .. "_room.curren_outcard_seat".._room.curren_outcard_seat) -- -- print("button.y"..button.y .. "_room.curren_outcard_seat".._room.curren_outcard_seat)
local isOut = IsHasDictionary(card.card_item, DataManager.CurrenRoom.laiziInfo) local isOut = IsHasDictionary(card.card_item, DataManager.CurrenRoom.laiziInfo)
if (button.y - card.old_postion.y < -50 and _room.curren_outcard_seat == _room.self_player.seat and isOut == false) then if (button.y - card.old_postion.y < -50 and _room.curren_outcard_seat == _room.self_player.seat and isOut == false) then
self._mainView:OutCard(card.card_item) self._mainView:OutCard(card.card_item)
@ -184,6 +172,7 @@ function M:CheckPlayerOnlineState()
end end
return true return true
end end
function M:Clear(bskip) function M:Clear(bskip)
--self._ctr_state.selectedIndex = 0 --self._ctr_state.selectedIndex = 0
self._area_fz_list.x = self._src_fz_list.x self._area_fz_list.x = self._src_fz_list.x
@ -202,6 +191,6 @@ function M:Clear(bskip)
self._carViewList[i].card:Dispose() self._carViewList[i].card:Dispose()
end end
self._carViewList = {} self._carViewList = {}
end end
return M return M

View File

@ -59,8 +59,8 @@ function M:InitView(url, use_custom_bg)
--local tempdsaf=self._view:GetChild("btn_back_jiesan") --local tempdsaf=self._view:GetChild("btn_back_jiesan")
--tempdsaf:GetChild("n3").displayObject.gameObject:SetActive(false) --tempdsaf:GetChild("n3").displayObject.gameObject:SetActive(false)
--print("2222222222222222222222") ---- print("2222222222222222222222")
--print(self._view:GetChild("btn_back_jiesan").displayObject.gameObject.name) ---- print(self._view:GetChild("btn_back_jiesan").displayObject.gameObject.name)
--self._view:GetChild("btn_back_jiesan").displayObject.gameObject:SetActive(false) --self._view:GetChild("btn_back_jiesan").displayObject.gameObject:SetActive(false)
--local temp111=self._view:GetChild("btn_back_jiesan").displayObject.gameObject --local temp111=self._view:GetChild("btn_back_jiesan").displayObject.gameObject
--temp111:SetActive(false) --temp111:SetActive(false)
@ -71,7 +71,6 @@ function M:InitView(url, use_custom_bg)
local _gamectr = ControllerManager.GetController(GameController) local _gamectr = ControllerManager.GetController(GameController)
_gamectr:AskDismissRoom() _gamectr:AskDismissRoom()
end end
end) end)
@ -101,7 +100,6 @@ function M:InitView(url, use_custom_bg)
end end
for i = 1, #_room.player_list do for i = 1, #_room.player_list do
local p = _room.player_list[i] local p = _room.player_list[i]
local zi, icon = self:GetPosString(p.seat) local zi, icon = self:GetPosString(p.seat)
if self._room.card_type == 2 then if self._room.card_type == 2 then
@ -126,14 +124,12 @@ function M:EventInit()
end end
function M:Change3d(flag) function M:Change3d(flag)
local _room = self._room local _room = self._room
local _view = self._view local _view = self._view
local _cardbox = _view:GetChild("cardbox") local _cardbox = _view:GetChild("cardbox")
for i = 1, #_room.player_list do for i = 1, #_room.player_list do
local p = _room.player_list[i] local p = _room.player_list[i]
local zi, icon = self:GetPosString(p.seat) local zi, icon = self:GetPosString(p.seat)
if self._room.card_type == 2 then if self._room.card_type == 2 then
@ -146,7 +142,6 @@ function M:Change3d(flag)
-- 如果要切换3d牌桌的cardbox位置及上方文字(剩余牌,回合数)显示不错乱,需要做以下改动 -- 如果要切换3d牌桌的cardbox位置及上方文字(剩余牌,回合数)显示不错乱,需要做以下改动
-- 取消文字组合的3d控制器的位置 并设置对cardbox的关联左左顶顶 -- 取消文字组合的3d控制器的位置 并设置对cardbox的关联左左顶顶
if flag == true then if flag == true then
if _view:GetController("3d") ~= nil then if _view:GetController("3d") ~= nil then
_view:GetController("3d").selectedIndex = 1 _view:GetController("3d").selectedIndex = 1
_cardbox.x = (_view.width - _cardbox.width) * 0.5 _cardbox.x = (_view.width - _cardbox.width) * 0.5
@ -230,7 +225,6 @@ function M:GetIndex(seat)
end end
function M:GetPosString(seat) function M:GetPosString(seat)
if DataManager.CurrenRoom.room_config.people_num == 4 then if DataManager.CurrenRoom.room_config.people_num == 4 then
if seat == 1 then if seat == 1 then
return "", "dir_1" return "", "dir_1"
@ -317,7 +311,6 @@ function M:OnPlayerReady( ... )
if readyNum == _room.room_config.people_num then if readyNum == _room.room_config.people_num then
local _cardbox = _view:GetChild("cardbox") local _cardbox = _view:GetChild("cardbox")
for i = 1, #_room.player_list do for i = 1, #_room.player_list do
local p = _room.player_list[i] local p = _room.player_list[i]
local zi, icon = self:GetPosString(p.seat) local zi, icon = self:GetPosString(p.seat)
_cardbox:GetChild("3d_direction" .. self:GetIndex(self:GetPos(p.seat))).icon = "ui://MajiangCard3d/" .. icon _cardbox:GetChild("3d_direction" .. self:GetIndex(self:GetPos(p.seat))).icon = "ui://MajiangCard3d/" .. icon

View File

@ -126,10 +126,10 @@ function M:UpdateHandCard(getcard, mp)
local handcard_list = self._mask_data['handcard_list'] local handcard_list = self._mask_data['handcard_list']
local oder = handcard_list['oder'] local oder = handcard_list['oder']
local _player = self._player local _player = self._player
-- print(vardump(self._player)) -- -- print(vardump(self._player))
self._area_handcard_list:RemoveChildren(0, -1, true) self._area_handcard_list:RemoveChildren(0, -1, true)
-- print(vardump(_player.card_list)) -- -- print(vardump(_player.card_list))
if (not mp) then if (not mp) then
local comp_back = handcard_list['comp_back'] local comp_back = handcard_list['comp_back']
if self._current_card_type == 2 then if self._current_card_type == 2 then
@ -161,8 +161,8 @@ function M:UpdateHandCard(getcard, mp)
local outcard_list = self._mask_data['outcard_list'] local outcard_list = self._mask_data['outcard_list']
local comp = handcard_list['comp'] local comp = handcard_list['comp']
local card = outcard_list['card'] local card = outcard_list['card']
--print("comp"..comp) ---- print("comp"..comp)
-- print(vardump(_player.card_list)) -- -- print(vardump(_player.card_list))
if self._current_card_type == 2 then if self._current_card_type == 2 then
comp = comp .. '_3d' comp = comp .. '_3d'

View File

@ -43,7 +43,7 @@ function M:setHandCardPos(btn_card, i, getcard)
end end
function M:UpdateHandCard(getcard, mp) function M:UpdateHandCard(getcard, mp)
print("======================onthisUpdateHandCard") -- print("======================onthisUpdateHandCard")
if self.outcard_button then if self.outcard_button then
self.outcard_button:Dispose() self.outcard_button:Dispose()
self.outcard_button = nil self.outcard_button = nil
@ -154,7 +154,7 @@ function M:__OnDragEnd(context)
local _room = DataManager.CurrenRoom local _room = DataManager.CurrenRoom
if not _room or _room:GetReloadStatus() then return end if not _room or _room:GetReloadStatus() then return end
-- print("button.y"..button.y .. "_room.curren_outcard_seat".._room.curren_outcard_seat) -- -- print("button.y"..button.y .. "_room.curren_outcard_seat".._room.curren_outcard_seat)
if (button.y < -150 and _room.curren_outcard_seat == _room.self_player.seat) then if (button.y < -150 and _room.curren_outcard_seat == _room.self_player.seat) then
self._mainView:OutCard(card.card_item) self._mainView:OutCard(card.card_item)
button.touchable = false button.touchable = false

View File

@ -52,7 +52,7 @@ function MJTableBG.GetTableBG(game_id)
local id = -1 local id = -1
local json_data = Utils.LoadLocalFile(DataManager.SelfUser.account_id .. DataManager.SelfUser.invite_code) local json_data = Utils.LoadLocalFile(DataManager.SelfUser.account_id .. DataManager.SelfUser.invite_code)
-- print(DataManager.SelfUser.invite_code, DataManager.SelfUser.account_id) -- -- print(DataManager.SelfUser.invite_code, DataManager.SelfUser.account_id)
if json_data ~= nil then if json_data ~= nil then
local config_data = json.decode(json_data) local config_data = json.decode(json_data)
id = GetBG(config_data, game_id) id = GetBG(config_data, game_id)

View File

@ -48,8 +48,6 @@ function M:InitView(url)
end end
end end
function M:SetReconnentLaiziTips() function M:SetReconnentLaiziTips()
local room = DataManager.CurrenRoom local room = DataManager.CurrenRoom
if room.beforelaiziCardId and room.beforelaiziCardId > 0 then if room.beforelaiziCardId and room.beforelaiziCardId > 0 then
@ -57,17 +55,14 @@ function M:SetReconnentLaiziTips()
end end
end end
function M:SetLaiZiCard(btn, cardId) function M:SetLaiZiCard(btn, cardId)
btn.icon = 'ui://Main_Majiang/' .. get_majiang_prefix(DataManager.CurrenRoom.game_id) .. "201_" .. cardId btn.icon = 'ui://Main_Majiang/' .. get_majiang_prefix(DataManager.CurrenRoom.game_id) .. "201_" .. cardId
end end
function M:IsShowLaiZi(btn, isShow) function M:IsShowLaiZi(btn, isShow)
btn.visible = isShow btn.visible = isShow
end end
function M:HideAllLaiZiCard() function M:HideAllLaiZiCard()
self.Laizi1Btn.visible = false self.Laizi1Btn.visible = false
self.Laizi2Btn.visible = false self.Laizi2Btn.visible = false
@ -80,9 +75,9 @@ function M:SetShowLaiZiProcess(beforeLaiziID,currentLaizi1ID,currentLaizi2ID,isS
if isShowAnim == nil then isShowAnim = false end if isShowAnim == nil then isShowAnim = false end
printlog("当前赋值结果为====>>>") printlog("当前赋值结果为====>>>")
print(beforeLaiziID) -- print(beforeLaiziID)
print(currentLaizi1ID) -- print(currentLaizi1ID)
print(currentLaizi2ID) -- print(currentLaizi2ID)
self:HideAllLaiZiCard() self:HideAllLaiZiCard()
self:SetLaiZiCard(self.selectLaiziBtn, beforeLaiziID) self:SetLaiZiCard(self.selectLaiziBtn, beforeLaiziID)
self:SetLaiZiCard(self.Laizi1Btn, currentLaizi1ID) self:SetLaiZiCard(self.Laizi1Btn, currentLaizi1ID)
@ -102,7 +97,6 @@ function M:SetShowLaiZiProcess(beforeLaiziID,currentLaizi1ID,currentLaizi2ID,isS
if currentLaizi2ID then if currentLaizi2ID then
self:IsShowLaiZi(self.Laizi2Btn, true) self:IsShowLaiZi(self.Laizi2Btn, true)
end end
end end
) )
else else
@ -115,7 +109,6 @@ function M:SetShowLaiZiProcess(beforeLaiziID,currentLaizi1ID,currentLaizi2ID,isS
self.LaiziBG.visible = true self.LaiziBG.visible = true
end end
function M:UpdateRound() function M:UpdateRound()
self._view:GetChild("tex_round1").text = self._room.curren_round self._view:GetChild("tex_round1").text = self._room.curren_round
self._view:GetChild("tex_round2").text = self._room.room_config.round self._view:GetChild("tex_round2").text = self._room.room_config.round
@ -310,7 +303,6 @@ function M:EventInit()
local item = he_list:GetChild("list"):AddItemFromPool("ui://Extend_MJ_TuiDaoHu/" .. com_name) local item = he_list:GetChild("list"):AddItemFromPool("ui://Extend_MJ_TuiDaoHu/" .. com_name)
coroutine.wait(0.3) coroutine.wait(0.3)
end end
end end
coroutine.wait(2) coroutine.wait(2)
@ -554,7 +546,8 @@ function M:_ChiView(tiplist, callback)
callback(tiplist[i].id) callback(tiplist[i].id)
end) end)
end end
_pop_tip_choice.xy = Vector2((self._view.width - _pop_tip_choice.width)/2, (self._view.height - _pop_tip_choice.height)/2) _pop_tip_choice.xy = Vector2((self._view.width - _pop_tip_choice.width) / 2,
(self._view.height - _pop_tip_choice.height) / 2)
self._view:AddChild(_pop_tip_choice) self._view:AddChild(_pop_tip_choice)
self._pop_tip_choice = _pop_tip_choice self._pop_tip_choice = _pop_tip_choice
end end

View File

@ -156,7 +156,7 @@ function M:FillPlayBackData(pd_data)
p.ready = _jp["ready"] == 1 and true or false p.ready = _jp["ready"] == 1 and true or false
local pid = _jp["aid"] local pid = _jp["aid"]
p.piao_niao = _jp["piao_niao"] p.piao_niao = _jp["piao_niao"]
-- print(DataManager.SelfUser.account_id,pid) -- -- print(DataManager.SelfUser.account_id,pid)
-- if (278 == pid) then -- if (278 == pid) then
-- room.self_player = p -- room.self_player = p
-- p.self_user = DataManager.SelfUser -- p.self_user = DataManager.SelfUser

View File

@ -16,7 +16,8 @@ function M.new(view,mainView)
end end
function M:ShowHuTip(card_list) function M:ShowHuTip(card_list)
local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui, DataManager.CurrenRoom.room_config.Laizi) local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui,
DataManager.CurrenRoom.room_config.Laizi)
if #tingList > 0 then if #tingList > 0 then
if DataManager.CurrenRoom.laiziInfo and #DataManager.CurrenRoom.laiziInfo > 0 then if DataManager.CurrenRoom.laiziInfo and #DataManager.CurrenRoom.laiziInfo > 0 then
for i = 1, #DataManager.CurrenRoom.laiziInfo do for i = 1, #DataManager.CurrenRoom.laiziInfo do
@ -25,7 +26,6 @@ function M:ShowHuTip(card_list)
end end
end end
end end
end end
self._mainView._hu_tip:FillData(tingList) self._mainView._hu_tip:FillData(tingList)
end end
@ -43,7 +43,6 @@ function M:UpdateHandCard(getcard, mp)
if obj.card:GetController("laizi") then if obj.card:GetController("laizi") then
obj.card:GetController("laizi").selectedIndex = 1 obj.card:GetController("laizi").selectedIndex = 1
end end
end end
else else
if obj.card.GetController then if obj.card.GetController then
@ -52,11 +51,8 @@ function M:UpdateHandCard(getcard, mp)
end end
end end
end end
end end
end end
end end
@ -72,7 +68,8 @@ function M:UpdateHandCard(getcard, mp)
local btn = _carViewList[i].card local btn = _carViewList[i].card
local card = self:GetCard(btn) local card = self:GetCard(btn)
list_remove(card_list, card) list_remove(card_list, card)
local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui, DataManager.CurrenRoom.room_config.Laizi) local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true,
DataManager.CurrenRoom.room_config.Qidui, DataManager.CurrenRoom.room_config.Laizi)
if #tingList > 0 then if #tingList > 0 then
local count = 0 local count = 0
for j = 1, #tingList do for j = 1, #tingList do
@ -108,7 +105,6 @@ function M:UpdateHandCard(getcard, mp)
end end
self._out_card = false self._out_card = false
end end
end end
function M:__OnClickHandCard(context) function M:__OnClickHandCard(context)
@ -169,7 +165,7 @@ function M:__OnDragEnd(context)
local card = button.data local card = button.data
local _room = DataManager.CurrenRoom local _room = DataManager.CurrenRoom
-- print("button.y"..button.y .. "_room.curren_outcard_seat".._room.curren_outcard_seat) -- -- print("button.y"..button.y .. "_room.curren_outcard_seat".._room.curren_outcard_seat)
if (button.y - card.old_postion.y < -50 and _room.curren_outcard_seat == _room.self_player.seat and card.card_item ~= 0) then if (button.y - card.old_postion.y < -50 and _room.curren_outcard_seat == _room.self_player.seat and card.card_item ~= 0) then
self._mainView:OutCard(card.card_item) self._mainView:OutCard(card.card_item)
button.touchable = false button.touchable = false
@ -189,6 +185,7 @@ function M:CheckPlayerOnlineState()
end end
return true return true
end end
function M:Clear(bskip) function M:Clear(bskip)
--self._ctr_state.selectedIndex = 0 --self._ctr_state.selectedIndex = 0
self._area_fz_list.x = self._src_fz_list.x self._area_fz_list.x = self._src_fz_list.x
@ -207,6 +204,6 @@ function M:Clear(bskip)
self._carViewList[i].card:Dispose() self._carViewList[i].card:Dispose()
end end
self._carViewList = {} self._carViewList = {}
end end
return M return M

View File

@ -137,7 +137,7 @@ function M:FillPlayBackData(pd_data)
p.ready = _jp["ready"] == 1 and true or false p.ready = _jp["ready"] == 1 and true or false
local pid = _jp["aid"] local pid = _jp["aid"]
p.piao_niao = _jp["piao_niao"] p.piao_niao = _jp["piao_niao"]
-- print(DataManager.SelfUser.account_id,pid) -- -- print(DataManager.SelfUser.account_id,pid)
-- if (278 == pid) then -- if (278 == pid) then
-- room.self_player = p -- room.self_player = p
-- p.self_user = DataManager.SelfUser -- p.self_user = DataManager.SelfUser

View File

@ -16,7 +16,8 @@ function M.new(view,mainView)
end end
function M:ShowHuTip(card_list) function M:ShowHuTip(card_list)
local tingList = CardCheck.tingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui, DataManager.CurrenRoom.room_config.Laizi) local tingList = CardCheck.tingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui,
DataManager.CurrenRoom.room_config.Laizi)
--if #tingList > 0 then --if #tingList > 0 then
-- table.insert(tingList, 412) -- table.insert(tingList, 412)
--end --end
@ -38,7 +39,8 @@ function M:UpdateHandCard(getcard, mp)
local btn = _carViewList[i].card local btn = _carViewList[i].card
local card = self:GetCard(btn) local card = self:GetCard(btn)
list_remove(card_list, card) list_remove(card_list, card)
local tingList = CardCheck.tingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui, DataManager.CurrenRoom.room_config.Laizi) local tingList = CardCheck.tingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui,
DataManager.CurrenRoom.room_config.Laizi)
if #tingList > 0 then if #tingList > 0 then
local count = 0 local count = 0
for j = 1, #tingList do for j = 1, #tingList do
@ -134,7 +136,7 @@ function M:__OnDragEnd(context)
local card = button.data local card = button.data
local _room = DataManager.CurrenRoom local _room = DataManager.CurrenRoom
-- print("button.y"..button.y .. "_room.curren_outcard_seat".._room.curren_outcard_seat) -- -- print("button.y"..button.y .. "_room.curren_outcard_seat".._room.curren_outcard_seat)
if (button.y - card.old_postion.y < -50 and _room.curren_outcard_seat == _room.self_player.seat and card.card_item ~= 412) then if (button.y - card.old_postion.y < -50 and _room.curren_outcard_seat == _room.self_player.seat and card.card_item ~= 412) then
self._mainView:OutCard(card.card_item) self._mainView:OutCard(card.card_item)
button.touchable = false button.touchable = false
@ -154,6 +156,7 @@ function M:CheckPlayerOnlineState()
end end
return true return true
end end
function M:Clear(bskip) function M:Clear(bskip)
--self._ctr_state.selectedIndex = 0 --self._ctr_state.selectedIndex = 0
self._area_fz_list.x = self._src_fz_list.x self._area_fz_list.x = self._src_fz_list.x
@ -172,6 +175,6 @@ function M:Clear(bskip)
self._carViewList[i].card:Dispose() self._carViewList[i].card:Dispose()
end end
self._carViewList = {} self._carViewList = {}
end end
return M return M

View File

@ -31,7 +31,8 @@ function M:InitView(url)
local room = self._room local room = self._room
UIPackage.AddPackage("extend/poker/chuntian/ui/Extend_Poker_ChunTian") UIPackage.AddPackage("extend/poker/chuntian/ui/Extend_Poker_ChunTian")
printlog(room.room_config.people_num) printlog(room.room_config.people_num)
PKMainView.InitView(self, "ui://Extend_Poker_ChunTian/ChunTian_Main_" .. room.room_config.people_num,nil,1,default_bg,bg_config,nil,"ui://Extend_Poker_ChunTian/SettingWindow1") PKMainView.InitView(self, "ui://Extend_Poker_ChunTian/ChunTian_Main_" .. room.room_config.people_num, nil, 1,
default_bg, bg_config, nil, "ui://Extend_Poker_ChunTian/SettingWindow1")
local _room = DataManager.CurrenRoom local _room = DataManager.CurrenRoom
local user_id = DataManager.SelfUser.account_id local user_id = DataManager.SelfUser.account_id
local json_data = Utils.LoadLocalFile(user_id .. _room.game_id .. "pai") local json_data = Utils.LoadLocalFile(user_id .. _room.game_id .. "pai")
@ -78,7 +79,6 @@ function M:InitView(url)
self._rightPanelView = ChunTian_RightPanelView.new(self, rightpanel) self._rightPanelView = ChunTian_RightPanelView.new(self, rightpanel)
for i = 1, #self._room.player_list do for i = 1, #self._room.player_list do
if self._room.self_player.seat == self._room.player_list[i].seat and self._room.self_player.self_user.account_id ~= self._room.player_list[i].self_user.account_id then if self._room.self_player.seat == self._room.player_list[i].seat and self._room.self_player.self_user.account_id ~= self._room.player_list[i].self_user.account_id then
-- body -- body
local ErrorMsgTip = UIPackage.CreateObject("Common", "Win_ConnectTip") local ErrorMsgTip = UIPackage.CreateObject("Common", "Win_ConnectTip")
@ -136,7 +136,6 @@ function M:InitView(url)
else else
self._ctr_action.selectedIndex = 2 self._ctr_action.selectedIndex = 2
end end
else else
self._ctr_action.selectedIndex = 1 self._ctr_action.selectedIndex = 1
end end
@ -153,10 +152,8 @@ function M:InitView(url)
self:ReConnectForStart() self:ReConnectForStart()
end end
else else
self._state.selectedIndex = StateType.Palying self._state.selectedIndex = StateType.Palying
self:ReconnectForClearing() self:ReconnectForClearing()
end end
self._view:GetChild("btn_back_jiesan").onClick:Set(function() self._view:GetChild("btn_back_jiesan").onClick:Set(function()
@ -166,7 +163,6 @@ function M:InitView(url)
local _gamectr = ControllerManager.GetController(GameController) local _gamectr = ControllerManager.GetController(GameController)
_gamectr:AskDismissRoom() _gamectr:AskDismissRoom()
end end
end) end)
--local tempdsaf=self._view:GetChild("btn_back_jiesan") --local tempdsaf=self._view:GetChild("btn_back_jiesan")
--tempdsaf:GetChild("n3").displayObject.gameObject:SetActive(false) --tempdsaf:GetChild("n3").displayObject.gameObject:SetActive(false)
@ -189,15 +185,14 @@ function M:InitView(url)
else else
self._view:GetChild('wanfa_text').text = '四人春天' .. room.score_times .. '' self._view:GetChild('wanfa_text').text = '四人春天' .. room.score_times .. ''
end end
end
end end
end
function M:UpdateCard(index) function M:UpdateCard(index)
self._room.pai = index self._room.pai = index
local card_info = self._player_card_info[1] local card_info = self._player_card_info[1]
-- for i=1,#self._room.player_list do -- for i=1,#self._room.player_list do
-- print(i) -- -- print(i)
-- end -- end
card_info:updatePoker() card_info:updatePoker()
for _, player in ipairs(self._room.player_list) do for _, player in ipairs(self._room.player_list) do
@ -283,7 +278,6 @@ function M:OnPlayerLeave(...)
else else
self._ctr_action.selectedIndex = 2 self._ctr_action.selectedIndex = 2
end end
else else
self._ctr_action.selectedIndex = 1 self._ctr_action.selectedIndex = 1
end end
@ -292,7 +286,6 @@ function M:OnPlayerLeave(...)
end end
end end
function M:EventInit() function M:EventInit()
local _gamectr = ControllerManager.GetController(GameController) local _gamectr = ControllerManager.GetController(GameController)
MainView.EventInit(self) MainView.EventInit(self)
@ -302,7 +295,6 @@ function M:EventInit()
_gamectr:AddEventListener(ChunTian_GameEvent.EventXiPai, function(...) _gamectr:AddEventListener(ChunTian_GameEvent.EventXiPai, function(...)
if self.result_view ~= nil then if self.result_view ~= nil then
self.result_view:Destroy() self.result_view:Destroy()
self.result_view = nil self.result_view = nil
@ -344,16 +336,12 @@ function M:EventInit()
-- body -- body
head_info._view:GetChild("shengyu"):GetChild("shengyu").text = "" .. p.hand_count .. "" head_info._view:GetChild("shengyu"):GetChild("shengyu").text = "" .. p.hand_count .. ""
end end
p:Clear() p:Clear()
head_info:FillData(p) head_info:FillData(p)
local card_info = self._player_card_info[self:GetPos(p.seat)] local card_info = self._player_card_info[self:GetPos(p.seat)]
card_info:Clear() card_info:Clear()
head_info:Ready(false) head_info:Ready(false)
end end
@ -379,12 +367,10 @@ function M:EventInit()
local currentPlayer2 = arg[2] local currentPlayer2 = arg[2]
self._popEvent = false self._popEvent = false
if (currentPlayer1) then if (currentPlayer1) then
local xipaiCB = function() local xipaiCB = function()
self._popEvent = true self._popEvent = true
end end
self:PlayXiPai(xipaiCB) self:PlayXiPai(xipaiCB)
end end
@ -395,9 +381,6 @@ function M:EventInit()
end end
self:PlayXiPai1(xipaiCB2) self:PlayXiPai1(xipaiCB2)
end end
end) end)
_gamectr:AddEventListener(ChunTian_GameEvent.OnMingCard, function(...) _gamectr:AddEventListener(ChunTian_GameEvent.OnMingCard, function(...)
@ -456,9 +439,6 @@ function M:EventInit()
-- body -- body
head_info._view:GetChild("shengyu"):GetChild("shengyu").text = "" .. p.hand_count .. "" head_info._view:GetChild("shengyu"):GetChild("shengyu").text = "" .. p.hand_count .. ""
end end
p:Clear() p:Clear()
head_info:FillData(p) head_info:FillData(p)
@ -473,7 +453,6 @@ function M:EventInit()
else else
card_info:InitPoker(cardlist, true) card_info:InitPoker(cardlist, true)
end end
else else
--card_info:UpdateHandPoker(#cardlist,true,false) --todo --card_info:UpdateHandPoker(#cardlist,true,false) --todo
--card_info:UpdateRemainCard(#cardlist,true) --card_info:UpdateRemainCard(#cardlist,true)
@ -561,8 +540,6 @@ function M:EventInit()
-- body -- body
head_info._view:GetChild("shengyu"):GetChild("shengyu").text = "" .. card_number .. "" head_info._view:GetChild("shengyu"):GetChild("shengyu").text = "" .. card_number .. ""
end end
end end
local card_info = self._player_card_info[index] local card_info = self._player_card_info[index]
card_info:SetOutCardInfo(p.out_card_list, false, true) card_info:SetOutCardInfo(p.out_card_list, false, true)
@ -613,7 +590,6 @@ function M:EventInit()
-- end -- end
-- end -- end
self:_Effect(cardstype, p) self:_Effect(cardstype, p)
else else
if cardstype == 11 and cardstype ~= 12 then if cardstype == 11 and cardstype ~= 12 then
self:_Effect(cardstype, p) self:_Effect(cardstype, p)
@ -632,7 +608,6 @@ function M:EventInit()
self:PlaySound(p.self_user.sex, "card_1") self:PlaySound(p.self_user.sex, "card_1")
end) end)
end end
end) end)
@ -657,7 +632,6 @@ function M:EventInit()
end end
self._popEvent = true self._popEvent = true
end) end)
_gamectr:AddEventListener(ChunTian_GameEvent.OnPassSucc, function(...) _gamectr:AddEventListener(ChunTian_GameEvent.OnPassSucc, function(...)
@ -690,7 +664,6 @@ function M:EventInit()
local piao = arg[1] local piao = arg[1]
local reload = arg[2] local reload = arg[2]
if reload == 0 then if reload == 0 then
if self._room.room_config.people_num == 3 and self._room.room_config.fangzuobi == 1 then if self._room.room_config.people_num == 3 and self._room.room_config.fangzuobi == 1 then
-- body -- body
self.MypokerList = cardlist self.MypokerList = cardlist
@ -852,7 +825,6 @@ function M:EventInit()
else else
card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_ChunTian/" .. card_n) card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_ChunTian/" .. card_n)
end end
else else
if card_n == 310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then if card_n == 310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then
-- body -- body
@ -860,7 +832,6 @@ function M:EventInit()
else else
card_code_obj = UIPackage.CreateObjectFromURL("ui://Main_Poker/" .. card_n .. "_2") card_code_obj = UIPackage.CreateObjectFromURL("ui://Main_Poker/" .. card_n .. "_2")
end end
end end
if card_code_obj ~= nil then if card_code_obj ~= nil then
card_code_obj:SetScale(0.6, 0.6) card_code_obj:SetScale(0.6, 0.6)
@ -868,14 +839,9 @@ function M:EventInit()
poker_item:AddChild(card_code_obj) poker_item:AddChild(card_code_obj)
otherpoker_list:AddChild(poker_item) otherpoker_list:AddChild(poker_item)
end end
end end
end) end)
end end
end end
@ -963,7 +929,8 @@ function M:EventInit()
self:ChangeBgmMusic(1) self:ChangeBgmMusic(1)
self.result_view = ChunTian_ResultView.new(self._root_view, info, self._room.room_id, over, win_seat, 0, remaincards) self.result_view = ChunTian_ResultView.new(self._root_view, info, self._room.room_id, over, win_seat, 0,
remaincards)
self.result_view:Show() self.result_view:Show()
if self.WinItem_view ~= nil then if self.WinItem_view ~= nil then
self.WinItem_view:Dispose() self.WinItem_view:Dispose()
@ -984,22 +951,18 @@ function M:EventInit()
-- body -- body
self:UnmarkSelfTuoguan() self:UnmarkSelfTuoguan()
ControllerManager.ChangeController(LoddyController) ControllerManager.ChangeController(LoddyController)
end end
end) end)
_gamectr:AddEventListener(ChunTian_GameEvent.OnResultByDissolve, function(...) _gamectr:AddEventListener(ChunTian_GameEvent.OnResultByDissolve, function(...)
local arg = { ... } local arg = { ... }
local over = arg[1] local over = arg[1]
local info = arg[2] local info = arg[2]
local winseat = arg[3] local winseat = arg[3]
local dissolve = arg[4] local dissolve = arg[4]
self.result_view = ChunTian_ResultView.new(self._root_view, info, self._room.room_id, over, winseat, dissolve,nil) self.result_view = ChunTian_ResultView.new(self._root_view, info, self._room.room_id, over, winseat, dissolve,
nil)
self.result_view:Show() self.result_view:Show()
ControllerManager.ChangeController(LoddyController) ControllerManager.ChangeController(LoddyController)
self:UnmarkSelfTuoguan() self:UnmarkSelfTuoguan()
@ -1050,11 +1013,9 @@ function M:EventInit()
printlog("同意报春座位号+++++++++++++++++") printlog("同意报春座位号+++++++++++++++++")
self._player_card_info[1]:ShowTongYiBaoChun(2) self._player_card_info[1]:ShowTongYiBaoChun(2)
end) end)
end end
function M:ReConnectForStart() function M:ReConnectForStart()
local _gamectr = ControllerManager.GetController(GameController) local _gamectr = ControllerManager.GetController(GameController)
self._room.is_new_bout = _gamectr:GetIsNewBout(self._room.curren_turn_seat) self._room.is_new_bout = _gamectr:GetIsNewBout(self._room.curren_turn_seat)
self._state.selectedIndex = 1 self._state.selectedIndex = 1
@ -1102,23 +1063,16 @@ function M:ReConnectForStart()
-- body -- body
head_info._view:GetChild("shengyu"):GetChild("shengyu").text = "" .. player.hand_count .. "" head_info._view:GetChild("shengyu"):GetChild("shengyu").text = "" .. player.hand_count .. ""
end end
if player.seat == self._room.self_player.seat then if player.seat == self._room.self_player.seat then
if player.open ~= nil and player.open == 0 and self._room.room_config.people_num == 3 and self._room.room_config.fangzuobi == 1 then if player.open ~= nil and player.open == 0 and self._room.room_config.people_num == 3 and self._room.room_config.fangzuobi == 1 then
-- body -- body
self.MypokerList = player.hand_list self.MypokerList = player.hand_list
player_card_info:InitPoker(player.hand_list, false, 1) player_card_info:InitPoker(player.hand_list, false, 1)
else else
player_card_info:InitPoker(player.hand_list, false) player_card_info:InitPoker(player.hand_list, false)
end end
else else
player_card_info:SetRemainCardNumber(player.hand_count == 1) player_card_info:SetRemainCardNumber(player.hand_count == 1)
if player.hand_count == 1 then if player.hand_count == 1 then
self.bgm_index = 2 self.bgm_index = 2
@ -1182,18 +1136,15 @@ function M:ReconnectForClearing()
-- body -- body
head_info._view:GetChild("shengyu"):GetChild("shengyu").text = "" .. player.hand_count .. "" head_info._view:GetChild("shengyu"):GetChild("shengyu").text = "" .. player.hand_count .. ""
end end
if player.seat == self._room.self_player.seat then if player.seat == self._room.self_player.seat then
player_card_info:InitPoker(player.hand_list, false) player_card_info:InitPoker(player.hand_list, false)
else else
player_card_info:UpdateHandPoker(player.hand_list, false, true) player_card_info:UpdateHandPoker(player.hand_list, false, true)
end end
if player.out_card_list[1] == 0 then if player.out_card_list[1] == 0 then
player_card_info:SetOutCardInfo(nil, false) player_card_info:SetOutCardInfo(nil, false)
else else
player_card_info:SetOutCardInfo(player.out_card_list, false) player_card_info:SetOutCardInfo(player.out_card_list, false)
@ -1204,19 +1155,17 @@ function M:ReconnectForClearing()
local remaincards = self._room.remaincards local remaincards = self._room.remaincards
if self._room.game_status == 1 then if self._room.game_status == 1 then
-- body -- body
coroutine.start(function() coroutine.start(function()
coroutine.wait(0.3) coroutine.wait(0.3)
self.result_view = ChunTian_ResultView.new(self._root_view, self._room.player_list, self._room.room_id, 0, win_seat,0,remaincards) self.result_view = ChunTian_ResultView.new(self._root_view, self._room.player_list, self._room.room_id, 0,
win_seat, 0, remaincards)
self.result_view:Show() self.result_view:Show()
local card_info = self._player_card_info[1] local card_info = self._player_card_info[1]
card_info._view:GetChild("out_card_list").visible = true card_info._view:GetChild("out_card_list").visible = true
end) end)
if remaincards then if remaincards then
local newremaincards = self._gamectr:ChangeCodeByFrom(remaincards, true) local newremaincards = self._gamectr:ChangeCodeByFrom(remaincards, true)
-- body -- body
@ -1344,8 +1293,6 @@ function M:_Effect( type1 ,player)
-- end -- end
end end
function M:UpdateRound(round) function M:UpdateRound(round)
local total_round = self._room.room_config.Times local total_round = self._room.room_config.Times
printlog("jefe total_round:", total_round) printlog("jefe total_round:", total_round)
@ -1434,7 +1381,6 @@ function M:PlayCardEff(card)
coroutine.wait(1) coroutine.wait(1)
self._popEvent = true self._popEvent = true
end) end)
end end
function M:ResetPoker() function M:ResetPoker()
@ -1445,7 +1391,6 @@ function M:ResetPoker()
end end
function M:PlaySound(sex, path) function M:PlaySound(sex, path)
local sex_path = ViewUtil.Sex_Chat[sex] -- 1 男 2 女 local sex_path = ViewUtil.Sex_Chat[sex] -- 1 男 2 女
local sound_path = string.format("extend/poker/chuntian/sound/%s/%s.mp3", sex_path, path) local sound_path = string.format("extend/poker/chuntian/sound/%s/%s.mp3", sex_path, path)
ViewUtil.PlaySound("ChunTianNew_PK", sound_path) ViewUtil.PlaySound("ChunTianNew_PK", sound_path)
@ -1459,6 +1404,7 @@ function M:ChangeBgmMusic(bgm_index)
end end
ViewUtil.PlayMuisc("ChunTianNew_PK", string.format("extend/poker/chuntian/sound/bgm%d.mp3", 1)) ViewUtil.PlayMuisc("ChunTianNew_PK", string.format("extend/poker/chuntian/sound/bgm%d.mp3", 1))
end end
function M:OnPlayerEnter(...) function M:OnPlayerEnter(...)
local arg = { ... } local arg = { ... }
local p = arg[1] local p = arg[1]

View File

@ -42,7 +42,8 @@ function M:InitView(url)
end end
self._gamectr = ControllerManager.GetController(GameController) self._gamectr = ControllerManager.GetController(GameController)
UIPackage.AddPackage('extend/poker/chuntian/ui/Extend_Poker_ChunTian') UIPackage.AddPackage('extend/poker/chuntian/ui/Extend_Poker_ChunTian')
PKPlayBackView.InitView(self, 'ui://Extend_Poker_ChunTian/ChunTian_Main_' .. self._room.room_config.people_num, default_bg, bg_config) PKPlayBackView.InitView(self, 'ui://Extend_Poker_ChunTian/ChunTian_Main_' .. self._room.room_config.people_num,
default_bg, bg_config)
self._tex_round = self._view:GetChild('round') self._tex_round = self._view:GetChild('round')
self._player_card_info = {} self._player_card_info = {}
local _player_card_info = self._player_card_info local _player_card_info = self._player_card_info
@ -94,7 +95,7 @@ function M:NewPlayerPokerInfoView(view, index)
end end
function M:FillRoomData(data) function M:FillRoomData(data)
print("hidezhanji 1111") -- print("hidezhanji 1111")
self._currentStep = 1 self._currentStep = 1
local room = DataManager.CurrenRoom local room = DataManager.CurrenRoom
local _player_card_info = self._player_card_info local _player_card_info = self._player_card_info
@ -109,7 +110,7 @@ function M:FillRoomData(data)
local head_info = self._player_info[self:GetPos(p.seat)] local head_info = self._player_info[self:GetPos(p.seat)]
if p.total_hp then if p.total_hp then
print("hidezhanji 2222") -- print("hidezhanji 2222")
head_info._view:GetChild('zhanji').visible = false head_info._view:GetChild('zhanji').visible = false
@ -125,7 +126,6 @@ function M:FillRoomData(data)
card_info:UpdateHandPoker(p.hand_list, false, true) card_info:UpdateHandPoker(p.hand_list, false, true)
end end
head_info:UpdatePiao(p.piao) head_info:UpdatePiao(p.piao)
end end
self:UpdateRound() self:UpdateRound()
@ -152,7 +152,6 @@ function M:ShowStep(index)
else else
info:InitPoker(p.hand_list, false) info:InitPoker(p.hand_list, false)
end end
end end
if step.cmd == ChunTian_Record_Event.Evt_OutCard then if step.cmd == ChunTian_Record_Event.Evt_OutCard then
@ -194,7 +193,8 @@ function M:ShowStep(index)
end end
if step.cmd == ChunTian_Record_Event.Evt_Result then if step.cmd == ChunTian_Record_Event.Evt_Result then
local Result = step.Result local Result = step.Result
self.result_view = ChunTian_ResultView.new(self._root_view, Result.info, self._room.room_id, Result.type, Result.winseat, 0, Result.remaincards) self.result_view = ChunTian_ResultView.new(self._root_view, Result.info, self._room.room_id, Result.type,
Result.winseat, 0, Result.remaincards)
local num = self._view:GetChildIndex(self._view:GetChild("panel_record")) local num = self._view:GetChildIndex(self._view:GetChild("panel_record"))
self._view:AddChildAt(self.result_view._view, num) self._view:AddChildAt(self.result_view._view, num)
else else
@ -257,6 +257,7 @@ function M:CmdPass(cmd, index)
data.cmd = cmd.cmd data.cmd = cmd.cmd
data.current_out_seat = cmd.seat data.current_out_seat = cmd.seat
end end
function M:Cmdresult(cmd, index) function M:Cmdresult(cmd, index)
local data = self:CopyLastStep(index) local data = self:CopyLastStep(index)
data.cmd = cmd.cmd data.cmd = cmd.cmd

View File

@ -102,7 +102,7 @@ function M:InitPoker(pokerList, isPlayAni, open)
if self.cor_init_poker ~= nil then if self.cor_init_poker ~= nil then
coroutine.stop(self.cor_init_poker) coroutine.stop(self.cor_init_poker)
end end
-- print(vardump(self.card_list)) -- -- print(vardump(self.card_list))
self.cor_init_poker = nil self.cor_init_poker = nil
self.card_list = {} self.card_list = {}
@ -176,7 +176,6 @@ function M:InitPoker(pokerList, isPlayAni, open)
end end
) )
else else
for i = 1, #pokerList do for i = 1, #pokerList do
local card_number_code = self:ChangeOneCodeByFrom(pokerList[i]) local card_number_code = self:ChangeOneCodeByFrom(pokerList[i])
local card_flower_code = pokerList[i] local card_flower_code = pokerList[i]
@ -200,7 +199,6 @@ function M:InitPoker(pokerList, isPlayAni, open)
end end
function M:updatePoker() function M:updatePoker()
local templist = {} local templist = {}
for i = 1, #self.card_list do for i = 1, #self.card_list do
templist[#templist + 1] = self.card_list[i].card_code_flower templist[#templist + 1] = self.card_list[i].card_code_flower
@ -285,7 +283,7 @@ function M:AddCardMoveEvent(card)
if card.btn_card.touchable == true then if card.btn_card.touchable == true then
send_card[#send_card + 1] = card send_card[#send_card + 1] = card
self:SetBtnCardColor(card, 1) self:SetBtnCardColor(card, 1)
--print(vardump(card)) ---- print(vardump(card))
if k == #self.card_list then if k == #self.card_list then
if if
card.btn_card.x + self.card_width > min_x and card.btn_card.x < max_x and card.btn_card.x + self.card_width > min_x and card.btn_card.x < max_x and
@ -343,6 +341,7 @@ function M:AddCardMoveEvent(card)
end end
) )
end end
function M:zhizhanxuanpai() --智障选牌 function M:zhizhanxuanpai() --智障选牌
printlog("zhizhanxuanpai") printlog("zhizhanxuanpai")
-- body -- body
@ -419,7 +418,6 @@ function M:TouchMoving(context)
card.btn_card.x + (self.card_width + self:GetHandCardOffset(#self.card_list)) > min_x and card.btn_card.x + (self.card_width + self:GetHandCardOffset(#self.card_list)) > min_x and
card.btn_card.x < max_x card.btn_card.x < max_x
then then
self:SetBtnCardColor(card, 0.8) self:SetBtnCardColor(card, 0.8)
if #send_card1 == 0 then if #send_card1 == 0 then
-- body -- body
@ -470,7 +468,7 @@ function M:TouchMoving(context)
end end
end end
end end
--print(vardump(send_card1)) ---- print(vardump(send_card1))
-- local send_card = {} -- local send_card = {}
-- self.send_card = {} -- self.send_card = {}
-- for i = 1, #self.card_list do -- for i = 1, #self.card_list do
@ -602,7 +600,6 @@ function M:SetOutCardBlack()
if card and card:GetChildAt(0) and card:GetChildAt(0):GetChildAt(0) and card:GetChildAt(0):GetChildAt(0):GetChildAt(0) then if card and card:GetChildAt(0) and card:GetChildAt(0):GetChildAt(0) and card:GetChildAt(0):GetChildAt(0):GetChildAt(0) then
card:GetChildAt(0):GetChildAt(0):GetChildAt(0).color = Color(0.7, 0.7, 0.7) card:GetChildAt(0):GetChildAt(0):GetChildAt(0).color = Color(0.7, 0.7, 0.7)
end end
end end
end end
@ -875,8 +872,6 @@ function M:BtnEvent()
btn_tongyi.onClick:Set(function() btn_tongyi.onClick:Set(function()
click_tongyibaochun(1) click_tongyibaochun(1)
end) end)
end end
function M:ShowTipsCard(index) function M:ShowTipsCard(index)
@ -916,6 +911,7 @@ function M:GetHandCardPos(index, card_count)
x = start_x + (self.card_width + offset) * (index - 1) x = start_x + (self.card_width + offset) * (index - 1)
return Vector2.New(x, y) return Vector2.New(x, y)
end end
function M:GetHandCardPos1(index, card_count) function M:GetHandCardPos1(index, card_count)
local x, y = 0, -18 local x, y = 0, -18
local offset = self:GetHandCardOffset(card_count) local offset = self:GetHandCardOffset(card_count)
@ -924,6 +920,7 @@ function M:GetHandCardPos1(index, card_count)
x = start_x + (self.card_width + offset) * (index - 1) x = start_x + (self.card_width + offset) * (index - 1)
return x, y return x, y
end end
function M:ChangeOneCodeByFrom(card) function M:ChangeOneCodeByFrom(card)
local flower = math.floor(card / 100) local flower = math.floor(card / 100)
local number = card % 100 local number = card % 100
@ -1057,7 +1054,6 @@ function M:GetCardTips(type, number, length, mustPutMaxCard, tip_templist)
-- body -- body
sidaisan = true sidaisan = true
end end
elseif type == ChunTian_CardType.TuiTuJI then elseif type == ChunTian_CardType.TuiTuJI then
list_type, touch_type = self:CheckTuiTuJi(card_map, 0, 4) list_type, touch_type = self:CheckTuiTuJi(card_map, 0, 4)
@ -1085,8 +1081,6 @@ function M:GetCardTips(type, number, length, mustPutMaxCard, tip_templist)
-- body -- body
tip_list = self:GetMergeAllList(tip_list, tip_templist2) tip_list = self:GetMergeAllList(tip_list, tip_templist2)
end end
end end
if (tip_templist ~= nil and sidaisan == false and #tip_templist >= 1) then if (tip_templist ~= nil and sidaisan == false and #tip_templist >= 1) then
@ -1401,6 +1395,7 @@ function M:GetCardMapAndMaxKey(pokerList)
end end
return map, max_key return map, max_key
end end
function M:CheckOnes(pokerMap, num, length) function M:CheckOnes(pokerMap, num, length)
local one_card_list = {} local one_card_list = {}
local touch_key_list = {} local touch_key_list = {}
@ -1446,6 +1441,7 @@ function M:CheckOnes(pokerMap, num, length)
end end
return one_card_list, touch_key_list, length return one_card_list, touch_key_list, length
end end
function M:Clear() function M:Clear()
self:PlayScore(nil) self:PlayScore(nil)
self:SetOutCardInfo(nil, false) self:SetOutCardInfo(nil, false)

View File

@ -22,7 +22,7 @@ local function __init(self,mainView,view)
end end
end) end)
else else
print("mainView.dismiss_room_cd_time"..mainView.dismiss_room_cd_time) -- print("mainView.dismiss_room_cd_time"..mainView.dismiss_room_cd_time)
if mainView.dismiss_room_cd_time > 0 then if mainView.dismiss_room_cd_time > 0 then
GameApplication.Instance:ShowTips("您还处于解散冷却时间当中,请稍后重试!") GameApplication.Instance:ShowTips("您还处于解散冷却时间当中,请稍后重试!")
else else
@ -61,6 +61,7 @@ function ChunTian_RightPanelView.new(mainView,view)
__init(self, mainView, view) __init(self, mainView, view)
return self return self
end end
function M:__UpdateTime() function M:__UpdateTime()
self._tex_data.text = os.date("%Y-%m-%d") self._tex_data.text = os.date("%Y-%m-%d")
self._tex_time.text = os.date("%H:%M") self._tex_time.text = os.date("%H:%M")

View File

@ -59,7 +59,6 @@ function M:NewRoom()
return ChunTian_Room.new() return ChunTian_Room.new()
end end
function M:GetIconUrl() function M:GetIconUrl()
return "ui://Extend_Poker_ChunTian/icon" return "ui://Extend_Poker_ChunTian/icon"
-- --
@ -131,7 +130,6 @@ function M:FillRoomData(s2croom)
room.owner_id = owner room.owner_id = owner
room.game_status = 0 room.game_status = 0
if reload then if reload then
local reloadInfo = s2croom["reloadInfo"] local reloadInfo = s2croom["reloadInfo"]
@ -141,8 +139,6 @@ function M:FillRoomData(s2croom)
room.curren_turn_seat = reloadInfo["active_seat"] room.curren_turn_seat = reloadInfo["active_seat"]
local info_list = reloadInfo["info_list"] local info_list = reloadInfo["info_list"]
if playing == true then if playing == true then
room.CurnrenState = StateType.Palying room.CurnrenState = StateType.Palying
room.game_status = 1 room.game_status = 1
@ -168,7 +164,7 @@ function M:FillRoomData(s2croom)
end end
end end
else else
-- print("aaaaaaaaaaaaaaaa1111111111111111111111111") -- -- print("aaaaaaaaaaaaaaaa1111111111111111111111111")
--pt(s2croom) --pt(s2croom)
room.game_status = 1 room.game_status = 1
@ -185,7 +181,6 @@ function M:FillRoomData(s2croom)
local last_outcard = info_list[i]["last_outcard"] local last_outcard = info_list[i]["last_outcard"]
if last_outcard ~= nil and last_outcard[1] ~= 0 then if last_outcard ~= nil and last_outcard[1] ~= 0 then
local out_card_list = _ctr_game:ChangeCodeByFrom(last_outcard.card_list, true) local out_card_list = _ctr_game:ChangeCodeByFrom(last_outcard.card_list, true)
local card_type, number, length, plan_three_count = _ctr_game:GetCardListInfo(out_card_list) local card_type, number, length, plan_three_count = _ctr_game:GetCardListInfo(out_card_list)
p.out_card_list = _ctr_game:GetSortOutCardList(out_card_list, card_type, number, plan_three_count) p.out_card_list = _ctr_game:GetSortOutCardList(out_card_list, card_type, number, plan_three_count)
@ -208,8 +203,6 @@ function M:FillRoomData(s2croom)
end end
end end
function M:FillPlayBackData(pd_data) function M:FillPlayBackData(pd_data)
local room = DataManager.CurrenRoom local room = DataManager.CurrenRoom
local _tableInfo = pd_data["info"] local _tableInfo = pd_data["info"]

View File

@ -62,7 +62,6 @@ function M:RegisterEvt()
-- self._eventmap[Protocol.GAME_EVT_READY] = self.OnExTendPlayerReady -- self._eventmap[Protocol.GAME_EVT_READY] = self.OnExTendPlayerReady
end end
function M:OnExTendPlayerReady(evt_data) function M:OnExTendPlayerReady(evt_data)
@ -150,7 +149,7 @@ function M:StarQiangZhuang()
end end
function M:FinishCuoPai(evt_data) function M:FinishCuoPai(evt_data)
print("上报搓牌返回==================") -- print("上报搓牌返回==================")
local seat = evt_data["seat"] local seat = evt_data["seat"]
local card = evt_data["card"] local card = evt_data["card"]
self._cacheEvent:Enqueue( self._cacheEvent:Enqueue(
@ -314,7 +313,8 @@ function M:OnPlaySucc(evt_data)
player.hand_count = remain player.hand_count = remain
local card_type, number, length, plan_three_count = self:GetCardListInfo(out_card_list) local card_type, number, length, plan_three_count = self:GetCardListInfo(out_card_list)
player.out_card_list = self:GetSortOutCardList(out_card_list, card_type, number, plan_three_count) player.out_card_list = self:GetSortOutCardList(out_card_list, card_type, number, plan_three_count)
DispatchEvent(self._dispatcher, MuShi_GameEvent.OnPlaySucc, player, remain, card_type, number, otherList,length) DispatchEvent(self._dispatcher, MuShi_GameEvent.OnPlaySucc, player, remain, card_type, number, otherList,
length)
end end
) )
end end
@ -339,6 +339,7 @@ function M:OnPutError(evt_data)
end end
) )
end end
function M:TuoGuan(isTuo) function M:TuoGuan(isTuo)
local _data = {} local _data = {}
_data["tuoguan"] = isTuo _data["tuoguan"] = isTuo
@ -353,6 +354,7 @@ function M:Game_TuoGuan(evt_data)
DispatchEvent(self._dispatcher, MuShi_GameEvent.Game_TuoGuan, tuoguan, seat) DispatchEvent(self._dispatcher, MuShi_GameEvent.Game_TuoGuan, tuoguan, seat)
end) end)
end end
function M:OnIndexMove(evt_data) function M:OnIndexMove(evt_data)
local seat = evt_data["index"] local seat = evt_data["index"]
self._cacheEvent:Enqueue( self._cacheEvent:Enqueue(
@ -389,7 +391,6 @@ function M:OnPiaoTip(evt_data)
--local reload = evt_data["reload"] --local reload = evt_data["reload"]
self._cacheEvent:Enqueue( self._cacheEvent:Enqueue(
function() function()
DispatchEvent(self._dispatcher, MuShi_GameEvent.OnPiaoTips) DispatchEvent(self._dispatcher, MuShi_GameEvent.OnPiaoTips)
end end
) )
@ -468,6 +469,7 @@ function M:OnConfrimToNextGameSucc(evt_data)
end end
) )
end end
function M:Game_TuoGuan(evt_data) function M:Game_TuoGuan(evt_data)
local tuoguan = evt_data["tuoguan"] local tuoguan = evt_data["tuoguan"]
local seat = evt_data["seat"] local seat = evt_data["seat"]
@ -475,6 +477,7 @@ function M:Game_TuoGuan(evt_data)
DispatchEvent(self._dispatcher, MuShi_GameEvent.Game_TuoGuan, tuoguan, seat) DispatchEvent(self._dispatcher, MuShi_GameEvent.Game_TuoGuan, tuoguan, seat)
end) end)
end end
function M:ChangeCodeByFrom(cardList, isSort) function M:ChangeCodeByFrom(cardList, isSort)
isSort = isSort or false isSort = isSort or false
local new_card_list = {} local new_card_list = {}
@ -595,7 +598,6 @@ end
--Bomb = 11 --Bomb = 11
-- 牌型,大小, 长度 -- 牌型,大小, 长度
function M:GetCardListInfo(cardlist) function M:GetCardListInfo(cardlist)
if #cardlist == 0 then if #cardlist == 0 then
return 0, 0, 0, 0 return 0, 0, 0, 0
end end
@ -616,9 +618,7 @@ function M:GetCardListInfo(cardlist)
card_type = MuShi_CardType.Bomb card_type = MuShi_CardType.Bomb
else else
card_type = MuShi_CardType.Three card_type = MuShi_CardType.Three
end end
elseif #cardlist == 4 then elseif #cardlist == 4 then
local max_key = 0 local max_key = 0
for k, v in pairs(card_map) do for k, v in pairs(card_map) do
@ -675,9 +675,7 @@ function M:GetCardListInfo(cardlist)
local max_one_key, max_two_key, max_three_key = 0, 0, 0 local max_one_key, max_two_key, max_three_key = 0, 0, 0
for k, v in pairs(card_map) do for k, v in pairs(card_map) do
if #v == 2 then if #v == 2 then
if k > max_two_key then if k > max_two_key then
max_two_key = k max_two_key = k
end end
@ -687,7 +685,6 @@ function M:GetCardListInfo(cardlist)
card_num = max_two_key card_num = max_two_key
end end
elseif #v == 1 then elseif #v == 1 then
if k > max_one_key then if k > max_one_key then
max_one_key = k max_one_key = k
end end
@ -697,7 +694,6 @@ function M:GetCardListInfo(cardlist)
card_num = max_one_key card_num = max_one_key
end end
elseif #v == 3 then elseif #v == 3 then
if max_three_key == 0 then if max_three_key == 0 then
max_three_key = k max_three_key = k
three_count = three_count + 1 three_count = three_count + 1
@ -730,21 +726,13 @@ function M:GetCardListInfo(cardlist)
if three_count * 3 == #cardlist then if three_count * 3 == #cardlist then
card_type = MuShi_CardType.Plane card_type = MuShi_CardType.Plane
card_num = max_three_key card_num = max_three_key
elseif three_count * 4 >= #cardlist and #cardlist % 4 == 0 then elseif three_count * 4 >= #cardlist and #cardlist % 4 == 0 then
card_type = MuShi_CardType.PlaneAndOne card_type = MuShi_CardType.PlaneAndOne
card_num = max_three_key card_num = max_three_key
elseif three_count * 5 >= #cardlist and #cardlist % 5 == 0 then elseif three_count * 5 >= #cardlist and #cardlist % 5 == 0 then
card_type = MuShi_CardType.PlaneAndTwo card_type = MuShi_CardType.PlaneAndTwo
card_num = max_three_key card_num = max_three_key
end end
end end
return card_type, card_num, card_length, plan_three_count return card_type, card_num, card_length, plan_three_count

View File

@ -48,7 +48,8 @@ function M:InitView(url)
self._curren_msg = nil self._curren_msg = nil
--room.room_config.people_num = 5 --room.room_config.people_num = 5
self.currenBank = -1 self.currenBank = -1
MSMainView.InitView(self, "ui://Extend_Poker_MuShi/MuShi_Main_"..room.room_config.people_num,nil,1,default_bg,bg_config,nil,"ui://Extend_Poker_MuShi/SettingWindow1") MSMainView.InitView(self, "ui://Extend_Poker_MuShi/MuShi_Main_" .. room.room_config.people_num, nil, 1, default_bg,
bg_config, nil, "ui://Extend_Poker_MuShi/SettingWindow1")
local _room = DataManager.CurrenRoom local _room = DataManager.CurrenRoom
local user_id = DataManager.SelfUser.account_id local user_id = DataManager.SelfUser.account_id
@ -75,7 +76,6 @@ function M:InitView(url)
self._rightPanelView = MuShi_RightPanelView.new(self, rightpanel) self._rightPanelView = MuShi_RightPanelView.new(self, rightpanel)
for i = 1, #self._room.player_list do for i = 1, #self._room.player_list do
if self._room.self_player.seat == self._room.player_list[i].seat and self._room.self_player.self_user.account_id ~= self._room.player_list[i].self_user.account_id then if self._room.self_player.seat == self._room.player_list[i].seat and self._room.self_player.self_user.account_id ~= self._room.player_list[i].self_user.account_id then
-- body -- body
local ErrorMsgTip = UIPackage.CreateObject("Common", "Win_ConnectTip") local ErrorMsgTip = UIPackage.CreateObject("Common", "Win_ConnectTip")
@ -138,7 +138,7 @@ function M:InitView(url)
local _gamectr = ControllerManager.GetController(GameController) local _gamectr = ControllerManager.GetController(GameController)
_gamectr:SendStar() _gamectr:SendStar()
end) end)
--print("11111111111111111111111122222222222222222222222222222222 ",room.CurnrenState) ---- print("11111111111111111111111122222222222222222222222222222222 ",room.CurnrenState)
if room.CurnrenState ~= StateType.PalyingWait then if room.CurnrenState ~= StateType.PalyingWait then
self._state.selectedIndex = state self._state.selectedIndex = state
-- if room.CurnrenState == StateType.Palying then -- if room.CurnrenState == StateType.Palying then
@ -152,15 +152,15 @@ function M:InitView(url)
end end
if room.CurnrenState ~= StateType.Ready then if room.CurnrenState ~= StateType.Ready then
--print("cccccccccccccccccc111111111111111111111111") ---- print("cccccccccccccccccc111111111111111111111111")
self._ctr_action.selectedIndex = 1 self._ctr_action.selectedIndex = 1
self.btnstar.visible = fasle self.btnstar.visible = fasle
else else
--print("cccccccccccccccccc222222222222222222222222") ---- print("cccccccccccccccccc222222222222222222222222")
self.btnstar.visible = true self.btnstar.visible = true
end end
print("cccccccccccccccccc222222222222222222222222") -- print("cccccccccccccccccc222222222222222222222222")
local jsBtn = self._view:GetChild("btn_back_jiesan") local jsBtn = self._view:GetChild("btn_back_jiesan")
printlog(jsBtn.visible) printlog(jsBtn.visible)
printlog(jsBtn.touchable) printlog(jsBtn.touchable)
@ -172,7 +172,6 @@ function M:InitView(url)
local _gamectr = ControllerManager.GetController(GameController) local _gamectr = ControllerManager.GetController(GameController)
_gamectr:AskDismissRoom() _gamectr:AskDismissRoom()
end end
end) end)
self.InitCardList = {} self.InitCardList = {}
@ -188,7 +187,8 @@ function M:InitView(url)
self:ResetCuoPai() self:ResetCuoPai()
self.isUpcuo = false self.isUpcuo = false
self.coin = ResourcesManager.LoadObjectByGroup("extend/poker/mushi/effect/flycoin/flyCoinEffect.prefab",typeof(UnityEngine.GameObject),"extend/poker/mushi/effect/flycoin/flyCoinEffect") self.coin = ResourcesManager.LoadObjectByGroup("extend/poker/mushi/effect/flycoin/flyCoinEffect.prefab",
typeof(UnityEngine.GameObject), "extend/poker/mushi/effect/flycoin/flyCoinEffect")
printlog("创建金币示例===》》》》") printlog("创建金币示例===》》》》")
printlog(self.coin) printlog(self.coin)
@ -202,12 +202,8 @@ function M:InitView(url)
-- end) -- end)
-- printlog("11111111111111111 ",self.endCard.displayObject.gameObject.transform:InverseTransformPoint(self._view.displayObject.gameObject.transform.position)) -- printlog("11111111111111111 ",self.endCard.displayObject.gameObject.transform:InverseTransformPoint(self._view.displayObject.gameObject.transform.position))
-- pt(self.endCard.displayObject.gameObject.transform:InverseTransformPoint(self._view.displayObject.gameObject.transform.position)) -- pt(self.endCard.displayObject.gameObject.transform:InverseTransformPoint(self._view.displayObject.gameObject.transform.position))
end end
-- function M:OnMuShiUpdate() -- function M:OnMuShiUpdate()
-- -- for i = 1, #self._room.player_list do -- -- for i = 1, #self._room.player_list do
-- -- local player = self._room.player_list[i] -- -- local player = self._room.player_list[i]
@ -271,7 +267,7 @@ function M:CuoPai()
self.initBtnX = self.n4.x self.initBtnX = self.n4.x
self.initBtnY = self.n4.y self.initBtnY = self.n4.y
self.cuopai.visible = false self.cuopai.visible = false
-- print("self.btnY ",self.btnY) -- -- print("self.btnY ",self.btnY)
end end
function M:ResetCuoPai() function M:ResetCuoPai()
@ -304,10 +300,9 @@ function M:onTouchMove(context)
if self.n4.y == self.initBtnY then if self.n4.y == self.initBtnY then
if tempx >= 0 then if tempx >= 0 then
local tempCardX = self.btnX + (xy.x - self.lastX) local tempCardX = self.btnX + (xy.x - self.lastX)
--print("cccccccccccc1111111111111111 ;",tempCardX," ",self.btnX) ---- print("cccccccccccc1111111111111111 ;",tempCardX," ",self.btnX)
if tempCardX <= 510 then if tempCardX <= 510 then
self.n4.x = tempCardX self.n4.x = tempCardX
self.btnX = self.n4.x self.btnX = self.n4.x
@ -315,10 +310,9 @@ function M:onTouchMove(context)
if (not self.isUpcuo) then if (not self.isUpcuo) then
self.isUpcuo = true self.isUpcuo = true
local _gamectr = ControllerManager.GetController(GameController) local _gamectr = ControllerManager.GetController(GameController)
print("===========================上报搓牌=====================") -- print("===========================上报搓牌=====================")
_gamectr:SendCuo() _gamectr:SendCuo()
self:ResetCuoPai() self:ResetCuoPai()
end end
self.n4.x = 510 self.n4.x = 510
self.btnX = self.n4.x self.btnX = self.n4.x
@ -333,13 +327,12 @@ function M:onTouchMove(context)
self.btnX = self.n4.x self.btnX = self.n4.x
end end
end end
end end
if self.n4.x == self.initBtnX then if self.n4.x == self.initBtnX then
if tempy >= 0 then if tempy >= 0 then
local tempCardY = self.btnY + (xy.y - self.lastY) local tempCardY = self.btnY + (xy.y - self.lastY)
--print("11111111111111111111 ;",tempCardY," ",self.btnY) ---- print("11111111111111111111 ;",tempCardY," ",self.btnY)
if tempCardY < 276 then if tempCardY < 276 then
self.n4.y = tempCardY self.n4.y = tempCardY
self.btnY = self.n4.y self.btnY = self.n4.y
@ -349,7 +342,7 @@ function M:onTouchMove(context)
end end
else else
local tempCardY = self.btnY + (xy.y - self.lastY) local tempCardY = self.btnY + (xy.y - self.lastY)
--print("22222222222222222222 ;",tempCardY," ",self.btnY) ---- print("22222222222222222222 ;",tempCardY," ",self.btnY)
if tempCardY > self.initBtnY then if tempCardY > self.initBtnY then
self.n4.y = tempCardY self.n4.y = tempCardY
self.btnY = self.n4.y self.btnY = self.n4.y
@ -380,7 +373,6 @@ function M:NewPlayerCardInfoView(tem, index)
return MuShi_PlayerSelfPokerInfoView.new(tem, self) return MuShi_PlayerSelfPokerInfoView.new(tem, self)
end end
return MuShi_PlayerPokerInfoView.new(tem, self) return MuShi_PlayerPokerInfoView.new(tem, self)
end end
function M:PlayCardEff(card) function M:PlayCardEff(card)
@ -424,10 +416,8 @@ function M:PlayCardEff(card)
coroutine.wait(1) coroutine.wait(1)
self._popEvent = true self._popEvent = true
end) end)
end end
function M:OnPlayerReady(...) function M:OnPlayerReady(...)
--printlog("玩家准备6++++++++++++++++++++") --printlog("玩家准备6++++++++++++++++++++")
local arg = { ... } local arg = { ... }
@ -511,7 +501,6 @@ function M:PlayZhuangEffect()
end end
end end
end end
end) end)
end end
@ -571,7 +560,6 @@ function M:EventInit()
_gamectr:AgreeStar(1) _gamectr:AgreeStar(1)
self._curren_msg:Dispose() self._curren_msg:Dispose()
self._curren_msg = nil self._curren_msg = nil
end end
) )
self._curren_msg:GetChild('btn_close').onClick:Set( self._curren_msg:GetChild('btn_close').onClick:Set(
@ -692,7 +680,6 @@ function M:EventInit()
end end
if (arg[2] == 3) and self._room.self_player.seat == seat then if (arg[2] == 3) and self._room.self_player.seat == seat then
self:SetCuoPai(piao) self:SetCuoPai(piao)
-- self.cuoCorout = coroutine.start(function() -- self.cuoCorout = coroutine.start(function()
-- coroutine.wait(5) -- coroutine.wait(5)
@ -753,7 +740,6 @@ function M:EventInit()
end end
end) end)
_gamectr:AddEventListener(MuShi_GameEvent.OnResult, function(...) _gamectr:AddEventListener(MuShi_GameEvent.OnResult, function(...)
local arg = { ... } local arg = { ... }
local over = arg[1] local over = arg[1]
local info = arg[2] local info = arg[2]
@ -781,7 +767,7 @@ function M:EventInit()
self.destory_win = nil self.destory_win = nil
self.destory_win = coroutine.start(function() self.destory_win = coroutine.start(function()
-- print("11111111111111") -- -- print("11111111111111")
-- coroutine.wait(1) -- coroutine.wait(1)
if self._room.self_player.seat == win_seat then if self._room.self_player.seat == win_seat then
local sprint_seat_list = self:GetSpringSeats(info) local sprint_seat_list = self:GetSpringSeats(info)
@ -794,8 +780,6 @@ function M:EventInit()
ViewUtil.PlaySound("MuShi_PK", "base/common/sound/win new.mp3") ViewUtil.PlaySound("MuShi_PK", "base/common/sound/win new.mp3")
end end
-- local url = #sprint_seat_list > 0 and "ui://Extend_Poker_MuShiNew/Spring" or "ui://Extend_Poker_MuShiNew/Win_Mine" -- local url = #sprint_seat_list > 0 and "ui://Extend_Poker_MuShiNew/Spring" or "ui://Extend_Poker_MuShiNew/Win_Mine"
else else
local beigang = false local beigang = false
if #self:GetSpringSeats(info) > 0 then if #self:GetSpringSeats(info) > 0 then
@ -809,13 +793,11 @@ function M:EventInit()
beigang = true beigang = true
end end
end end
end end
end end
for i = 1, #info do for i = 1, #info do
-- coroutine.wait(0.3) -- coroutine.wait(0.3)
--print("player.cardMul===============",player.cardMul) ---- print("player.cardMul===============",player.cardMul)
local player = info[i] local player = info[i]
local p = self._room:GetPlayerBySeat(player.seat) local p = self._room:GetPlayerBySeat(player.seat)
local head_info = self._player_info[self:GetPos(player.seat)] local head_info = self._player_info[self:GetPos(player.seat)]
@ -867,7 +849,6 @@ function M:EventInit()
else else
end end
end end
coroutine.wait(0.5) coroutine.wait(0.5)
for i = 1, #info do for i = 1, #info do
@ -890,10 +871,10 @@ function M:EventInit()
self:ChangeBgmMusic(1) self:ChangeBgmMusic(1)
-- if over == 0 then -- if over == 0 then
if #self:GetSpringSeats(info) > 0 then if #self:GetSpringSeats(info) > 0 then
-- print("222222222222222222") -- -- print("222222222222222222")
--coroutine.wait(1) --coroutine.wait(1)
else else
-- print("333333333333333333") -- -- print("333333333333333333")
-- coroutine.wait(2) -- coroutine.wait(2)
end end
coroutine.wait(1) coroutine.wait(1)
@ -930,8 +911,6 @@ function M:EventInit()
local btn_confirm = self.result_view._view:GetChild("btn_confirm") local btn_confirm = self.result_view._view:GetChild("btn_confirm")
btn_confirm.onClick:Call() btn_confirm.onClick:Call()
end end
end) end)
if over == 1 then if over == 1 then
-- body -- body
@ -945,7 +924,6 @@ function M:EventInit()
end) end)
_gamectr:AddEventListener(MuShi_GameEvent.OnResultByDissolve, function(...) _gamectr:AddEventListener(MuShi_GameEvent.OnResultByDissolve, function(...)
local arg = { ... } local arg = { ... }
local over = arg[1] local over = arg[1]
local info = arg[2] local info = arg[2]
@ -1043,7 +1021,6 @@ function M:EventInit()
head_info.colKuang = true head_info.colKuang = true
self.btn_ready1.visible = false self.btn_ready1.visible = false
end end
end) end)
_gamectr:AddEventListener(MuShi_GameEvent.OnBet, function(...) _gamectr:AddEventListener(MuShi_GameEvent.OnBet, function(...)
@ -1100,8 +1077,10 @@ function M:FlyCoinByInfo(info)
-- coroutine.wait(0.2) -- coroutine.wait(0.2)
-- end -- end
FlyCoin.new(bankHeadInfo.point.displayObject.gameObject.transform.position,head_info.point.displayObject.gameObject.transform.position,self._view,self.coin) FlyCoin.new(bankHeadInfo.point.displayObject.gameObject.transform.position,
printlog("playerseatplayerseatplayerseatplayerseatplayerseat111 ",player.seat," ",self._room.self_player.seat) head_info.point.displayObject.gameObject.transform.position, self._view, self.coin)
printlog("playerseatplayerseatplayerseatplayerseatplayerseat111 ", player.seat, " ",
self._room.self_player.seat)
if self.currenBank == self._room.self_player.seat then if self.currenBank == self._room.self_player.seat then
ViewUtil.PlaySound("MuShi_PK", "extend/poker/mushi/sound/ms_sound_flychips.mp3") ViewUtil.PlaySound("MuShi_PK", "extend/poker/mushi/sound/ms_sound_flychips.mp3")
end end
@ -1111,8 +1090,10 @@ function M:FlyCoinByInfo(info)
-- FlyCoin.new(head_info._btn_head.displayObject.gameObject.transform.position,bankHeadInfo._btn_head.displayObject.gameObject.transform.position,self._view) -- FlyCoin.new(head_info._btn_head.displayObject.gameObject.transform.position,bankHeadInfo._btn_head.displayObject.gameObject.transform.position,self._view)
-- coroutine.wait(0.2) -- coroutine.wait(0.2)
-- end -- end
printlog("playerseatplayerseatplayerseatplayerseatplayerseat22222 ",player.seat," ",self._room.self_player.seat) printlog("playerseatplayerseatplayerseatplayerseatplayerseat22222 ", player.seat, " ",
FlyCoin.new(head_info.point.displayObject.gameObject.transform.position,bankHeadInfo.point.displayObject.gameObject.transform.position,self._view,self.coin) self._room.self_player.seat)
FlyCoin.new(head_info.point.displayObject.gameObject.transform.position,
bankHeadInfo.point.displayObject.gameObject.transform.position, self._view, self.coin)
if self.currenBank == self._room.self_player.seat then if self.currenBank == self._room.self_player.seat then
ViewUtil.PlaySound("MuShi_PK", "extend/poker/mushi/sound/ms_sound_flychips.mp3") ViewUtil.PlaySound("MuShi_PK", "extend/poker/mushi/sound/ms_sound_flychips.mp3")
end end
@ -1131,7 +1112,8 @@ function M:FlyCoinByInfo(info)
-- coroutine.wait(0.02) -- coroutine.wait(0.02)
-- end -- end
printlog("playerseatplayerseatplayerseatplayerseatplayerseat333333333333333333333333") printlog("playerseatplayerseatplayerseatplayerseatplayerseat333333333333333333333333")
FlyCoin.new(self.btn_ready1.displayObject.gameObject.transform.position,head_info.point.displayObject.gameObject.transform.position,self._view,self.coin) FlyCoin.new(self.btn_ready1.displayObject.gameObject.transform.position,
head_info.point.displayObject.gameObject.transform.position, self._view, self.coin)
if player.seat == self._room.self_player.seat then if player.seat == self._room.self_player.seat then
--printlog("aaaaaaaaaaaaaa33333333333333333333333") --printlog("aaaaaaaaaaaaaa33333333333333333333333")
ViewUtil.PlaySound("MuShi_PK", "extend/poker/mushi/sound/ms_sound_flychips.mp3") ViewUtil.PlaySound("MuShi_PK", "extend/poker/mushi/sound/ms_sound_flychips.mp3")
@ -1143,7 +1125,8 @@ function M:FlyCoinByInfo(info)
-- coroutine.wait(0.02) -- coroutine.wait(0.02)
-- end -- end
printlog("playerseatplayerseatplayerseatplayerseatplayerseat4444444444444444444444444444") printlog("playerseatplayerseatplayerseatplayerseatplayerseat4444444444444444444444444444")
FlyCoin.new(head_info.point.displayObject.gameObject.transform.position,self.btn_ready1.displayObject.gameObject.transform.position,self._view,self.coin) FlyCoin.new(head_info.point.displayObject.gameObject.transform.position,
self.btn_ready1.displayObject.gameObject.transform.position, self._view, self.coin)
if player.seat == self._room.self_player.seat then if player.seat == self._room.self_player.seat then
--printlog("aaaaaaaaaaaaaa444444444444444444444444444444444") --printlog("aaaaaaaaaaaaaa444444444444444444444444444444444")
ViewUtil.PlaySound("MuShi_PK", "extend/poker/mushi/sound/ms_sound_flychips.mp3") ViewUtil.PlaySound("MuShi_PK", "extend/poker/mushi/sound/ms_sound_flychips.mp3")
@ -1153,7 +1136,6 @@ function M:FlyCoinByInfo(info)
end) end)
end end
end end
end end
function M:ReConnectForStart() function M:ReConnectForStart()
@ -1343,13 +1325,11 @@ function M:ReconnectForClearing()
if player.seat == self._room.self_player.seat then if player.seat == self._room.self_player.seat then
player_card_info:InitPoker(player.hand_list, false) player_card_info:InitPoker(player.hand_list, false)
else else
player_card_info:UpdateHandPoker(player.hand_list, false, true) player_card_info:UpdateHandPoker(player.hand_list, false, true)
end end
if player.out_card_list[1] == 0 then if player.out_card_list[1] == 0 then
--player_card_info:SetOutCardInfo(nil, false) --player_card_info:SetOutCardInfo(nil, false)
else else
--player_card_info:SetOutCardInfo(player.out_card_list, false) --player_card_info:SetOutCardInfo(player.out_card_list, false)
@ -1360,8 +1340,6 @@ function M:ReconnectForClearing()
local remaincards = self._room.remaincards local remaincards = self._room.remaincards
if self._room.game_status == 1 then if self._room.game_status == 1 then
-- body -- body
coroutine.start(function() coroutine.start(function()
coroutine.wait(0.3) coroutine.wait(0.3)
@ -1372,7 +1350,6 @@ function M:ReconnectForClearing()
card_info._view:GetChild("out_card_list").visible = true card_info._view:GetChild("out_card_list").visible = true
end) end)
if remaincards then if remaincards then
local newremaincards = self._gamectr:ChangeCodeByFrom(remaincards, true) local newremaincards = self._gamectr:ChangeCodeByFrom(remaincards, true)
-- body -- body
@ -1423,7 +1400,6 @@ function M:CreateRankEff()
self.rank_view:GetTransition("t0"):Play() self.rank_view:GetTransition("t0"):Play()
end end
function M:UpdateRound(round) function M:UpdateRound(round)
local total_round = self._room.room_config.Times local total_round = self._room.room_config.Times
self._text_round.text = string.format("%d / %d 局", round, total_round) self._text_round.text = string.format("%d / %d 局", round, total_round)
@ -1468,10 +1444,7 @@ function M:GetSpringSeats(player_info)
return seat_list return seat_list
end end
function M:PlaySound(sex, path) function M:PlaySound(sex, path)
local sex_path = ViewUtil.Sex_Chat[sex] -- 1 男 2 女 local sex_path = ViewUtil.Sex_Chat[sex] -- 1 男 2 女
local sound_path = string.format("extend/poker/mushi/sound/%s/%s.mp3", sex_path, path) local sound_path = string.format("extend/poker/mushi/sound/%s/%s.mp3", sex_path, path)
ViewUtil.PlaySound("MuShi_PK", sound_path) ViewUtil.PlaySound("MuShi_PK", sound_path)
@ -1485,6 +1458,7 @@ function M:ChangeBgmMusic(bgm_index)
end end
ViewUtil.PlayMuisc("MuShi_PK", string.format("extend/poker/mushi/sound/bgm%d.mp3", 1)) ViewUtil.PlayMuisc("MuShi_PK", string.format("extend/poker/mushi/sound/bgm%d.mp3", 1))
end end
function M:OnPlayerEnter(...) function M:OnPlayerEnter(...)
--DataManager.CurrenRoom.RoomConfig.people_num --DataManager.CurrenRoom.RoomConfig.people_num
--pt(DataManager.CurrenRoom.room_config) --pt(DataManager.CurrenRoom.room_config)

View File

@ -51,7 +51,8 @@ function M:InitView(url)
end end
self._gamectr = ControllerManager.GetController(GameController) self._gamectr = ControllerManager.GetController(GameController)
UIPackage.AddPackage('extend/poker/mushi/ui/Extend_Poker_MuShi') UIPackage.AddPackage('extend/poker/mushi/ui/Extend_Poker_MuShi')
PKPlayBackView.InitView(self, 'ui://Extend_Poker_MuShi/MuShi_Main_' .. self._room.room_config.people_num, default_bg, bg_config) PKPlayBackView.InitView(self, 'ui://Extend_Poker_MuShi/MuShi_Main_' .. self._room.room_config.people_num, default_bg,
bg_config)
self._tex_round = self._view:GetChild('round') self._tex_round = self._view:GetChild('round')
self._player_card_info = {} self._player_card_info = {}
local _player_card_info = self._player_card_info local _player_card_info = self._player_card_info
@ -111,13 +112,12 @@ function M:InitView(url)
self._cmdmap[MuShi_Record_Event.Evt_Result] = self.Wuyong self._cmdmap[MuShi_Record_Event.Evt_Result] = self.Wuyong
self:CuoPai() self:CuoPai()
end end
function M:CuoPai() function M:CuoPai()
self.cuopai = self._view:GetChild("cuopai") self.cuopai = self._view:GetChild("cuopai")
self.cuopai.visible = false self.cuopai.visible = false
-- print("self.btnY ",self.btnY) -- -- print("self.btnY ",self.btnY)
end end
function M:Wuyong() function M:Wuyong()
@ -132,7 +132,7 @@ function M:NewPlayerPokerInfoView(view, index)
end end
function M:FillRoomData(data) function M:FillRoomData(data)
--print("hidezhanji 1111") ---- print("hidezhanji 1111")
self._currentStep = 1 self._currentStep = 1
local room = DataManager.CurrenRoom local room = DataManager.CurrenRoom
local _player_card_info = self._player_card_info local _player_card_info = self._player_card_info
@ -147,7 +147,7 @@ function M:FillRoomData(data)
local head_info = self._player_info[self:GetPos(p.seat)] local head_info = self._player_info[self:GetPos(p.seat)]
if p.total_hp then if p.total_hp then
-- print("hidezhanji 2222") -- -- print("hidezhanji 2222")
head_info._view:GetChild('zhanji').visible = false head_info._view:GetChild('zhanji').visible = false
if room.hpOnOff == 1 or room:checkHpNonnegative() then if room.hpOnOff == 1 or room:checkHpNonnegative() then
@ -286,7 +286,6 @@ function M:ShowStep(index)
card_info:SetCarType(cardType, cardPoint) card_info:SetCarType(cardType, cardPoint)
end end
end end
end end
function M:GenerateAllStepData(data) function M:GenerateAllStepData(data)
@ -314,8 +313,6 @@ function M:GenerateAllStepData(data)
end end
end end
function M:CmdAlertQiangZhuang(cmd, index) --通知抢庄 function M:CmdAlertQiangZhuang(cmd, index) --通知抢庄
local data = self:CopyLastStep(index) local data = self:CopyLastStep(index)
data.cmd = cmd.cmd data.cmd = cmd.cmd
@ -374,10 +371,8 @@ function M:CmdResult(cmd,index)
local data = self:CopyLastStep(index) local data = self:CopyLastStep(index)
data.cmd = cmd.cmd data.cmd = cmd.cmd
data.result = cmd.data.result data.result = cmd.data.result
end end
function M:CopyLastStep(index) function M:CopyLastStep(index)
local step = {} local step = {}
local last_step = self._step[index] local last_step = self._step[index]

View File

@ -113,8 +113,6 @@ function M:init()
self:BtnEvent() self:BtnEvent()
end end
function M:BtnEvent() function M:BtnEvent()
self.btnBuPai.onClick:Set(function() self.btnBuPai.onClick:Set(function()
--printlog("点击补牌=================================") --printlog("点击补牌=================================")
@ -236,10 +234,8 @@ function M:InitPoker2(pokerList)
end end
end end
function M:AddPoker(poker) function M:AddPoker(poker)
--print("玩家自己加牌===========================================") ---- print("玩家自己加牌===========================================")
local card_number_code = self:ChangeOneCodeByFrom(poker) local card_number_code = self:ChangeOneCodeByFrom(poker)
local card_flower_code = poker local card_flower_code = poker
local btn_card = self:CreatPoker(poker, 1, 0) local btn_card = self:CreatPoker(poker, 1, 0)

View File

@ -168,7 +168,7 @@ function M:FillRoomData(s2croom)
end end
end end
else else
-- print("aaaaaaaaaaaaaaaa1111111111111111111111111") -- -- print("aaaaaaaaaaaaaaaa1111111111111111111111111")
--pt(s2croom) --pt(s2croom)
room.game_status = 1 room.game_status = 1

View File

@ -30,7 +30,8 @@ local bg_config = {
function M:InitView(url) function M:InitView(url)
local room = self._room local room = self._room
UIPackage.AddPackage("extend/poker/runfast/ui/Extend_Poker_RunFastNew") UIPackage.AddPackage("extend/poker/runfast/ui/Extend_Poker_RunFastNew")
PKMainView.InitView(self, "ui://Extend_Poker_RunFastNew/RunFast_Main_" .. room.room_config.people_num,nil,1,default_bg,bg_config,nil,"ui://Extend_Poker_RunFastNew/SettingWindow1") PKMainView.InitView(self, "ui://Extend_Poker_RunFastNew/RunFast_Main_" .. room.room_config.people_num, nil, 1,
default_bg, bg_config, nil, "ui://Extend_Poker_RunFastNew/SettingWindow1")
local _room = DataManager.CurrenRoom local _room = DataManager.CurrenRoom
local user_id = DataManager.SelfUser.account_id local user_id = DataManager.SelfUser.account_id
local json_data = Utils.LoadLocalFile(user_id .. _room.game_id .. "pai") local json_data = Utils.LoadLocalFile(user_id .. _room.game_id .. "pai")
@ -77,7 +78,6 @@ function M:InitView(url)
self._rightPanelView = RunFast_RightPanelView.new(self, rightpanel) self._rightPanelView = RunFast_RightPanelView.new(self, rightpanel)
for i = 1, #self._room.player_list do for i = 1, #self._room.player_list do
if self._room.self_player.seat == self._room.player_list[i].seat and self._room.self_player.self_user.account_id ~= self._room.player_list[i].self_user.account_id then if self._room.self_player.seat == self._room.player_list[i].seat and self._room.self_player.self_user.account_id ~= self._room.player_list[i].self_user.account_id then
-- body -- body
local ErrorMsgTip = UIPackage.CreateObject("Common", "Win_ConnectTip") local ErrorMsgTip = UIPackage.CreateObject("Common", "Win_ConnectTip")
@ -135,7 +135,6 @@ function M:InitView(url)
else else
self._ctr_action.selectedIndex = 2 self._ctr_action.selectedIndex = 2
end end
else else
self._ctr_action.selectedIndex = 1 self._ctr_action.selectedIndex = 1
end end
@ -152,10 +151,8 @@ function M:InitView(url)
self:ReConnectForStart() self:ReConnectForStart()
end end
else else
self._state.selectedIndex = StateType.Palying self._state.selectedIndex = StateType.Palying
self:ReconnectForClearing() self:ReconnectForClearing()
end end
self._view:GetChild("btn_back_jiesan").onClick:Set(function() self._view:GetChild("btn_back_jiesan").onClick:Set(function()
@ -165,7 +162,6 @@ function M:InitView(url)
local _gamectr = ControllerManager.GetController(GameController) local _gamectr = ControllerManager.GetController(GameController)
_gamectr:AskDismissRoom() _gamectr:AskDismissRoom()
end end
end) end)
--local tempdsaf=self._view:GetChild("btn_back_jiesan") --local tempdsaf=self._view:GetChild("btn_back_jiesan")
--tempdsaf:GetChild("n3").displayObject.gameObject:SetActive(false) --tempdsaf:GetChild("n3").displayObject.gameObject:SetActive(false)
@ -204,11 +200,12 @@ function M:InitView(url)
end end
end end
end end
function M:UpdateCard(index) function M:UpdateCard(index)
self._room.pai = index self._room.pai = index
local card_info = self._player_card_info[1] local card_info = self._player_card_info[1]
-- for i=1,#self._room.player_list do -- for i=1,#self._room.player_list do
-- print(i) -- -- print(i)
-- end -- end
card_info:updatePoker() card_info:updatePoker()
for _, player in ipairs(self._room.player_list) do for _, player in ipairs(self._room.player_list) do
@ -305,7 +302,6 @@ function M:OnPlayerLeave(...)
else else
self._ctr_action.selectedIndex = 2 self._ctr_action.selectedIndex = 2
end end
else else
self._ctr_action.selectedIndex = 1 self._ctr_action.selectedIndex = 1
end end
@ -314,7 +310,6 @@ function M:OnPlayerLeave(...)
end end
end end
function M:EventInit() function M:EventInit()
local _gamectr = ControllerManager.GetController(GameController) local _gamectr = ControllerManager.GetController(GameController)
MainView.EventInit(self) MainView.EventInit(self)
@ -324,7 +319,6 @@ function M:EventInit()
_gamectr:AddEventListener(RunFast_GameEvent.EventXiPai, function(...) _gamectr:AddEventListener(RunFast_GameEvent.EventXiPai, function(...)
if self.result_view ~= nil then if self.result_view ~= nil then
self.result_view:Destroy() self.result_view:Destroy()
self.result_view = nil self.result_view = nil
@ -366,16 +360,12 @@ function M:EventInit()
-- body -- body
head_info._view:GetChild("shengyu"):GetChild("shengyu").text = "" .. p.hand_count .. "" head_info._view:GetChild("shengyu"):GetChild("shengyu").text = "" .. p.hand_count .. ""
end end
p:Clear() p:Clear()
head_info:FillData(p) head_info:FillData(p)
local card_info = self._player_card_info[self:GetPos(p.seat)] local card_info = self._player_card_info[self:GetPos(p.seat)]
card_info:Clear() card_info:Clear()
head_info:Ready(false) head_info:Ready(false)
end end
@ -401,12 +391,10 @@ function M:EventInit()
local currentPlayer2 = arg[2] local currentPlayer2 = arg[2]
self._popEvent = false self._popEvent = false
if (currentPlayer1) then if (currentPlayer1) then
local xipaiCB = function() local xipaiCB = function()
self._popEvent = true self._popEvent = true
end end
self:PlayXiPai(xipaiCB) self:PlayXiPai(xipaiCB)
end end
@ -417,9 +405,6 @@ function M:EventInit()
end end
self:PlayXiPai1(xipaiCB2) self:PlayXiPai1(xipaiCB2)
end end
end) end)
_gamectr:AddEventListener(RunFast_GameEvent.OnMingCard, function(...) _gamectr:AddEventListener(RunFast_GameEvent.OnMingCard, function(...)
@ -478,9 +463,6 @@ function M:EventInit()
-- body -- body
head_info._view:GetChild("shengyu"):GetChild("shengyu").text = "" .. p.hand_count .. "" head_info._view:GetChild("shengyu"):GetChild("shengyu").text = "" .. p.hand_count .. ""
end end
p:Clear() p:Clear()
head_info:FillData(p) head_info:FillData(p)
@ -495,7 +477,6 @@ function M:EventInit()
else else
card_info:InitPoker(cardlist, true) card_info:InitPoker(cardlist, true)
end end
else else
--card_info:UpdateHandPoker(#cardlist,true,false) --todo --card_info:UpdateHandPoker(#cardlist,true,false) --todo
--card_info:UpdateRemainCard(#cardlist,true) --card_info:UpdateRemainCard(#cardlist,true)
@ -583,8 +564,6 @@ function M:EventInit()
-- body -- body
head_info._view:GetChild("shengyu"):GetChild("shengyu").text = "" .. card_number .. "" head_info._view:GetChild("shengyu"):GetChild("shengyu").text = "" .. card_number .. ""
end end
end end
local card_info = self._player_card_info[index] local card_info = self._player_card_info[index]
card_info:SetOutCardInfo(p.out_card_list, false, true) card_info:SetOutCardInfo(p.out_card_list, false, true)
@ -635,7 +614,6 @@ function M:EventInit()
-- end -- end
-- end -- end
self:_Effect(cardstype, p) self:_Effect(cardstype, p)
else else
if cardstype == 11 and cardstype ~= 12 then if cardstype == 11 and cardstype ~= 12 then
self:_Effect(cardstype, p) self:_Effect(cardstype, p)
@ -654,7 +632,6 @@ function M:EventInit()
self:PlaySound(p.self_user.sex, "card_1") self:PlaySound(p.self_user.sex, "card_1")
end) end)
end end
end) end)
@ -679,7 +656,6 @@ function M:EventInit()
end end
self._popEvent = true self._popEvent = true
end) end)
_gamectr:AddEventListener(RunFast_GameEvent.OnPassSucc, function(...) _gamectr:AddEventListener(RunFast_GameEvent.OnPassSucc, function(...)
@ -712,7 +688,6 @@ function M:EventInit()
local piao = arg[1] local piao = arg[1]
local reload = arg[2] local reload = arg[2]
if reload == 0 then if reload == 0 then
if self._room.room_config.people_num == 3 and self._room.room_config.fangzuobi == 1 then if self._room.room_config.people_num == 3 and self._room.room_config.fangzuobi == 1 then
-- body -- body
self.MypokerList = cardlist self.MypokerList = cardlist
@ -866,19 +841,19 @@ function M:EventInit()
if DataManager.CurrenRoom.pai == 0 then if DataManager.CurrenRoom.pai == 0 then
if card_n == 310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then if card_n == 310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then
-- body -- body
card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/"..card_n.."_1") card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/" .. card_n ..
"_1")
else else
card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/" .. card_n) card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/" .. card_n)
end end
else else
if card_n == 310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then if card_n == 310 and DataManager.CurrenRoom.room_config.Heart10 == 1 then
-- body -- body
card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/"..card_n.."_2") card_code_obj = UIPackage.CreateObjectFromURL("ui://Extend_Poker_RunFastNew/" .. card_n ..
"_2")
else else
card_code_obj = UIPackage.CreateObjectFromURL("ui://Main_Poker/" .. card_n .. "_2") card_code_obj = UIPackage.CreateObjectFromURL("ui://Main_Poker/" .. card_n .. "_2")
end end
end end
if card_code_obj ~= nil then if card_code_obj ~= nil then
card_code_obj:SetScale(0.6, 0.6) card_code_obj:SetScale(0.6, 0.6)
@ -886,14 +861,9 @@ function M:EventInit()
poker_item:AddChild(card_code_obj) poker_item:AddChild(card_code_obj)
otherpoker_list:AddChild(poker_item) otherpoker_list:AddChild(poker_item)
end end
end end
end) end)
end end
end end
if self._cor_sound ~= nil then if self._cor_sound ~= nil then
coroutine.stop(self._cor_sound) coroutine.stop(self._cor_sound)
@ -906,7 +876,7 @@ function M:EventInit()
self.destory_win = nil self.destory_win = nil
self.destory_win = coroutine.start(function() self.destory_win = coroutine.start(function()
-- print("11111111111111") -- -- print("11111111111111")
-- coroutine.wait(1) -- coroutine.wait(1)
if self._room.self_player.seat == win_seat then if self._room.self_player.seat == win_seat then
local sprint_seat_list = self:GetSpringSeats(info) local sprint_seat_list = self:GetSpringSeats(info)
@ -919,8 +889,6 @@ function M:EventInit()
ViewUtil.PlaySound("RunFastNew_PK", "base/common/sound/win new.mp3") ViewUtil.PlaySound("RunFastNew_PK", "base/common/sound/win new.mp3")
end end
-- local url = #sprint_seat_list > 0 and "ui://Extend_Poker_RunFastNew/Spring" or "ui://Extend_Poker_RunFastNew/Win_Mine" -- local url = #sprint_seat_list > 0 and "ui://Extend_Poker_RunFastNew/Spring" or "ui://Extend_Poker_RunFastNew/Win_Mine"
else else
local beigang = false local beigang = false
if #self:GetSpringSeats(info) > 0 then if #self:GetSpringSeats(info) > 0 then
@ -934,12 +902,10 @@ function M:EventInit()
beigang = true beigang = true
end end
end end
end end
-- if beigang == false then -- if beigang == false then
-- self:CreateRankEff() -- self:CreateRankEff()
-- end -- end
end end
for i = 1, #info do for i = 1, #info do
local player = info[i] local player = info[i]
@ -981,14 +947,15 @@ function M:EventInit()
self:ChangeBgmMusic(1) self:ChangeBgmMusic(1)
-- if over == 0 then -- if over == 0 then
if #self:GetSpringSeats(info) > 0 then if #self:GetSpringSeats(info) > 0 then
-- print("222222222222222222") -- -- print("222222222222222222")
coroutine.wait(1) coroutine.wait(1)
else else
-- print("333333333333333333") -- -- print("333333333333333333")
-- coroutine.wait(2) -- coroutine.wait(2)
end end
self.result_view = RunFast_ResultView.new(self._root_view, info, self._room.room_id, over, win_seat, 0, remaincards) self.result_view = RunFast_ResultView.new(self._root_view, info, self._room.room_id, over, win_seat, 0,
remaincards)
self.result_view:Show() self.result_view:Show()
if self.WinItem_view ~= nil then if self.WinItem_view ~= nil then
self.WinItem_view:Dispose() self.WinItem_view:Dispose()
@ -1023,12 +990,10 @@ function M:EventInit()
-- body -- body
self:UnmarkSelfTuoguan() self:UnmarkSelfTuoguan()
ControllerManager.ChangeController(LoddyController) ControllerManager.ChangeController(LoddyController)
end end
end) end)
_gamectr:AddEventListener(RunFast_GameEvent.OnResultByDissolve, function(...) _gamectr:AddEventListener(RunFast_GameEvent.OnResultByDissolve, function(...)
local arg = { ... } local arg = { ... }
local over = arg[1] local over = arg[1]
local info = arg[2] local info = arg[2]
@ -1074,7 +1039,6 @@ function M:EventInit()
end end
function M:ReConnectForStart() function M:ReConnectForStart()
local _gamectr = ControllerManager.GetController(GameController) local _gamectr = ControllerManager.GetController(GameController)
self._room.is_new_bout = _gamectr:GetIsNewBout(self._room.curren_turn_seat) self._room.is_new_bout = _gamectr:GetIsNewBout(self._room.curren_turn_seat)
self._state.selectedIndex = 1 self._state.selectedIndex = 1
@ -1122,23 +1086,16 @@ function M:ReConnectForStart()
-- body -- body
head_info._view:GetChild("shengyu"):GetChild("shengyu").text = "" .. player.hand_count .. "" head_info._view:GetChild("shengyu"):GetChild("shengyu").text = "" .. player.hand_count .. ""
end end
if player.seat == self._room.self_player.seat then if player.seat == self._room.self_player.seat then
if player.open ~= nil and player.open == 0 and self._room.room_config.people_num == 3 and self._room.room_config.fangzuobi == 1 then if player.open ~= nil and player.open == 0 and self._room.room_config.people_num == 3 and self._room.room_config.fangzuobi == 1 then
-- body -- body
self.MypokerList = player.hand_list self.MypokerList = player.hand_list
player_card_info:InitPoker(player.hand_list, false, 1) player_card_info:InitPoker(player.hand_list, false, 1)
else else
player_card_info:InitPoker(player.hand_list, false) player_card_info:InitPoker(player.hand_list, false)
end end
else else
player_card_info:SetRemainCardNumber(player.hand_count == 1) player_card_info:SetRemainCardNumber(player.hand_count == 1)
if player.hand_count == 1 then if player.hand_count == 1 then
self.bgm_index = 2 self.bgm_index = 2
@ -1202,18 +1159,15 @@ function M:ReconnectForClearing()
-- body -- body
head_info._view:GetChild("shengyu"):GetChild("shengyu").text = "" .. player.hand_count .. "" head_info._view:GetChild("shengyu"):GetChild("shengyu").text = "" .. player.hand_count .. ""
end end
if player.seat == self._room.self_player.seat then if player.seat == self._room.self_player.seat then
player_card_info:InitPoker(player.hand_list, false) player_card_info:InitPoker(player.hand_list, false)
else else
player_card_info:UpdateHandPoker(player.hand_list, false, true) player_card_info:UpdateHandPoker(player.hand_list, false, true)
end end
if player.out_card_list[1] == 0 then if player.out_card_list[1] == 0 then
player_card_info:SetOutCardInfo(nil, false) player_card_info:SetOutCardInfo(nil, false)
else else
player_card_info:SetOutCardInfo(player.out_card_list, false) player_card_info:SetOutCardInfo(player.out_card_list, false)
@ -1224,19 +1178,17 @@ function M:ReconnectForClearing()
local remaincards = self._room.remaincards local remaincards = self._room.remaincards
if self._room.game_status == 1 then if self._room.game_status == 1 then
-- body -- body
coroutine.start(function() coroutine.start(function()
coroutine.wait(0.3) coroutine.wait(0.3)
self.result_view = RunFast_ResultView.new(self._root_view, self._room.player_list, self._room.room_id, 0, win_seat,0,remaincards) self.result_view = RunFast_ResultView.new(self._root_view, self._room.player_list, self._room.room_id, 0,
win_seat, 0, remaincards)
self.result_view:Show() self.result_view:Show()
local card_info = self._player_card_info[1] local card_info = self._player_card_info[1]
card_info._view:GetChild("out_card_list").visible = true card_info._view:GetChild("out_card_list").visible = true
end) end)
if remaincards then if remaincards then
local newremaincards = self._gamectr:ChangeCodeByFrom(remaincards, true) local newremaincards = self._gamectr:ChangeCodeByFrom(remaincards, true)
-- body -- body
@ -1354,6 +1306,7 @@ function M:_Effect( type1 ,player)
end) end)
-- end -- end
end end
-- function M:_Effect(type1, player) -- function M:_Effect(type1, player)
-- if type1 < 7 and type1 ~= 4 then return end -- if type1 < 7 and type1 ~= 4 then return end
-- local eff_code = 0 -- local eff_code = 0
@ -1493,7 +1446,6 @@ function M:PlayCardEff(card)
coroutine.wait(1) coroutine.wait(1)
self._popEvent = true self._popEvent = true
end) end)
end end
function M:ResetPoker() function M:ResetPoker()
@ -1504,7 +1456,6 @@ function M:ResetPoker()
end end
function M:PlaySound(sex, path) function M:PlaySound(sex, path)
local sex_path = ViewUtil.Sex_Chat[sex] -- 1 男 2 女 local sex_path = ViewUtil.Sex_Chat[sex] -- 1 男 2 女
local sound_path = string.format("extend/poker/runfast/sound/%s/%s.mp3", sex_path, path) local sound_path = string.format("extend/poker/runfast/sound/%s/%s.mp3", sex_path, path)
ViewUtil.PlaySound("RunFastNew_PK", sound_path) ViewUtil.PlaySound("RunFastNew_PK", sound_path)
@ -1518,6 +1469,7 @@ function M:ChangeBgmMusic(bgm_index)
end end
ViewUtil.PlayMuisc("RunFastNew_PK", string.format("extend/poker/runfast/sound/bgm%d.mp3", 1)) ViewUtil.PlayMuisc("RunFastNew_PK", string.format("extend/poker/runfast/sound/bgm%d.mp3", 1))
end end
function M:OnPlayerEnter(...) function M:OnPlayerEnter(...)
local arg = { ... } local arg = { ... }
local p = arg[1] local p = arg[1]

Some files were not shown because too many files have changed in this diff Show More