pre cw with probe and a bunch script to read game behavior
This commit is contained in:
1 parent
5120219ae2
commit
da8a32f60d
310 files changed
+219693
-872
No files matched your search
@@ -0,0 +1,26 @@
|
||||
package sdkserver
|
||||
|
||||
import (
|
||||
pb "gac-hkrpg-go/protocol/proto"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestLiveNativeDictionariesSupplyBreakdownWithoutReplacingAggregate(t *testing.T) {
|
||||
avatars := []*pb.AvatarBattleInfo{{Id: 10, TotalDamage: 1200}, {Id: 11}}
|
||||
err := applyLiveAvatarBreakdowns(avatars, []liveAvatarBreakdown{
|
||||
{Damage: map[string]float64{"ElationDamage": 700, "TrueDamage": 300}, MaxDamage: map[string]float64{"ElationDamage": 400}},
|
||||
{Damage: map[string]float64{}},
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if avatars[0].TotalDamage != 1200 || len(avatars[0].AttackTypeDamage) != 2 || avatars[0].AttackTypeMaxDamage[0].Damage != 400 || len(avatars[1].AttackTypeDamage) != 0 {
|
||||
t.Fatalf("native data was replaced or lost: %v", avatars)
|
||||
}
|
||||
if err := applyLiveAvatarBreakdowns(avatars, []liveAvatarBreakdown{{}}); err == nil {
|
||||
t.Fatal("accepted a mismatched avatar count")
|
||||
}
|
||||
if _, err := liveDamageProperties(map[string]float64{"Normal": -1}); err == nil {
|
||||
t.Fatal("accepted negative damage")
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user