The online racing simulator
PHPInSim
(96 posts, started )
Quote from mcgas001 :Yes, but dont do it another way. just because your told its better. If you like one way, Do it. Also its a PHP script, If they want it that way they can change it themself.

I think I will just implement all of them.

bool %PacketName%::send(int arg);
bool %PacketName%::emit(array[]);
And Instance Style.

24 hours down for New York State Emergency Medical Technician - Critical Care ambulance rotations, 51 hours to go.
Just so you guys are aware, I have been terrible sick over the past 2 days. This is by no means an abandoned project. Funny, I get sick within 24 hours of saving some mans life. Life in general is very ironic.
Listen socket created!
Binded to listen socket!
Send socket created!
Conneceted to send socket!
Array
(
[Size] => 20
[Type] => 2
[ReqI] => 1
[Zero] => 0
[Version] => 0.5Y
[Product] => S2
[InSimVer] => 4
)
Array
(
[Size] => 28
[Type] => 5
[ReqI] => 0
[Zero] => 0
[ReplaySpeed] => 1
[Flags] => 3200
[InGameCam] => 0
[ViewPLID] => 0
[NumP] => 0
[NumConns] => 1
[NumFinished] => 0
[RaceInProg] => 0
[QualMins] => 0
[RaceLaps] => 5
[Spare2] => 0
[Spare3] => 0
[Track] => BL1
[Weather] => 0
[Wind] => 1
)
Array
(
[Size] => 28
[Type] => 5
[ReqI] => 0
[Zero] => 0
[ReplaySpeed] => 1
[Flags] => 3200
[InGameCam] => 0
[ViewPLID] => 0
[NumP] => 1
[NumConns] => 1
[NumFinished] => 0
[RaceInProg] => 0
[QualMins] => 0
[RaceLaps] => 1
[Spare2] => 0
[Spare3] => 0
[Track] => AU1
[Weather] => 0
[Wind] => 0
)
Array
(
[Size] => 136
[Type] => 11
[ReqI] => 0
[Zero] => 0
[UCID] => 0
[PLID] => 0
[UserType] => 0
[TextStart] => 0
[Msg] => Autocross : 2 checkpoints
)
Array
(
[Size] => 36
[Type] => 36
[ReqI] => 0
[NumP] => 1
[PLID] => 
)
Array
(
[Size] => 28
[Type] => 17
[ReqI] => 0
[Zero] => 0
[RaceLaps] => 1
[QualMins] => 0
[NumP] => 1
[Spare] => 0
[Track] => AU1
[Weather] => 0
[Wind] => 0
[Flags] => 35
[NumNodes] => 0
[Finish] => 0
[Split1] => 0
[Split2] => 0
[Split3] => 0
)
Array
(
[Size] => 28
[Type] => 5
[ReqI] => 0
[Zero] => 0
[ReplaySpeed] => 1
[Flags] => 19586
[InGameCam] => 2
[ViewPLID] => 2
[NumP] => 1
[NumConns] => 1
[NumFinished] => 0
[RaceInProg] => 1
[QualMins] => 0
[RaceLaps] => 1
[Spare2] => 0
[Spare3] => 0
[Track] => AU1
[Weather] => 0
[Wind] => 0
)
Array
(
[Size] => 16
[Type] => 25
[ReqI] => 0
[PLID] => 2
[STime] => 2980
[ETime] => 2980
[Split] => 1
[Penalty] => 0
[NumStops] => 0
[Sp3] => 0
)
Array
(
[Size] => 16
[Type] => 25
[ReqI] => 0
[PLID] => 2
[STime] => 3480
[ETime] => 3480
[Split] => 2
[Penalty] => 0
[NumStops] => 0
[Sp3] => 0
)
Array
(
[Size] => 20
[Type] => 24
[ReqI] => 0
[PLID] => 2
[LTime] => 5400
[ETime] => 5400
[LapsDone] => 1
[Flags] => 9793
[Sp0] => 0
[Penalty] => 0
[NumStops] => 0
[Sp3] => 0
)
Array
(
[Size] => 84
[Type] => 35
[ReqI] => 0
[PLID] => 2
[UName] =>
[PName] => ^1(E^7AGL^4E)^7Dygear
[Plate] => Dygear
[CName] => XRT
[TTime] => 5400
[BTime] => 5400
[SpA] => 0
[NumStops] => 0
[Confirm] => 0
[SpB] => 0
[LapsDone] => 0
[Flags] => 9793
[ResultNum] => 0
[NumRes] => 1
[PSeconds] => 0
)
Array
(
[Size] => 28
[Type] => 5
[ReqI] => 0
[Zero] => 0
[ReplaySpeed] => 1
[Flags] => 19586
[InGameCam] => 2
[ViewPLID] => 2
[NumP] => 1
[NumConns] => 1
[NumFinished] => 1
[RaceInProg] => 1
[QualMins] => 0
[RaceLaps] => 1
[Spare2] => 0
[Spare3] => 0
[Track] => AU1
[Weather] => 0
[Wind] => 0
)
Array
(
[Size] => 4
[Type] => 3
[ReqI] => 0
[SubT] => 0
)
Array
(
[Size] => 4
[Type] => 3
[ReqI] => 0
[SubT] => 11
)
Array
(
[Size] => 28
[Type] => 5
[ReqI] => 0
[Zero] => 0
[ReplaySpeed] => 1
[Flags] => 19840
[InGameCam] => 2
[ViewPLID] => 0
[NumP] => 0
[NumConns] => 1
[NumFinished] => 0
[RaceInProg] => 0
[QualMins] => 0
[RaceLaps] => 1
[Spare2] => 0
[Spare3] => 0
[Track] => AU1
[Weather] => 0
[Wind] => 0
)

