*此内容使用人工智能(Beta)翻译,可能包含错误。若要查看英文页面,请点按 此处

Universe

代表 Roblox 体验。

属性

pathstring

宇宙资源路径。

格式:universes/{universe_id}.

createTimestring
仅输出

宇宙创建时的时戳。. 此字符串格式为 FieldMask

updateTimestring
仅输出

宇宙最后更新时的时戳。. 此字符串格式为 FieldMask

displayNamestring
仅输出

宇宙的名称。

该字段可以通过更新根位置的名称来更新。.

descriptionstring
仅输出

宇宙的描述。

该字段可以通过更新根位置的描述来更新。.

请为owner选择其中一项:

userstring
仅输出

宇宙是用户拥有的。.

groupstring
仅输出

宇宙是集体所有的。.

visibilityEnum<string>
仅输出

宇宙是否公开可访问。

可能的值:

| 值 | 描述 | | --- | --- | | VISIBILITY_UNSPECIFIED | 使用此值进行更新时,将在后端上发生错误。| | 公共 | 宇宙是公共的。| | 私有 | 宇宙是私有的。如果宇宙的可见度设置为私人,所有激活的玩家将立即从所有运行的服务器中删除。|. 可能的值:

facebookSocialLinkobject

Facebook 的社交链接。.

twitterSocialLinkobject

Twitter 的社交链接。.

youtubeSocialLinkobject

Youtube 的社交链接。.

twitchSocialLinkobject

Twitch 的社交链接。.

discordSocialLinkobject

Discord 社交链接。.

robloxGroupSocialLinkobject

Roblox 群组的社交链接。.

guildedSocialLinkobject

公会的社交链接。.

voiceChatEnabledboolean

体验中的用户是否启用语音聊天。

更新此值不会影响运行中的服务器。.

ageRatingEnum<string>
仅输出

该宇宙的年龄评级。

可能的值:

| 值 | 描述 | | --- | --- | | AGE_RATING_UNSPECIFIED | 年龄评分未设置。| | AGE_RATING_ALL | 支持所有用户。| | AGE_RATING_9_PLUS | 支持 9 岁及以上的用户。| | AGE_RATING_13_PLUS | 支持 13 岁及以上的用户。| | AGE_RATING_17_PLUS | 支持 17 岁及以上的用户。 |. 可能的值:

privateServerPriceRobuxnumber

代表私服的价格在 Robux 上。

如果未设置,私有服务器不支持该宇宙。

只能在使用领域面具时禁用。

将设置为 null 将禁用所有激活的私有服务器。

更改价格将取消所有私服订阅。.

desktopEnabledboolean

玩家是否可以通过桌面加入体验。.

mobileEnabledboolean

玩家是否可以通过移动设备加入体验。.

tabletEnabledboolean

是否允许玩家通过平板电脑加入体验。.

consoleEnabledboolean

玩家是否可以通过控制台加入体验。.

vrEnabledboolean

玩家是否可以通过 VR 加入体验。.

基本网址

https://apis.roblox.com
Universe 资源

{
"path": "universes/123",
"createTime": "2023-07-05T12:34:56Z",
"updateTime": "2023-07-05T12:34:56Z",
"displayName": "ROBLOX Battle [OPEN]",
"description": "OPEN SOURCE! \n Feel free to check out how we made this game and ask us about it!",
"user": "string",
"visibility": "VISIBILITY_UNSPECIFIED",
"facebookSocialLink": {
"title": "string",
"uri": "string"
},
"twitterSocialLink": {
"title": "string",
"uri": "string"
},
"youtubeSocialLink": {
"title": "string",
"uri": "string"
},
"twitchSocialLink": {
"title": "string",
"uri": "string"
},
"discordSocialLink": {
"title": "string",
"uri": "string"
},
"robloxGroupSocialLink": {
"title": "string",
"uri": "string"
},
"guildedSocialLink": {
"title": "string",
"uri": "string"
},
"voiceChatEnabled": true,
"ageRating": "AGE_RATING_UNSPECIFIED",
"privateServerPriceRobux": "integer",
"desktopEnabled": true,
"mobileEnabled": true,
"tabletEnabled": true,
"consoleEnabled": true,
"vrEnabled": true
}

Universe

获取宇宙

GET /cloud/v2/universes/{universe_id}

获取指定的宇宙。

请求路径参数
universe_idstring
必填

宇宙ID。.

答复Universe
GET /cloud/v2/universes/{universe_id}

curl -L -X GET 'https://apis.roblox.com/cloud/v2/universes/{universe_id}' \
-H 'x-api-key: {your-api-key}'
答复

