fix: sync current handlers, repair relic data and restore visible launcher consoles
This commit is contained in:
1 parent
163d4433e6
commit
74f3c4411b
46 files changed
+4599
-1402
No files matched your search
@@ -0,0 +1,35 @@
|
||||
package common
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
goproto "gac-hkrpg-go/protocol/proto"
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
func TestStandaloneBattleRelicWire(t *testing.T) {
|
||||
relic := Relic{
|
||||
RelicID: 61151, Level: 15, MainAffixID: 1, InternalUID: 42,
|
||||
SubAffixes: []SubAffix{{SubAffixID: 7, Count: 3, Step: 3}, {SubAffixID: 8, Count: 3, Step: 0}},
|
||||
}
|
||||
encoded, err := proto.Marshal(relic.ToBattleRelic())
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
var decoded goproto.BattleRelic
|
||||
if err := proto.Unmarshal(encoded, &decoded); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if decoded.UniqueId != 0 {
|
||||
t.Fatal("standalone battle relic must not use inventory ID")
|
||||
}
|
||||
if decoded.Id != 61151 || decoded.MainAffixId != 1 || len(decoded.SubAffixList) != 2 {
|
||||
t.Fatalf("relic or affixes lost on wire: %v", &decoded)
|
||||
}
|
||||
if decoded.SubAffixList[0].Cnt != 3 || decoded.SubAffixList[0].Step != 3 || decoded.SubAffixList[1].Step != 0 {
|
||||
t.Fatalf("sub-affix values changed on wire: %v", decoded.SubAffixList)
|
||||
}
|
||||
if relic.ToProtoRelic().UniqueId != 42 || relic.ToEquipRelic().RelicUniqueId != 42 {
|
||||
t.Fatal("inventory and equipped relic references must retain their IDs")
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user