zhengtao 9 kuukautta sitten
vanhempi
commit
10d1d9f3f2

+ 1 - 1
game/config/data/dailyTaskConfig.json

@@ -1,5 +1,5 @@
 [
-		{"ID":1,"Enable":1,"Type":1,"Condition":3,"Reward":[{"itemBaseType":1,"itemID":5,"amount":100}]},
+		{"ID":1,"Enable":1,"Type":1,"Condition":3,"Reward":[{"itemBaseType":1,"itemID":5,"amount":10000}]},
 		{"ID":2,"Enable":1,"Type":1,"Condition":30,"Reward":[{"itemBaseType":1,"itemID":1,"amount":10}]},
 		{"ID":3,"Enable":1,"Type":1,"Condition":100,"Reward":[{"itemBaseType":1,"itemID":1,"amount":30}]},
 		{"ID":4,"Enable":1,"Type":1,"Condition":500,"Reward":[{"itemBaseType":2,"itemID":6,"amount":10}]}	

+ 3 - 3
game/config/data/sdkConfig.json

@@ -1,5 +1,5 @@
 [
-		{"ID":1,"CallbackName":"dev","Salt":"123456","Params":null,"Desc":""},
-		{"ID":2,"CallbackName":"Telegram-sdk","Salt":"qwe123","Params":{"BotToken":"6558312022:AAGcpPhC5_Y22qzvkWIYauuT0L1VhJrsPQg","BtUserName":"mhaya_bot","ChatIDName":"@mhaya_monopoly","AppID":"","AppKey":"","AppUrl":"https://api.telegram.org/bot"},"Desc":""},
-		{"ID":3,"CallbackName":"Telegram-sdk-test","Salt":"aaabbb","Params":{"BotToken":"7023119999:AAENbsnH0b9nDbWC60yMdINiezDeUkqOq0Y","BtUserName":"mhaya_bot","ChatIDName":"@mhaya_monopoly","AppID":"","AppKey":"","AppUrl":"https://api.telegram.org/bot"},"Desc":""}	
+		{"ID":1,"CallbackName":"dev","Salt":"123456","Params":null,"S3":null,"Desc":""},
+		{"ID":2,"CallbackName":"Telegram-sdk","Salt":"qwe123aa","Params":{"BotToken":"6558312022:AAGcpPhC5_Y22qzvkWIYauuT0L1VhJrsPQg","BtUserName":"mhaya_bot","ChatIDName":"@mhaya_monopoly","AppID":"","AppKey":"","AppUrl":"https://api.telegram.org/bot"},"S3":{"AccessKey":"AKIAQE3ROQJW2LCZ7XEA","SecretKey":"","Region":"","BucketName":"","Uid":""},"Desc":""},
+		{"ID":3,"CallbackName":"Telegram-sdk-test","Salt":"aaabbbaaaa","Params":{"BotToken":"7023119999:AAENbsnH0b9nDbWC60yMdINiezDeUkqOq0Y","BtUserName":"mhaya_bot","ChatIDName":"@mhaya_monopoly","AppID":"","AppKey":"","AppUrl":"https://api.telegram.org/bot"},"S3":null,"Desc":""}	
 ]

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

@@ -3,6 +3,7 @@ package models
 import (
 	"context"
 	"fmt"
+	"github.com/mhaya/game/game_cluster/internal/third"
 	"time"
 
 	jsoniter "github.com/json-iterator/go"
@@ -227,11 +228,11 @@ func (p *Player) CheckTaskByType1(openid int64, id int) bool {
 	case 1: //关注关注推特
 		return true
 	case 2: //加入TG频道
-		//if third.GetIfChannel(openid) == 1 {
-		//	return true
-		//} else {
-		//	return false
-		//}
+		if third.GetIfChannel(openid) == 1 {
+			return true
+		} else {
+			return false
+		}
 		return true
 
 	case 3: //关注Yutube账号

+ 2 - 2
game/game_cluster/internal/third/telegram.go

@@ -18,7 +18,7 @@ type GetIfChannelResp struct {
 
 // 判断是否是VIP
 func GetIfPremium(openid int64) int32 {
-	ret := data.SdkConfig.Get(3)
+	ret := data.SdkConfig.Get(2)
 	params := map[string]string{}
 	rs, _, err := mhayaHttp.GET(fmt.Sprintf("%vbot%v/getChatMember?chat_id=%v&user_id=%v", ret.Params.AppUrl, ret.Params.BotToken, ret.Params.ChatIDName, openid), params)
 	if err != nil {
@@ -55,7 +55,7 @@ func GetIfPremium(openid int64) int32 {
 
 // 判断用户是否是成员
 func GetIfChannel(openid int64) int32 {
-	ret := data.SdkConfig.Get(3)
+	ret := data.SdkConfig.Get(2)
 	params := map[string]string{}
 	rs, _, err := mhayaHttp.GET(fmt.Sprintf("%vbot%v/getChatMember?chat_id=%v&user_id=%v", ret.Params.AppUrl, ret.Params.BotToken, ret.Params.ChatIDName, openid), params)
 	if err != nil {

+ 2 - 2
game/game_cluster/nodes/game/module/player/actor_player.go

@@ -82,10 +82,10 @@ func (p *actorPlayer) OnInit() {
 	p.Timer().Add(10*time.Second, p.refreshRoll)
 	p.Timer().Add(1*time.Second, p.SetRewardToDB)
 	p.Timer().Add(1*time.Minute, p.setRedis)
-	p.Timer().Add(1*time.Second, p.setDb)
+	p.Timer().Add(5*time.Second, p.setDb)
 	p.Timer().Add(30*time.Second, p.setInviteReward)
 
-	p.Timer().Add(1*time.Second, p.addRoll)
+	//	p.Timer().Add(1*time.Second, p.addRoll)
 	p.Timer().Add(10*time.Second, p.playerSessionClose)
 
 	p.Timer().Add(1*time.Minute, p.upatePlayerLevelStat)

+ 4 - 2
game/game_cluster/nodes/web/controller/guide.go

@@ -2,9 +2,11 @@ package controller
 
 import (
 	mhayaGin "github.com/mhaya/components/gin"
+	mhayaString "github.com/mhaya/extend/string"
 	"github.com/mhaya/game/game_cluster/internal/code"
 	"github.com/mhaya/game/game_cluster/internal/constant"
 	"github.com/mhaya/game/game_cluster/internal/param"
+	"github.com/mhaya/game/game_cluster/internal/third"
 	mhayaLogger "github.com/mhaya/logger"
 )
 
@@ -28,8 +30,8 @@ func (p *Controller) guide(c *mhayaGin.Context) {
 		return
 	}
 	if pa.CloseReward == 1 {
-		//	pa.Status = third.GetIfChannel(token.PlayerID)
-		pa.Status = 1
+		openid, _ := mhayaString.ToInt64(token.OpenID)
+		pa.Status = third.GetIfChannel(openid)
 	}
 
 	resp := &param.GuideResp{}