Exemplo n.º 1
0
        static cacheFactory()
        {
            CreatePath();

            AccaountCache  = new AccountCache(NameAndPath["AccountFile"]);
            UserCache      = new UserCache();
            PosCache       = new PosCache();
            SkillCache     = new SkillCache();
            InventoryCache = new InventoryCache();
        }
Exemplo n.º 2
0
        protected override void RegisterStaticInventoryCache(IItemSpecCache cache)
        {
            InventoryHandler persister = null;

            if (UseFileDataStore)
            {
                persister = new InventoryHandler(this);
                persister.Init();
            }

            StaticInventoryCache.Instance = new InventoryCache(Engine, persister, persister);
            _inventoryCache = StaticInventoryCache.Instance;
        }
Exemplo n.º 3
0
        public EntityHandler(IGame game, IServer server, IInventoryCache cache)
            : base(game, "Entity")
        {
            _entitiesToLoad   = new List <ChunkKey>();
            _entitiesToDelete = new List <string>();
            _entitiesToSave   = new Dictionary <int, EntitySaveData>();

            _server = server;
            _game   = game;

            // take advantage of the fact that entity ids are unique per instance
            // so to make an entity id more unique - we add the instance id to the save name
            // this way when restarted and we start re-using the entity ids, we don't have a collision
            _runInstanceGuid = System.Guid.NewGuid().ToString();

            _inventoryCache = cache;
        }
Exemplo n.º 4
0
 public MessageHandler(GameServer gameServer, IInventoryCache inventoryCache)
 {
     _gameServer     = gameServer;
     _inventoryCache = inventoryCache;
 }