public void Setup() { Blocks = new Dictionary <string, MBuildingBlock>(); // AddDefaults(); string sData = MFileSystem.GetFile(MFileSystem.RegistryPath); if (string.IsNullOrEmpty(sData)) { return; } Blocks = JsonConvert.DeserializeObject <Dictionary <string, MBuildingBlock> >(sData); SetupMaterials(); }
public void Load() { String sDetails = MFileSystem.GetFile("settings.json"); try { MUserAccount acc = MUserAccount.Deserialize <MUserAccount>(sDetails); if (acc != null) { Globals.UserAccount = acc; } } catch (Exception e) { Console.WriteLine(e.Message); } }
public void Setup() { string sPath = Path.Combine(MFileSystem.ProjectPath, "Terms.txt"); if (!File.Exists(sPath)) { Console.WriteLine("ERROR, could not find TOS"); return; } string sData = MFileSystem.GetFile(sPath); TermsTextBox.Text = sData; sPath = Path.Combine(MFileSystem.ProjectPath, "Constitution.txt"); if (!File.Exists(sPath)) { Console.WriteLine("ERROR, could not find Constitution"); return; } sData = MFileSystem.GetFile(sPath); TermsTextBox.Text += "\r\n" + sData; }
public void Setup() { Globals.VERSION = MVersion.VERSION; MFileSystem.SetProjectPath(@".\"); Globals._scene = new MScene(true); _spawnHandler = new MSpawnHandler(); _deleteHandler = new MDeleteHandler(); _teleportHandler = new MTeleportHandler(); _textureHandler = new MTextureHandler(); _lightHandler = new MLightHandler(); _propertyHandler = new MPropertyChangeHandler(); _navPointer = new MNavigationPointer(); _bookmarkController = new BookmarkController(); _moveHandler = new MMoveHandler(); _avatarHandler = new MAvatarHandler(); Globals._scene.SetupInitialObjects(); _cameraHandler = new MCameraHandler(); _buildParts = new MBuildParts(); _buildParts.Setup(); _userDetails = new UserDetails(); _userDetails.Setup(); ParseCmdLine(); //TODO: get from server Globals._scene.Setup(); _navPointer.Setup(); Globals._scene.Play(); //Settings.DebugNetwork = true; CreateAvatar(); }
public void Save() { String sDetails = Globals.UserAccount.Serialize(); MFileSystem.SaveFile("settings.json", sDetails); }