In the web client, I did a periodic CP_UPDATES packet, which just
repeatedly requests the server to keep using the same update rate we're
already using:
https://github.com/apsillers/html5-netrek/blob/e99e25d10166dda662c534a671689142f62d4301/js/main.js#L246

setInterval(function() { net.sendArray(CP_UPDATES.data(UPDATE_RATE)); },
10000);

I'm also curious if there's a better way or not.

Andrew

On Thu, Mar 28, 2019, 8:14 PM Darrell Root <darrellroot at mac.com> wrote:

> netrek-dev folks,
>
> Question 1: On continuum.us.netrek.org, if my client doesn’t send any
> commands for 20-30 seconds, I get ghostbusted.  It seems like the server
> wants some sort of activity keepalive.  Any ideas?  There is a SP_PING and
> a CP_PING_RESPONSE, but I don’t see a CP_PING.  What should I send
> periodically?
>
> Question 2:
>
> I’m having trouble with the “picking team” logic in my netrek client.
>
> The server sends an SP_MASK packet:
>
> struct mask_spacket { /* SP_MASK py-struct "!bbxx" #19 */
>     char type;
>     char mask;
>     char pad1;
>     char pad2;
> };
>
> Here’s what the currently online servers send:
>
> continuum.us.netrek.org sends mask = 15 (fed + rom + kli + ori)
> netrek.beesenterprises.com sends mask = 3  (fed + rom)
> pickled.netrek.org sends mask = 2 (rom)
>
> Then the client sends a CP_OUTFIT packet:
>
> struct outfit_cpacket { /* CP_OUTFIT py-struct "!bbbx" #9 */
>     char type;
>     char team;
>     char ship;
>     char pad1;
> };
>
> It looks like the “Team” has to be an integer between 0 and 3 inclusive:
>
> netrek-server-vanilla/ntserv/getentry.c:
>
>             if (teamPick < 0 || teamPick > 3) {
>
>                 new_warning(UNDEF,"Get real!");
>                 sendPickokPacket(0);
>                 teamPick= -1;
>                 continue;
>             }
>
> On beesenterprises.com, when I send team = 0 I end up rom.  Anything else I am rejected.
> On pickled.netrek.org when I send team = 0 I end up rom. Anything else I am rejected.
> On continuum.us.netrek.org, when I send team = 0, I end up rom.  Anything else I am rejected.
>
> Is there a way to select teams?  What does the team = 0 or 1 or 2 or 3 mean in the CP_OUTFIT packet?
>
> I have a pulldown menu with the “preferred team”, but it doesn’t work the way a player would expect.
>
> Darrell
>
>
>
>
>
>
> _______________________________________________
> netrek-dev mailing list
> netrek-dev at us.netrek.org
> http://mailman.us.netrek.org/mailman/listinfo/netrek-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.us.netrek.org/pipermail/netrek-dev/attachments/20190329/5f64568f/attachment.html>