通关星级对应到指定的描述位置
This commit is contained in:
parent
367a553c15
commit
2ecebd23fd
@ -18,7 +18,6 @@ import (
|
|||||||
"go_dreamfactory/sys/configure"
|
"go_dreamfactory/sys/configure"
|
||||||
"go_dreamfactory/sys/db"
|
"go_dreamfactory/sys/db"
|
||||||
"go_dreamfactory/utils"
|
"go_dreamfactory/utils"
|
||||||
"math"
|
|
||||||
"reflect"
|
"reflect"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
@ -72,15 +71,22 @@ func GetMonthStartEnd() (int64, int64) {
|
|||||||
}
|
}
|
||||||
func Test_Main(t *testing.T) {
|
func Test_Main(t *testing.T) {
|
||||||
|
|
||||||
var l int64
|
var star1, star2, star3 int32
|
||||||
var l1 int64
|
var rst int32
|
||||||
var i int32
|
star1 = 1 << 2
|
||||||
var f float64
|
star2 = 1 << 1
|
||||||
i = math.MaxInt32
|
star3 = 1 << 0
|
||||||
l = int64(i) << 31
|
|
||||||
l1 = 1 << 31
|
//rst = star1 ^ star2 ^ star3 // 三星
|
||||||
f = float64(l)
|
//rst = star1 ^ star2 // 2星
|
||||||
fmt.Printf("%d,%d,%f", l, l1, f)
|
rst ^= star1
|
||||||
|
rst ^= star2
|
||||||
|
// 校验星
|
||||||
|
b1 := (rst&star1 == star1)
|
||||||
|
b2 := (rst&star2 == star2)
|
||||||
|
b3 := (rst&star3 == star3)
|
||||||
|
fmt.Printf("%d,%d,%d,%d", star1, star2, star3, rst)
|
||||||
|
fmt.Printf("%v,%v,%v,%d", b1, b2, b3, rst)
|
||||||
var list []int32
|
var list []int32
|
||||||
var list2 []int32
|
var list2 []int32
|
||||||
list = []int32{1, 2, 3, 4, 5, 6, 7, 8, 9}
|
list = []int32{1, 2, 3, 4, 5, 6, 7, 8, 9}
|
||||||
|
@ -76,16 +76,23 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MlineChall
|
|||||||
code = pb.ErrorCode_ConfigNoFound
|
code = pb.ErrorCode_ConfigNoFound
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
var star1, star2, star3 int32
|
||||||
|
star1 = 1 << 2
|
||||||
|
star2 = 1 << 1
|
||||||
|
star3 = 1 << 0
|
||||||
for i, v := range stageConf.StarType {
|
for i, v := range stageConf.StarType {
|
||||||
if v == comm.MainStarType1 {
|
if v == comm.MainStarType1 {
|
||||||
star += stageConf.Star[i]
|
//star += stageConf.Star[i]
|
||||||
|
star ^= star1
|
||||||
} else if v == comm.MainStarType2 {
|
} else if v == comm.MainStarType2 {
|
||||||
if req.Report.Death <= stageConf.StarValue[i] {
|
if req.Report.Death <= stageConf.StarValue[i] {
|
||||||
star += stageConf.Star[i]
|
//star += stageConf.Star[i]
|
||||||
|
star ^= star2
|
||||||
}
|
}
|
||||||
} else if v == comm.MainStarType3 {
|
} else if v == comm.MainStarType3 {
|
||||||
if req.Report.Round <= stageConf.StarValue[i] {
|
if req.Report.Round <= stageConf.StarValue[i] {
|
||||||
star += stageConf.Star[i]
|
//star += stageConf.Star[i]
|
||||||
|
star ^= star3
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user