瀏覽代碼

Merge remote-tracking branch 'origin/master'

zhengtao 9 月之前
父節點
當前提交
d7cafe52c9

+ 8 - 8
game/config/data/achieveTaskConfig.json

@@ -1,10 +1,10 @@
 [
-		{"ID":2,"Enable":1,"Type":1,"Condition":1,"Reward":[{"itemBaseType":2,"itemID":6,"amount":10},{"itemBaseType":1,"itemID":5,"amount":10000},{"itemBaseType":1,"itemID":7,"amount":2}],"Url":"https://t.me/mhaya_official/389467"},
-		{"ID":1,"Enable":1,"Type":1,"Condition":1,"Reward":[{"itemBaseType":2,"itemID":6,"amount":10},{"itemBaseType":1,"itemID":5,"amount":10000},{"itemBaseType":1,"itemID":7,"amount":2}],"Url":"https://x.com/Mhaya_Official"},
-		{"ID":3,"Enable":1,"Type":1,"Condition":1,"Reward":[{"itemBaseType":2,"itemID":6,"amount":10},{"itemBaseType":1,"itemID":5,"amount":10000},{"itemBaseType":1,"itemID":7,"amount":2}],"Url":"https://www.youtube.com/@mhayaPlaytoearn"},
-		{"ID":4,"Enable":1,"Type":1,"Condition":1,"Reward":[{"itemBaseType":2,"itemID":6,"amount":10},{"itemBaseType":1,"itemID":5,"amount":10000},{"itemBaseType":1,"itemID":7,"amount":2}],"Url":"https://discord.com/invite/mhaya"},
-		{"ID":5,"Enable":1,"Type":2,"Condition":1,"Reward":[{"itemBaseType":2,"itemID":6,"amount":10},{"itemBaseType":1,"itemID":7,"amount":2}],"Url":""},
-		{"ID":6,"Enable":1,"Type":2,"Condition":6,"Reward":[{"itemBaseType":2,"itemID":6,"amount":15},{"itemBaseType":1,"itemID":7,"amount":3}],"Url":""},
-		{"ID":7,"Enable":1,"Type":2,"Condition":11,"Reward":[{"itemBaseType":2,"itemID":6,"amount":20},{"itemBaseType":1,"itemID":7,"amount":4}],"Url":""},
-		{"ID":8,"Enable":1,"Type":2,"Condition":21,"Reward":[{"itemBaseType":2,"itemID":6,"amount":25},{"itemBaseType":1,"itemID":7,"amount":5}],"Url":""}	
+		{"ID":2,"Order":1,"Enable":1,"Type":1,"Condition":1,"Reward":[{"itemBaseType":2,"itemID":6,"amount":10},{"itemBaseType":1,"itemID":5,"amount":10000},{"itemBaseType":1,"itemID":7,"amount":2}],"Url":"https://t.me/mhaya_official/389467"},
+		{"ID":1,"Order":2,"Enable":1,"Type":1,"Condition":1,"Reward":[{"itemBaseType":2,"itemID":6,"amount":10},{"itemBaseType":1,"itemID":5,"amount":10000},{"itemBaseType":1,"itemID":7,"amount":2}],"Url":"https://x.com/Mhaya_Official"},
+		{"ID":3,"Order":3,"Enable":1,"Type":1,"Condition":1,"Reward":[{"itemBaseType":2,"itemID":6,"amount":10},{"itemBaseType":1,"itemID":5,"amount":10000},{"itemBaseType":1,"itemID":7,"amount":2}],"Url":"https://www.youtube.com/@mhayaPlaytoearn"},
+		{"ID":4,"Order":4,"Enable":1,"Type":1,"Condition":1,"Reward":[{"itemBaseType":2,"itemID":6,"amount":10},{"itemBaseType":1,"itemID":5,"amount":10000},{"itemBaseType":1,"itemID":7,"amount":2}],"Url":"https://discord.com/invite/mhaya"},
+		{"ID":5,"Order":5,"Enable":1,"Type":2,"Condition":1,"Reward":[{"itemBaseType":2,"itemID":6,"amount":10},{"itemBaseType":1,"itemID":7,"amount":2}],"Url":""},
+		{"ID":6,"Order":6,"Enable":1,"Type":2,"Condition":6,"Reward":[{"itemBaseType":2,"itemID":6,"amount":15},{"itemBaseType":1,"itemID":7,"amount":3}],"Url":""},
+		{"ID":7,"Order":7,"Enable":1,"Type":2,"Condition":11,"Reward":[{"itemBaseType":2,"itemID":6,"amount":20},{"itemBaseType":1,"itemID":7,"amount":4}],"Url":""},
+		{"ID":8,"Order":8,"Enable":1,"Type":2,"Condition":21,"Reward":[{"itemBaseType":2,"itemID":6,"amount":25},{"itemBaseType":1,"itemID":7,"amount":5}],"Url":""}	
 ]

