Exemplo n.º 1
0
        public void RemoveScene(SceneManager _this, ulong guid, RemoveScene removeType)
        {
            Scene scene;

            if (_this.Scenes.TryGetValue(guid, out scene))
            {
                RemoveScene(_this, scene, removeType);
            }
        }
Exemplo n.º 2
0
        public void RemoveScene(SceneManager _this, Scene scene, RemoveScene removeType)
        {
            var serverId = scene.ServerId;
            Dictionary <int, Dictionary <ulong, Scene> > scenes;

            if (_this.ScenesDic.TryGetValue(serverId, out scenes))
            {
                Dictionary <ulong, Scene> regions;
                var sceneId = scene.TypeId;
                if (scenes.TryGetValue(sceneId, out regions))
                {
                    //Dictionary<ulong, Scene> regions = scenes[sceneId];
                    var guid = scene.Guid;
                    if (regions.ContainsKey(guid))
                    {
                        PlayerLog.WriteLog(889, "RemoveScene ok! sceneId={0},sceneGuid={1},type={2},serverId={3}",
                                           scene.TypeId, scene.Guid, removeType, serverId);
                        regions.Remove(guid);
                    }
                    else
                    {
                        PlayerLog.WriteLog(889,
                                           "RemoveScene notfind guid sceneId={0},sceneGuid={1},type={2},serverId={3}", scene.TypeId,
                                           scene.Guid, removeType, serverId);
                    }
                    if (regions.Count == 0)
                    {
                        scenes.Remove(sceneId);
                    }
                }
                else
                {
                    PlayerLog.WriteLog(889, "RemoveScene notfind scene sceneId={0},sceneGuid={1},type={2},serverId={3}",
                                       scene.TypeId, scene.Guid, removeType, serverId);
                }
                if (scenes.Count == 0)
                {
                    _this.ScenesDic.Remove(serverId);
                }
            }
            else
            {
                PlayerLog.WriteLog(889, "RemoveScene notfind server sceneId={0},sceneGuid={1},type={2},serverId={3}",
                                   scene.TypeId, scene.Guid, removeType, serverId);
            }

            scene.Destroy();
            _this.Scenes.Remove(scene.Guid);
        }
Exemplo n.º 3
0
 public void RemoveScene(Scene scene, RemoveScene removeType)
 {
     mImpl.RemoveScene(this, scene, removeType);
 }
Exemplo n.º 4
0
 public void RemoveScene(ulong guid, RemoveScene removeType)
 {
     mImpl.RemoveScene(this, guid, removeType);
 }