@@ -14,7 +14,8 @@ namespace
14
14
zpp::serializer::make_type<Gekko::SyncMsg, zpp::serializer::make_id(" Gekko::SyncMsg" )>,
15
15
zpp::serializer::make_type<Gekko::InputMsg, zpp::serializer::make_id(" Gekko::InputMsg" )>,
16
16
zpp::serializer::make_type<Gekko::InputAckMsg, zpp::serializer::make_id(" Gekko::InputAckMsg" )>,
17
- zpp::serializer::make_type<Gekko::HealthCheckMsg, zpp::serializer::make_id(" Gekko::HealthCheckMsg" )>
17
+ zpp::serializer::make_type<Gekko::SessionHealthMsg, zpp::serializer::make_id(" Gekko::SessionHealthMsg" )>,
18
+ zpp::serializer::make_type<Gekko::NetworkHealthMsg, zpp::serializer::make_id(" Gekko::NetworkHealthMsg" )>
18
19
> _;
19
20
}
20
21
@@ -105,7 +106,7 @@ void Gekko::MessageSystem::SendPendingOutput(GekkoNetAdapter* host)
105
106
SendDataToAll (pkt.get (), host, true );
106
107
}
107
108
}
108
- else if (pkt->pkt .header .type == HealthCheck ) {
109
+ else if (pkt->pkt .header .type == SessionHealth ) {
109
110
// send to remotes
110
111
SendDataToAll (pkt.get (), host);
111
112
// send to spectators
@@ -287,15 +288,15 @@ bool Gekko::MessageSystem::CheckStatusActors()
287
288
return result == 0 ;
288
289
}
289
290
290
- void Gekko::MessageSystem::SendHealthCheck (Frame frame, u32 checksum)
291
+ void Gekko::MessageSystem::SendSessionHealth (Frame frame, u32 checksum)
291
292
{
292
293
_pending_output.push (std::make_unique<NetData>());
293
294
auto & message = _pending_output.back ();
294
295
295
296
// the address and magic is set later so dont worry about it now
296
- message->pkt .header .type = HealthCheck ;
297
+ message->pkt .header .type = SessionHealth ;
297
298
298
- auto body = std::make_unique<HealthCheckMsg >();
299
+ auto body = std::make_unique<SessionHealthMsg >();
299
300
body->frame = frame;
300
301
body->checksum = checksum;
301
302
@@ -453,8 +454,11 @@ void Gekko::MessageSystem::ParsePacket(NetAddress& addr, NetPacket& pkt)
453
454
case InputAck:
454
455
OnInputAck (addr, pkt);
455
456
return ;
456
- case HealthCheck:
457
- OnHealthCheck (addr, pkt);
457
+ case SessionHealth:
458
+ OnSessionHealth (addr, pkt);
459
+ return ;
460
+ case NetworkHealth:
461
+ OnNetworkHealth (addr, pkt);
458
462
return ;
459
463
default :
460
464
printf (" cannot process an unknown event!\n " );
@@ -592,9 +596,9 @@ void Gekko::MessageSystem::OnInputAck(NetAddress& addr, NetPacket& pkt)
592
596
}
593
597
}
594
598
595
- void Gekko::MessageSystem::OnHealthCheck (NetAddress& addr, NetPacket& pkt)
599
+ void Gekko::MessageSystem::OnSessionHealth (NetAddress& addr, NetPacket& pkt)
596
600
{
597
- auto body = (HealthCheckMsg *)pkt.body .get ();
601
+ auto body = (SessionHealthMsg *)pkt.body .get ();
598
602
599
603
const Frame frame = body->frame ;
600
604
const u32 checksum = body->checksum ;
@@ -616,6 +620,11 @@ void Gekko::MessageSystem::OnHealthCheck(NetAddress& addr, NetPacket& pkt)
616
620
}
617
621
}
618
622
623
+ void Gekko::MessageSystem::OnNetworkHealth (NetAddress& addr, NetPacket& pkt)
624
+ {
625
+ // TODO
626
+ }
627
+
619
628
void Gekko::MessageSystem::AddPendingInput (bool spectator)
620
629
{
621
630
u64 now = TimeSinceEpoch ();
0 commit comments