Example #1
0
        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();
        }
Example #2
0
        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);
            }
        }
Example #3
0
        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;
        }
Example #4
0
        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();
        }
Example #5
0
        public void Save()
        {
            String sDetails = Globals.UserAccount.Serialize();

            MFileSystem.SaveFile("settings.json", sDetails);
        }