/// <summary> /// 请求好友操作 /// </summary> public static void SendRelationApplyCommand(long event_idx, long char_idx, eRelationApplyCmd cmd) { c2ss.RelationApplyCmd msg = PacketPools.Get(c2ss.msg.RELATION_APPLY_CMD) as c2ss.RelationApplyCmd; msg.event_idx = event_idx; msg.target_char_idx = char_idx; msg.cmd = cmd; ClientNetManager.Instance.Send(msg); }
/// <summary> /// 操作 /// </summary> private void OnRelationApplyCommand(PacketBase packet) { c2ss.RelationApplyCmd msg = packet as c2ss.RelationApplyCmd; Player player = UnitManager.Instance.GetPlayerByClientUID(msg.client_uid); if (player == null) { Log.Debug("OnRelationApply 未找到unit:" + msg.client_uid.srv_uid + ", " + msg.client_uid.conn_idx); return; } MemberRelation relation = RelationManager.Instance.GetMember(player.char_idx); if (relation != null) { relation.ApplyCommandClient(msg.event_idx, msg.target_char_idx, msg.cmd); } }