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

This commit is contained in:
2023-09-08 18:24:17 +09:00
parent fafc463f2a
commit 117a3e5d90

View File

@ -403,18 +403,23 @@ func (caller apiCaller) lockcreatecharAPI(w http.ResponseWriter, r *http.Request
return err return err
} }
curregion, _ := gocommon.ReadStringFormValue(r.Form, "region") haschr, _ := gocommon.ReadStringFormValue(r.Form, "haschr")
locked := map[string]any{ locked := make(map[string]any)
"lock": false, if haschr == "true" {
} locked["lock"] = false
} else {
curregion, _ := gocommon.ReadStringFormValue(r.Form, "region")
for _, regioninfo := range mg { for _, regioninfo := range mg {
region := regioninfo["divisions"].(primitive.M) region := regioninfo["divisions"].(primitive.M)
for idx, rl := range region { for idx, rl := range region {
if idx == curregion { if idx == curregion {
if rl.(primitive.M)["lockcreatechar"].(bool) { if rl.(primitive.M)["lockcreatechar"].(bool) {
locked["lock"] = true locked["lock"] = true
} else {
locked["lock"] = false
}
} }
} }
} }