在线离线联调
parent
88dbbabbd6
commit
fd5b374479
|
|
@ -16,6 +16,7 @@ GroupMgrEvent = {
|
|||
IsOpenChatRoom = "IsOpenChatRoom",
|
||||
ChatRoomData = "ChatRoomData",
|
||||
OnNewApply = "OnNewApply",
|
||||
OnNewRecord = "OnNewRecord",
|
||||
}
|
||||
|
||||
GroupMgrController = {
|
||||
|
|
@ -53,6 +54,7 @@ function GroupMgrController.new()
|
|||
self._eventmap[Protocol.FGMGR_RESPONSE_INVITE] = self.FG_ResponseInvited
|
||||
self._eventmap[Protocol.FGMGR_EVT_ISOPEN_CHATROOM] = self.FG_Isopen_ChatRoom
|
||||
self._eventmap[Protocol.FGMGR_EVT_DATA_CHATROOM] = self.FG_Data_ChatRoom
|
||||
self._eventmap[Protocol.FGMGR_EVT_NEWCHAT] = self.FG_Data_NewChat
|
||||
-- self:connect(callback)
|
||||
return self
|
||||
end
|
||||
|
|
@ -341,6 +343,28 @@ function M:FG_InvitePlayer(group_id, tag, player_id, roomid, pid, game_name, cal
|
|||
end)
|
||||
end
|
||||
|
||||
-- 进入亲友圈
|
||||
function M:FG_Get_Online_Member(groupId, callback)
|
||||
local _data = {}
|
||||
_data.id = groupId
|
||||
_data.uid = DataManager.SelfUser.account_id
|
||||
local _client = ControllerManager.GroupClient
|
||||
_client:send(Protocol.WEB_FG_GET_ONLINE_MEMBER, _data, function(res)
|
||||
callback(res)
|
||||
end)
|
||||
end
|
||||
|
||||
-- 退出亲友圈
|
||||
function M:FG_Get_Offline_Member(groupId, callback)
|
||||
local _data = {}
|
||||
_data.id = groupId
|
||||
_data.uid = DataManager.SelfUser.account_id
|
||||
local _client = ControllerManager.GroupClient
|
||||
_client:send(Protocol.WEB_FG_GET_OFFLINE_MEMBER, _data, function(res)
|
||||
callback(res)
|
||||
end)
|
||||
end
|
||||
|
||||
-- 回复邀请
|
||||
-- function M:FG_ResponseInvited(id, refuse)
|
||||
-- local _data = {}
|
||||
|
|
@ -368,10 +392,15 @@ end
|
|||
function M:FG_Data_ChatRoom(evt_data)
|
||||
print("收到是否开启聊天室推送")
|
||||
pt(evt_data)
|
||||
--json.decode(_totalScore)
|
||||
DispatchEvent(self._dispatcher, GroupMgrEvent.ChatRoomData, evt_data)
|
||||
end
|
||||
|
||||
function M:FG_Data_NewChat(evt_data)
|
||||
print("收到新聊天室推送")
|
||||
pt(evt_data)
|
||||
DispatchEvent(self._dispatcher, GroupMgrEvent.OnNewRecord, evt_data)
|
||||
end
|
||||
|
||||
function M:PopEvent()
|
||||
local _cacheEvent = self._cacheEvent
|
||||
if (_cacheEvent:Count() > 0) then
|
||||
|
|
|
|||
|
|
@ -1675,6 +1675,7 @@ function M:FG_Recharge_Diamo(groupId, diamo, callback)
|
|||
end)
|
||||
end
|
||||
|
||||
--[[
|
||||
-- 进入亲友圈
|
||||
function M:FG_Get_Online_Member(groupId, callback)
|
||||
local _data = {}
|
||||
|
|
@ -1694,3 +1695,4 @@ function M:FG_Get_Offline_Member(groupId, callback)
|
|||
callback(res)
|
||||
end)
|
||||
end
|
||||
]]
|
||||
|
|
|
|||
|
|
@ -278,9 +278,9 @@ Protocol = {
|
|||
-- 亲友圈房卡充值
|
||||
WEB_FG_RECHARGE_DIAMO = "group/recharge_diamo",
|
||||
-- 进入亲友圈
|
||||
WEB_FG_GET_ONLINE_MEMBER = "group/get_online_member",
|
||||
WEB_FG_GET_ONLINE_MEMBER = "13005",--"get_online_member",
|
||||
-- 退出亲友圈
|
||||
WEB_FG_GET_OFFLINE_MEMBER = "group/get_offline_member",
|
||||
WEB_FG_GET_OFFLINE_MEMBER = "13006",--"get_offline_member",
|
||||
-------------- group-log---------------------
|
||||
-- 获取奖励日志
|
||||
WEB_FG_GET_REWARDS_LOG = "group/log/get_reward_log",
|
||||
|
|
@ -397,6 +397,8 @@ Protocol = {
|
|||
FGMGR_EVT_ENTER_CHATROOM = "13004",
|
||||
-- 聊天室协议
|
||||
FGMGR_EVT_DATA_CHATROOM = "13003",
|
||||
-- 其他成员结算游戏时推送战绩
|
||||
FGMGR_EVT_NEWCHAT = "12011",
|
||||
-- 设置是否允许观战
|
||||
WEB_FG_SET_CANWATCH = "group/set_group_guest",
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ local function list_players_Renderer(index, obj, totalScore, self)
|
|||
end
|
||||
|
||||
local function ChatItemRenderer(index, obj, self)
|
||||
|
||||
--local data = self.ChatRoomData.records[index + 1]
|
||||
local data = self.ChatRoomData[1].records[index + 1]
|
||||
local totalScore = json.decode(data.totalScore)
|
||||
|
|
@ -116,35 +115,53 @@ function FamilyChatRoom:Close()
|
|||
end
|
||||
|
||||
function FamilyChatRoom:Refalsh()
|
||||
--local data = string.sub(self.ChatRoomData[1].records, 1, -2)
|
||||
--data = data .. ']'
|
||||
pt(self.ChatRoomData[1])
|
||||
--pt(data)
|
||||
--self.records = json.decode(self.ChatRoomData[1].records)
|
||||
--self.records = json.decode(self.ChatRoomData[1].records)
|
||||
self.list_chat.numItems = #self.ChatRoomData[1].records or 0
|
||||
end
|
||||
|
||||
-- 新战绩推到时刷新一条
|
||||
function FamilyChatRoom:OnNewChatRefalsh(arg)
|
||||
local groupId = arg.gid
|
||||
local maxRound = arg.datas.maxRound
|
||||
local round = arg.datas.round
|
||||
local playerlist = arg.datas.datas
|
||||
local time = arg.datas.time
|
||||
local roomId = arg.datas.roomid
|
||||
local pid = arg.datas.pid
|
||||
local group = DataManager.groups.groupMap[groupId]
|
||||
local play = group:getPlay(pid)
|
||||
local gameName = play.game_name
|
||||
|
||||
local obj = self.list_chat:AddItemFromPool()
|
||||
local list_players = obj:GetChild("list_players")
|
||||
local tex_time = obj:GetChild("tex_time")
|
||||
local tex_name = obj:GetChild("tex_name")
|
||||
local tex_roomIdRound = obj:GetChild("tex_roomIdRound")
|
||||
|
||||
tex_time.text = os.date("游戏结算:%m月%d号 %X", time) --data.create_time
|
||||
tex_name.text = gameName
|
||||
local roundTex = round .. "/" .. maxRound
|
||||
tex_roomIdRound.text = roomId .. "\n" .. roundTex
|
||||
|
||||
for _, player in pairs(playerlist) do
|
||||
|
||||
local pObj = list_players:AddItemFromPool()
|
||||
|
||||
local tex_name = pObj:GetChild("tex_name")
|
||||
local loader_icon = pObj:GetChild("loader_icon")
|
||||
local tex_id = pObj:GetChild("tex_id")
|
||||
local tex_score = pObj:GetChild("tex_score")
|
||||
|
||||
tex_name.text = player.nick
|
||||
tex_id.text = player.accId
|
||||
tex_score.text = player.score
|
||||
ImageLoad.Load(player.portrait, loader_icon)
|
||||
end
|
||||
end
|
||||
|
||||
function FamilyChatRoom:Show()
|
||||
local cChatRoom = self.root._view:GetController("cIsChatRoom")
|
||||
cChatRoom.selectedIndex = 1
|
||||
|
||||
--[[
|
||||
GetIsOpenChatRoom(self.root._group.id, self)
|
||||
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
fgCtr:GetChatRoom(self.root._group.id, function(res)
|
||||
self:GetChatCallBack(res)
|
||||
end)
|
||||
]]
|
||||
end
|
||||
|
||||
--[[
|
||||
function FamilyChatRoom:GetChatCallBack(res)
|
||||
print("收到聊天室协议")
|
||||
pt(res)
|
||||
pt(res.Data.records.totalScore)
|
||||
end
|
||||
]]
|
||||
|
||||
return FamilyChatRoom
|
||||
|
|
@ -24,6 +24,7 @@ function FamilyEventView.new(root)
|
|||
mgr_ctr:AddEventListener(GroupMgrEvent.IsOpenChatRoom, handler(self, self._evtIsOpenChatRoom))
|
||||
mgr_ctr:AddEventListener(GroupMgrEvent.ChatRoomData, handler(self, self._evtChatRoomData))
|
||||
mgr_ctr:AddEventListener(GroupMgrEvent.OnNewApply, handler(self, self._evtOnNewApply))
|
||||
mgr_ctr:AddEventListener(GroupMgrEvent.OnNewRecord, handler(self, self._evtOnNewRecord))
|
||||
return self
|
||||
end
|
||||
|
||||
|
|
@ -146,4 +147,13 @@ function M:_evtChatRoomData(...)
|
|||
view.com_FamilyChatRoom:Refalsh()
|
||||
end
|
||||
|
||||
function M:_evtOnNewRecord(...)
|
||||
local view = ViewManager.GetCurrenView()
|
||||
if view.class ~= "FamilyMainView" then
|
||||
return
|
||||
end
|
||||
local arg = { ... }
|
||||
view.com_FamilyChatRoom:OnNewChatRefalsh(arg[1])
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
|||
|
|
@ -24,14 +24,14 @@ FamilyView = {}
|
|||
local M = FamilyView
|
||||
|
||||
local function FamilyOnline(groupId)
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
local fgCtr = ControllerManager.GetController(GroupMgrController)
|
||||
fgCtr:FG_Get_Online_Member(groupId, function(res)
|
||||
|
||||
end)
|
||||
end
|
||||
|
||||
local function FamilyOffline(groupId)
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
local fgCtr = ControllerManager.GetController(GroupMgrController)
|
||||
fgCtr:FG_Get_Offline_Member(groupId, function(res)
|
||||
|
||||
end)
|
||||
|
|
|
|||
|
|
@ -5,14 +5,20 @@ local M = ResultView
|
|||
setmetatable(M, { __index = BaseWindow })
|
||||
local self = setmetatable({}, { __index = M })
|
||||
|
||||
function M:Show()
|
||||
local obj = self._view:GetChild("Frist")
|
||||
if obj then
|
||||
local pos = obj.xy
|
||||
self._view:GetChild("Frist"):TweenMove(Vector2.New(pos.x, pos.y + 200), 1.5)
|
||||
end
|
||||
BaseWindow.Show(self)
|
||||
end
|
||||
|
||||
function M:InitView()
|
||||
self:InitMaPai()
|
||||
self:InitMaPaiShowPanel()
|
||||
|
||||
end
|
||||
|
||||
|
||||
function M:InitMaPaiShowPanel()
|
||||
self.mapaiTypeCtr = self._view:GetController("matype")
|
||||
if self.mapaiTypeCtr then
|
||||
|
|
@ -45,9 +51,7 @@ function M:InitMaPai()
|
|||
if tempMP then
|
||||
table.insert(self.maPaiList, tempMP)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function M:IsMapaiShow(niao, isShow)
|
||||
|
|
@ -56,7 +60,6 @@ function M:IsMapaiShow(niao,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
|
||||
|
|
@ -74,8 +77,6 @@ function M:HideAllMapai()
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
function M:ShowSelectMaPai(niaoList)
|
||||
if niaoList and #niaoList > 0 then
|
||||
self.maPaiCtr.selectedIndex = 1
|
||||
|
|
@ -92,8 +93,8 @@ function M:ShowSelectMaPai(niaoList)
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
function M:init(url, isBigFull)
|
||||
self._animation = false
|
||||
BaseWindow.init(self, url)
|
||||
|
||||
self:InitView()
|
||||
|
|
@ -193,7 +194,6 @@ function M:init(url,isBigFull)
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
-- 分享数据至聊天室,需在扩展填充数据,GenerateRoomResultInfo()
|
||||
function M:__ShareResultInfo()
|
||||
local info = self._resultInfo
|
||||
|
|
|
|||
|
|
@ -361,10 +361,3 @@ function ViewUtil.ShowOneInput(showText, callback)
|
|||
GRoot.inst:RemoveChild(pop_oneInput)
|
||||
end)
|
||||
end
|
||||
|
||||
function ViewUtil.TextOmit(str)
|
||||
if utf8.len(str) > 6 then
|
||||
return string.sub(str, 1, utf8.offset(s, 6)) .. "..."
|
||||
end
|
||||
return str
|
||||
end
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ function M:InitView(url)
|
|||
|
||||
btn_closeRoom.onClick:Add(handler(self, function()
|
||||
local settingView = SettingView.new(self)
|
||||
settingView:Show()
|
||||
settingView:Show(self._room)
|
||||
end))
|
||||
|
||||
--------
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ function M:InitView(url)
|
|||
|
||||
btn_closeRoom.onClick:Add(handler(self, function()
|
||||
local settingView = SettingView.new(self)
|
||||
settingView:Show()
|
||||
settingView:Show(self._room)
|
||||
end))
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ function M:InitView(url)
|
|||
|
||||
btn_closeRoom.onClick:Add(handler(self, function()
|
||||
local settingView = SettingView.new(self)
|
||||
settingView:Show()
|
||||
settingView:Show(self._room)
|
||||
end))
|
||||
|
||||
--------
|
||||
|
|
|
|||
|
|
@ -2086,6 +2086,17 @@
|
|||
<image id="xblm7jbl" name="queren_btn1.png" path="/images/"/>
|
||||
<image id="xblm7jbm" name="bt_cancel1.png" path="/images/"/>
|
||||
<component id="xblm7jbn" name="btn_bg.xml" path="/buttons/" exported="true"/>
|
||||
<component id="cbn27jbo" name="playerDetail.xml" path="/window/" exported="true"/>
|
||||
<image id="cbn27jbp" name="Rectangle 93.png" path="/images/"/>
|
||||
<image id="qmc17jbq" name="Rectangle 297.png" path="/images/" scale="9grid" scale9grid="50,48,60,42"/>
|
||||
<image id="qmc17jbr" name="CommonRes_3 4.png" path="/images/"/>
|
||||
<component id="qmc17jbs" name="btn_close.xml" path="/window/Component/"/>
|
||||
<image id="qmc17jbt" name="Rectangle 298.png" path="/images/" scale="9grid" scale9grid="38,38,103,66"/>
|
||||
<component id="qmc17jbu" name="btn_emoji.xml" path="/window/Component/"/>
|
||||
<image id="qmc17jbv" name="default3.png" path="/images/Emojies2/"/>
|
||||
<image id="qmc17jbw" name="default4.png" path="/images/Emojies2/"/>
|
||||
<image id="qmc17jbx" name="default.png" path="/images/Emojies2/"/>
|
||||
<image id="qmc17jby" name="default2.png" path="/images/Emojies2/"/>
|
||||
</resources>
|
||||
<publish name="Common" path="..\wb_unity_pro\Assets\ART\base\common\ui" packageCount="2" maxAtlasSize="2048">
|
||||
<atlas name="默认" index="0"/>
|
||||
|
|
|
|||
|
|
@ -1,18 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<component size="2532,1170" bgColor="#000000">
|
||||
<controller name="over" pages="0,,1," selected="0"/>
|
||||
<controller name="main" pages="0,,1," selected="1"/>
|
||||
<controller name="main" pages="0,,1," selected="0"/>
|
||||
<controller name="playerNum" alias="玩家数量" pages="0,两人,1,三人,2,四人" selected="0"/>
|
||||
<controller name="showType" pages="0,,1," selected="0"/>
|
||||
<displayList>
|
||||
<image id="n110_qt01" name="n110" src="qt01ys" fileName="Main_new/Main/Image/Rectangle 212.png" xy="559,651" group="n113_qt01"/>
|
||||
<component id="n111_qt01" name="btn_showClearMain" src="qt01yu" fileName="Main_new/Main/Component/btn_showClearMain.xml" xy="762,724" group="n113_qt01">
|
||||
<gearXY controller="showType" pages="1" values="1064,724" default="762,724"/>
|
||||
<image id="n110_qt01" name="n110" src="qt01ys" fileName="Main_new/Main/Image/Rectangle 212.png" xy="559,451" group="n113_qt01"/>
|
||||
<component id="n111_qt01" name="btn_showClearMain" src="qt01yu" fileName="Main_new/Main/Component/btn_showClearMain.xml" xy="762,524" group="n113_qt01">
|
||||
<gearXY controller="showType" pages="0,1" values="762,524|1064,524"/>
|
||||
</component>
|
||||
<component id="n112_qt01" name="btn_nextRound" src="qt01yt" fileName="Main_new/Main/Component/btn_nextRound.xml" xy="1366,724" group="n113_qt01">
|
||||
<component id="n112_qt01" name="btn_nextRound" src="qt01yt" fileName="Main_new/Main/Component/btn_nextRound.xml" xy="1366,524" group="n113_qt01">
|
||||
<gearDisplay controller="showType" pages="0"/>
|
||||
</component>
|
||||
<group id="n113_qt01" name="Frist" xy="559,651" size="1420,258" advanced="true">
|
||||
<group id="n113_qt01" name="Frist" xy="559,451" size="1420,258" advanced="true">
|
||||
<gearDisplay controller="main" pages="0"/>
|
||||
</group>
|
||||
<image id="n114_yry6" name="n114" src="yry6yx" fileName="Main_new/Clearing/Image/Group 239.png" xy="-3,72" group="n116_yry6"/>
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@
|
|||
<component size="64,90">
|
||||
<controller name="jing" pages="0,,1," selected="1"/>
|
||||
<displayList>
|
||||
<loader id="n0_ckvb" name="icon" xy="0,0" size="64,90" url="ui://v0j9abjyk0pa11p" align="center" fill="scaleFree" clearOnPublish="true">
|
||||
<loader id="n0_ckvb" name="icon" xy="0,0" size="64,90" url="ui://v0j9abjyk0pa126" align="center" fill="scaleFree" clearOnPublish="true">
|
||||
<relation target="" sidePair="width-width,height-height"/>
|
||||
</loader>
|
||||
<image id="n1_ckvb" name="n1" src="xblm1a5" fileName="Main_new/Main/Image/jing 1.png" xy="5,3" size="59,61" aspect="true">
|
||||
<image id="n1_ckvb" name="n1" src="xblm1a5" fileName="Main_new/Main/Image/jing 1.png" xy="5,3" size="59,61">
|
||||
<gearDisplay controller="jing" pages="1"/>
|
||||
<relation target="" sidePair="width-width%,height-height%,left-left%,top-top%"/>
|
||||
</image>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<component size="132,132" initName="gcm_info">
|
||||
<controller name="room_owner" pages="0,,1," selected="0"/>
|
||||
<controller name="bank" pages="0,,1," selected="0"/>
|
||||
<controller name="read" pages="0,,1," selected="0"/>
|
||||
<controller name="read" pages="0,,1," selected="1"/>
|
||||
<controller name="offline" pages="0,,1," selected="0"/>
|
||||
<controller name="mask_voice" pages="0,,1," selected="0"/>
|
||||
<controller name="piao_niao" pages="0,,1," selected="0"/>
|
||||
|
|
@ -37,7 +37,7 @@
|
|||
<group id="n33_e7qn" name="n33" xy="0,0" size="138,139" advanced="true">
|
||||
<relation target="" sidePair="width-width,height-height"/>
|
||||
</group>
|
||||
<image id="n8" name="ready" src="gq7m5y" fileName="font/images/game/game_fonts_01.png" xy="-1,-109">
|
||||
<image id="n8" name="ready" src="qmc11ao" fileName="images/gamexzmj_9 1.png" xy="38,166" size="55,65">
|
||||
<gearDisplay controller="read" pages="1"/>
|
||||
<relation target="" sidePair="top-bottom"/>
|
||||
</image>
|
||||
|
|
|
|||
|
|
@ -1404,7 +1404,7 @@
|
|||
<image id="u6331a2" name="button_chat.png" path="/Main_new/Main/Image/"/>
|
||||
<image id="u6331a3" name="looker.png" path="/Main_new/Main/Image/"/>
|
||||
<image id="u6331a4" name="button_desk.png" path="/Main_new/Main/Image/"/>
|
||||
<image id="xblm1a5" name="jing 1.png" path="/Main_new/Main/Image/"/>
|
||||
<image id="xblm1a5" name="jing 1.png" path="/Main_new/Main/Image/" scale9grid="80,0,160,342" disableTrim="true"/>
|
||||
<image id="xblm1a6" name="di.png" path="/Main_new/Main/Image/"/>
|
||||
<image id="xblm1a7" name="di2.png" path="/Main_new/Main/Image/"/>
|
||||
<image id="xblm1a8" name="bg.png" path="/Main_new/Main/Image/"/>
|
||||
|
|
@ -1422,6 +1422,7 @@
|
|||
<image id="xblm1al" name="Vector@3x.png" path="/component/Setting/Image/"/>
|
||||
<image id="xblm1am" name="Group 82@3x.png" path="/component/Setting/Image/"/>
|
||||
<component id="xblm1an" name="btn_gameDismissRoom.xml" path="/Main_new/Main/Component/"/>
|
||||
<image id="qmc11ao" name="gamexzmj_9 1.png" path="/images/"/>
|
||||
</resources>
|
||||
<publish name="Main_Majiang" path="..\wb_unity_pro\Assets\ART\base\main_majiang\ui" packageCount="2"/>
|
||||
</packageDescription>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.3 MiB After Width: | Height: | Size: 3.5 MiB |
Binary file not shown.
Loading…
Reference in New Issue