The online racing simulator
#1 - Krayy
IS_CPP & IS_CCH...bug or feature
Hi guys,

I'm writing an add-on to LFS Lapper and am having trouble working out how to determine which PLID a player is viewing. What I am trying to do is to capture the ViewPLID from the IS_CPP packet, but have run into a view problems.

First is how to actually get LFS to send an IS_CPP packet. The docs say to send an IS_TINY with a SubT of TINY_SCP, but I cannot for the life of me get LFS to respond to that packet (using the InSimSniffer tool). If anyone has a working example of how to get an IS_CPP sent, that would be appreciated.

Secondly, to determine if the player is viewing a different user, I'm looking at using the IS_CCH packet to determine that a view change has occurred. The problem is that when using the Tab key to switch players, an IS_CCH is generated when you first move away from your PLID, but never for any subsequent Tabs. So you know that the View has shifted to another player only once, and if someone is tabbing like heck, you cannot capture those events. Is this a bug in the IS_CCH method, or by design?

If it's by design, then I suppose I have to poll the player a few times a second to get an IS_CPP packet to see who they are viewing and adjust the output accordingly, but see problem above on how to get an IS_CPP packet sent back.

Any help would be appreciated.
Quote from Krayy :First is how to actually get LFS to send an IS_CPP packet. The docs say to send an IS_TINY with a SubT of TINY_SCP, but I cannot for the life of me get LFS to respond to that packet (using the InSimSniffer tool). If anyone has a working example of how to get an IS_CPP sent, that would be appreciated.

Was worried this might be a bug with the Sniffer so I checked it out, but it works perfectly for me. I connect to LFS, join a race, go to Request > TINY_SCP, and LFS immediately replies with a IS_CPP. How are you trying to get it to work?

In terms of changing cameras, although the IS_CPP isn't sent all the time, each time I change views a IS_STA is sent, which has the ViewPLID of the driver I'm watching.
#3 - Krayy
Quote from DarkTimes :Was worried this might be a bug with the Sniffer so I checked it out, but it works perfectly for me. I connect to LFS, join a race, go to Request > TINY_SCP, and LFS immediately replies with a IS_CPP. How are you trying to get it to work?

In terms of changing cameras, although the IS_CPP isn't sent all the time, each time I change views a IS_STA is sent, which has the ViewPLID of the driver I'm watching.

If I'm using the LFS client to start a new host then starting an InSim session, then the IS_CPP packets are sent when requesting a TINY_SCP. Also any view change does generate an IS_STA when viewing another player or AI.

However, I get no STA,or CPP packets if I run a Dedicated host and then attach the Sniffer and the Client to it. Could you please start a Dedicated host, then use the Sniffer and a Client to see if that works for you?
The dedicated server doesn't actively run the simulation, it doesn't "view" any player at all. There is no way to get this to work with a dedi and there's no alternative to achieve the same
#5 - Krayy
Quote from morpha :The dedicated server doesn't actively run the simulation, it doesn't "view" any player at all. There is no way to get this to work with a dedi and there's no alternative to achieve the same

Dang. That is seriously annoying

I'll just make it so that you get extra functionality if the host is run on a client rather than a dedicated server.

The question is, how do you tell if you are connected to a dedi host rather than a client based host?
Well right now I can only think of one reliable way: If UCID 0 has a UName, it's a client, otherwise a dedi.
#7 - Krayy
Quote from morpha :Well right now I can only think of one reliable way: If UCID 0 has a UName, it's a client, otherwise a dedi.

Ta. So just to clarify what you've said...if the Host is a dedicated server, then there is no way to get an IS_CPP packet for any Player and therefore no way to see who that Player is viewing (ViewPLID)?

The only thing we can determine (via the IS_CCH that is sent when the users view changes) is that they are viewing someone other than thenselves?
Quote from Krayy :Ta. So just to clarify what you've said...if the Host is a dedicated server, then there is no way to get an IS_CPP packet for any Player and therefore no way to see who that Player is viewing (ViewPLID)?

The only thing we can determine (via the IS_CCH that is sent when the users view changes) is that they are viewing someone other than thenselves?

It's been a while since I tried wrapping my head around this, but as far as I can remember, that's correct. I attempted to display additional information to spectators for whatever vehicle they were spectating, but I could not find a way to determine the vehicle "in focus" for a given player.

FGED GREDG RDFGDR GSFDG