Server-side Installation 服务器端安装
The Asset Server is designed to be a simple one-time installation on a server machine. Interacting with the Asset Server is done through Unity. Unity can be installed on the server machine, but it does not need to be. It must be administrated from a Client machine, where Projects and Users can be added. Each additional client must be configured to synchronize with a Project, using a specific User credential.
资源服务器被设计成简单的一次性安装到服务器机器上。资源服务器与Unity之间的相互关系已经设置好了。Unity可以安装到服务器机器上,但并不是必须的。服务器必须从一个能够添加工程和用户的客户端机器来管理。每一个添加的客户端必须初始化成这样,使用一个指定的用户证书从一个工程同步。
You can install the Asset Server on Mac OS X 10.4 or later, Windows XP, Windows Vista and various Linux distributions including CentOS, Ubuntu and Suse Linux. Download Unity Asset Server from here.
你可以在如下系统上安装资源服务器:Mac OS X10.4或更高版本,Windows XP, Windows Vista和各种各样的Linux发布版包括Cent OS,Ubuntu和Suse Linux。从这里下载Unity资源服务器。
The installer will install all necessary files, setup a database and launch the Asset Server. At the end of the process you will be asked to create anAdmin password. This password is required to administer the Asset Server from within Unity. You must connect to the Asset Server as the administrator before you can create any projects or users.
这个安装包将安装所有必需的文件,设置数据库并启动资源服务器。这个过程结束的时候你会被要求创建一个管理员密码(Admin password)。这个密码是管理Unity内建的资源服务器所必需的。在你可以创建任何工程或用户之前,你必需作为管理员角色连接到资源服务器。
Administrating the Asset Server 管理资源服务器
The Asset Server allows any number of Users Project. The Administrator must first connect to the Server with Unity as a client and create new Projects and Users.
资源服务器允许任意数量的用户(Users)连接到一个工程(Project)。管理员必需先使用Unity作为客户端连接到服务器并创建工程和用户。
To access the Administrator controls, launch Unity and select Window->Asset Server, then click the Administration button.
要访问管理员控制面板,打开Unity并选择菜单Window->Asset Server,然后点击Administration按钮。
The Administration tab 管理标签页
In the Server Address ip address host name Server Address. Next, provide the administrator name and password. The administrator name is always "admin", and the password is what was entered when installing the Asset Server. Finally, hit theConnect button. You're now connected to the Asset Server, and can perform the initial setup.
在服务器地址(Server Adress)栏,输入IP地址(ip adress)或计算机的主机名(host name)来运行你所要管理的资源服务器。如果资源服务器安装在你本地的机器上,你可以使用"localhost"作为服务器地址(Server Address)。接下来,输入管理员名称和密码。管理员名称固定使用"admin",密码是安装资源服务器时所输入的密码。最后,点击连接(Connect)按钮。你现在连接到了资源服务器,并且可以执行初始化设置了。
Managing Projects and Users 管理工程和用户
Each Server can contain several Projects, and each User can have permission to one or more Projects. Projects are generally orthogonal, and unique in asset collections. It is best to think "one Project equals one game".
每一个服务器都可以包含许多工程,并且每一个用户可以允许有一个或者多个工程。工程通常是正交的,并且独立于资源集合。最好这样想"一个工程等于一个游戏"。
New Projects can be created by clicking on the Create Server Administration tab.
新的工程可以通过点击服务器管理(Server Administration)标签页上的创建(Create)按钮来创建
Click Create, then enter a name for the new project
点击创建(Create),然后输入新工程的名称
New users can be created by first selecting an existing project and then clicking on the New User button.
新的用户可以这样创建,首先选择一个已经存在的工程然后点击新建用户(New User)按钮。
Creating a new user 创建一个新用户
After a user has been created in one Project, the user can be added to another project by enabling the checkbox on the left of the user name in the users list.
当一个用户在一个工程里被创建,选中在用户列表的用户名左侧的选择框,允许这个用户添加到其他的工程里。
You can enable or disable user access for individual projects. To completely remove a project or user from the server use the Delete Project andDelete User buttons.
你可以允许或不允许用户访问个别的工程。从服务器完全的删除一个工程或用户使用删除工程(Delete Project)和删除用户(Delete User)按钮。
Firewall settings 防火墙设置
The Unity Asset Server uses TCP port 10733. You might need to enable connections to this port in your firewall and/or router.
Unity资源服务器使用TCP端口10733。你可能需要设置你的防火墙和/或路由器以允许连接到这个端口。
Advanced 高级
The Asset Server is built using a modified version of PostgreSQL. Accessing the SQL database directly requires a bit of technical knowledge about SQL and Unix/Linux command lines. User discretion is advised.
资源服务器使用一个修改版本的PostgreSQL构建。直接访问SQL数据库需要一点关于SQL和Unix/Linux命令行的技术知识。建议用户谨慎操作。
Backing up 备份
We have provided a command line tool to back up an asset server. The tool should be run from an administrator account on the machine running the asset server. Replace BACKUP_LOCATION with the path name you want the backup tool to place the backups:
我们提供了一个命令行工具用于备份一个资源服务器。这个工具需要运行资源服务器的机器上的管理员账号来执行。用你想使用的目录覆盖掉BACKUP_LOCATION宏,备份工具会将备份放置到此处。
Mac OS X
sudo /Library/UnityAssetServer/bin/as_backup BACKUP_LOCATION Linux sudo /opt/unity_asset_server/bin/as_backup BACKUP_LOCATION Windows "\Unity\AssetServer\bin\as_backup.cmd" BACKUP_LOCATION
as_backup will create a directory at BACKUP_LOCATION containing one or more files per project plus files containing information about each project and a backup of all users and their passwords.
as_backup命令将在BACKUP_LOCATION处创建一个包含每个工程中一个或者多个文件的目录,另有包含每一个工程和所有用户密码备份的信息文件。
Restoring a Backup 恢复一个备份
To restore an Asset Server backup produced with as_backup, first perform a clean installation of the Asset Server without any projects created. (The restore procedure will refuse to overwrite already existing projects with the same name.)
要恢复一个使用as_backup命令产生的资源服务器备份,首先安装一个没有创建任何工程的干净的资源服务器。(恢复程序将拒绝覆盖已经存在的同名工程。)
Then run the provided backup restoration tool, as_restore pointing it to the location of a backup created with as_backup:
然后运行提供的备份恢复工具,as_restore命令,参数指向使用as_backup创建的一个备份位置。
Mac OS X
sudo /Library/UnityAssetServer/bin/as_restore BACKUP_LOCATION Linux sudo /opt/unity_asset_server/bin/as_restore BACKUP_LOCATION Windows "\Unity\AssetServer\bin\as_restore.cmd" BACKUP_LOCATION
Note that you can also use as_backup and as_restore to move an asset server installation from one machine to another by performing the backup on the source machine, moving the backup directory to the destination machine (or mount it through a network file share,) and then running as_restore to insert the data into the newly installed Asset Server instance. This will even work when the source and destination Asset Servers have different versions or are running on different operating systems.
注意你可以使用as_backup命令和as_restore命令把一个资源服务器安装从一个机器移动到另外一个机器,只需在源机器上执行备份命令即可,并移动备份目录到目标机器(或者通过一个网络文件共享来配置,)然后运行as_restore插入数据到新安装的资源服务器实例。这个方法在源和目标资源服务器版本不同或是运行在不同操作系统上的时候同样适用。
Locating the database name of an Asset Server Project
定位一个资源服务器工程的数据库名称
To view the tables in a Project database, first you need to figure out the name of the actual database. Run this command line command on the machine hosting the Asset Server:
如要查看一个工程数据库中的表,首先你需要指定已有的数据库的名称。在资源服务器运行的机器上运行这个命令行命令:
Mac OS X
/Library/UnityAssetServer/bin/psql -U admin -h localhost -d postgres -c 'select * from all_databases__view' Linux /opt/unity_asset_server/bin/psql -U admin -h localhost -d postgres -c 'select * from all_databases__view' Windows "\Unity\AssetServer\bin\psql.exe" -U admin -h localhost -d postgres -c "select * from all_databases__view"
This and other commands will prompt you for a password. Every time this happens, enter the admin password for the database, which was set during the installation. The result will be a table that follows this basic layout:
这个命令和其他的命令会要求你输入一个密码。每当这种情况时,输入数据库安装时设定的管理员密码。得到的结果将是如下所示的基本布局:
databasename | projectname | description | version --------------------+--------------------+--------------------------+--------- sandbox | Sandbox | Created with Unity 2.0.0 | 1.0 game | Game | Created with Unity 2.0.0 | 1.0 my_game_project | My Game Project | Created with Unity 2.0.0 | 1.0 (3 rows)
Now you need to identify the "databasename" of the Project you want to back up. When creating a database, the default "databasename" is same as the "projectname" as shown inside Unity, but in lowercase and spaces replaced with underscores.
现在你需要指定你所要备份工程的"数据库名称(databasename)"。在创建一个数据库时,"数据库名称(databasename)"与Unity中显示的"工程名称(projectname)"相同,但是全部是小写字母并且用下划线代替空格。
Note that if your server hosts multiple PostgreSQL databases on different ports you nay need to explicitly provide the port used to connect to the Asset Server database. In this case add -p 10733 to the commands given (assuming you have used the default port of 10733 for your instance.) For example:
注意如果你的服务器使用不同的端口安装有多个PostgreSQL数据库你可能需要明确的指定连接到资源服务器数据库所使用的端口。在这种情况下给命令行添加参数-p 10733(假定你的服务器实例使用默认的端口10733)例如:
Linux
/opt/unity_asset_server/bin/psql -U admin -h localhost -d postgres -c 'select * from all_databases__view' -p 10733
Additional SQL Functions
其他的SQL功能
These and all other commands use tools from the PostgreSQL distribution. You can read more about these tools here:http://www.postgresql.org/docs/8.3/interactive/reference-client.html
这些和所有的命令使用PostgreSQL发布版中的工具。你可以在这里找到更多关于这些工具的信息: