Took a look at the video, how did you get color into the CMD prompt, very jealous that you got this working in such a short amount of time. Keep on rocking on dude!
PRISM is meant to get around those problems by allowing plugins to work as applications. You could write the applications in PRISMs plugins and avoid the whole problem in the first place. But I guess a MetaSim plugin is not a bad idea if for some reason you need to do that as well. Not sure how that would work tho, would have to look at PRISMS networking code to see if it's possible in it's current incarnation. (Pretty sure it would be, it just might be a little awkward.)
I was using a similar idea from AMX Mod and Source Mod with regards to InSim packets. As each InSim packet is an event, making the methods of a class handle these events via defined methods I found to be interesting. Where you could use the method clientConnect for when the IS_NCN packet is sent or clientDisconnect when the IS_CNL packet is sent. Dynamic arguments are not really an option for me in PHP so I would have to give them the packet (and then what's the point of having a high level of abstraction in the first place.) or manually map the method's arguments myself and have to remember to change them when the version number changes, and new functions or the packet structure changes. Ideally, only editing the packet's module should be enough to update everything, but PHP does not allow me to do that. At least Python has that covered for you.
That's unbelievable! Having the option to swap out NodeJS with socket.io to have it run in a browser is just awesome. Must play around with this, possibilities are endless!
PTH VERSION 0 - Path files for Live for Speed S2 =============
The nodes are given by a fixed point position (X, Y, Z) and a floating point direction (X, Y, Z)
The node can be considered as a line perpendicular to its direction.
Outer and driving area left and right limits are given.
TYPES : =======
1) X,Y,Z int : 32-bit fixed point world coordinates (1 metre = 65536)
X and Y are ground coordinates, Z is up.
2) float : 32 bit floating point number
FILE DESCRIPTION : ==================
num unit offset description --- ---- ------ -----------
HEADER BLOCK :
6 char 0 LFSPTH : do not read file if no match 1 byte 6 version : 0 - do not read file if > 0 1 byte 7 revision : 0 - do not read file if > 0 1 int 8 num nodes : number 1 int 12 finish line : number ......NODE BLOCKS
NODE BLOCK :
1 int 0 centre X : fp 1 int 4 centre Y : fp 1 int 8 centre Z : fp 1 float 12 dir X : float 1 float 16 dir Y : float 1 float 20 dir Z : float 1 float 24 limit left : outer limit 1 float 28 limit right : outer limit 1 float 32 drive left : road limit 1 float 36 drive right : road limit
I don't really expect this post to go over that well, but I'll give it a shot. For the other members of the community, I respectfully request that you do not use this as a catalysis to start moaning at the devs. I would like a discussion, an open dialog with the dev, not a one sided yelling match. So here is my argument.
With no time frame for new releases, it makes sense to keep the community alive that new content should be released to retain interest and enthusiasm in the project. I thank you for the current work on Live For Speed, the simulator is great and I've not regretted purchasing the for even a minute. It's still by far and away the best sim I've ever raced on even with it's "incorrect" tire model. We all understand that the tire model is not perfect, and that's fine with me.
So why not release the VWS, having some fresh content in this game, even as simple as adding a car would do great things for this community. I understand that Rockingham is S3 content, and that with the new tire model we should get realistic times on that track. But until such a time as the new tire model is available for release, what is the harm in releasing this track. We then get the benefit of seeing how well the new tire model works over the old current model. I also think that releasing Rockingham would be a great a idea, allowing us to purchase an S3 license to use it would also be good for you as it would inject some cash into the project and perhaps give you some incentive to work on the project full time. Then when you have the new tire model you can release that, when you have new cars or tracks you can release them until LFS is done. I have 12 GBP sitting in my account right now. Go on, take it, I know you want too!
I don't think you understand, PRISM has it's own settings that you must change to allow it to get MCI packets. This is because it's up to the InSim application (Such as PRISM) to request these details from the InSim host (In this case, the LFS Server.) To do that you have to change the settings for the host to include the MCI flag. The default value right now is ISF_MSO_COLS (8) & ISF_CON (64), or 72. You have to add ISF_MCI (32) to get MCI packets. This is not explicit, you have to set the flags your self in the hosts.ini file.
[localhost] ; Host 1 - Your local LFS Server. ; The IP Address we are going to attempt a connection on. ip = "127.0.0.1" ; The Port we are going to attempt the connection on. port = 29999 ; Optional UDP Port to receive MCI / NLP packets on ; Use 0 to skip this port and receive MCI / NLP via regular TCP [b]udpPort = 29999[/b] ; Number of MCI or NLP packets to get a second. [b]pps = 4[/b] ; Set connection flags ; 4 : ISF_LOCAL - guest or single player ; [b]8 : ISF_MSO_COLS - keep colours in MSO text[/b] ; 16 : ISF_NLP - receive NLP packets ; [b]32 : ISF_MCI - receive MCI packets[/b] ; [b]64 : ISF_CON - receive CON packets[/b] ; [b]128 : ISF_OBH - receive OBH packets[/b] ; [b]256 : ISF_HLV - receive HLV packets[/b] ; [b]512 : ISF_AXM_LOAD - receive AXM when loading a layout[/b] ; [b]1024 : ISF_AXM_EDIT - receive AXM when changing objects[/b] [b]flags = 2024[/b] ; Separate port to listen on for OutGauge packets. ; You must manually edit LFS's cfg.txt to have LFS send OutGauge packets to this port. ; Use 0 to skip this port. outgaugePort = 0 ; Default Password to Attempt password = "password" ; Socket Connection Type ; 0 - Use Best ; 1 - Use TCP ; 2 - Use UDP socketType = 2
The flags settings above will give you the most amount of detail possible right now (2024).
I'll be the first to admit that I don't follow all of the programming standard that is set out in the thread you linked too. Some of the code was made before the standards where settled, so I'm not really sure I could be held accountable for it. As far as verbose variable names, it's really something that people are going to have to swallow. It just makes the code much easier to read then a bunch of one letter variables. Variable name size does not make your compiled program any bigger, so I recommend not worrying about that, and worrying more about if you can read the code a year from now. It's also very helpful to have different classes of thing with the program typed in different ways. One example of this is variables are always preceded with a dolor sign in PHP, $. Functions could then there for use all camelCase, and classes could be CapitalCase, const and defines are always UPPERCASE.
I don't understand how that could happen. Why would you ever think of replacing Spa with any track, yet alone Magny Cours. This should never of been a question in my opinion.
If they gave InSim applications first shot at the message so we could decide if we want the client to talk or not, or if the client's message should be delivered to other clients or not that would be good. If I remember correctly, a message is at most 128 characters, and there are a maximum of 64 clients on the server, and 4 bytes for the packet header. We could use all of this information and put it into a packet and still be well within the 256 byte envelope for a InSim packet.
We add an option flag to the IS_ISI packet, obviously to set the flag you also have to have the admin password for the server so that the InSim instance can control it. Well call the flag INSIM_CHAT_CONTROL, and we will += that into our IS_ISI::Flags. That will tell LFS that we want this InSim instance to be authoritative on who can talk to whom. After that's added we modify the IS_SMALL packet, and the IS_MSO packet as follows.
We add a small define, in the regards of
<?php define('SMALL_MSC', 8); // 8 - inStruction : Allow the message to be sent to all clients. ?>
And we make the ISP_SMALL's UVal that of the IS_MSO's MID, so LFS knows what message to deliver. This allows us to sync the messages between the systems.
We edit the IS_MSO packet so that we combine parts of it header. We take $ReqI, and $Zero and combine them to make a uInt_16 datatype. This will be used to identify the message. So this
So now when we get an IS_MSO packet, we can look at who it's coming from, and use the IS_SMALL packet to block the message by not sending a IS_SMALL::SMALL_MSC with the Msg ID, or sending another packet so that only some players can see that message. This packet would be called IS_MSC and looks as follows.
<?php class IS_MSC extends Struct // MeSsage Control - Control who get's to see a message from a client. { const PACK = 'CCSCCCCa128'; const UNPACK = 'CSize/CType/SMID/CUCID/CPLID/CUserType/CTextStart/a128Msg';
public $UCID = 0; # connection's unique id (0 = host) public $PLID = 0; # player's unique id (if zero, use UCID) public $UserType; # set if typed by a user (see User Values below) public $TextStart; # first character of the actual text (after player name)
public $UCIDs; # Array of UCIDs the message should be sent too. public $Msg; }; function IS_MSC() { return new IS_MSC; } ?>
Pit lanes entrance and exits are outside of a Nodes Road Limit, so you'll know when a client is rejoining the track and should be following the racing rules again by weather or not they are within the Node Road Limit. That should remove that fringe case.
InSim reports when a player is in the pits via a IS_PIT packet, so you add a flag when they go into the pits to make sure no one get's gigged for taking them over while they are in the pits and remove the bit onces the player moves out of the pits (that's another IS_PIT packet I think, I don't know any more, it's handled internally within PRISM so I don't have to think about it.).
InSim also gives information about players who have crashed by using the IS_FLG packet, it's the case of allowing a car to pass another without penality while that car is CAUSING the yellow flag for that player.
If these two cases are not met then the player that over took the other player deserves a penalty.
Thoughts, comments? I've had no luck with the MOMO that I had and the G25 that I still have (It simply, never worked.) So I think giving this a shot at $119.99 is a safer bet then having to spend almost 2.5 times that for a wheel.
You can however, use your normal LFS client to run the server with tweak in the background. As long as the client-server, known as a listen sever, has the same tweak settings as it's clients you should be good to go. This has the upsides of being legal from a rules standpoint, and much safer as you don't have to rely on a modified EXE that might steal your license info.