Beispiel #1
0
		// Token: 0x06002AF4 RID: 10996 RVA: 0x0010C614 File Offset: 0x0010AA14
		public void load()
		{
			if (PlayerSavedata.fileExists(base.channel.owner.playerID, "/Player/Anim.dat") && Level.info.type == ELevelType.SURVIVAL)
			{
				Block block = PlayerSavedata.readBlock(base.channel.owner.playerID, "/Player/Anim.dat", 0);
				byte b = block.readByte();
				this._gesture = (EPlayerGesture)block.readByte();
				this.captorID = block.readSteamID();
				if (b > 1)
				{
					this.captorItem = block.readUInt16();
				}
				else
				{
					this.captorItem = 0;
				}
				this.captorStrength = block.readUInt16();
				if (this.gesture != EPlayerGesture.ARREST_START)
				{
					this._gesture = EPlayerGesture.NONE;
				}
				return;
			}
			this._gesture = EPlayerGesture.NONE;
			this.captorID = CSteamID.Nil;
			this.captorItem = 0;
			this.captorStrength = 0;
		}
Beispiel #2
0
        public void save()
        {
            Block block = new Block();

            block.writeByte(PlayerSkills.SAVEDATA_VERSION);
            block.writeUInt32(this.experience);
            block.writeInt32(this.reputation);
            block.writeByte((byte)this.boost);
            byte b = 0;

            while ((int)b < this.skills.Length)
            {
                if (this.skills[(int)b] != null)
                {
                    byte b2 = 0;
                    while ((int)b2 < this.skills[(int)b].Length)
                    {
                        block.writeByte(this.skills[(int)b][(int)b2].level);
                        b2 += 1;
                    }
                }
                b += 1;
            }
            PlayerSavedata.writeBlock(base.channel.owner.playerID, "/Player/Skills.dat", block);
        }
Beispiel #3
0
 public void load()
 {
     if (PlayerSavedata.fileExists(base.channel.owner.playerID, "/Player/Skills.dat") && Level.info.type == ELevelType.SURVIVAL)
     {
         Block block = PlayerSavedata.readBlock(base.channel.owner.playerID, "/Player/Skills.dat", 0);
         byte  b     = block.readByte();
         if (b > 4)
         {
             this._experience = block.readUInt32();
             if (b >= 7)
             {
                 this._reputation = block.readInt32();
             }
             else
             {
                 this._reputation = 0;
             }
             this._boost = (EPlayerBoost)block.readByte();
             if (b >= 6)
             {
                 byte b2 = 0;
                 while ((int)b2 < this.skills.Length)
                 {
                     if (this.skills[(int)b2] != null)
                     {
                         byte b3 = 0;
                         while ((int)b3 < this.skills[(int)b2].Length)
                         {
                             this.skills[(int)b2][(int)b3].level = block.readByte();
                             if (this.skills[(int)b2][(int)b3].level > this.skills[(int)b2][(int)b3].max)
                             {
                                 this.skills[(int)b2][(int)b3].level = this.skills[(int)b2][(int)b3].max;
                             }
                             b3 += 1;
                         }
                     }
                     b2 += 1;
                 }
             }
         }
     }
 }
Beispiel #4
0
		// Token: 0x06002AF5 RID: 10997 RVA: 0x0010C6EC File Offset: 0x0010AAEC
		public void save()
		{
			if (base.player.life.isDead)
			{
				if (PlayerSavedata.fileExists(base.channel.owner.playerID, "/Player/Anim.dat"))
				{
					PlayerSavedata.deleteFile(base.channel.owner.playerID, "/Player/Anim.dat");
				}
			}
			else
			{
				Block block = new Block();
				block.writeByte(PlayerAnimator.SAVEDATA_VERSION);
				block.writeByte((byte)this.gesture);
				block.writeSteamID(this.captorID);
				block.writeUInt16(this.captorItem);
				block.writeUInt16(this.captorStrength);
				PlayerSavedata.writeBlock(base.channel.owner.playerID, "/Player/Anim.dat", block);
			}
		}
Beispiel #5
0
 // Token: 0x06002ABF RID: 10943 RVA: 0x001093AC File Offset: 0x001077AC
 public void save()
 {
     if (this.life.isDead)
     {
         if (PlayerSavedata.fileExists(this.channel.owner.playerID, "/Player/Player.dat"))
         {
             PlayerSavedata.deleteFile(this.channel.owner.playerID, "/Player/Player.dat");
         }
     }
     else
     {
         Block block = new Block();
         block.writeByte(Player.SAVEDATA_VERSION);
         block.writeSingleVector3(base.transform.position);
         block.writeByte((byte)(base.transform.rotation.eulerAngles.y / 2f));
         PlayerSavedata.writeBlock(this.channel.owner.playerID, "/Player/Player.dat", block);
     }
     this.clothing.save();
     this.inventory.save();
     this.life.save();
     this.skills.save();
     this.animator.save();
     this.quests.save();
 }