{
"path": "universes/123",
"createTime": "2023-07-05T12:34:56Z",
"updateTime": "2023-07-05T12:34:56Z",
"displayName": "ROBLOX Battle [OPEN]",
"description": "OPEN SOURCE! \n Feel free to check out how we made this game and ask us about it!",
"user": "string",
"visibility": "VISIBILITY_UNSPECIFIED",
"facebookSocialLink": {
"title": "string",
"uri": "string"
},
"twitterSocialLink": {
"title": "string",
"uri": "string"
},
"youtubeSocialLink": {
"title": "string",
"uri": "string"
},
"twitchSocialLink": {
"title": "string",
"uri": "string"
},
"discordSocialLink": {
"title": "string",
"uri": "string"
},
"robloxGroupSocialLink": {
"title": "string",
"uri": "string"
},
"guildedSocialLink": {
"title": "string",
"uri": "string"
},
"voiceChatEnabled": true,
"ageRating": "AGE_RATING_UNSPECIFIED",
"privateServerPriceRobux": "integer",
"desktopEnabled": true,
"mobileEnabled": true,
"tabletEnabled": true,
"consoleEnabled": true,
"vrEnabled": true
}

Universe

更新宇宙

PATCH /cloud/v2/universes/{universe_id}

更新指定的宇宙。

该方法保证返回所有更新的字段。此方法还可能返回完整资源。

范围
universe:write
请求路径参数
universe_idstring
必填

宇宙ID。.

查询参数
updateMaskstring

要更新的字段列表。. 此字符串格式为 FieldMask

请求正文Universe
答复Universe
PATCH /cloud/v2/universes/{universe_id}

curl -L -X PATCH 'https://apis.roblox.com/cloud/v2/universes/{universe_id}?updateMask={string}' \
-H 'x-api-key: {your-api-key}' \
-H 'Content-Type: application/json' \
--data '{
"facebookSocialLink": {
"title": "string",
"uri": "string"
},
"twitterSocialLink": {
"title": "string",
"uri": "string"
},
"youtubeSocialLink": {
"title": "string",
"uri": "string"
},
"twitchSocialLink": {
"title": "string",
"uri": "string"
},
"discordSocialLink": {
"title": "string",
"uri": "string"
},
"robloxGroupSocialLink": {
"title": "string",
"uri": "string"
},
"guildedSocialLink": {
"title": "string",
"uri": "string"
},
"voiceChatEnabled": true,
"privateServerPriceRobux": "integer",
"desktopEnabled": true,
"mobileEnabled": true,
"tabletEnabled": true,
"consoleEnabled": true,
"vrEnabled": true
}'
答复

{
"path": "universes/123",
"createTime": "2023-07-05T12:34:56Z",
"updateTime": "2023-07-05T12:34:56Z",
"displayName": "ROBLOX Battle [OPEN]",
"description": "OPEN SOURCE! \n Feel free to check out how we made this game and ask us about it!",
"user": "string",
"visibility": "VISIBILITY_UNSPECIFIED",
"facebookSocialLink": {
"title": "string",
"uri": "string"
},
"twitterSocialLink": {
"title": "string",
"uri": "string"
},
"youtubeSocialLink": {
"title": "string",
"uri": "string"
},
"twitchSocialLink": {
"title": "string",
"uri": "string"
},
"discordSocialLink": {
"title": "string",
"uri": "string"
},
"robloxGroupSocialLink": {
"title": "string",
"uri": "string"
},
"guildedSocialLink": {
"title": "string",
"uri": "string"
},
"voiceChatEnabled": true,
"ageRating": "AGE_RATING_UNSPECIFIED",
"privateServerPriceRobux": "integer",
"desktopEnabled": true,
"mobileEnabled": true,
"tabletEnabled": true,
"consoleEnabled": true,
"vrEnabled": true
}

Universe

发布宇宙消息
Beta

POST /cloud/v2/universes/{universe_id}:publishMessage

向宇宙的实时服务器发布消息。

服务器可以通过 消息传递服务 消耗消息。

范围
universe-messaging-service:publish
请求路径参数
universe_idstring
必填

宇宙ID。.

请求正文
topicstring

要发布消息的主题。.

messagestring

要发布的消息。.

POST /cloud/v2/universes/{universe_id}:publishMessage

curl -L -X POST 'https://apis.roblox.com/cloud/v2/universes/{universe_id}:publishMessage' \
-H 'x-api-key: {your-api-key}' \
-H 'Content-Type: application/json' \
--data '{
"topic": "my-topic",
"message": "Hello, world!"
}'

Universe

重启宇宙服务器

POST /cloud/v2/universes/{universe_id}:restartServers

如果新版本的体验已发布,重启所有活跃的服务器以特定宇宙,否则不会。用于发布体验更新。

范围
universe:write
请求路径参数
universe_idstring
必填

宇宙ID。.

请求正文
答复
POST /cloud/v2/universes/{universe_id}:restartServers

curl -L -X POST 'https://apis.roblox.com/cloud/v2/universes/{universe_id}:restartServers' \
-H 'x-api-key: {your-api-key}' \
-H 'Content-Type: application/json' \
--data '{}'
答复

{}