Merge branch 'game' of http://192.168.31.100:3000/fatiao/ro-webgl into game
This commit is contained in:
commit
866f8625ae
@ -592,6 +592,7 @@ local UIEventNames = {
|
||||
EID_FRUIT_SETTLE = id(),
|
||||
|
||||
EID_DANMU_INPUT_NTF = id(),
|
||||
EID_CHAT_STORY_REWARD = id()
|
||||
}
|
||||
|
||||
return UIEventNames
|
||||
@ -53,6 +53,9 @@ function StoryData:RegisterNetEvents()
|
||||
ManagerContainer.NetManager:NetRegister(ProtoMsgId.SC_ROLE_STORY_ACK, function(data)
|
||||
if data.error == Enum.NetErrorCode.ERROR_OK then
|
||||
self:RefreshStoryData(data.story_id)
|
||||
if data.story_rewards and #data.story_rewards > 0 then
|
||||
ManagerContainer.LuaEventMgr:Dispatch(UIEventNames.EID_CHAT_STORY_REWARD, data.story_rewards)
|
||||
end
|
||||
end
|
||||
end)
|
||||
ManagerContainer.NetManager:NetRegister(ProtoMsgId.SC_NEW_MAP_CARTOON_ACK, function(data)
|
||||
@ -126,15 +129,30 @@ function StoryData:GetStateStoryChapterId(id)
|
||||
end
|
||||
|
||||
function StoryData:IsRecord(storyId)
|
||||
if self.data.storyDatas[storyId] and self.data.storyDatas[storyId]==1 then
|
||||
if self.data.storyDatas[storyId] and self.data.storyDatas[storyId] > 0 then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
function StoryData:Record(storyId, idx)
|
||||
self.data.storyDatas[storyId] = idx
|
||||
ManagerContainer.NetManager:SendMessage(ProtoMsgId.CS_ROLE_STORY_REQ, {story_id = {key = storyId, value = idx or 0}})
|
||||
local STORY_GET_REWARD_TAG = 8
|
||||
function StoryData:IsGetReward(storyId)
|
||||
if self.data.storyDatas[storyId] and self.data.storyDatas[storyId] == STORY_GET_REWARD_TAG then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
function StoryData:RecordGetReward(storyId)
|
||||
self:Record(storyId, STORY_GET_REWARD_TAG)
|
||||
end
|
||||
|
||||
function StoryData:Record(storyId, val)
|
||||
if self.data.storyDatas[storyId] and val < self.data.storyDatas[storyId] then
|
||||
return
|
||||
end
|
||||
self.data.storyDatas[storyId] = val
|
||||
ManagerContainer.NetManager:SendMessage(ProtoMsgId.CS_ROLE_STORY_REQ, {story_id = {key = storyId, value = val or 0}})
|
||||
end
|
||||
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
|
||||
äÌ
|
||||
ÞÛ
|
||||
login.protoserverproto
|
||||
user.proto"0
|
||||
|
||||
@ -701,14 +701,15 @@ param_list (
R paramList"o
|
||||
SCPlayerBattleRecordAck
|
||||
error (Rerror>
|
||||
record_list (2.serverproto.BattleRecordInfoR
|
||||
recordList"Ž
|
||||
recordList"É
|
||||
SCPlayerBattleDataChangeNtf(
|
||||
last_income_time (RlastIncomeTime
|
||||
map_level (
RmapLevel
|
||||
map_id (
RmapId&
|
||||
max_income_time (R
maxIncomeTime?
|
||||
quick_battle (2.serverproto.QuickBattleDataRquickBattle(
|
||||
reward_map_count (
RrewardMapCount"
|
||||
reward_map_count (
RrewardMapCount9
|
||||
fruit_income_reward_point (
RfruitIncomeRewardPoint"
|
||||
CSGetMapRankReq"¨
|
||||
SCGetMapRankAck
|
||||
error (Rerror
|
||||
@ -982,10 +983,11 @@ targetName"u
|
||||
Story (RStory4
|
||||
map_cart (2.serverproto.KeyValueTypeRmapCart"F
|
||||
CSRoleStoryReq4
|
||||
story_id (2.serverproto.KeyValueTypeRstoryId"\
|
||||
story_id (2.serverproto.KeyValueTypeRstoryId"œ
|
||||
SCRoleStoryAck
|
||||
error (Rerror4
|
||||
story_id (2.serverproto.KeyValueTypeRstoryId"J
|
||||
story_id (2.serverproto.KeyValueTypeRstoryId>
|
||||
story_rewards (2.serverproto.KeyValueTypeRstoryRewards"J
|
||||
CSNewMapCartoonReq4
|
||||
map_cart (2.serverproto.KeyValueTypeRmapCart"`
|
||||
SCNewMapCartoonAck
|
||||
@ -2672,4 +2674,66 @@ rewardList"M
|
||||
exp (Rexp
|
||||
group (Rgroup"O
|
||||
SCLevelupSummonStartupNtf2
|
||||
info (2.serverproto.LevelupSummonInfoRinfobproto3
|
||||
info (2.serverproto.LevelupSummonInfoRinfo"V
|
||||
CSFruitJoinReq
|
||||
uid (Ruid
|
||||
room_no (RroomNo
|
||||
chip_num (RchipNum"ì
|
||||
SCFruitJoinAck
|
||||
uid (Ruid
|
||||
error (Rerror
|
||||
stage (Rstage
|
||||
sec (Rsec
|
||||
my_chip_num (R myChipNum"
|
||||
pool_chip_num (RpoolChipNum@
|
||||
total_bet_info (2.serverproto.FruitSlotInfoRtotalBetInfo:
|
||||
my_bet_info (2.serverproto.FruitSlotInfoR myBetInfo%
|
||||
settle_history (R
settleHistory(
|
||||
curr_award_slots
|
||||
(RcurrAwardSlots(
|
||||
curr_target_slot (RcurrTargetSlotM
|
||||
player_award_rank (2!.serverproto.FruitPlayerAwardInfoRplayerAwardRank"<
|
||||
CSFruitLeaveReq
|
||||
uid (Ruid
|
||||
room_no (RroomNo"9
|
||||
SCFruitLeaveAck
|
||||
uid (Ruid
|
||||
error (Rerror"X
|
||||
CSFruitBetReq
|
||||
uid (Ruid5
|
||||
bet_info (2.serverproto.FruitSlotInfoRbetInfo"ù
|
||||
SCFruitBetAck
|
||||
uid (Ruid
|
||||
error (Rerror
|
||||
my_chip_num (R myChipNum"
|
||||
pool_chip_num (
RpoolChipNum@
|
||||
total_bet_info (2.serverproto.FruitSlotInfoRtotalBetInfo:
|
||||
my_bet_info (2.serverproto.FruitSlotInfoR myBetInfo"ÿ
|
||||
SCFruitSettleNtf
|
||||
uid (Ruid
|
||||
my_chip_num (R myChipNum
|
||||
|
||||
award_type (R awardType$
|
||||
award_chip_num (RawardChipNum
|
||||
award_slots (R
|
||||
awardSlotsB
|
||||
award_chip_info (2.serverproto.FruitSlotInfoR
awardChipInfo%
|
||||
settle_history (R
settleHistory
|
||||
|
||||
start_slot (R startSlot
|
||||
target_slot (R
|
||||
targetSlot(
|
||||
add_reward_point
|
||||
(
RaddRewardPoint"&
|
||||
SCFruitStartBetNtf
|
||||
uid (Ruid"<22>
|
||||
SCFruitSecTickNtf
|
||||
uid (Ruid
|
||||
sec (Rsec"
|
||||
pool_chip_num (
RpoolChipNum@
|
||||
total_bet_info (2.serverproto.FruitSlotInfoRtotalBetInfo"›
|
||||
SCFruitPlayerAwardRankNtf
|
||||
uid (Ruid
|
||||
|
||||
award_type (R awardTypeM
|
||||
player_award_rank (2!.serverproto.FruitPlayerAwardInfoRplayerAwardRankbproto3
|
||||
@ -1,5 +1,5 @@
|
||||
|
||||
<EFBFBD>Û
|
||||
ÞÛ
|
||||
login.protoserverproto
|
||||
user.proto"0
|
||||
|
||||
@ -983,10 +983,11 @@ targetName"u
|
||||
Story (RStory4
|
||||
map_cart (2.serverproto.KeyValueTypeRmapCart"F
|
||||
CSRoleStoryReq4
|
||||
story_id (2.serverproto.KeyValueTypeRstoryId"\
|
||||
story_id (2.serverproto.KeyValueTypeRstoryId"œ
|
||||
SCRoleStoryAck
|
||||
error (Rerror4
|
||||
story_id (2.serverproto.KeyValueTypeRstoryId"J
|
||||
story_id (2.serverproto.KeyValueTypeRstoryId>
|
||||
story_rewards (2.serverproto.KeyValueTypeRstoryRewards"J
|
||||
CSNewMapCartoonReq4
|
||||
map_cart (2.serverproto.KeyValueTypeRmapCart"`
|
||||
SCNewMapCartoonAck
|
||||
|
||||
@ -239,6 +239,10 @@ function UIChatCtr:OnStoryChatFinish()
|
||||
-- end
|
||||
end
|
||||
|
||||
function UIChatCtr:GetStoryChatReward(storyId)
|
||||
ManagerContainer.DataMgr.StoryData:Record(storyId, 8)
|
||||
end
|
||||
|
||||
function UIChatCtr:GetCurrStoryPerformCfgId(storyId)
|
||||
return self.currStoryPerformCfgId
|
||||
end
|
||||
|
||||
@ -57,6 +57,13 @@ function UIChatView:AddEventListener()
|
||||
self:RefreshMessageTab()
|
||||
self:RefreshChatLayer2(channelId)
|
||||
end)
|
||||
ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.EID_CHAT_STORY_REWARD, function(story_rewards)
|
||||
local rewards = {}
|
||||
for k, v in pairs(story_rewards) do
|
||||
table.insert(rewards,{cfgId = v.key, num = v.value})
|
||||
end
|
||||
ManagerContainer.LuaUIMgr:Open(Enum.UIPageName.UIPOPGot, {rewards = rewards})
|
||||
end)
|
||||
end
|
||||
|
||||
function UIChatView:FillContent(data, uiBase)
|
||||
@ -718,15 +725,21 @@ function UIChatView:RefreshMessageTab()
|
||||
end
|
||||
if #worldHeadIcons >= 9 then break end
|
||||
end
|
||||
if #worldHeadIcons > 0 then
|
||||
table.insert(chatTabDataList, {
|
||||
chatType = ChatType.Group,
|
||||
channelId = CONST_CHANNEL_WORLD,
|
||||
title = "世界",
|
||||
headIcons = worldHeadIcons,
|
||||
subTitle = worldChats[#worldChats].fromData.nickname..": "..worldChats[#worldChats].message.message,
|
||||
})
|
||||
|
||||
local worldTitle = "世界"
|
||||
local worldSubTitle = "给世界发一条消息吧!"
|
||||
if #worldHeadIcons > 0 and worldChats[#worldChats].fromData then
|
||||
worldSubTitle = worldChats[#worldChats].fromData.nickname..": "..worldChats[#worldChats].message.message
|
||||
else
|
||||
worldHeadIcons = {"Heads/head_100102"}
|
||||
end
|
||||
table.insert(chatTabDataList, {
|
||||
chatType = ChatType.Group,
|
||||
channelId = CONST_CHANNEL_WORLD,
|
||||
title = worldTitle,
|
||||
headIcons = worldHeadIcons,
|
||||
subTitle = worldSubTitle
|
||||
})
|
||||
|
||||
-------------------------- 2. 公会群聊 --------------------------
|
||||
local guildChats = ManagerContainer.DataMgr.ChatData:GetGuildChatDatas()
|
||||
@ -762,6 +775,7 @@ function UIChatView:RefreshMessageTab()
|
||||
for i = 1, #storyChatDatas do
|
||||
local storyCfg = storyChatDatas[i]
|
||||
local firstStoryPerformCfg = ManagerContainer.CfgMgr:GetFirstStoryPerformCfg(storyCfg.StoryId)
|
||||
LogError("firstStoryPerformCfg: "..Inspect(firstStoryPerformCfg))
|
||||
local headImg, name
|
||||
if firstStoryPerformCfg.SpeakSite == 1 then
|
||||
headImg = firstStoryPerformCfg.LeftImg
|
||||
@ -1005,6 +1019,7 @@ function UIChatView:EnterChatLayer2(channelId, storyData)
|
||||
self.chatLayer2.titleBarReturnBtn.button.interactable = true
|
||||
end
|
||||
local storyRecordDatas = ManagerContainer.DataMgr.StoryData:GetStoryDatas()
|
||||
LogError("storyRecordDatas: "..Inspect(storyRecordDatas))
|
||||
if true or not storyRecordDatas[storyData.StoryId] then
|
||||
self:SetUIStoryMode(true)
|
||||
self.controller:StartStoryChat(storyData.Id, newMessageNtfFunc, chatInputNtfFunc, storyPlayFinishNtfFunc, true)
|
||||
@ -1013,6 +1028,8 @@ function UIChatView:EnterChatLayer2(channelId, storyData)
|
||||
self:SetUIStoryMode(false)
|
||||
end
|
||||
self:RefreshChatLayer2(channelId, storyData)
|
||||
|
||||
self.controller:GetStoryChatReward(storyData.StoryId)
|
||||
else
|
||||
self:SetUIStoryMode(false)
|
||||
self:RefreshChatLayer2(channelId, storyData)
|
||||
@ -1093,6 +1110,7 @@ function UIChatView:RefreshChatLayer2(channelId, storyData)
|
||||
|
||||
-- private chat
|
||||
else
|
||||
self.currChatData.chats = {}
|
||||
local privateChats = ManagerContainer.DataMgr.ChatData:GetPrivateSortChatDatas()
|
||||
for k, v in pairs(privateChats) do
|
||||
if v.fromData.uid == channelId then
|
||||
@ -1113,7 +1131,9 @@ function UIChatView:RefreshChatLayer2(channelId, storyData)
|
||||
-- subType = 7
|
||||
-- }
|
||||
-- })
|
||||
self.chatLayer2.titleBarText.text.text = self.currChatData.fromData.nickname
|
||||
if self.currChatData.fromData then
|
||||
self.chatLayer2.titleBarText.text.text = self.currChatData.fromData.nickname
|
||||
end
|
||||
|
||||
local datas = self.currChatData.chats
|
||||
local max = datas and #datas or 0
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user