From e4be401bdb2e5e24330da5031e62949c37fbc146 Mon Sep 17 00:00:00 2001 From: wh_zcy Date: Wed, 4 Jan 2023 16:07:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/json/game_worldtask.json | 50 ++++++++++++++++++++++++++---------- modules/rtask/module.go | 1 + utils/utils_test.go | 23 +++++++++++------ 3 files changed, 52 insertions(+), 22 deletions(-) diff --git a/bin/json/game_worldtask.json b/bin/json/game_worldtask.json index 5ebd83749..d8cc9981b 100644 --- a/bin/json/game_worldtask.json +++ b/bin/json/game_worldtask.json @@ -2,14 +2,14 @@ { "key": 10100, "lock": 1, - "ontxe": 999999, + "ontxe": 0, "id_after": 10101, "group": 1, "des": 2, "icon": "", "npc": [ "scenes_boundary_01_recordtask", - "杰克-入场", + "杰克", "150" ], "getafter_event": [ @@ -30,7 +30,7 @@ { "key": 10101, "lock": 1, - "ontxe": 10100, + "ontxe": 10101, "id_after": 10102, "group": 1, "des": 2, @@ -52,7 +52,7 @@ { "key": 10102, "lock": 1, - "ontxe": 10101, + "ontxe": 0, "id_after": 10103, "group": 1, "des": 2, @@ -1747,7 +1747,7 @@ ], "completetask": 0, "auto_accept": 0, - "overtips": 1, + "overtips": 0, "reword": [] }, { @@ -1769,7 +1769,7 @@ ], "completetask": 0, "auto_accept": 1, - "overtips": 1, + "overtips": 0, "reword": [] }, { @@ -1791,7 +1791,7 @@ ], "completetask": 0, "auto_accept": 0, - "overtips": 1, + "overtips": 0, "reword": [] }, { @@ -1813,7 +1813,7 @@ ], "completetask": 0, "auto_accept": 0, - "overtips": 1, + "overtips": 0, "reword": [] }, { @@ -1835,7 +1835,7 @@ ], "completetask": 0, "auto_accept": 0, - "overtips": 1, + "overtips": 0, "reword": [] }, { @@ -1857,7 +1857,7 @@ ], "completetask": 0, "auto_accept": 0, - "overtips": 1, + "overtips": 0, "reword": [] }, { @@ -1879,7 +1879,7 @@ ], "completetask": 0, "auto_accept": 0, - "overtips": 1, + "overtips": 0, "reword": [] }, { @@ -1901,7 +1901,7 @@ ], "completetask": 0, "auto_accept": 0, - "overtips": 1, + "overtips": 0, "reword": [] }, { @@ -1923,7 +1923,7 @@ ], "completetask": 0, "auto_accept": 0, - "overtips": 1, + "overtips": 0, "reword": [] }, { @@ -1945,7 +1945,7 @@ ], "completetask": 0, "auto_accept": 0, - "overtips": 1, + "overtips": 0, "reword": [] }, { @@ -1967,6 +1967,28 @@ ], "completetask": 0, "auto_accept": 0, + "overtips": 0, + "reword": [] + }, + { + "key": 101, + "lock": 1, + "ontxe": 0, + "id_after": 0, + "group": 2, + "des": 2, + "icon": "", + "npc": [ + "scenes_boundary_01_recordtask", + "杰克A", + "150" + ], + "getafter_event": [ + 2, + 1002 + ], + "completetask": 0, + "auto_accept": 0, "overtips": 1, "reword": [] } diff --git a/modules/rtask/module.go b/modules/rtask/module.go index b6961c480..092c312ce 100644 --- a/modules/rtask/module.go +++ b/modules/rtask/module.go @@ -291,6 +291,7 @@ func (this *ModuleRtask) SendToRtask(session comm.IUserSession, rtaskType comm.T if code := this.CheckCondi(uid, conf.Id); code == pb.ErrorCode_Success { module, err := this.service.GetModule(comm.ModuleWorldtask) if err == nil { + // 世界任务 if worldtask, ok := module.(comm.IWorldtask); ok { if err := worldtask.TaskcondNotify(session, conf.Id); err != nil { var customErr = new(comm.CustomError) diff --git a/utils/utils_test.go b/utils/utils_test.go index 556cbe082..0ebb63e76 100644 --- a/utils/utils_test.go +++ b/utils/utils_test.go @@ -78,17 +78,24 @@ func TestMatrxing(t *testing.T) { } func TestCompre(t *testing.T) { - a := []int32{1, 2, 4, 5} - b := []int32{1, 2, 4} - fmt.Println(utils.ForContainer(a, b)) + // a := []int32{1, 2, 4, 5} + // b := []int32{1, 2, 4} + // fmt.Println(utils.ForContainer(a, b)) } func TestDeletex(t *testing.T) { - a := []int32{1, 2, 3, 4} - c := utils.Deletex(a, 2) - fmt.Println(c) + // a := []int32{1, 2, 3, 4} + // c := utils.Deletex(a, 2) + // fmt.Println(c) } func TestDiffDays(t *testing.T) { - fmt.Println(utils.DiffDays(1614527999, 1614614400)) -} \ No newline at end of file + // fmt.Println(utils.DiffDays(1614527999, 1614614400)) +} + +func BenchmarkRandNumbers(b *testing.B) { + for i := 0; i < b.N; i++ { + b.ReportAllocs() + utils.RandomNumbers(0, 7, 4) + } +}