全部放大

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.onevent = event("onevent", 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:SetCallBackListener(R.c__ondata)
@ -92,7 +92,7 @@ local NULL_JSON = "{}"
--- send
function R.send(self, cmd, data, callback)
if (debug_print) then
print("send host:" .. self.host)
-- print("send host:" .. self.host)
end
if self.c__netClient == nil then
return
@ -170,7 +170,7 @@ end
---c#网络层回调函数
function R.c__onconnect(self, code)
if (debug_print) then
print("codeccccccccccccccccccccccccccccccccccccccc" .. code)
-- print("codeccccccccccccccccccccccccccccccccccccccc" .. code)
end
self.onconnect(code)
end

View File

@ -20,8 +20,8 @@ function Queue:Enqueue(element)
self.queue[self.rear] = element
else
local temp = (self.rear + 1) % self.capacity
--print("1111111111111111111====>>>>")
--print(temp)
---- print("1111111111111111111====>>>>")
---- print(temp)
if temp == self.head then
error("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.size_ = self.size_ + 1
end
end
function Queue:Dequeue()
@ -84,6 +83,6 @@ function Queue:dump()
end
str = str .. "," .. self.queue[r] .. "}"
if (debug_print) then
print(str)
-- print(str)
end
end

View File

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

View File

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

View File

@ -48,11 +48,11 @@ OnInit、DoHideAnimation、DoShowAnimation、OnShown、OnHide。
MyWinClass = fgui.window_class()
function MyWinClass:ctor()
print('MyWinClass-ctor')
-- print('MyWinClass-ctor')
self.contentPane = UIPackage.CreateObject("Basics", "WindowA")
end
function MyWinClass:OnShown()
print('MyWinClass-onShown')
-- print('MyWinClass-onShown')
end
local win = MyWinClass.New()
win:Show()
@ -92,12 +92,12 @@ MyButton = fgui.extension_class(GButton)
fgui.register_extension("ui://包名/我的按钮", MyButton)
function MyButton:ctor() --当组件构建完成时此方法被调用
print(self:GetChild("n1"))
-- print(self:GetChild("n1"))
end
--添加自定义的方法和字段
function MyButton:Test()
print('test')
-- print('test')
end
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_AUTO_CARD] = self.OnEvtOpenGameHuTuoGtips
end
function DispatchEvent(_dispatcher, evt_name, ...)
@ -86,9 +84,8 @@ function M:AddEventListener(evt_name, func)
self._dispatcher[evt_name] = func
end
function M:ResetConnect()
-- print("断线重连================")
-- -- print("断线重连================")
--ControllerManager.OnConnect(SocketCode.TimeoutDisconnect)
ViewManager.refreshGameView()
end
@ -101,6 +98,7 @@ function M:PlayerReady()
if not _client then
return
end
print("====================================1发送准备")
_client:send(Protocol.GAME_READY)
end
@ -178,7 +176,7 @@ function M:DismissRoomVote(agree)
if not _client then
return
end
-- print(agree)
-- -- print(agree)
local _data = {}
_data['result'] = agree
_client:send(Protocol.GAME_DISMISS_ROOM_VOTE, _data)
@ -261,7 +259,7 @@ end
-- 玩家进
function M:OnEventPlayerEnter(evt_data)
--print("进入房间++++++++++++++++++++++++++++++++++++++")
---- print("进入房间++++++++++++++++++++++++++++++++++++++")
self._cacheEvent:Enqueue(
function()
local p = self._room:NewPlayer()
@ -286,7 +284,6 @@ function M:OnEventPlayerEnter(evt_data)
p.line_state = 1
DataManager.CurrenRoom:AddPlayer(p)
DispatchEvent(self._dispatcher, GameEvent.PlayerEnter, p)
end
)
end
@ -331,7 +328,6 @@ function M:OnEventPlayerReady(evt_data)
else
p.isSendCardState = false
end
else
p.isSendCardState = false
end
@ -341,7 +337,6 @@ function M:OnEventPlayerReady(evt_data)
)
end
function M:OnEventPlayerXiPaiReady(evt_data)
self._cacheEvent:Enqueue(
function()
@ -354,7 +349,6 @@ function M:OnEventPlayerXiPaiReady(evt_data)
else
p.isSendCardState = false
end
else
p.isSendCardState = false
end
@ -364,8 +358,6 @@ function M:OnEventPlayerXiPaiReady(evt_data)
)
end
-- 聊天事件
function M:OnEventInteraction(evt_data)
if self._room.ban_chat1 == false or self._room.ban_chat2 == false then
@ -396,7 +388,6 @@ function M:OnEventUpdateGPS(evt_data)
)
end
-- 被踢出房间事件
function M:OnEventKicked()
if ViewManager.GetCurrenView().dview_class == LobbyView then
@ -544,7 +535,7 @@ end
function M:OnEnter()
if (debug_print) then
print(self._name .. '进入Game控制器')
-- print(self._name .. '进入Game控制器')
end
self._room = DataManager.CurrenRoom
local _client = ControllerManager.GameNetClinet
@ -555,14 +546,14 @@ end
function M:OnExit()
if (debug_print) then
print(self._name .. ' 离开Game控制器')
-- print(self._name .. ' 离开Game控制器')
end
ControllerManager.SetGameNetClient(nil)
self._cacheEvent:Clear()
end
function M:__OnNetEvent(msg)
--print("Game消息ID===>>"..msg.Command)
---- print("Game消息ID===>>"..msg.Command)
local func = self._eventmap[msg.Command]
if (func ~= nil) then
func(self, msg.Data)
@ -586,12 +577,10 @@ function M:ReturnToRoom()
end,
self.tmpGroupID
)
end
function M:OnEvtOpenTupGTips(msg)
--print("显示托管倒计时=====================")
---- print("显示托管倒计时=====================")
pt(msg)
local pid = msg['aid']
local p = self._room:GetPlayerById(pid)
@ -599,9 +588,8 @@ function M:OnEvtOpenTupGTips(msg)
DispatchEvent(self._dispatcher, GameEvent.TupGuanOpen, p, true, t)
end
function M:OnEvtCloseTupGTips(msg)
--print("关闭托管倒计时=================")
---- print("关闭托管倒计时=================")
--pt(msg)
local pid = msg['aid']
local p = self._room:GetPlayerById(pid)
@ -609,13 +597,10 @@ function M:OnEvtCloseTupGTips(msg)
DispatchEvent(self._dispatcher, GameEvent.TupGuanOpen, p, false, t)
end
function M:DispatchEventTuoGuan(p, isShow, t)
DispatchEvent(self._dispatcher, GameEvent.TupGuanOpen, p, isShow, t)
end
function M:OnEvtOpenGameHuTuoGtips(isAuto)
local _client = ControllerManager.GameNetClinet
if not _client then

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -31,7 +31,7 @@ function ControllerManager.Init()
local hostIp = GetGameInfo("login_url")
if (debug_print) then
print("hostIp:::" .. hostIp)
-- print("hostIp:::" .. hostIp)
end
ControllerManager.WebClient = NetClient.new(hostIp, "majiang", 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
function ControllerManager.OnConnect(code)
print("=======================================ControllerManager", code)
-- print("=======================================ControllerManager", code)
if (code ~= SocketCode.Connect) then
ControllerManager.SetGameNetClient(nil)
if code ~= SocketCode.DisconnectByServer then

View File

@ -49,7 +49,7 @@ end
function TableBG.GetTableBG(game_id)
local id = -1
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
local config_data = json.decode(json_data)
id = GetBG(config_data, game_id)

View File

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

View File

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

View File

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

View File

@ -84,13 +84,13 @@ function M:CreatePlay()
local loddyCtr = ControllerManager.GetController(LoddyController)
local gameId = PlayInfo[1].playList[self.playNameCtr.selectedIndex + 1].playeId
local config = ExtendManager.GetExtendConfig(gameId)
print("==============================config")
-- print("==============================config")
pt(config)
local mode = config:GetGameInfo()
print("==============================mode")
-- print("==============================mode")
pt(mode)
local _data = mode:SelectedConfigData()
print("==============================_data")
-- print("==============================_data")
pt(_data)
-- loddyCtr:CreateRoom(gameId,_data, function (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()
fgCtr:FG_GroupMembers(group_id, limit, num, minus_only, sort_type, function(res)
local members = res.Data.members
print("==========================res.Data.members")
-- print("==========================res.Data.members")
pt(res.Data.members)
ViewUtil:CloseModalWait()
if res.ReturnCode ~= 0 then
@ -303,7 +303,7 @@ function M:UpdateFamilyRoom(fgCtr, id)
}
end
local roomList = self._group.rooms
print("=========================playList,rooms")
-- print("=========================playList,rooms")
pt(playList)
pt(roomList)
local roomCtr = ControllerManager.GetController(RoomController)
@ -405,7 +405,7 @@ function M:UpdateFamilyRoom(fgCtr, id)
end)
end
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)
list_room.numItems = all_num
list_gamePlay.numItems = #playList + 1
@ -418,7 +418,7 @@ function M:ConnetFamily(index, groups, isCreate)
local list_family = self._view:GetChild('list_family')
list_family:SetVirtual()
self._group = DataManager.groups:get(groups[index].id)
print("===================================self._group")
-- print("===================================self._group")
pt(self._group)
self._roomNum = self._group.room_num
@ -533,7 +533,7 @@ function M:OnUpdate()
self._group.update_room = false
self._fristRoom = true
end
print("====================================UpdateFamilyRoom", fgCtr, self._group.id)
-- print("====================================UpdateFamilyRoom", fgCtr, self._group.id)
self:UpdateFamilyRoom(fgCtr, self._group.id)
end
end

View File

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

View File

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

View File

@ -21,9 +21,9 @@ function M:init(url)
local view = self._view
local user = self.user;
print("================phone=====================")
-- print("================phone=====================")
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
--show

View File

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

View File

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

View File

@ -18,7 +18,7 @@ function M:init(url)
self.ctr_update = self._view:GetController("update")
if DataManager.SelfUser.password then
--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)
end
@ -75,7 +75,6 @@ end
--绑定
function M:Bind()
local tex_passwd = self._view:GetChild("tex_passwd")
local password = tex_passwd.text
if string.len(password) < 6 then
@ -110,7 +109,6 @@ function M:Bind()
end)
end
function M:CheckInputCode()
local code = self._view:GetChild("tex_code").text
if not (string.len(code) == 6) then

