예제 #1
0
        public void AddResource(AssetData res)
        {
            res.package = this;

            resources.Enqueue(res.id, res);
            resourcesList.Add(res);

            switch (res.type)
            {
            case ResourceComponentType.component:
                components.Add(res);
                if (res.exported)
                {
                    exportComponents.Add(res);
                }
                break;

            case ResourceComponentType.sound:
                sounds.Add(res);
                break;

            case ResourceComponentType.image:
                images.Add(res);
                break;
            }
        }
예제 #2
0
        internal Address GetNextAddress()
        {
            lock (this._connections.SyncRoot)
            {
                var node = loadBalancerQueue.Dequeue();

                if (node == null)
                {
                    var connection = GetAnyConnection();

                    if (connection == null || !connection.IsConnected)
                    {
                        return(null);
                    }
                    else
                    {
                        foreach (Address ad in this._connections.Keys)
                        {
                            loadBalancerQueue.Enqueue(ad);
                        }
                    }
                }

                Connection conn = _connections[node] as Connection;

                if (conn == null || !conn.IsConnected)
                {
                    conn = GetAnyConnection();

                    if (conn == null || !conn.IsConnected)
                    {
                        return(null);
                    }
                }
                else
                {
                    loadBalancerQueue.Enqueue(node);
                }

                return(conn.ServerAddress);
            }
        }
예제 #3
0
    public void AddResource(ResourceComponent res)
    {
        res.package = this;

        resources.Enqueue(res.id, res);
        if (res.type == ResourceComponentType.component)
        {
            components.Add(res);

            if (res.exported)
            {
                exportComponents.Add(res);
            }
        }
        else if (res.type == ResourceComponentType.sound)
        {
            sounds.Add(res);
        }
    }
예제 #4
0
 public void AddPackage(Package package)
 {
     packageList.Add(package);
     packages.Enqueue(package.id, package);
     packagesByName.Add(package.name, package);
 }