From 5bcdcc4709313333a453582197dff0e354f2ed2d Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Wed, 13 Sep 2023 17:41:34 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9A=8F=E6=9C=BA=E9=A1=BE=E5=AE=A2=E5=A5=96?= =?UTF-8?q?=E5=8A=B1=E5=8F=91=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/json/game_dragonplay.json | 108 +++++++++---------- bin/json/game_robot.json | 80 +++++++------- bin/json/game_skillatk.json | 5 - modules/smithy/api_refuse.go | 2 +- modules/smithy/api_trade.go | 8 +- modules/smithy/model_trade.go | 30 +++--- sys/configure/structs/Game.DragonPlayData.go | 4 +- 7 files changed, 120 insertions(+), 117 deletions(-) diff --git a/bin/json/game_dragonplay.json b/bin/json/game_dragonplay.json index 5cfdb808a..4ab9bb1fc 100644 --- a/bin/json/game_dragonplay.json +++ b/bin/json/game_dragonplay.json @@ -1,9 +1,9 @@ [ { "key": 1, - "id": "20030001", - "grow": 1, + "id": "20030003", "type": 1, + "interact": 1, "exp": 200, "time": 1, "cd": 0, @@ -13,9 +13,9 @@ }, { "key": 2, - "id": "20030001", - "grow": 1, - "type": 2, + "id": "20030003", + "type": 1, + "interact": 2, "exp": 300, "time": 1, "cd": 0, @@ -25,9 +25,9 @@ }, { "key": 3, - "id": "20030001", - "grow": 2, - "type": 1, + "id": "20030003", + "type": 2, + "interact": 1, "exp": 200, "time": 1, "cd": 0, @@ -37,9 +37,9 @@ }, { "key": 4, - "id": "20030001", - "grow": 2, + "id": "20030003", "type": 2, + "interact": 2, "exp": 200, "time": 1, "cd": 0, @@ -55,9 +55,9 @@ }, { "key": 5, - "id": "20030001", - "grow": 2, - "type": 3, + "id": "20030003", + "type": 2, + "interact": 3, "exp": 200, "time": 1, "cd": 0, @@ -67,9 +67,9 @@ }, { "key": 6, - "id": "20030001", - "grow": 2, - "type": 4, + "id": "20030003", + "type": 2, + "interact": 4, "exp": 100, "time": 1, "cd": 0, @@ -79,9 +79,9 @@ }, { "key": 7, - "id": "20030001", - "grow": 3, - "type": 1, + "id": "20030003", + "type": 3, + "interact": 1, "exp": 200, "time": 1, "cd": 0, @@ -91,9 +91,9 @@ }, { "key": 8, - "id": "20030001", - "grow": 3, - "type": 2, + "id": "20030003", + "type": 3, + "interact": 2, "exp": 300, "time": 1, "cd": 0, @@ -109,9 +109,9 @@ }, { "key": 9, - "id": "20030002", - "grow": 1, + "id": "20030001", "type": 1, + "interact": 1, "exp": 200, "time": 1, "cd": 0, @@ -121,9 +121,9 @@ }, { "key": 10, - "id": "20030002", - "grow": 1, - "type": 2, + "id": "20030001", + "type": 1, + "interact": 2, "exp": 300, "time": 1, "cd": 0, @@ -133,9 +133,9 @@ }, { "key": 11, - "id": "20030002", - "grow": 2, - "type": 1, + "id": "20030001", + "type": 2, + "interact": 1, "exp": 200, "time": 1, "cd": 0, @@ -145,9 +145,9 @@ }, { "key": 12, - "id": "20030002", - "grow": 2, + "id": "20030001", "type": 2, + "interact": 2, "exp": 200, "time": 1, "cd": 0, @@ -157,9 +157,9 @@ }, { "key": 13, - "id": "20030002", - "grow": 2, - "type": 3, + "id": "20030001", + "type": 2, + "interact": 3, "exp": 200, "time": 1, "cd": 0, @@ -169,9 +169,9 @@ }, { "key": 14, - "id": "20030002", - "grow": 2, - "type": 4, + "id": "20030001", + "type": 2, + "interact": 4, "exp": 100, "time": 1, "cd": 0, @@ -181,9 +181,9 @@ }, { "key": 15, - "id": "20030002", - "grow": 3, - "type": 1, + "id": "20030001", + "type": 3, + "interact": 1, "exp": 200, "time": 1, "cd": 0, @@ -193,9 +193,9 @@ }, { "key": 16, - "id": "20030002", - "grow": 3, - "type": 2, + "id": "20030001", + "type": 3, + "interact": 2, "exp": 300, "time": 1, "cd": 0, @@ -205,9 +205,9 @@ }, { "key": 17, - "id": "20030003", - "grow": 1, + "id": "20030002", "type": 1, + "interact": 1, "exp": 200, "time": 1, "cd": 0, @@ -217,9 +217,9 @@ }, { "key": 18, - "id": "20030003", - "grow": 2, + "id": "20030002", "type": 2, + "interact": 2, "exp": 200, "time": 1, "cd": 0, @@ -229,9 +229,9 @@ }, { "key": 19, - "id": "20030003", - "grow": 3, - "type": 1, + "id": "20030002", + "type": 3, + "interact": 1, "exp": 200, "time": 1, "cd": 0, @@ -241,9 +241,9 @@ }, { "key": 20, - "id": "20030003", - "grow": 3, - "type": 2, + "id": "20030002", + "type": 3, + "interact": 2, "exp": 300, "time": 1, "cd": 0, diff --git a/bin/json/game_robot.json b/bin/json/game_robot.json index b9ab9f696..6827aa367 100644 --- a/bin/json/game_robot.json +++ b/bin/json/game_robot.json @@ -9,7 +9,7 @@ "mtsid": { "a": "mts", "t": "20030001", - "n": 25 + "n": 8 } }, { @@ -22,7 +22,7 @@ "mtsid": { "a": "mts", "t": "20030001", - "n": 25 + "n": 8 } }, { @@ -35,7 +35,7 @@ "mtsid": { "a": "mts", "t": "20030001", - "n": 25 + "n": 8 } }, { @@ -48,7 +48,7 @@ "mtsid": { "a": "mts", "t": "20030001", - "n": 25 + "n": 8 } }, { @@ -61,7 +61,7 @@ "mtsid": { "a": "mts", "t": "20030001", - "n": 25 + "n": 8 } }, { @@ -74,7 +74,7 @@ "mtsid": { "a": "mts", "t": "20030001", - "n": 25 + "n": 8 } }, { @@ -87,7 +87,7 @@ "mtsid": { "a": "mts", "t": "20030001", - "n": 25 + "n": 8 } }, { @@ -100,7 +100,7 @@ "mtsid": { "a": "mts", "t": "20030001", - "n": 25 + "n": 8 } }, { @@ -113,7 +113,7 @@ "mtsid": { "a": "mts", "t": "20030001", - "n": 25 + "n": 8 } }, { @@ -126,7 +126,7 @@ "mtsid": { "a": "mts", "t": "20030001", - "n": 25 + "n": 8 } }, { @@ -139,7 +139,7 @@ "mtsid": { "a": "mts", "t": "20030001", - "n": 25 + "n": 8 } }, { @@ -152,7 +152,7 @@ "mtsid": { "a": "mts", "t": "20030001", - "n": 25 + "n": 8 } }, { @@ -165,7 +165,7 @@ "mtsid": { "a": "mts", "t": "20030001", - "n": 25 + "n": 8 } }, { @@ -178,7 +178,7 @@ "mtsid": { "a": "mts", "t": "20030001", - "n": 25 + "n": 8 } }, { @@ -191,7 +191,7 @@ "mtsid": { "a": "mts", "t": "20030001", - "n": 25 + "n": 8 } }, { @@ -204,7 +204,7 @@ "mtsid": { "a": "mts", "t": "20030001", - "n": 25 + "n": 8 } }, { @@ -217,7 +217,7 @@ "mtsid": { "a": "mts", "t": "20030001", - "n": 25 + "n": 8 } }, { @@ -230,7 +230,7 @@ "mtsid": { "a": "mts", "t": "20030001", - "n": 25 + "n": 8 } }, { @@ -243,7 +243,7 @@ "mtsid": { "a": "mts", "t": "20030001", - "n": 25 + "n": 8 } }, { @@ -256,7 +256,7 @@ "mtsid": { "a": "mts", "t": "20030001", - "n": 25 + "n": 8 } }, { @@ -269,7 +269,7 @@ "mtsid": { "a": "mts", "t": "20030001", - "n": 25 + "n": 8 } }, { @@ -282,7 +282,7 @@ "mtsid": { "a": "mts", "t": "20030001", - "n": 25 + "n": 8 } }, { @@ -295,7 +295,7 @@ "mtsid": { "a": "mts", "t": "20030001", - "n": 25 + "n": 8 } }, { @@ -308,7 +308,7 @@ "mtsid": { "a": "mts", "t": "20030001", - "n": 25 + "n": 8 } }, { @@ -321,7 +321,7 @@ "mtsid": { "a": "mts", "t": "20030001", - "n": 25 + "n": 8 } }, { @@ -334,7 +334,7 @@ "mtsid": { "a": "mts", "t": "20030001", - "n": 25 + "n": 8 } }, { @@ -347,7 +347,7 @@ "mtsid": { "a": "mts", "t": "20030001", - "n": 25 + "n": 8 } }, { @@ -360,7 +360,7 @@ "mtsid": { "a": "mts", "t": "20030001", - "n": 25 + "n": 8 } }, { @@ -373,7 +373,7 @@ "mtsid": { "a": "mts", "t": "20030001", - "n": 25 + "n": 8 } }, { @@ -386,7 +386,7 @@ "mtsid": { "a": "mts", "t": "20030001", - "n": 25 + "n": 8 } }, { @@ -399,7 +399,7 @@ "mtsid": { "a": "mts", "t": "20030001", - "n": 25 + "n": 8 } }, { @@ -412,7 +412,7 @@ "mtsid": { "a": "mts", "t": "20030001", - "n": 25 + "n": 8 } }, { @@ -425,7 +425,7 @@ "mtsid": { "a": "mts", "t": "20030001", - "n": 25 + "n": 8 } }, { @@ -438,7 +438,7 @@ "mtsid": { "a": "mts", "t": "20030001", - "n": 25 + "n": 8 } }, { @@ -451,7 +451,7 @@ "mtsid": { "a": "mts", "t": "20030001", - "n": 25 + "n": 8 } }, { @@ -464,7 +464,7 @@ "mtsid": { "a": "mts", "t": "20030001", - "n": 25 + "n": 8 } }, { @@ -477,7 +477,7 @@ "mtsid": { "a": "mts", "t": "20030001", - "n": 25 + "n": 8 } }, { @@ -490,7 +490,7 @@ "mtsid": { "a": "mts", "t": "20030001", - "n": 25 + "n": 8 } }, { @@ -503,7 +503,7 @@ "mtsid": { "a": "mts", "t": "20030001", - "n": 25 + "n": 8 } }, { @@ -516,7 +516,7 @@ "mtsid": { "a": "mts", "t": "20030001", - "n": 25 + "n": 8 } } ] \ No newline at end of file diff --git a/bin/json/game_skillatk.json b/bin/json/game_skillatk.json index d468ac22a..1bd2b293c 100644 --- a/bin/json/game_skillatk.json +++ b/bin/json/game_skillatk.json @@ -25335,7 +25335,6 @@ "Target": 1, "ChildSkill": { "Id": [ - 223003311, 223003312, 223003314 ] @@ -25369,7 +25368,6 @@ "Target": 1, "ChildSkill": { "Id": [ - 223003311, 223003322, 223003314 ] @@ -25403,7 +25401,6 @@ "Target": 1, "ChildSkill": { "Id": [ - 223003311, 223003332, 223003314 ] @@ -25437,7 +25434,6 @@ "Target": 1, "ChildSkill": { "Id": [ - 223003311, 223003342, 223003314 ] @@ -25471,7 +25467,6 @@ "Target": 1, "ChildSkill": { "Id": [ - 223003311, 223003352, 223003314 ] diff --git a/modules/smithy/api_refuse.go b/modules/smithy/api_refuse.go index c13d1a9e5..a3b8d5703 100644 --- a/modules/smithy/api_refuse.go +++ b/modules/smithy/api_refuse.go @@ -21,7 +21,7 @@ func (this *apiComp) Refuse(session comm.IUserSession, req *pb.SmithyRefuseReq) return } - cus, err := this.module.modelTrade.updateCustomer(session.GetUserId(), req.CustomerId) + cus, _, err := this.module.modelTrade.updateCustomer(session.GetUserId(), req.CustomerId) if err != nil { var errCustom = new(comm.CustomError) if errors.As(err, &errCustom) { diff --git a/modules/smithy/api_trade.go b/modules/smithy/api_trade.go index 4bcc8ad81..2c63415e3 100644 --- a/modules/smithy/api_trade.go +++ b/modules/smithy/api_trade.go @@ -22,12 +22,14 @@ func (this *apiComp) Sell(session comm.IUserSession, req *pb.SmithySellReq) (err if errdata = this.SellCheck(session, req); errdata != nil { return } - + var ( + rewardId int32 + ) //校验customer类型,因为有的类型是不能进入交易逻辑的 this.module.ModuleEquipment.RecycleEquipments(session, req.EquipIds, this.module.modelStove.StoveToolsSellUp(session.GetUserId())) - cus, err := this.module.modelTrade.updateCustomer(session.GetUserId(), req.CustomerId) + cus, rewardId, err := this.module.modelTrade.updateCustomer(session.GetUserId(), req.CustomerId) if err != nil { var customErr = new(comm.CustomError) if errors.As(err, &customErr) { @@ -41,7 +43,7 @@ func (this *apiComp) Sell(session comm.IUserSession, req *pb.SmithySellReq) (err return } } - conf, err := this.module.configure.GetSmithyCustomerConf(1) + conf, err := this.module.configure.GetSmithyCustomerConf(rewardId) if err != nil { errdata = &pb.ErrorData{ Code: pb.ErrorCode_ConfigNoFound, diff --git a/modules/smithy/model_trade.go b/modules/smithy/model_trade.go index 4a1733063..d2a476bd1 100644 --- a/modules/smithy/model_trade.go +++ b/modules/smithy/model_trade.go @@ -134,10 +134,15 @@ func (s *modelTrade) removeCustomer(cus *pb.DBCustomer, customerId string) *pb.D } // 随机新顾客 -func (s *modelTrade) updateCustomer(uid string, customerId string) (*pb.DBCustomer, error) { - cus, err := s.getDBCustomer(uid) +func (s *modelTrade) updateCustomer(uid string, customerId string) (cus *pb.DBCustomer, cusid int32, err error) { + + cus, err = s.getDBCustomer(uid) if err == nil { - cus = s.removeCustomer(cus, customerId) + //cus = s.removeCustomer(cus, customerId) + if v, ok := cus.Customers[customerId]; ok { + cusid = v.CustomerId + delete(cus.Customers, customerId) + } cus.Total++ //上限 limit := s.module.modelStove.StoveSkillAddCustomer(uid) @@ -150,15 +155,16 @@ func (s *modelTrade) updateCustomer(uid string, customerId string) (*pb.DBCustom "total": cus.Total, "lastRefreshTime": cus.LastRefreshTime, } - if err := s.Change(uid, update); err != nil { - return nil, err + if err = s.Change(uid, update); err != nil { + return } - return cus, nil + return } randCustomerId := s.getCustomerRandom() - conf, err := s.module.configure.GetSmithyCustomerConf(randCustomerId) - if err != nil { - return nil, comm.NewCustomError(pb.ErrorCode_ConfigNoFound) + conf, err1 := s.module.configure.GetSmithyCustomerConf(randCustomerId) + if err1 != nil { + err = comm.NewCustomError(pb.ErrorCode_ConfigNoFound) + return } suiteId := s.GetSuitRandom(uid, conf.CustomerType) if suiteId != 0 { @@ -177,11 +183,11 @@ func (s *modelTrade) updateCustomer(uid string, customerId string) (*pb.DBCustom "total": cus.Total, "lastRefreshTime": cus.LastRefreshTime, } - if err := s.Change(uid, update); err != nil { - return nil, err + if err = s.Change(uid, update); err != nil { + return } } - return cus, nil + return } // 返回概率下的套装 diff --git a/sys/configure/structs/Game.DragonPlayData.go b/sys/configure/structs/Game.DragonPlayData.go index cff31914e..daf449add 100644 --- a/sys/configure/structs/Game.DragonPlayData.go +++ b/sys/configure/structs/Game.DragonPlayData.go @@ -13,8 +13,8 @@ import "errors" type GameDragonPlayData struct { Key int32 Id string - Grow int32 Type int32 + Interact int32 Exp int32 Time int32 Cd int32 @@ -32,8 +32,8 @@ func (*GameDragonPlayData) GetTypeId() int32 { func (_v *GameDragonPlayData)Deserialize(_buf map[string]interface{}) (err error) { { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["key"].(float64); !_ok_ { err = errors.New("key error"); return }; _v.Key = int32(_tempNum_) } { var _ok_ bool; if _v.Id, _ok_ = _buf["id"].(string); !_ok_ { err = errors.New("id error"); return } } - { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["grow"].(float64); !_ok_ { err = errors.New("grow error"); return }; _v.Grow = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["type"].(float64); !_ok_ { err = errors.New("type error"); return }; _v.Type = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["interact"].(float64); !_ok_ { err = errors.New("interact error"); return }; _v.Interact = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["exp"].(float64); !_ok_ { err = errors.New("exp error"); return }; _v.Exp = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["time"].(float64); !_ok_ { err = errors.New("time error"); return }; _v.Time = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["cd"].(float64); !_ok_ { err = errors.New("cd error"); return }; _v.Cd = int32(_tempNum_) }