View File

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

View File

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

View File

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

View File

@ -26,7 +26,7 @@ function M:init()
local view = self._view
-- 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
self.agree = view:GetController("agree");
-- Utils.LoadBg("loginbg", view)
@ -70,7 +70,7 @@ function M:init()
Utils.SaveLocalFile(key, json.encode(_data))
end)
if not s then
print("Error:" .. e)
-- print("Error:" .. e)
end
DataManager.SelfUser.acc = utez
@ -218,7 +218,7 @@ end
function M:QuickLogin()
if (not GameApplication.Instance.accountTest) then
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
ViewUtil.ShowModalWait(self._root_view, "正在登录游戏...")
local loginCtr = ControllerManager.GetController(LoginController)
@ -231,8 +231,8 @@ end
function M:LoginCallBack(result, data)
self.isWXCallBackMark = true
--print("微信登录返回================================================================")
--print("result===>"..result)
---- print("微信登录返回================================================================")
---- print("result===>"..result)
--pt(data)
if (not result) or result ~= 0 then
if result == 10 then

View File

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

View File

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

View File

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

View File

@ -57,7 +57,7 @@ function M:init(url, btn_type)
-- 初始化标题列表
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])
--如果界面无show_key或圈子中对应的key为true才显示界面
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 page_info = getPageConfig(self.page_config[index + 1])
if not self._view_map[index + 1] then
local tem = page_info.view.new(self.group_id, self._root_view)
-- anchor:AddRelation(self._root_view, RelationType.Size,true)
--tem._view:Center(true)
--print("222222222222222",anchor._view)
---- print("222222222222222",anchor._view)
anchor:AddChild(tem._view)
-- tem._view.parent = anchor
@ -176,12 +175,10 @@ function M:init(url, btn_type)
end)
end
function M:SetCurrentGroupInfoViewIns(groupInfoViewCallBack)
self.groupInfoViewCallBack = groupInfoViewCallBack
end
-- 获取指定ID的页面
function M:GetPageByID(id)
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 name = tex_name.text
print("jefe:")
-- print("jefe:")
pt(self.hpData)
local fgCtr = ControllerManager.GetController(NewGroupController)
@ -469,7 +469,7 @@ function M:FillFagData()
return
end
ViewUtil.CloseModalWait()
--print("======新增玩法=============")
---- print("======新增玩法=============")
--pt(res)
if res.ReturnCode == 0 then
local play = {}
@ -510,7 +510,7 @@ function M:FillFagData()
return
end
ViewUtil.CloseModalWait()
--print("======修改玩法=============")
---- print("======修改玩法=============")
--pt(res)
if res.ReturnCode == 0 then
local play = {}

