public static void Save() { var dts = DbSerializer.CustomTypeToBytes(UserProfile.Profile, typeof(Profile)); C2SSender.Save(UserProfile.ProfileName, dts); WorldInfoManager.Save(); }
private void MainForm_Load(object sender, EventArgs e) { string version = FileVersionInfo.GetVersionInfo(Application.ExecutablePath).FileVersion; Text = string.Format("幻兽传说卡片版 v{0}", version); try { ConfigData.LoadData(); Scene.Instance = new Scene(tabPageGame, tabPageGame.Width, tabPageGame.Height); SystemMenuManager.Load(tabPageGame.Width, tabPageGame.Height); MainTipManager.Init(tabPageGame.Height); PanelManager.Init(tabPageGame.Width, tabPageGame.Height); CardConfigManager.Init(); DbSerializer.Init(); WorldInfoManager.Load(); } catch (Exception ex) { NLog.Warn(ex); Close(); } tabPageLogin.BackgroundImage = PicLoader.Read("System", "LogBack.JPG"); textBoxName.Text = WorldInfoManager.LastAccountName; ChangePage(0); myCursor.ChangeCursor("default"); Scene.Instance.Init(); workThread = new Thread(TimeGo); workThread.IsBackground = true; workThread.Start(); }
public MainForm() { InitializeComponent(); myCursor = new HSCursor(this); flowController = new MainFlowController(tabPageGame); Instance = this; WorldInfoManager.Load(); }
public static void SaveToDB() { WorldInfoManager.Save(); FileStream fs = new FileStream(string.Format("./Save/{0}.db", ProfileName), FileMode.OpenOrCreate); var dts = DbSerializer.CustomTypeToBytes(Profile, typeof(Profile)); fs.Write(dts, 0, dts.Length); fs.Close(); }
public void OnCreate(int constellation, int bldType, int headId) { Pid = WorldInfoManager.GetPlayerPid(); Name = UserProfile.ProfileName; InfoBasic.Job = JobConfig.Indexer.NewBie; InfoBasic.Constellation = constellation + 1; InfoBasic.BloodType = bldType + 1; InfoBasic.Face = headId; InfoBasic.Level = 1; InfoBasic.MapId = 13010001; InfoBasic.Position = 1001; InfoBasic.HealthPoint = 100; InfoBasic.MentalPoint = 100; InfoBasic.FoodPoint = 100; InfoBag.BagCount = 50; InfoEquip.AddEquipCompose(21200101); InfoEquip.AddEquipCompose(21300101); }