요약
메서드
GetServerAttribute(name: string):Tuple |
InitializeServerAttributesForStudio(serverAttributes: Dictionary):Tuple |
SetServerAttribute(name: string,value: Variant):Tuple |
상속된 멤버
API 참조
메서드
InitializeServerAttributesForStudio
매개 변수
반환
SetServerAttribute
매개 변수
value:Variant |
반환
코드 샘플
매치메이킹 서비스 샘플
local MatchmakingService = game:GetService("MatchmakingService")
local RunService = game:GetService("RunService")
if RunService:IsStudio() then
-- 테스트를 위한 초기 속성과 스키마 설정
MatchmakingService:InitializeServerAttributesForStudio({
Level = "Advanced",
Elo = 123.456,
TrainingMode = true
})
end
-- Level 속성 가져오기
local currentLevel, errorMessage = MatchmakingService:GetServerAttribute("Level")
if errorMessage then
warn(errorMessage)
else
print("현재 레벨: " .. currentLevel)
end
-- Level 속성 값을 Advanced로 업데이트
local success, errorMessage = MatchmakingService:SetServerAttribute("Level", "Advanced")
if not success then
warn("서버 속성 [Level]을 [Advanced]로 업데이트하는 데 실패했습니다: " .. errorMessage)
else
print("[Level]을 [Advanced]로 성공적으로 설정했습니다.")
end