View File

@ -52,7 +52,6 @@ function M:init(url)
end
self.lst_fag.scrollPane.onPullUpRelease:Set(function()
self:GetData(self.lst_fag.numItems + self.m_index)
end)
if not self.not_manager then
self._view:GetController("manager").selectedIndex = 1
@ -75,7 +74,8 @@ function M:init(url)
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._view:GetChild("btn_search").onClick:Set(function()
@ -93,7 +93,7 @@ function M:GetFilter()
local filter = 0
for i = 1, 8 do
local tem = math.pow(2, i - 1)
--print("aaaaaaaaaaaaaaaaaaaaaaaa ",tem)
---- print("aaaaaaaaaaaaaaaaaaaaaaaa ",tem)
local btn_filter = self._view:GetChild("btn_filter" .. tem)
if btn_filter and btn_filter.selected then
filter = filter + tem
@ -150,7 +150,8 @@ function M:GetData(index)
if filter == 0 then return end
ViewUtil.ShowModalWait()
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
return
end
@ -160,7 +161,7 @@ function M:GetData(index)
else
local data = res.Data.hp_logs
if #data == 0 then return end
-- print("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
-- -- print("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
-- pt(data)
-- pt(self.member)
for i = 1, #data do
@ -217,7 +218,6 @@ function M:GuoLv(data)
end
self.m_index = #data - #m_data_other + self.m_index
end
end
local function fillItem(data, obj)

View File

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

View File

@ -65,7 +65,7 @@ function M:OnRenderItem(index, obj)
local hpStr
local hpData = json.decode(play.hpData)
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_val = play.rewardValueType == 1 and "百分比返点" or "固定值返点"
local str_hp_type = hpData.type == 1 and "固定抽水" or "浮动抽水"

View File

@ -62,15 +62,15 @@ function M:FillView()
end
self.lst_member.scrollPane.onPullUpRelease:Set(
function()
--print("aaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbb ",self.lst_member.numItems)
---- print("aaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbb ",self.lst_member.numItems)
self:GetMemberData(self.lst_member.numItems)
end
)
--local n50=self._view:GetChild('n50')
--print(n50)
---- print(n50)
--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')
self._view:GetChild('btn_search').onClick:Set(
@ -174,9 +174,6 @@ function M:FillView()
self:initData()
end
)
end
-- 快速访问
@ -187,8 +184,8 @@ end
-- 获取成员数据
function M:GetMemberData(index)
--print("11111111111111111111")
--print(debug.traceback())
---- print("11111111111111111111")
---- print(debug.traceback())
local group = DataManager.groups:get(self.group_id)
if index == 0 then
group:clearMember()

View File

@ -71,7 +71,6 @@ function M:FillView()
self.online = tonumber(rtype.value)
self:GetMemberData(0)
--printlog("aaaaaaaa222222222222222222222222222222")
end)
-- 初始化成员列表
@ -88,9 +87,9 @@ function M:FillView()
)
--local n50=self._view:GetChild('n50')
--print(n50)
---- print(n50)
--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')
self._view:GetChild('btn_search').onClick:Set(
@ -200,13 +199,10 @@ function M:FillView()
--self._view:GetChild("n50").selected = true
ctr_page.onChanged:Set(
function()
self.stype = ctr_page.selectedIndex + 1
self:initData()
end
)
end
-- 快速访问
@ -217,8 +213,8 @@ end
-- 获取成员数据
function M:GetMemberData(index)
--print("11111111111111111111")
--print(debug.traceback())
---- print("11111111111111111111")
---- print(debug.traceback())
-- local iClear = false
-- local rtype = self._view:GetChild("n132").value
-- if tostring(self.online) ~= rtype then
@ -324,7 +320,7 @@ function M:FillItem(obj, member, refresh)
-- else
-- obj:GetChild('tex_last_login').text = os.date('%Y/%m/%d', member.last_time)
-- 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)
else
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')
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)
obj:GetChild('btn_bxx').onClick:Set(
function()

View File

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

View File

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

View File

@ -129,8 +129,8 @@ end
function ViewUtil.HandCardSort2(a, b)
a = tonumber(string.sub(a, 2))
b = tonumber(string.sub(b, 2))
--print(a)
--print(b)
---- print(a)
---- print(b)
return a < b
end
@ -242,7 +242,7 @@ function get_gps(callback)
end)
end)
if not s then
--print("Error" .. e)
---- print("Error" .. e)
end
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)))

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -22,7 +22,6 @@ function CS_ClearingView.new(blur_view)
return self
end
function M:InitMaPai()
self.maPaiCtr = self._view:GetController("mapai")
self.maPaiCtr.selectedIndex = 0
@ -33,17 +32,14 @@ function M:InitMaPai()
local tempMP = self._view:GetChild("niao" .. i)
table.insert(self.maPaiList, tempMP)
end
end
function M:IsMapaiShow(niao, isShow)
if niao then
niao.visible = isShow
end
end
function M:SetMaPaiValue(niao, value)
if niao then
niao.icon = 'ui://Main_Majiang/' .. get_majiang_prefix(DataManager.CurrenRoom.game_id) .. "201_" .. value
@ -61,8 +57,6 @@ function M:HideAllMapai()
end
end
function M:ShowSelectMaPai(niaoList)
if niaoList and #niaoList > 0 then
self.maPaiCtr.selectedIndex = 1
@ -79,7 +73,6 @@ function M:ShowSelectMaPai(niaoList)
end
end
function M:InitData(over, room, result, total_result, callback)
self._callback = callback
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 _sdkCtr = self._view:GetController("sdk")
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_roomnum").text = room.room_id
-- 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
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
item:GetController("win").selectedIndex = 2
end
@ -408,7 +402,8 @@ function M:FillItemData2(room, data, list)
-- self:SetGSListlineGap(-10)
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")
if #player_list == 3 then
lst_p.columnGap = 108

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -16,7 +16,8 @@ function M.new(view,mainView)
end
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
table.insert(tingList, 412)
end
@ -38,7 +39,8 @@ function M:UpdateHandCard(getcard, mp)
local btn = _carViewList[i].card
local card = self:GetCard(btn)
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
local count = 0
for j = 1, #tingList do
@ -134,7 +136,7 @@ function M:__OnDragEnd(context)
local card = button.data
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
self._mainView:OutCard(card.card_item)
button.touchable = false
@ -154,6 +156,7 @@ function M:CheckPlayerOnlineState()
end
return true
end
function M:Clear(bskip)
--self._ctr_state.selectedIndex = 0
self._area_fz_list.x = self._src_fz_list.x
@ -172,6 +175,6 @@ function M:Clear(bskip)
self._carViewList[i].card:Dispose()
end
self._carViewList = {}
end
return M

