Files
JJBB/Assets/Project/Script/GameLogic/NetWork/PacketHandler/GC_ADDFRIENDHandler.cs
2024-08-23 15:49:34 +08:00

45 lines
1.5 KiB
C#
Raw 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.

//This code create by CodeEngine
using System;
using Module.Log;
using Google.ProtocolBuffers;
using System.Collections;
namespace SPacket.SocketInstance
{
public class GC_ADDFRIENDHandler : Ipacket
{
public uint Execute(PacketDistributed ipacket)
{
GC_ADDFRIEND packet = (GC_ADDFRIEND)ipacket;
if (null == packet)
return (uint)PACKET_EXE.PACKET_EXE_ERROR;
if (null != GameManager.gameManager.PlayerDataPool.FriendList)
{
Relation _relation = new Relation();
_relation.Guid = packet.Guid;
_relation.Name = packet.Name;
_relation.Level = packet.Level;
_relation.Profession = packet.Prof;
_relation.CombatNum = packet.Combat;
_relation.State = packet.State;
_relation.TimeInfo = packet.TimeInfo;
_relation.FriendPoint = packet.IntimacyDegree;
if (GameManager.gameManager.PlayerDataPool.FriendList.AddRelation(_relation))
{
if (Singleton<ObjManager>.Instance.MainPlayer != null)
{
Singleton<ObjManager>.Instance.MainPlayer.SendNoticMsg(false, "#{2393}");
}
}
}
//更新好友界面如果未打开则UpdateFriendList不处理
if (null != GUIData.delFriendDataUpdate) GUIData.delFriendDataUpdate();
return (uint)PACKET_EXE.PACKET_EXE_CONTINUE;
}
}
}