Пример #1
0
        /// <summary>
        ///     Creates a new DarkRiftClient object with specified cache settings.
        /// </summary>
        /// <param name="objectCacheSettings">The settings for the object cache.</param>
        public DarkRiftClient(ClientObjectCacheSettings objectCacheSettings)
        {
            ObjectCache.Initialize(objectCacheSettings);
            ClientObjectCache.Initialize(objectCacheSettings);

            this.RoundTripTime = new RoundTripTimeHelper(10, 10);
        }
Пример #2
0
        public DarkRiftClient(ObjectCacheSettings objectCacheSettings)
        {
            ObjectCache.Initialize(objectCacheSettings);

            if (objectCacheSettings is ClientObjectCacheSettings settings)
            {
                ClientObjectCache.Initialize(settings);
            }
            else
            {
                ClientObjectCacheSettings clientObjectCacheSettings = new ClientObjectCacheSettings {
                    MaxMessageReceivedEventArgs = 4
                };
                ClientObjectCache.Initialize(clientObjectCacheSettings);
            }

            this.RoundTripTime = new RoundTripTimeHelper(10, 10);
        }
 /// <summary>
 ///     Initializes the object cache.
 /// </summary>
 /// <remarks>
 ///     Normally, initializing the object cache is handled for you when you create a server or client
 ///     however there are times when it is necessary to initialize it without creating a server or client
 ///     such as during testing. This method can be used to initialize the cache in those circumstances.
 ///
 ///     If the cache is already initialized this method will do nothing.
 ///
 ///     This method will also initialize the <see cref="ObjectCache"/>.
 /// </remarks>
 /// <param name="settings"></param>
 //DR3 Make static
 public void InitializeObjectCache(ClientObjectCacheSettings settings)
 {
     ObjectCache.Initialize(settings);
     ClientObjectCache.Initialize(settings);
 }