Exemple #1
0
 static public bool LoadFromDB(string passport)
 {
     if (File.Exists(string.Format("./Save/{0}.db", passport)))
     {
         Profile = new Profile();
         FileStream fs = new FileStream(string.Format("./Save/{0}.db", passport), FileMode.Open);
         byte[] dts = new byte[fs.Length];
         fs.Read(dts, 0, dts.Length);
         object tmp;
         DbSerializer.BytesToCustomType(dts, out  tmp, typeof(Profile));
         Profile = (Profile)tmp;
         fs.Close();
         return true;
     }
     return false;
 }
 private Profile CreateProfile()
 {
     Profile profile = new Profile();
     profile.Pid = WorldInfoManager.GetPlayerPid();
     profile.Name = UserProfile.ProfileName;
     profile.InfoBasic.Job = JobConfig.Indexer.NewBie;
     profile.InfoBasic.Constellation = constellation + 1;
     profile.InfoBasic.BloodType = bldType + 1;
     profile.InfoBasic.Face = headId;
     profile.InfoBasic.Level = 1;
     profile.InfoBasic.MapId = SceneConfig.Indexer.BornMapId;
     profile.InfoBag.BagCount = 50;
     return profile;
 }