View File

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

View File

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

View File

@ -121,7 +121,7 @@ function M:OnEventSendCards(evt_data)
_room.jing = jing
self._cacheEvent:Enqueue(function()
_room.banker_seat = seat
print("========================fuzhijing")
-- print("========================fuzhijing")
for i = 1, #_room.player_list do
_room.player_list[i].hand_left_count = 13
_room.player_list[i].fz_list = {}
@ -275,7 +275,7 @@ function M:OnEventFzAction(evt_data)
end
function M:OnEventHu(evt_data)
print("===========================OnEventHu")
-- print("===========================OnEventHu")
local cards = evt_data["card"]
local win_p = self._room:GetPlayerBySeat(evt_data["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]
if tem.type > 0 and tem.type < 32 then
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)
coroutine.wait(0.3)
end

View File

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

View File

@ -110,7 +110,7 @@ function M:UpdateHandCard(getcard, mp)
end
function M:__OnClickHandCard(context)
print("==========================__OnClickHandCard")
-- print("==========================__OnClickHandCard")
local button = context.sender
local _carViewList = self._carViewList
local refresh = true
@ -168,7 +168,7 @@ function M:__OnDragEnd(context)
local card = button.data
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
self._mainView:OutCard(card.card_item)
button.touchable = false

View File

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

View File

@ -166,7 +166,7 @@ function M:__OnDragEnd(context)
local card = button.data
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
self._mainView:OutCard(card.card_item)
button.touchable = false

View File

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

View File

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

View File

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

View File

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

View File

@ -43,7 +43,7 @@ function M:setHandCardPos(btn_card, i, getcard)
end
function M:UpdateHandCard(getcard, mp)
print("======================onthisUpdateHandCard")
-- print("======================onthisUpdateHandCard")
if self.outcard_button then
self.outcard_button:Dispose()
self.outcard_button = nil
@ -154,7 +154,7 @@ function M:__OnDragEnd(context)
local _room = DataManager.CurrenRoom
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
self._mainView:OutCard(card.card_item)
button.touchable = false

View File

@ -52,7 +52,7 @@ function MJTableBG.GetTableBG(game_id)
local id = -1
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
local config_data = json.decode(json_data)
id = GetBG(config_data, game_id)

View File

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

View File

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

View File

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

View File

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

View File

@ -16,7 +16,8 @@ function M.new(view,mainView)
end
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
-- table.insert(tingList, 412)
--end
@ -38,7 +39,8 @@ function M:UpdateHandCard(getcard, mp)
local btn = _carViewList[i].card
local card = self:GetCard(btn)
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
local count = 0
for j = 1, #tingList do
@ -134,7 +136,7 @@ function M:__OnDragEnd(context)
local card = button.data
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
self._mainView:OutCard(card.card_item)
button.touchable = false
@ -154,6 +156,7 @@ function M:CheckPlayerOnlineState()
end
return true
end
function M:Clear(bskip)
--self._ctr_state.selectedIndex = 0
self._area_fz_list.x = self._src_fz_list.x
@ -172,6 +175,6 @@ function M:Clear(bskip)
self._carViewList[i].card:Dispose()
end
self._carViewList = {}
end
return M

View File

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

View File

@ -42,7 +42,8 @@ function M:InitView(url)
end
self._gamectr = ControllerManager.GetController(GameController)
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._player_card_info = {}
local _player_card_info = self._player_card_info
@ -94,7 +95,7 @@ function M:NewPlayerPokerInfoView(view, index)
end
function M:FillRoomData(data)
print("hidezhanji 1111")
-- print("hidezhanji 1111")
self._currentStep = 1
local room = DataManager.CurrenRoom
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)]
if p.total_hp then
print("hidezhanji 2222")
-- print("hidezhanji 2222")
head_info._view:GetChild('zhanji').visible = false
@ -125,7 +126,6 @@ function M:FillRoomData(data)
card_info:UpdateHandPoker(p.hand_list, false, true)
end
head_info:UpdatePiao(p.piao)
end
self:UpdateRound()
@ -152,7 +152,6 @@ function M:ShowStep(index)
else
info:InitPoker(p.hand_list, false)
end
end
if step.cmd == ChunTian_Record_Event.Evt_OutCard then
@ -194,7 +193,8 @@ function M:ShowStep(index)
end
if step.cmd == ChunTian_Record_Event.Evt_Result then
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"))
self._view:AddChildAt(self.result_view._view, num)
else
@ -257,6 +257,7 @@ function M:CmdPass(cmd, index)
data.cmd = cmd.cmd
data.current_out_seat = cmd.seat
end
function M:Cmdresult(cmd, index)
local data = self:CopyLastStep(index)
data.cmd = cmd.cmd

