on join: set {_thirst} to yaml value "Thirst::%uuid of player%" from "thirst" if {_thirst} is not set or null: set yaml value "Thirst::%uuid of player%" from "thirst" to 100 set {_thirst} to 100 set metadata "Thirst" of player to {_thirst} on quit: set {_meta} to metadata "Thirst" of player set yaml value "Thirst::%uuid of player%" from "thirst" to {_meta} delete metadata "Thirst" of player save yaml "thirst"
이런식으로 들어오면 Yaml을 불러와 메타데이터에 저장 시킨뒤, 캐시로 사용하고, 나갈때 Yaml에 저장하는 방식을 썼는데 스크립트 허브를 보니 세이브를 하지 않으면 값은 캐시에서 변경된다고 되어 있더군.
그럼 결국 캐시를 사용한다는건데,
그럼 그냥 Yaml에 계속 쓰고 삭제하고 하다가 나갈때 세이브를 하는게 나을까 아니면
위에 올린 코드의 방식이 나을까?
캐라 해도 Yaml이라 잘 모르겠어서 질문드림..
댓글 0