From a806541204b8b522141f9257a1278f3304528369 Mon Sep 17 00:00:00 2001 From: RallyBlock Date: Mon, 9 Nov 2026 15:18:00 -0500 Subject: [PATCH] Retry hello until RPG_TopDown; Message cmd --- client.cs | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/client.cs b/client.cs index b6003dd..3e8419f 100644 --- a/client.cs +++ b/client.cs @@ -8,6 +8,7 @@ $RPGClient::Yaw = 0; $RPGClient::Dist = 14; $RPGClient::HelloPending = 0; $RPGClient::HelloLast = ""; +$RPGClient::TopDownWatchSched = 0; function RPGClient_NormPos(%ctrl, %pos) { @@ -227,7 +228,7 @@ function RPGClient_SendHello() $RPGClient::HelloLast = %now; commandToServer('RPG_Hello', $RPGClient::Version); commandToServer('RPGHello', $RPGClient::Version); - commandToServer('message', "/rpg clienthello " @ $RPGClient::Version); + commandToServer('Message', "/rpg clienthello " @ $RPGClient::Version); } function clientCmdRPG_Probe() @@ -239,8 +240,8 @@ function clientCmdRPG_Welcome(%serverProto, %accepted) { if (%accepted && %serverProto == $RPGClient::Version) { - $RPGClient::Server = 1; $RPGClient::HelloPending = 0; + schedule(2500, 0, RPGClient_TopDownWatch); } else if (!%accepted) { @@ -249,10 +250,25 @@ function clientCmdRPG_Welcome(%serverProto, %accepted) } } +function RPGClient_TopDownWatch() +{ + $RPGClient::TopDownWatchSched = 0; + if ($RPGClient::Active || $RPGClient::Server || !RPGClient_CanSendCmd()) + { + return; + } + $RPGClient::HelloLast = ""; + RPGClient_SendHello(); + $RPGClient::TopDownWatchSched = schedule(2500, 0, RPGClient_TopDownWatch); +} + function clientCmdRPG_TopDown(%on, %yaw, %dist) { if (%on) { + cancel($RPGClient::TopDownWatchSched); + $RPGClient::TopDownWatchSched = 0; + $RPGClient::Server = 1; $RPGClient::Active = 1; $RPGClient::Yaw = %yaw; $RPGClient::Dist = %dist > 0 ? %dist : 14; @@ -391,6 +407,8 @@ package RPGClient_Cleanup $RPGClient::Server = 0; $RPGClient::HelloPending = 0; $RPGClient::HelloLast = ""; + cancel($RPGClient::TopDownWatchSched); + $RPGClient::TopDownWatchSched = 0; Parent::disconnectedCleanup(%doReconnect); } };