View File

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

View File

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

View File

@ -59,7 +59,6 @@ function M:NewRoom()
return ChunTian_Room.new()
end
function M:GetIconUrl()
return "ui://Extend_Poker_ChunTian/icon"
--
@ -131,7 +130,6 @@ function M:FillRoomData(s2croom)
room.owner_id = owner
room.game_status = 0
if reload then
local reloadInfo = s2croom["reloadInfo"]
@ -141,8 +139,6 @@ function M:FillRoomData(s2croom)
room.curren_turn_seat = reloadInfo["active_seat"]
local info_list = reloadInfo["info_list"]
if playing == true then
room.CurnrenState = StateType.Palying
room.game_status = 1
@ -168,7 +164,7 @@ function M:FillRoomData(s2croom)
end
end
else
-- print("aaaaaaaaaaaaaaaa1111111111111111111111111")
-- -- print("aaaaaaaaaaaaaaaa1111111111111111111111111")
--pt(s2croom)
room.game_status = 1
@ -185,7 +181,6 @@ function M:FillRoomData(s2croom)
local last_outcard = info_list[i]["last_outcard"]
if last_outcard ~= nil and last_outcard[1] ~= 0 then
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)
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
function M:FillPlayBackData(pd_data)
local room = DataManager.CurrenRoom
local _tableInfo = pd_data["info"]

