From 199400ef01a0c02559c504af5df7c623756d1c77 Mon Sep 17 00:00:00 2001 From: cwkoh Date: Wed, 14 Dec 2022 14:37:47 +0900 Subject: [PATCH] =?UTF-8?q?=EC=BA=90=EB=A6=AD=ED=84=B0=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1=20=EC=84=B1=EA=B3=B5=EC=8B=9C=20=EC=A0=84=EB=8B=AC?= =?UTF-8?q?=ED=95=98=EB=8A=94=20=EA=B2=B0=EA=B3=BC=20=EA=B0=92=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 생성된 캐릭터 정보를 바로 보내서 클라에서 캐릭터 정보를 바로 update 하도록 한다 --- core/AEGS_methods.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/AEGS_methods.go b/core/AEGS_methods.go index 4adf3cb..f9a8732 100644 --- a/core/AEGS_methods.go +++ b/core/AEGS_methods.go @@ -317,8 +317,9 @@ func (tx *transaction) UpdateCharInfo(charSlotId int32, raw map[string]interface q, err := tx.gs.mongoClient.FindOne("PlayerInfo", bson.M{"_id": playerid, "charInfo.slotId": charSlotId}, options.FindOne().SetProjection(bson.M{"charInfo.$": 1})) + var info map[string]interface{} if q == nil { - info := raw + info = raw info["slotId"] = charSlotId tx.gs.Logger.Println("new info", info) @@ -331,7 +332,7 @@ func (tx *transaction) UpdateCharInfo(charSlotId int32, raw map[string]interface }, options.Update().SetUpsert(true)) } else { - info := q["charInfo"].(bson.A)[0].(map[string]interface{}) + info = q["charInfo"].(bson.A)[0].(map[string]interface{}) tx.gs.Logger.Println("current info", info) for k, v := range raw { @@ -359,7 +360,8 @@ func (tx *transaction) UpdateCharInfo(charSlotId int32, raw map[string]interface // }, options.Update().SetUpsert(true)) if err == nil { - return shared.MakeRPCReturn("update success", err) + doc := bson.M(info) + return shared.MakeRPCReturn(doc, nil) } else { return shared.MakeRPCReturn(nil, errors.New("invalid body")) }