I've made it so the packets are readable to the humans amongst us. Now, I just have to think of a good / fast way of writing packets.
Quote from Dygear :a good / fast way of writing packets.

I sense premature optimization. Go for the good way, leave fast for later.
Yeah, let's think about that for a second. The easiest way might just be the object model.
pckSize
Just a text file with some information on how to handle InSim packets in InSim. Other's might find it useful, so here it is. The class that made this array of arrays will be included with the next version of PHPInSim.

Do please keep in mind that it's for the current, as of time of this post, version of InSim. LFS Version Y
Attached files
pckSize.txt - 16.2 KB - 348 views
#57 - sun
right guys, i'am sorry for butting in here... even though i'am about to talk about somthing completely diffrent to plugins. I copied your code u posted dygear, in notepad++ and saved it has main.php. I right clicked on it and selected php.CLI and it jjst opens a cmd for a second and shuts down. what have i done wrong ?
did you use the loop:
$continue = true;
do
{
....
}
while($continue);

cause if it pops up for half a second, then shuts down then I guess it means that the has finished it tasks.. or it should be an error..
#59 - sun
i thought it stays up like a window and displays somthing in the server saying: InSim: TCP :LFSPhp or what ever
What code? From the first post? Did you start LFS before you started the PHPInSim code?
LOL! This still goes on?
Quote from mcgas001 :LOL! This still goes on?

The project is kinda alive, it's still on my hard drive. Though I am really starting to think that my hard drive is going to die soon.
#63 - sun
i loaded it into notepad++ saved it as main.php, right lciked on it opened it in php.CGI, i had LFS Dedi already open not LFS open ( so i can test it )
Quote from sun :i loaded it into notepad++ saved it as main.php, right lciked on it opened it in php.CGI, i had LFS Dedi already open not LFS open ( so i can test it )

What PHPInSim version are you using?

Make this patch file on your computer (Right Click in the Same Directory as the main.php and go to New, Then Text Document.) In the text document place this text:

PHPInSim.bat
@echo off
php main.php > output.txt

Save the new text document.txt as PHPInSim.bat and then double click that new made batch file.

Now providing that the PHP-CLI parser is in the environment (as in the the PHP.exe file is in the windows directory or not, or apart of the system path variable in some way) that should produce an output from the main.php file into another file called output.txt. Once you have done this post back with the contents of the output.txt file.
#65 - sun
it dsiplays nothing inside the output.txt file its just blank
#66 - sun
still blank, dygear. mcgas, dont post things about my ability please.
I think you need to install PHP-CLI, as it does not seem to be apart of your environment. I would recommend using the PHP-CLI Installer.
Dygear - Do you mind posting your latest version of this?
Ah, sure. I will, but I want to make a working release, and the packet system is being a bitch.
Can you give us an update on phpInSim please? I am interested in using this library.
I'm going to have to update the packet definitions to the current version of InSim. A nice little nudge from Vic in this post showing the devs really do care was nice to see. I'll update and we will see where it goes.
This is now my primary project, I'm working from the 0.2.1 release as I have lost the 0.3.X dev version that I had with my last hard drive failure. I know you all expect good things. So a working packet system would be nice. I'm going to be doing small releases, in the 0.3.x branch so that you can all see I'm doing SOMETHING!
I'm a little more then half way though copying the defines and structs from the most current version of InSim.txt. Some of witch I would like to pull my hair out over, but that's besides the point. I'm going to sleep now, as I have work in ... 10 hours. Good night, and I'll work on this if I get some down time at work. (My FDNY 911 Ambulance normally does not get much down time tonight.)
that's sweet Dygear, I'm looking forward to this.
yea could be keen on this when its done

PHPInSim
(96 posts, started )
FGED GREDG RDFGDR GSFDG