Inheritance: global::ProtoBuf.IExtensible
Example #1
0
 private void HandleRemoveFriend(NodeMessage msg, int handle, uint seq)
 {
     GameFrameworkMessage.NodeMessageWithGuid nodeMsg = msg.m_NodeHeader as GameFrameworkMessage.NodeMessageWithGuid;
     if (null != nodeMsg)
     {
         GameFrameworkMessage.Msg_CL_RemoveFriend protoData = msg.m_ProtoData as GameFrameworkMessage.Msg_CL_RemoveFriend;
         if (null != protoData)
         {
             UserThread userThread = m_UserProcessScheduler.GetUserThread(nodeMsg.m_Guid);
             if (null != userThread)
             {
                 userThread.QueueAction(userThread.RemoveFriend, nodeMsg.m_Guid, protoData);
             }
         }
     }
 }
        internal void RemoveFriend(ulong guid, Msg_CL_RemoveFriend msg)
        {
            UserInfo userInfo = GetUserInfo(guid);
            if (null != userInfo) {
                FriendInfo friendInfo = userInfo.FriendInfos.Find(fi => fi.FriendGuid == msg.m_FriendGuid);
                if (null != friendInfo) {
                    friendInfo.Deleted = true;

                    Msg_LC_RemoveFriend retMsg = new Msg_LC_RemoveFriend();
                    retMsg.m_FriendGuid = msg.m_FriendGuid;
                    NotifyUser(guid, LobbyMessageDefine.Msg_LC_RemoveFriend, retMsg);
                }
            }
        }
 internal void RemoveFriend(ulong friendGuid)
 {
     try {
         NodeMessage msg = new NodeMessage(LobbyMessageDefine.Msg_CL_RemoveFriend);
         msg.SetHeaderWithGuid(m_Guid);
         Msg_CL_RemoveFriend protoData = new Msg_CL_RemoveFriend();
         protoData.m_FriendGuid = friendGuid;
         msg.m_ProtoData = protoData;
         SendMessage(msg);
     } catch (Exception ex) {
         LogSystem.Error("Exception:{0}\n{1}", ex.Message, ex.StackTrace);
     }
 }