Commit f24e0fba056c411f1ecd2d866d520fe6a0bbd9d8

Authored by 陆恒
1 parent d2c0db63

提交修改

src/HttpServer/logic/constdef.go
@@ -48,6 +48,6 @@ const ( @@ -48,6 +48,6 @@ const (
48 ) 48 )
49 49
50 const ( 50 const (
51 - WATCH_ADD_DAY_LIMIT = 9 //当天观看视频次数限制  
52 - FREE_REDBAG_NUM = 3 //玩家免费红包次数 51 + WATCH_ADD_DAY_LIMIT = 50 //当天获取红包次数限制
  52 + FREE_REDBAG_NUM = 3 //玩家免费红包次数
53 ) 53 )
src/HttpServer/logic/datadef.go
@@ -8,11 +8,11 @@ type UserLoginReq struct { @@ -8,11 +8,11 @@ type UserLoginReq struct {
8 } 8 }
9 9
10 type UserLoginData struct { 10 type UserLoginData struct {
11 - Walletgold int `json:"walletgold"`  
12 - Leftads int `json:"leftads"`  
13 - Guangold int `json:"guangold"`  
14 - Userlv int `json:"userlv"`  
15 - Userexp int `json:"userexp"` 11 + Walletgold int `json:"walletgold"`
  12 + Leftredbagcnt int `json:"leftredbagcnt"`
  13 + Guangold int `json:"guangold"`
  14 + Userlv int `json:"userlv"`
  15 + Userexp int `json:"userexp"`
16 } 16 }
17 17
18 type UserLoginResp struct { 18 type UserLoginResp struct {
@@ -28,7 +28,7 @@ type GetuserdataReq struct { @@ -28,7 +28,7 @@ type GetuserdataReq struct {
28 28
29 type GetuserdataData struct { 29 type GetuserdataData struct {
30 Walletgold int `json:"walletgold"` 30 Walletgold int `json:"walletgold"`
31 - Leftads int `json:"leftads"` 31 + Leftredbagcnt int `json:"leftredbagcnt"`
32 Guangold int `json:"guangold"` 32 Guangold int `json:"guangold"`
33 Userlv int `json:"userlv"` 33 Userlv int `json:"userlv"`
34 Userexp int `json:"userexp"` 34 Userexp int `json:"userexp"`
@@ -286,7 +286,7 @@ type UserData struct { @@ -286,7 +286,7 @@ type UserData struct {
286 Exp int //玩家当前经验值 286 Exp int //玩家当前经验值
287 GuanGold int //玩家存钱罐中金币数量 287 GuanGold int //玩家存钱罐中金币数量
288 RealGold int //玩家实际金币数量(可用于提现的) 288 RealGold int //玩家实际金币数量(可用于提现的)
289 - WatchAddsTime int //当天观看激励视频次数 289 + WatchAddsTime int //当天剩余红包次数 初始化50次
290 LastLoginTime int //上次登陆时间 290 LastLoginTime int //上次登陆时间
291 ContinueLoginDay int //连续登录天数 291 ContinueLoginDay int //连续登录天数
292 GetFromGuanCnt int //当天从存钱款提取金币次数 292 GetFromGuanCnt int //当天从存钱款提取金币次数
src/HttpServer/logic/function.go
@@ -464,7 +464,7 @@ func InitUserInfo(data *UserLoginReq, resp *UserLoginResp, uuid int) error { @@ -464,7 +464,7 @@ func InitUserInfo(data *UserLoginReq, resp *UserLoginResp, uuid int) error {
464 } 464 }
465 465
466 resp.Data.Guangold = initdata.GuanGold 466 resp.Data.Guangold = initdata.GuanGold
467 - resp.Data.Leftads = initdata.WatchAddsTime 467 + resp.Data.Leftredbagcnt = initdata.WatchAddsTime
468 resp.Data.Walletgold = initdata.RealGold 468 resp.Data.Walletgold = initdata.RealGold
469 resp.Data.Userlv = initdata.Lv 469 resp.Data.Userlv = initdata.Lv
470 470
@@ -641,7 +641,7 @@ func GetUserData(uuid int, req *UserLoginReq, resp *UserLoginResp) error { @@ -641,7 +641,7 @@ func GetUserData(uuid int, req *UserLoginReq, resp *UserLoginResp) error {
641 SaveUserInfo(data) 641 SaveUserInfo(data)
642 642
643 resp.Data.Walletgold = data.RealGold 643 resp.Data.Walletgold = data.RealGold
644 - resp.Data.Leftads = data.WatchAddsTime 644 + resp.Data.Leftredbagcnt = data.WatchAddsTime
645 resp.Data.Guangold = data.GuanGold 645 resp.Data.Guangold = data.GuanGold
646 resp.Data.Userlv = data.Lv 646 resp.Data.Userlv = data.Lv
647 resp.Data.Userexp = data.Exp 647 resp.Data.Userexp = data.Exp
src/HttpServer/logic/httpserver.go
@@ -407,6 +407,11 @@ func Queryguaninfo(w http.ResponseWriter, r *http.Request) { @@ -407,6 +407,11 @@ func Queryguaninfo(w http.ResponseWriter, r *http.Request) {
407 407
408 func Watchads(w http.ResponseWriter, r *http.Request) { 408 func Watchads(w http.ResponseWriter, r *http.Request) {
409 409
  410 + //这个接口作废
  411 + logger.Info("Watchads is not used")
  412 + SetHeader(w)
  413 +
  414 + return
410 Uuid := 0 415 Uuid := 0
411 if len(r.Header) > 0 { 416 if len(r.Header) > 0 {
412 Uuid, _ = strconv.Atoi(r.Header.Get("Uuid")) 417 Uuid, _ = strconv.Atoi(r.Header.Get("Uuid"))
src/HttpServer/logic/logic.go
@@ -526,6 +526,9 @@ func HandlerUpdatetaskandachieve(w http.ResponseWriter, data string, uuid int) { @@ -526,6 +526,9 @@ func HandlerUpdatetaskandachieve(w http.ResponseWriter, data string, uuid int) {
526 if uinfo.LeftFreeRB > 0 { 526 if uinfo.LeftFreeRB > 0 {
527 uinfo.LeftFreeRB-- 527 uinfo.LeftFreeRB--
528 } 528 }
  529 + if uinfo.WatchAddsTime > 0 {
  530 + uinfo.WatchAddsTime--
  531 + }
529 case TASKTYPE_WATCHADS: 532 case TASKTYPE_WATCHADS:
530 uinfo.Achieve.WatchAdsCnt += rdata.Value 533 uinfo.Achieve.WatchAdsCnt += rdata.Value
531 case TASKTYPE_KILLSTAR: 534 case TASKTYPE_KILLSTAR:
@@ -807,7 +810,7 @@ func HandlerGetuserdata(w http.ResponseWriter, data string, uuid int) { @@ -807,7 +810,7 @@ func HandlerGetuserdata(w http.ResponseWriter, data string, uuid int) {
807 810
808 resp.Data.Walletgold = data.RealGold 811 resp.Data.Walletgold = data.RealGold
809 resp.Data.Guangold = data.GuanGold 812 resp.Data.Guangold = data.GuanGold
810 - resp.Data.Leftads = data.WatchAddsTime 813 + resp.Data.Leftredbagcnt = data.WatchAddsTime
811 resp.Data.Userexp = data.Exp 814 resp.Data.Userexp = data.Exp
812 resp.Data.Userlv = data.Lv 815 resp.Data.Userlv = data.Lv
813 resp.Data.Leftfreeredbag = data.LeftFreeRB 816 resp.Data.Leftfreeredbag = data.LeftFreeRB