Пример #1
0
 //查看好友信息
 public static void LookFriendManorInfo(CSQueryOther csQueryOther, Action <SCManorFriendData> ResponseSCManorFriendDataCallBack)
 {
     if (StaticData.IsUsedLocalDataNotServer)
     {
         //测试
         SCManorFriendData scManorFriendData = new SCManorFriendData()
         {
         };
         SCManorStruct scManorStruct = new SCManorStruct()
         {
             SoilId         = 1001,
             SoilType       = ManorScene.Tile,
             CropGoodId     = 0,
             Yield          = 0,
             TotalYield     = 0,
             SoilStatus     = 0,
             Xaxle          = -8.4338960647583f,
             Yaxle          = 12.0527410507202f,
             NextTime       = 0,
             ParcelDivision = 1
         };
         scManorFriendData.OtherManorInfo.Add(scManorStruct);
         ResponseSCManorFriendDataCallBack(scManorFriendData);
     }
     else
     {
         ProtocalManager.Instance().SendCSQueryOther(csQueryOther, ResponseSCManorFriendDataCallBack, (error) => { }, false);
     }
 }
Пример #2
0
    /// <summary>
    ///
    /// </summary>
    /// <param name="friendId">-1 表示自己</param>
    public async UniTask EnterManor(long friendId)
    {
        if (friendId == -1)
        {//自己
            StaticData.DataDot(Company.Cfg.DotEventId.OpenManor);
            StaticData.idPreEnterManor = -1;
            CSEmptyManorInfo csEmptyManorInfo = new CSEmptyManorInfo();
            ManorProtocalHelper.GetSelfManorInfo(csEmptyManorInfo, async(scManorData) =>
            {
                Root2dSceneManager._instance.isFriendManor = false;
                //设置头像信息
                StaticData.SetPlayerIconInfo();
                Root2dSceneManager._instance.UnlockAreaInfoSelf = scManorData.UnlockAreaInfo;
                // add_by_wsf
                mouseManorManager.playerUid = StaticData.Uid;
                // add_by_wsf end
                await GenerateExistPlants(scManorData.ManorInfo, false);
                SetRegionsUnLockInfoState();
                //根据本地数据恢复相机参数
                worldCameraComponent.SetWorldCameraParam();
                //判定是不是有公棚
                SetCameraToWorkShedRegion();
                //是否触发Avg动画
                if (LocalInfoData.localManorInfoData != null && LocalInfoData.localManorInfoData.isFirstAvgDialogFinish == false)
                {
                    //打开对话框
                    var UIDialogGo = await UIComponent.CreateUIAsync(UIType.UIManorUnLockRegionDialog);
                    UIDialogGo.GetComponent <UIManorUnLockRegionDialogComponent>().BeginFirstAVGDialog();
                }
            });
        }
        else
        {//好友
            StaticData.DataDot(Company.Cfg.DotEventId.EnterFriendManor);
            //新手引导
            if (friendId == 1 && StaticData.isOpenGuide && GuideCanvasComponent._instance != null && GuideCanvasComponent._instance.CurrExecuteGuideLittleStepDefine.Id == 10023)
            {
                CSEmptyManorGuidance csEmptyManorGuidance = new CSEmptyManorGuidance()
                {
                };
                ManorProtocalHelper.LookFriendGuide(csEmptyManorGuidance, async(scManorData) =>
                {
                    Root2dSceneManager._instance.isFriendManor = true;
                    //设置头像信息
                    StaticData.SetPlayerIconInfo();
                    Root2dSceneManager._instance.UnlockAreaInfoFriend = scManorData.UnlockAreaInfo;
                    StaticData.GetUIWorldHandleComponent().IdFriend   = friendId;
                    mouseManorManager.playerUid = friendId;
                    SetFriendGuideStealClass(scManorData.ManorInfo);
                    await GenerateExistPlants(scManorData.ManorInfo, true);
                    SetRegionsUnLockInfoState();
                });
                return;
            }
            CSQueryOther csQueryOther = new CSQueryOther()
            {
                OtherUid = friendId
            };
            ManorProtocalHelper.LookFriendManorInfo(csQueryOther, async(scManorData) =>
            {
                Root2dSceneManager._instance.isFriendManor = true;
                //设置头像信息
                StaticData.SetPlayerIconInfo();
                Root2dSceneManager._instance.UnlockAreaInfoFriend = scManorData.UnlockAreaInfo;
                StaticData.GetUIWorldHandleComponent().IdFriend   = friendId;
                // add_by_wsf
                mouseManorManager.playerUid = friendId;
                // add_by_wsf end

                //设置是否能偷的状态
                SetFriendManorListStealClass(scManorData);
                await GenerateExistPlants(scManorData.OtherManorInfo, true);
                SetRegionsUnLockInfoState();
            });
        }
    }
Пример #3
0
        public void SendCSQueryOther(CSQueryOther csqueryother, Action <SCManorFriendData> ResponseSCManorFriendDataCallBack, Action <ErrorInfo> errorCallBack, bool isShowDefaultTip = true)
        {
            OpCodeType opCodeType = ListOPRelation.GetOpCodeTypeByRequest <CSQueryOther> ();

            ProtoSendMethod.BusinessRequest <SCManorFriendData>(csqueryother, opCodeType, ResponseSCManorFriendDataCallBack, errorCallBack, isShowDefaultTip);
        }