[이민우] 캐릭터 생성 제한 구현 (대신 커밋)

This commit is contained in:
2023-09-06 17:11:47 +09:00
parent 89e7d35b5a
commit e2bec481f0

View File

@ -405,19 +405,23 @@ func (caller apiCaller) lockcreatecharAPI(w http.ResponseWriter, r *http.Request
curregion, _ := gocommon.ReadStringFormValue(r.Form, "region")
var locked map[string]any
for _, regioninfo := range mg {
region := regioninfo["divisions"].(primitive.M)
for idx, rl := range region {
if idx == curregion {
if rl.(primitive.M)["lockcreatechar"].(bool) {
w.Write([]byte(fmt.Sprintf(`{"create":"%t"}`, true)))
locked["lock"] = true
} else {
w.Write([]byte(fmt.Sprintf(`{"create":"%t"}`, false)))
locked["lock"] = false
}
}
}
}
create, _ := json.Marshal(locked)
w.Write(create)
return nil
}