示例#1
0
 public void SetRemotePlayerData(RemotePlayer data1, RemotePlayerDetail data2)
 {
     if (data1 == null || data2 == null)
     {
         Debug.LogError(new object[]
         {
             "data1 == null || data2 == null"
         });
         return;
     }
     this.ClearRemotePlayerData();
     this.remoteID = data1.GUID;
     this.remoteName = data1.Name;
     this.remoteLevel = data1.Level;
     this.remoteFurther = data1.FurtherLevel;
     this.remoteAwake = data1.AwakeLevel;
     this.remoteAwakeItemFlag = data1.AwakeItemFlag;
     this.remoteVipLevel = data1.VipLevel;
     this.remoteGender = data1.Gender;
     this.remoteConstellationLevel = data1.ConstellationLevel;
     this.remoteFashionLevel = data2.FashionLevel;
     if (data2.Lopet != null && data2.Lopet.InfoID != 0)
     {
         LopetInfo info = Globals.Instance.AttDB.LopetDict.GetInfo(data2.Lopet.InfoID);
         if (info == null)
         {
             Debug.LogErrorFormat("LopetDict.GetInfo error, id = {0}", new object[]
             {
                 data2.Lopet.InfoID
             });
             return;
         }
         this.remoteLopet = new LopetDataEx(data2.Lopet, info);
     }
     PlayerPetInfo.Info2.Name = this.remoteName;
     PlayerPetInfo.Info2.Quality = this.GetRemoteQuality();
     PlayerPetInfo.Info2.Type = this.remoteGender;
     PetData petData = new PetData();
     if (petData == null)
     {
         Debug.LogError(new object[]
         {
             "new PetData error"
         });
         return;
     }
     petData.ID = 0uL;
     petData.InfoID = 90001;
     petData.Level = (uint)this.remoteLevel;
     petData.Further = (uint)this.remoteFurther;
     petData.Awake = (uint)this.remoteAwake;
     petData.ItemFlag = (uint)this.remoteAwakeItemFlag;
     data2.Pets.Add(petData);
     for (int i = 0; i < data2.Pets.Count; i++)
     {
         int num = (int)data2.Pets[i].ID;
         if (num >= 4)
         {
             num -= 4;
             if (num >= 6)
             {
                 Debug.LogErrorFormat("remote assist pet slot error, slot = {0}", new object[]
                 {
                     num
                 });
             }
             else
             {
                 PetInfo info2 = Globals.Instance.AttDB.PetDict.GetInfo(data2.Pets[i].InfoID);
                 if (info2 == null)
                 {
                     Debug.LogErrorFormat("PetDict.GetInfo error, id = {0}", new object[]
                     {
                         data2.Pets[i].InfoID
                     });
                 }
                 else
                 {
                     this.remoteAssistPets[num] = new PetDataEx(data2.Pets[i], info2);
                 }
             }
         }
     }
     int fashionID = data1.FashionID;
     for (int j = 0; j < 4; j++)
     {
         this.remoteSockets[j] = new SocketDataEx();
         if (this.remoteSockets[j] == null)
         {
             Debug.LogError(new object[]
             {
                 "allocate SocketDataEx error!"
             });
         }
         else
         {
             this.remoteSockets[j].Init(j, (j != 0) ? 0 : fashionID, data2);
         }
     }
     this.UpdateRemoteCombatValue();
 }
示例#2
0
 public void Init(int slot, int fashionID, RemotePlayerDetail data)
 {
     this.local = false;
     this.socketSlot = slot;
     int num = this.socketSlot * 6;
     for (int i = 0; i < data.Equips.Count; i++)
     {
         int num2 = (int)data.Equips[i].ID - num;
         if (num2 >= 0 && num2 < 6)
         {
             ItemInfo info = Globals.Instance.AttDB.ItemDict.GetInfo(data.Equips[i].InfoID);
             if (info == null)
             {
                 Debug.LogErrorFormat("ItemDict.GetInfo error, id = {0}", new object[]
                 {
                     data.Equips[i].InfoID
                 });
             }
             else
             {
                 this.equips[num2] = new ItemDataEx(data.Equips[i], info);
                 if (this.equips[num2] != null)
                 {
                     this.equips[num2].SetEquipSlot(this.socketSlot * 6 + num2);
                 }
             }
         }
     }
     if (fashionID != 0)
     {
         this.fashion = Globals.Instance.AttDB.FashionDict.GetInfo(fashionID);
         if (this.fashion == null)
         {
             Debug.LogErrorFormat("FashionDict.GetInfo error, id = {0}", new object[]
             {
                 fashionID
             });
         }
         else
         {
             PlayerPetInfo.Info2.Icon = this.fashion.Icon;
         }
     }
     for (int j = 0; j < data.Pets.Count; j++)
     {
         if (this.socketSlot == (int)data.Pets[j].ID)
         {
             PetInfo info2 = Globals.Instance.AttDB.PetDict.GetInfo(data.Pets[j].InfoID);
             if (info2 != null)
             {
                 this.petData = new PetDataEx(data.Pets[j], info2);
                 this.EquipPet(this.petData);
                 break;
             }
             Debug.LogErrorFormat("PetDict.GetInfo error, id = {0}", new object[]
             {
                 data.Pets[j].InfoID
             });
         }
     }
 }