View File

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

View File

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

View File

@ -51,7 +51,8 @@ function M:InitView(url)
end
self._gamectr = ControllerManager.GetController(GameController)
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._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:CuoPai()
end
function M:CuoPai()
self.cuopai = self._view:GetChild("cuopai")
self.cuopai.visible = false
-- print("self.btnY ",self.btnY)
-- -- print("self.btnY ",self.btnY)
end
function M:Wuyong()
@ -132,7 +132,7 @@ function M:NewPlayerPokerInfoView(view, index)
end
function M:FillRoomData(data)
--print("hidezhanji 1111")
---- print("hidezhanji 1111")
self._currentStep = 1
local room = DataManager.CurrenRoom
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)]
if p.total_hp then
-- print("hidezhanji 2222")
-- -- print("hidezhanji 2222")
head_info._view:GetChild('zhanji').visible = false
if room.hpOnOff == 1 or room:checkHpNonnegative() then
@ -286,7 +286,6 @@ function M:ShowStep(index)
card_info:SetCarType(cardType, cardPoint)
end
end
end
function M:GenerateAllStepData(data)
@ -314,8 +313,6 @@ function M:GenerateAllStepData(data)
end
end
function M:CmdAlertQiangZhuang(cmd, index) --通知抢庄
local data = self:CopyLastStep(index)
data.cmd = cmd.cmd
@ -374,10 +371,8 @@ function M:CmdResult(cmd,index)
local data = self:CopyLastStep(index)
data.cmd = cmd.cmd
data.result = cmd.data.result
end
function M:CopyLastStep(index)
local step = {}
local last_step = self._step[index]

View File

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

View File

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

View File

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

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