mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-02-21 15:43:40 +00:00
Implant Terminal Hack (#1221)
* preliminary functional implant hacking; am going to explore better hacking policies * HackMessage now uses custom fields and a float value rather than integers (2, 32, 32); separate hack state and hack clear states; everything changes
This commit is contained in:
parent
8afe7fa248
commit
02f95a293e
32 changed files with 488 additions and 204 deletions
|
|
@ -14,20 +14,20 @@ class HackMessageTest extends Specification {
|
|||
"decode" in {
|
||||
PacketCoding.decodePacket(string).require match {
|
||||
case HackMessage(unk1, target_guid, player_guid, progress, unk5, hack_state, unk7) =>
|
||||
unk1 mustEqual 0
|
||||
unk1 mustEqual HackState1.Unk0
|
||||
target_guid mustEqual PlanetSideGUID(1024)
|
||||
player_guid mustEqual PlanetSideGUID(3607)
|
||||
progress mustEqual 0
|
||||
unk5 mustEqual 3212836864L
|
||||
unk5 mustEqual -1.0f
|
||||
hack_state mustEqual HackState.Start
|
||||
unk7 mustEqual 8L
|
||||
unk7 mustEqual HackState7.Unk8
|
||||
case _ =>
|
||||
ko
|
||||
}
|
||||
}
|
||||
|
||||
"encode" in {
|
||||
val msg = HackMessage(0, PlanetSideGUID(1024), PlanetSideGUID(3607), 0, 3212836864L, HackState.Start, 8L)
|
||||
val msg = HackMessage(HackState1.Unk0, PlanetSideGUID(1024), PlanetSideGUID(3607), 0, -1.0f, HackState.Start, HackState7.Unk8)
|
||||
val pkt = PacketCoding.encodePacket(msg).require.toByteVector
|
||||
pkt mustEqual string
|
||||
}
|
||||
|
|
|
|||
|
|
@ -136,9 +136,9 @@ class HackClearTest extends ActorTest {
|
|||
"pass HackClear" in {
|
||||
val service = system.actorOf(Props(classOf[LocalService], Zone.Nowhere), "l_service")
|
||||
service ! Service.Join("test")
|
||||
service ! LocalServiceMessage("test", LocalAction.HackClear(PlanetSideGUID(10), obj, 0L, 1000L))
|
||||
service ! LocalServiceMessage("test", LocalAction.HackClear(PlanetSideGUID(10), obj, 0L, HackState7.Unk8))
|
||||
expectMsg(
|
||||
LocalServiceResponse("/test/Local", PlanetSideGUID(10), LocalResponse.SendHackMessageHackCleared(PlanetSideGUID(40), 0L, 1000L))
|
||||
LocalServiceResponse("/test/Local", PlanetSideGUID(10), LocalResponse.SendHackMessageHackCleared(PlanetSideGUID(40), 0L, HackState7.Unk8))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue