private async ETTask RunAsync(Player player, C2L_RefreshRelationshipApply message, Action <L2C_RefreshRelationshipApply> reply)
        {
            L2C_RefreshRelationshipApply response = new L2C_RefreshRelationshipApply();

            try
            {
                long uid = player.uid;
                List <RelationshipApplyInfo> relationApplyInfos = null;
                if (message.IsRequested)
                {
                    relationApplyInfos = await RelationshipDataHelper.GetRelationshipApplyInfoBySenderUid(uid);
                }
                else
                {
                    relationApplyInfos = await RelationshipDataHelper.GetRelationshipApplyInfoByReceiverUid(uid);
                }
                response.TotalCount = relationApplyInfos.Count;
                response.RelationshipApplyList.AddRange(relationApplyInfos);
                response.Error = ErrorCode.ERR_Success;
                reply(response);
            }
            catch (Exception e)
            {
                ReplyError(response, e, reply);
            }
        }
예제 #2
0
        private async ETVoid RunAsync(Player player, C2L_GetRelationshipApplyList message, Action <L2C_GetRelationshipApplyList> reply)
        {
            L2C_GetRelationshipApplyList response = new L2C_GetRelationshipApplyList();

            try
            {
                long uid = player.uid;
                if (uid == 0)
                {
                    //未被Gate授權的帳戶
                    response.Error = ErrorCode.ERR_ConnectGateKeyError;
                }
                else
                {
                    List <RelationshipApplyInfo> relationApplyInfos = null;
                    if (message.IsRequested)
                    {
                        relationApplyInfos = await RelationshipDataHelper.GetRelationshipApplyInfoBySenderUid(uid);
                    }
                    else
                    {
                        relationApplyInfos = await RelationshipDataHelper.GetRelationshipApplyInfoByReceiverUid(uid);
                    }
                    response.TotalCount = relationApplyInfos.Count;
                    response.RelationshipApplyList.AddRange(relationApplyInfos);
                }
                response.Error = ErrorCode.ERR_Success;
                reply(response);
            }
            catch (Exception e)
            {
                ReplyError(response, e, reply);
            }
        }