Exemplo n.º 1
0
 /// <summary>
 /// Creates a new instance of <see cref="UpdateEvent"/>.
 /// </summary>
 public UpdateEvent(ISerialFiber fiber, IClock timeHandler, Action <int> action, long intervalInMs)
 {
     this.fiber       = fiber;
     this.timeHandler = timeHandler;
     this.action      = action;
     this.interval    = intervalInMs;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Creates a new instance of the <see cref="MmoSocial"/> class.
        /// </summary>
        /// <param name="server"></param>
        private MmoSocial(ISocialServer server)
        {
            this.server       = server;
            this.sessionCache = new SocialSessionCache(PeerSettings.MaxLockWaitTime);
            this.worlds       = new ConcurrentStorageMap <short, IWorld>(-1);

            this.primaryFiber = new SerialThreadFiber(ThreadPriority.Highest);
            this.primaryFiber.Start();
        }
Exemplo n.º 3
0
        /// <summary>
        /// Creates a new instance of the <see cref="MmoChat"/> class.
        /// </summary>
        /// <param name="server"></param>
        private MmoChat(IChatServer server)
        {
            this.server       = server;
            this.channels     = new ConcurrentStorageMap <int, Channel>(PeerSettings.MaxLockWaitTime);
            this.sessionCache = new ChatSessionCache(PeerSettings.MaxLockWaitTime);
            this.counter      = new Counter(INVALID_CHAT_CHANNEL + 1);

            this.syncFiber = new SerialThreadFiber(ThreadPriority.Highest);
            this.syncFiber.Start();
        }
Exemplo n.º 4
0
        /// <summary>
        /// Creates a new instance of the <see cref="MmoWorld"/> class.
        /// </summary>
        /// <param name="server"> The main peer used for communication with other servers and clients. </param>
        /// <param name="gameConfiguration"> </param>
        /// <param name="worldDescription"> The world data which contains data of the whole world </param>
        private MmoWorld(IWorldServer server, GameConfig gameConfiguration, WorldDescription worldDescription)
        {
            this.server = server;
            // world bounds will adjust its size based on the zones
            this.bounds        = new Bounds(Vector3.Zero, Vector3.Zero);
            this.configuration = gameConfiguration;

            this.primaryFiber = new SerialThreadFiber(ThreadPriority.Highest);
            this.primaryFiber.Start();

            this.zones        = new ConcurrentStorageMap <int, MmoZone>(1000);
            this.sessionCache = new WorldSessionCache(PeerSettings.MaxLockWaitTime);
            this.itemCache    = new WorldItemCache();

            this.LoadWorld();
        }