+ 1 - 0
game/game_cluster/internal/data/achieveTaskConfig.go

@@ -13,6 +13,7 @@ type achieveTaskConfig struct {
 
 type AchieveTaskConfigRow struct {
 	ID        int          // #任务ID
+	Order     int          //顺序
 	Enable    int          // 是否开启(0否1是)
 	Type      int          // 任务类型(1基本类型2邀请好友相关)
 	Condition int          // 完成条件

+ 2 - 0
game/game_cluster/internal/mdb/models/achieveTask.go

@@ -17,6 +17,7 @@ const (
 
 type AchieveTaskBase struct {
 	ID        int               `json:"id" bson:"id"`               // #任务ID
+	Order     int               `json:"order" bson:"order"`         //任务客户端排序
 	Type      int               `json:"type" bson:"type"`           // 任务类型(1基本类型2邀请好友相关)
 	Condition int               `json:"condition" bson:"condition"` // 完成条件
 	Reward    []data.ItemReward `json:"reward" bson:"reward"`       // 奖励
@@ -39,6 +40,7 @@ func (at AchieveTask) RefreshAchieveTask() {
 		if _, ok := at[d.ID]; !ok {
 			at[d.ID] = &AchieveTaskBase{
 				ID:        d.ID,
+				Order:     d.Order,
 				Type:      d.Type,
 				Condition: d.Condition,
 				Reward:    d.Reward,

+ 9 - 6
game/game_cluster/internal/mdb/models/player.go

@@ -10,7 +10,6 @@ import (
 	"github.com/mhaya/game/game_cluster/internal/data"
 	"github.com/mhaya/game/game_cluster/internal/mdb"
 	"github.com/mhaya/game/game_cluster/internal/param"
-	"github.com/mhaya/game/game_cluster/internal/third"
 	"github.com/mhaya/game/game_cluster/internal/token"
 	"time"
 
@@ -224,11 +223,13 @@ func (p *Player) CheckTaskByType1(userID string, id int) bool {
 	case 1: //关注关注推特
 		return true
 	case 2: //加入TG频道
-		if third.GetIfChannel(userID) == 1 {
-			return true
-		} else {
-			return false
-		}
+		//if third.GetIfChannel(userID) == 1 {
+		//	return true
+		//} else {
+		//	return false
+		//}
+		return true
+
 	case 3: //关注Yutube账号
 		return true
 	case 4: //加入DC频道
@@ -245,6 +246,8 @@ func (p *Player) FinishAchieveTaskByType1(id int) bool {
 				p.AchieveTask[id].Num = 1
 				p.AchieveTask[id].Status = 1
 			} else {
+				p.AchieveTask[id].Validate = 0 //验证成功
+				p.AchieveTask[id].Status = 0
 				mhayaLogger.Error("FinishAchieveTaskByType1 验证失败 username :%v,  id : v%", p.UserName, id)
 				return false
 			}