예제 #1
0
        private MyServerAction NewGameStarted(MyMwcObjectBuilder_Checkpoint checkpoint, MyMissionID missionId)
        {
            MyLocalCache.ClearCurrentSave();
            MyClientServer.LoggedPlayer.HasAnyCheckpoints = false;

            Debug.Assert(checkpoint.CurrentSector.UserId == null, "New game checkpoint.CurrentSector must be story sector");

            var cachedSector = MyLocalCache.LoadSector(checkpoint.CurrentSector);

            if (cachedSector != null)
            {
                checkpoint.SectorObjectBuilder  = cachedSector;
                checkpoint.CurrentSector.UserId = MyClientServer.LoggedPlayer.GetUserId();
                ReloadGameplayNewGame(checkpoint, missionId);
                return(null);
            }
            throw new MyDataCorruptedException("New game story checkpoint does not contain first sector!");
        }