Files
Main/Assets/GameAssets/Resources/Lua/Logic/Friend/FriendsSystem.lua
2025-01-25 04:38:09 +08:00

708 lines
24 KiB
Lua
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

------------------------------------------------
-- 作者: 高子昱
-- 日期: 2021-03-05
-- 文件: FriendsSystem.lua
-- 模块: FriendsSystem
-- 描述: 好友系统类
------------------------------------------------
local FriendsSystem = {
--好友数据
FriendList = List:New(),
--仇人数据
EnemyList = List:New(),
--屏蔽数据
ShieldList = List:New(),
--推荐列表
RecommendInfoList = List:New(),
--查询结果
DimSelectList = List:New(),
--最近数据
RecentList = List:New(),
--请求加好友的列表
ApplyList = List:New(),
--向服务器发送通过请求的好友
ReqArgeeList = List:New(),
--向服务器发送未通过请求的好友
ReqRefuseList = List:New(),
--是否刷新列表
RefreshList = true,
--是否打开最近好友界面
OpenRecentPanel = false,
--好友界面是否显示
FriendPanelEanble = false,
--当前标签页
PageType = FriendType.Undefine,
--获取好友数据的委托
Func = nil,
--配偶Id
MarryTargetId = 0,
--赠送情谊点剩余次数
ResidueSendFriendShipCount = nil,
--接受情谊点剩余次数
ResidueReciveFriendShipCount = nil,
--今日获得的情谊点数
FriendShip = 0,
--是否有好友申请
isHaveNewFriendApply = false,
}
--初始化
function FriendsSystem:Initialize()
end
--反初始化
function FriendsSystem:UnInitialize()
self.FriendList:Clear()
self.EnemyList:Clear()
self.ShieldList:Clear()
self.RecommendInfoList:Clear()
self.DimSelectList:Clear()
self.RecentList:Clear()
self.MarryTargetId = 0
end
--跳转私聊到私聊 先加入到最近列表
function FriendsSystem:JumpToChatPrivate(roleID , roleName , career , level)
if GameCenter.GameSceneSystem:GetLocalPlayerID() == roleID then
Utils.ShowPromptByEnum("C_FRIEND_CANNOT_CHATME")
return
end
self.OpenRecentPanel = true
self:AddRelation(FriendType.Recent , roleID)
end
--判断好友是否屏蔽
function FriendsSystem:IsShield(id)
for i = 1, #self.ShieldList do
if self.ShieldList[i].playerId == id then
return true
end
end
return false
end
--判断好友是否是仇人
function FriendsSystem:IsEnemy(id)
for i = 1, #self.EnemyList do
if self.EnemyList[i].playerId == id then
return true
end
end
return false
end
--判断是否是好友
function FriendsSystem:IsFriend(id)
local isFriend = false
for i = 1, #self.FriendList do
if self.FriendList[i].playerId == id and self.FriendList[i].isFriend then
isFriend = true
end
end
-- for i = 1, #self.RecentList do
-- if self.RecentList[i].isFriend then
-- isFriend = true
-- end
-- end
return isFriend
end
--判断有没有没接收的情谊点
function FriendsSystem:IsHaveShip()
local isHaveShip = false
for i = 1, #self.FriendList do
if self:GetQYDTypeByPlayer(self.FriendList[i]) then
isHaveShip = true
end
end
if isHaveShip == false then
for i = 1, #self.RecentList do
if self:GetQYDTypeByPlayer(self.RecentList[i]) then
isHaveShip = true
end
end
end
if GameCenter.NPCFriendSystem.CurNPC ~= nil and isHaveShip == false then
isHaveShip = GameCenter.NPCFriendSystem.CurNPCShipBtnType == FriendShipType.Recvie or GameCenter.NPCFriendSystem.CurNPCShipBtnType == FriendShipType.ReSend
end
GameCenter.MainFunctionSystem:SetAlertFlag(FunctionStartIdCode.Friend, isHaveShip )
return isHaveShip
end
--获取好友信息
function FriendsSystem:GetFriend(id)
for i = 1, #self.FriendList do
if self.FriendList[i].playerId == id then
return self.FriendList[i]
end
end
return nil
end
--判断是否是推荐列表的玩家
function FriendsSystem:IsRecommend(id)
for i = 1, #self.RecommendInfoList do
if self.RecommendInfoList[i].playerId == id then
return true
end
end
return false
end
--判断是不是最近列表玩家
function FriendsSystem:IsRecent(id)
for i = 1, #self.RecentList do
if self.RecentList[i].playerId == id then
return true
end
end
return false
end
--获取姓名
function FriendsSystem:GetName(id , type)
local _name = nil
local _list = nil
if type == FriendType.Friend then
_list = self.FriendList
elseif type == FriendType.Enemy then
_list = self.EnemyList
elseif type == FriendType.Shield then
_list = self.ShieldList
elseif type == FriendType.Recent then
_list = self.RecentList
end
if _list ~= nil then
for i = 1, #_list do
if _list[i].playerID == id then
_name = _list[i].name
end
end
end
return _name
end
--获取好友信息
function FriendsSystem:GetFriendInfo(type , playerId)
local _ret = nil
local _list = nil
if type == FriendType.Friend then
_list = self.FriendList
elseif type == FriendType.Enemy then
_list = self.EnemyList
elseif type == FriendType.Shield then
_list = self.ShieldList
end
if _list ~= nil then
for i = 1, #_list do
if _list[i].playerId == playerId then
_ret = _list[i]
end
end
end
return _ret
end
--删除关系二次确认
function FriendsSystem:DeleteConfirmation(type , playerId)
local _msg = nil
if type == FriendType.Friend then
_msg = DataConfig.DataMessageString.Get("C_MSG_FRIEND_IS_DELETE_FRIEND")
elseif type == FriendType.Enemy then
_msg = DataConfig.DataMessageString.Get("C_MSG_FRIEND_IS_DELETE_ENEMY")
elseif type == FriendType.Shield then
_msg = DataConfig.DataMessageString.Get("C_MSG_FRIEND_IS_DELETE_SHIELD")
end
GameCenter.MsgPromptSystem:ShowMsgBox(_msg , DataConfig.DataMessageString.Get("C_MSGBOX_CANCEL") ,
DataConfig.DataMessageString.Get("C_MSGBOX_OK") ,
function(x)
if x == MsgBoxResultCode.Button2 then
self:DeleteRelation(type , playerId)
end
end,
false , false , 5 , CS.Thousandto.Code.Logic.MsgInfoPriority.Highest )
end
--添加仇人屏蔽二次确认
function FriendsSystem:AddConfirmation(type , playerId)
if self:IsMarryTarget(playerId) then
GameCenter.MsgPromptSystem:ShowPrompt(DataConfig.DataMessageString.Get("C_FRIENT_FUQI_PINGBI"))
return
end
local _friendInfo = self:GetFriend(playerId)
if _friendInfo ~= nil and _friendInfo.intimacy > 0 then
GameCenter.MsgPromptSystem:ShowMsgBox(DataConfig.DataMessageString.Get("C_FRIENT_PINGBI_ASK") ,
function (x)
if x == MsgBoxResultCode.Button2 then
self:AddRelation(type , playerId)
end
end
)
else
local _msg = type == FriendType.Enemy and DataConfig.DataMessageString.Get("C_MSG_FRIEND_IS_ADD_ENEMY") or DataConfig.DataMessageString.Get("C_MSG_FRIEND_IS_ADD_SHIELD")
GameCenter.MsgPromptSystem:ShowMsgBox( _msg , DataConfig.DataMessageString.Get("C_MSGBOX_CANCEL") ,
DataConfig.DataMessageString.Get("C_MSGBOX_OK"),
function (x)
if x == MsgBoxResultCode.Button2 then
self:AddRelation(type , playerId)
end
end , false , false , 5 , CS.Thousandto.Code.Logic.MsgInfoPriority.Highest )
end
end
--删除关系 1 好友 2 仇人 3 屏蔽
function FriendsSystem:DeleteRelation(type , playerId , targetServerId)
self:ReqDeleteRelation( UnityUtils.GetObjct2Int(type) , playerId)
if type == FriendType.Enemy or type == FriendType.Shield then
self:AddRelation(FriendType.Recent , playerId , targetServerId)
end
end
--添加关系 1 好友 2 仇人 3 屏蔽 5 最近
function FriendsSystem:AddRelation( type , playerId , targetServerId)
if targetServerId == nil then
targetServerId = 0
end
if type == FriendType.Friend then
local _friendMaxCount = tonumber( DataConfig.DataGlobal[1438].Params)
if #self.FriendList >= _friendMaxCount then
self:ShowInfoMsg(DataConfig.DataMessageString.Get("C_FRIEND_ADD_FULL"))
return
end
self:ShowInfoMsg(DataConfig.DataMessageString.Get("C_SendFriendApply"))
elseif type == FriendType.Enemy then
local _enemyMaxCount = tonumber( DataConfig.DataGlobal[1439].Params )
if #self.EnemyList >= _enemyMaxCount then
self:ShowInfoMsg(DataConfig.DataMessageString.Get("C_FRIEND_ADDCHOUREN_FULL"))
return
end
elseif type == FriendType.Shield then
local _shieldMaxCount = tonumber( DataConfig.DataGlobal[1440].Params )
if #self.ShieldList >= _shieldMaxCount then
self:ShowInfoMsg(DataConfig.DataMessageString.Get("C_FRIEND_ADDHEIMINGDAN_FULL"))
return
end
end
self:ReqAddRelation(type , playerId , targetServerId)
if type == FriendType.Enemy then
self:ReqAddRelation(FriendType.Recent , playerId , targetServerId)
end
end
--是否是结婚对象
function FriendsSystem:IsMarryTarget(uid)
return uid == self.MarryTargetId
end
--给列表赋值
function FriendsSystem:AddValueToList( list_1 , list_2)
list_1:Clear()
if list_2 ~= nil and #list_2 > 0 then
for i = 1, #list_2 do
list_1:Add(list_2[i])
end
end
end
--提示信息
function FriendsSystem:ShowInfoMsg( showString )
GameCenter.MsgPromptSystem:ShowPrompt(showString)
end
--排序
function FriendsSystem:OnSortData(list)
list:Sort(
function(a , b)
if a.isOnline and not b.isOnline then
return true
elseif (a.isOnline == b.isOnline) then
if a.intimacy ~= nil and b.intimacy ~= nil then
if a.intimacy > b.intimacy then
return true
elseif a.intimacy == b.intimacy then
if a.lv > b.lv then
return true
else
return false
end
else
return false
end
else
return false
end
else
return false
end
end)
end
--排序逻辑方法
--请求好友列表 1好友2仇人3屏蔽, 4请求推荐好友, 5最近聊天列表
function FriendsSystem:ReqGetRelationList(type , isShowWitingForm)
if isShowWitingForm == nil then
isShowWitingForm = true
end
if type ~= FriendType.Undefine then
local _msg = ReqMsg.MSG_Friend.ReqGetRelationList:New()
_msg.type = UnityUtils.GetObjct2Int(type)
_msg:Send()
if isShowWitingForm then
GameCenter.PushFixEvent(UIEventDefine.UI_WAITING_OPEN)
end
end
end
--外部调用 请求好友列表 1好友2仇人3屏蔽, 4请求推荐好友, 5最近聊天列表
function FriendsSystem:ReqExternalGetRelationList(type , func)
self.Func = func
local _msg = ReqMsg.MSG_Friend.ReqGetRelationList:New()
_msg.type = UnityUtils.GetObjct2Int(type)
_msg:Send()
end
--删除关系 1 好友 2 仇人 3 屏蔽
function FriendsSystem:ReqDeleteRelation(type , playerId)
local _msg = ReqMsg.MSG_Friend.ReqDeleteRelation:New()
_msg.type = type
_msg.targetPlayerId = playerId
_msg:Send()
end
--添加关系 1好友2仇人3屏蔽
function FriendsSystem:ReqAddRelation(type , playerId , targetServerId)
local _msg = ReqMsg.MSG_Friend.ReqAddRelation:New()
_msg.type = UnityUtils.GetObjct2Int(type)
_msg.targetPlayerId = playerId
_msg.targetServerId = targetServerId
_msg:Send()
end
--查找好友 ->匹配名字
function FriendsSystem:ReqDimSelect(name)
local _msg = ReqMsg.MSG_Friend.ReqDimSelect:New()
_msg.name = name
_msg:Send()
end
--举报
function FriendsSystem:ReqReport(playerId , type ,content)
local _msg = ReqMsg.MSG_Friend.ReqReport:New()
_msg.roleId = playerId
_msg.type = type
_msg.context = content
_msg:Send()
end
--服务器返回数据
function FriendsSystem:ResFriendList(msg)
if msg == nil then
return
end
GameCenter.PushFixEvent(UIEventDefine.UI_WAITING_CLOSE)
self.MarryTargetId = msg.marryTargetId
if msg.type == 1 then
self:AddValueToList(self.FriendList , msg.resultList)
self:AddValueToList(self.RecentList , msg.resultList)
self:OnSortData(self.FriendList)
GameCenter.PushFixEvent(LogicLuaEventDefine.EID_EVENT_FRIEND_FRIENDSHIP)
elseif msg.type == 2 then
self:AddValueToList(self.EnemyList , msg.resultList)
self:OnSortData(self.EnemyList)
elseif msg.type == 3 then
self:AddValueToList(self.ShieldList , msg.resultList)
elseif msg.type == 4 then
self:AddValueToList(self.RecommendInfoList , msg.resultList)
self:OnSortData(self.RecommendInfoList)
elseif msg.type == 5 then
self:AddValueToList(self.RecentList , msg.resultList)
end
if msg.type == 4 then
GameCenter.PushFixEvent(LogicEventDefine.EID_EVENT_FRIEND_UPDATE_SEARCHFRIENDPANEL , nil)
end
if self.FriendPanelEanble and self.RefreshList then
GameCenter.PushFixEvent(LogicEventDefine.EID_EVENT_FRIEND_UPDATE_FRIENDLIST , msg.type)
end
if self.Func ~= nil then
local _list = List:New()
self:AddValueToList(_list , msg.resultList)
self.Func(_list)
self.Func = nil
return
end
end
--服务器返回成功删除关系列表 //1好友2仇人3屏蔽, 4推荐好友5最近聊天列表
function FriendsSystem:ResDeleteRelationSuccess(msg)
if msg == nil then
return
end
local _list = nil
local _msgStr = nil
if msg.type == UnityUtils.GetObjct2Int(FriendType.Friend) then
_list = self.FriendList
_msgStr = DataConfig.DataMessageString.Get("C_MSG_FRIEND_DELETEFRIENDSUC")
elseif msg.type == UnityUtils.GetObjct2Int(FriendType.Enemy) then
_list = self.EnemyList
_msgStr = DataConfig.DataMessageString.Get("C_MSG_FRIEND_DELETENISUC")
elseif msg.type == UnityUtils.GetObjct2Int(FriendType.Shield) then
_list = self.ShieldList
_msgStr = DataConfig.DataMessageString.Get("C_MSG_FRIEND_DELETESHIELDSUC")
end
for i = 1, #_list do
if _list[i].playerId == msg.targetPlayerId then
_list:RemoveAt(i)
break
end
end
self:ShowInfoMsg(_msgStr)
if self.FriendPanelEanble then
self:ReqGetRelationList(self.PageType)
end
end
--服务器返回添加关系成功
function FriendsSystem:ResAddFriendSuccess(msg)
if msg == nil then
return
end
local _msgStr = nil
if msg.type == UnityUtils.GetObjct2Int(FriendType.Friend) then
self.FriendList:Add(msg.resultList)
self.RecentList:Add(msg.resultList)
self:OnSortData(self.FriendList)
elseif msg.type == UnityUtils.GetObjct2Int(FriendType.Enemy) then
self.EnemyList:Add(msg.resultList)
self:OnSortData(self.EnemyList)
_msgStr = DataConfig.DataMessageString.Get("C_MSG_FRIEND_ADDENIMYSUC")
elseif msg.type == UnityUtils.GetObjct2Int(FriendType.Shield) then
self.ShieldList:Add(msg.resultList)
for i = 1, #self.FriendList do
if self.FriendList[i].playerId == msg.resultList.playerId then
self.FriendList:RemoveAt(i)
break
end
end
self:OnSortData(self.ShieldList)
_msgStr = DataConfig.DataMessageString.Get("C_MSG_FRIEND_ADDSHIELDSUC")
elseif msg.type == UnityUtils.GetObjct2Int(FriendType.Recent) then
self.RecentList:Add(msg.resultList)
end
self:ShowInfoMsg(_msgStr)
if msg.type == UnityUtils.GetObjct2Int(FriendType.Recent) then
if self.OpenRecentPanel and not self.FriendPanelEanble then
self.OpenRecentPanel = false
GameCenter.PushFixEvent(UIEventDefine.UISocialityForm_OPEN , SocialityFormSubPanel.RecentFriend)
elseif self.OpenRecentPanel and self.FriendPanelEanble then
self.OpenRecentPanel = false
GameCenter.PushFixEvent(LogicEventDefine.EID_EVENT_FRIEND_OPEN_FRIENDPANEL , FriendType.Recent)
end
return
end
if self.FriendPanelEanble then
self:ReqGetRelationList(self.PageType)
end
end
--服务器返回查询结果
function FriendsSystem:ResDimSelectList(msg)
if msg == nil then
return
end
if msg.list == nil or #msg.list == 0 then
GameCenter.MsgPromptSystem:ShowPrompt(DataConfig.DataMessageString.Get("C_FRIEND_ID_ERROR"))
return
end
self:AddValueToList(self.DimSelectList , msg.list)
GameCenter.PushFixEvent(LogicEventDefine.EID_EVENT_FRIEND_UPDATE_SEARCHFRIENDPANEL , FriendType.Search)
end
--服务器返回好友申请个人请求
function FriendsSystem:ResApproval(msg)
local isNew = true
for i = 1, #self.ApplyList do
if msg.playerId == self.ApplyList[i].playerId then
--已经包含了玩家,新增
isNew = false
break
end
end
if isNew then
self.ApplyList:Add(msg)
GameCenter.MsgPromptSystem:ShowPrompt(DataConfig.DataMessageString.Get("C_GetFriendApply"))
GameCenter.PushFixEvent(LogicLuaEventDefine.EID_EVENT_FRIENDAPPLY_REFESH)
GameCenter.PushFixEvent(LogicLuaEventDefine.EID_EVENT_FRIEND_UPDATE_NEWFRIENDNOTIC, true)
self.isHaveNewFriendApply = true
end
end
--判断情谊点按钮状态
function FriendsSystem:GetQYDTypeByInfo(msg)
local playerInfo
if msg.npcFriendInfo then
playerInfo = msg.npcFriendInfo
elseif msg.friendInfo then
playerInfo = msg.friendInfo
end
local QYDSendR = Utils.SplitStr( DataConfig.DataGlobal[GlobalName.qingyi_send_goods_max].Params , "_")
local QYDReciveR = Utils.SplitStr( DataConfig.DataGlobal[GlobalName.qingyi_recive_goods_max].Params , "_")
local type = FriendShipType.Send
if not playerInfo.isGiveFriendshipPoint and not playerInfo.isReceiveFriendshipPoint and not playerInfo.isFriendshipPointAward then
type = FriendShipType.Send
elseif playerInfo.isGiveFriendshipPoint and not playerInfo.isReceiveFriendshipPoint and not playerInfo.isFriendshipPointAward then
type = FriendShipType.HadSend
local str = ""
if msg.residueGiveRewardCount > 0 then
str = UIUtils.CSFormat(DataConfig.DataMessageString.Get("C_FRIENDSHIP_NOTIC_1"), QYDSendR[1] ,msg.residueGiveRewardCount)
else
str = DataConfig.DataMessageString.Get("C_FRIENDSHIP_NOTIC_3")
end
GameCenter.MsgPromptSystem:ShowPrompt(str)
--判断是npc 自动回赠
if msg.npcFriendInfo ~= nil then
GameCenter.PushFixEvent(LogicLuaEventDefine.EID_EVENT_NPCFRIENFTRIGGERTYPE_SENDSHIP,1)--1 = 我赠送给npc npc说话
GameCenter.FriendSystem:ReqNpcFriendGiveShipPoint(msg.npcFriendInfo.npcId)
end
elseif not playerInfo.isGiveFriendshipPoint and playerInfo.isReceiveFriendshipPoint and not playerInfo.isFriendshipPointAward then
type = FriendShipType.ReSend
local str = ""
if msg.residueReceiveRewardCount > 0 then
str = UIUtils.CSFormat(DataConfig.DataMessageString.Get("C_FRIENDSHIP_NOTIC_2"), QYDReciveR[1] ,msg.residueReceiveRewardCount)
else
str = DataConfig.DataMessageString.Get("C_FRIENDSHIP_NOTIC_4")
end
GameCenter.MsgPromptSystem:ShowPrompt(str)
if msg.npcFriendInfo ~= nil then
GameCenter.PushFixEvent(LogicLuaEventDefine.EID_EVENT_NPCFRIENFTRIGGERTYPE_SENDSHIP,2)--2 = npc赠送给我 npc说话
end
elseif playerInfo.isGiveFriendshipPoint and playerInfo.isReceiveFriendshipPoint and not playerInfo.isFriendshipPointAward then
type = FriendShipType.Recvie
elseif playerInfo.isGiveFriendshipPoint and playerInfo.isReceiveFriendshipPoint and playerInfo.isFriendshipPointAward then
type = FriendShipType.Done
local str = ""
if msg.residueReceiveRewardCount > 0 then
str = UIUtils.CSFormat(DataConfig.DataMessageString.Get("C_FRIENDSHIP_NOTIC_5"), QYDReciveR[1] ,msg.residueReceiveRewardCount)
else
str = DataConfig.DataMessageString.Get("C_FRIENDSHIP_NOTIC_6")
end
GameCenter.MsgPromptSystem:ShowPrompt(str)
end
return type
end
--单独判断情谊点按钮状态
function FriendsSystem:GetQYDTypeByPlayer(data)
local playerInfo = nil
if data.isGiveFriendshipPoint ~= nil then
playerInfo = data
else
playerInfo = data[1]
end
local type = FriendShipType.Send
if not playerInfo.isGiveFriendshipPoint and not playerInfo.isReceiveFriendshipPoint and not playerInfo.isFriendshipPointAward then
type = FriendShipType.Send
elseif playerInfo.isGiveFriendshipPoint and not playerInfo.isReceiveFriendshipPoint and not playerInfo.isFriendshipPointAward then
type = FriendShipType.HadSend
elseif not playerInfo.isGiveFriendshipPoint and playerInfo.isReceiveFriendshipPoint and not playerInfo.isFriendshipPointAward then
type = FriendShipType.ReSend
elseif playerInfo.isGiveFriendshipPoint and playerInfo.isReceiveFriendshipPoint and not playerInfo.isFriendshipPointAward then
type = FriendShipType.Recvie
elseif playerInfo.isGiveFriendshipPoint and playerInfo.isReceiveFriendshipPoint and playerInfo.isFriendshipPointAward then
type = FriendShipType.Done
end
if type == FriendShipType.ReSend or type == FriendShipType.Recvie then
return true
else
return false
end
end
--服务器返回好友申请列表
function FriendsSystem:ResApprovalList(msg)
self.ApplyList = msg
if #self.ApplyList > 0 then
self.isHaveNewFriendApply = true
GameCenter.PushFixEvent(LogicLuaEventDefine.EID_EVENT_FRIEND_UPDATE_NEWFRIENDNOTIC, true)
else
self.isHaveNewFriendApply = false
GameCenter.PushFixEvent(LogicLuaEventDefine.EID_EVENT_FRIEND_UPDATE_NEWFRIENDNOTIC, false)
end
GameCenter.PushFixEvent(LogicLuaEventDefine.EID_EVENT_FRIENDAPPLY_REFESH)
end
--服务器返回好友审批结果
function FriendsSystem:ResApprovalResult(msg , type)
if type == 1 then
GameCenter.MsgPromptSystem:ShowPrompt(DataConfig.DataMessageString.Get("C_MSG_FRIEND_ADDFRIEND_SUCESS"))
elseif type == 2 then
GameCenter.MsgPromptSystem:ShowPrompt(DataConfig.DataMessageString.Get("C_RefuseFriendApply"))
end
self.ApplyList = msg
GameCenter.PushFixEvent(LogicLuaEventDefine.EID_EVENT_FRIENDAPPLY_REFESH)
end
--获取好友申请列表
function FriendsSystem:GetApplyList()
return self.ApplyList
end
--同意添加好友的同意列表
function FriendsSystem:ArgeeListAdd(info)
self.ReqArgeeList:Clear()
self.ReqRefuseList:Clear()
self.ReqArgeeList:Add(info)
end
--拒绝添加好友的拒绝列表
function FriendsSystem:RefuseListAdd(info)
self.ReqRefuseList:Clear()
self.ReqArgeeList:Clear()
self.ReqRefuseList:Add(info)
end
--向服务器发送申请结果
function FriendsSystem:ReqApplyResult()
local _msg = ReqMsg.MSG_Friend.ReqAddFriendApproval:New()
_msg.agreeList = self.ReqArgeeList
_msg.declineList = self.ReqRefuseList
_msg:Send()
end
--向服务器发送情谊点请求
function FriendsSystem:ReqFriendShipEvent(type , playerId , isNpc)
local _msg = ReqMsg.MSG_Friend.ReqGiveFriendShipPoint:New()
if isNpc == nil then
isNpc = 1
end
_msg.type = type
_msg.friendPlayerId = playerId
_msg.friendType = isNpc
_msg:Send()
end
function FriendsSystem:ReqNpcFriendGiveShipPoint(id)
local _msg = ReqMsg.MSG_Friend.ReqNpcFriendGiveShipPoint:New()
_msg.npcId = id
_msg:Send()
end
return FriendsSystem