Пример #1
0
        void RecvSetMap(IIPSocket conn, BitStream r)
        {
            var mapID = r.ReadMapID();

            // Create the new map
            var newMap = new Map(mapID, World.Camera, World);
            newMap.Load(ContentPaths.Build, false, _dynamicEntityFactory);

            // Clear quest requirements caches
            UserInfo.HasStartQuestRequirements.Clear();

            // Change maps
            World.Map = newMap;

            // Unload all map content from the previous map and from the new map loading
            GameplayScreen.ScreenManager.Content.Unload(ContentLevel.Map);

            // Change the screens, if needed
            GameplayScreen.ScreenManager.SetScreen<GameplayScreen>();
        }