Beispiel #1
0
        public void SendPackage(Package package)
        {
            if (package == null)
            {
                return;
            }

            if (State == ConnectionState.Unconnected)
            {
                package.PutPool();
                return;
            }

            MiNetServer.TraceSend(package);

            bool isBatch = package is McpeWrapper;

            if (!isBatch)
            {
                //var result = Server.PluginManager.PluginPacketHandler(package, false, Player);
                //if (result != package) package.PutPool();
                //package = result;

                //if (package == null) return;
            }

            lock (_queueSync)
            {
                _sendQueueNotConcurrent.Enqueue(package);
                SignalTick();
            }
        }
        public void SendPackage(Package package)
        {
            MiNetServer.TraceSend(package);

            if (package == null)
            {
                return;
            }

            if (State == ConnectionState.Unconnected)
            {
                package.PutPool();
                return;
            }

            bool isBatch = package is McpeBatch;

            if (!isBatch)
            {
                //var result = Server.PluginManager.PluginPacketHandler(package, false, Player);
                //if (result != package) package.PutPool();
                //package = result;

                //if (package == null) return;
            }

            Server.SendPackage(this, package);
            //lock (_queueSync)
            //{
            //	_sendQueueNotConcurrent.Enqueue(package);
            //}
        }