From 199400ef01a0c02559c504af5df7c623756d1c77 Mon Sep 17 00:00:00 2001 From: cwkoh Date: Wed, 14 Dec 2022 14:37:47 +0900 Subject: [PATCH 1/2] =?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")) } From a0372bec9d2f4e3f134c58b5738e6256818fe5e4 Mon Sep 17 00:00:00 2001 From: cwkoh Date: Wed, 14 Dec 2022 14:57:09 +0900 Subject: [PATCH 2/2] =?UTF-8?q?-port=20=ED=94=84=EB=A1=9C=EA=B7=B8?= =?UTF-8?q?=EB=9E=A8=20=EC=8B=A4=ED=96=89=20=ED=8C=8C=EB=9D=BC=EB=AF=B8?= =?UTF-8?q?=ED=84=B0=EA=B0=80=20=EC=9E=98=20=EB=8F=99=EC=9E=91=ED=95=98?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20flag=20parse=20=ED=95=98=EB=8A=94=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/AeGameServer.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/AeGameServer.go b/core/AeGameServer.go index 0314b59..b07b96c 100644 --- a/core/AeGameServer.go +++ b/core/AeGameServer.go @@ -3,6 +3,7 @@ package core import ( "anvil/shared" "bytes" + "flag" "fmt" "io" "io/ioutil" @@ -77,6 +78,9 @@ func (gs *AeGameServer) Version() string { // New : func New() (*AeGameServer, error) { + if !flag.Parsed() { + flag.Parse() + } logfilename := fmt.Sprintf("AEGS_%s.log", time.Now().Format("2006-01-02T15-04-05")) logFile, err := os.OpenFile(logfilename, os.O_CREATE|os.O_WRONLY|os.O_CREATE, 0666)