57 lines
1.8 KiB
Go
57 lines
1.8 KiB
Go
package unit
|
|
|
|
import (
|
|
"fmt"
|
|
"server/game"
|
|
"server/game/mod/activity"
|
|
"testing"
|
|
)
|
|
|
|
func TestChampionshipReward(t *testing.T) {
|
|
player := getTestPlayer()
|
|
player.GetChampshipMod().AddScore([]int{15, 15, 15})
|
|
todayAid, yestAid := player.GetChampshipActivityId()
|
|
activityCfg := game.G_GameLogicPtr.ActivityMgr.GetActivityListByType(activity.ACT_TYPE_CHAMPION)
|
|
fmt.Printf("activity cfg : %v\n", activityCfg)
|
|
items := player.GetChampshipReward(todayAid)
|
|
fmt.Printf("today id %d items : %v\n", todayAid, items)
|
|
player.GetChampshipMod().ZeroUpdate(activityCfg.Id, activityCfg.AId)
|
|
player.GetChampshipMod().AddScore([]int{15, 15, 15})
|
|
yestAid = 0
|
|
items = player.GetChampshipReward(yestAid)
|
|
fmt.Printf("yesterday id %d items : %v\n", yestAid, items)
|
|
}
|
|
|
|
func TestChampionshipRankReward(t *testing.T) {
|
|
player := getTestPlayer()
|
|
player.GetChampshipMod().AddScore([]int{15, 15, 15})
|
|
_, yestAid := player.GetChampshipActivityId()
|
|
items, err := player.GetChampshipRankReward(1, yestAid)
|
|
if err != nil {
|
|
fmt.Printf("get rank reward error : %v\n", err)
|
|
} else {
|
|
fmt.Printf("yesterday id %d rank reward items : %v\n", yestAid, items)
|
|
}
|
|
yestAid = 0
|
|
items, err = player.GetChampshipRankReward(2, yestAid)
|
|
if err != nil {
|
|
fmt.Printf("get rank reward error : %v\n", err)
|
|
} else {
|
|
fmt.Printf("yesterday id %d rank reward items : %v\n", yestAid, items)
|
|
}
|
|
player.BackChampship()
|
|
}
|
|
|
|
func TestChampionshipZeroUpdate(t *testing.T) {
|
|
player := getTestPlayer()
|
|
player.GetChampshipMod().AddScore([]int{15, 15, 15})
|
|
todayAid, _ := player.GetChampshipActivityId()
|
|
fmt.Printf("before zero update today id %d score : %d\n", todayAid, player.GetChampshipMod().GetScore())
|
|
player.ChampionshipZeroUpdate()
|
|
}
|
|
|
|
func TestChampionshipBack(t *testing.T) {
|
|
player := getTestPlayer()
|
|
player.BackChampship()
|
|
}
|