The online racing simulator
Searching in All forums
(948 results)
filur
S2 licensed
stream_socket stuff is PHP 5, which i think i've already mentioned.

stream_socket_server()

Quote from php.net :stream_socket_server

(PHP 5)
stream_socket_server -- Create an Internet or Unix domain server socket

filur
S2 licensed
Quote from Jakg :I would like to distribute 1.84 Gb's worth of files on a cd, so i zipped it with WinRAR, after that it was 1.83 Gb! What do you recomend i use for the task? If it helps they are all exe's (office 2007)

You can't magically compress data, if there's 1.83gb of unique data, any form of lossless compression will result in an 1.83gb file. If the exe's you're trying to compress are installation files, they're probably already compressed.

7-zip is very good for compressing multiple files with very similar contents, other then that it's pretty much the same, a bit more aggressive compression at the cost of alot longer time to compress.
filur
S2 licensed
Quote from St4Lk3R :what pack-type should I use when I want to pack/unpack an int value?.. ..(I assume the server ignores bad-encoded packages, because I do not get any answer on my listening socket).

Use i to pack/unpack an int, the server does not ignore bad packets if you don't tell it to ignore packet warnings: ..
#define ISF_NO_WARNINGS 8 // bit 3 : turns off packet warnings

.. but it only displays the warning in the server console, it doesn't send anything.
filur
S2 licensed
Really good.
filur
S2 licensed
Quote from Guber-X :okay... so how do i run the script.. haha, dont think ive ever used PHP for application wise...


c:\windows\php>php -f myfile.php

gruber@linux:~/php$ php -f myfile.php

PHP: Using PHP from the command line.
filur
S2 licensed
Quote from Guber-X :i get a time out error

set_time_limit()
Quote :If seconds is set to zero, no time limit is imposed.

Don't run a neverending script under a webserver.
filur
S2 licensed
Quote from Noxi :I use Putty to log on to the server, but when I have started LFSLapper and closes Putty I also close LFSLapper?

Screen
filur
S2 licensed

<?php 
php
   
/**
   * insim_mst()
   *
   * @param string Destination IP.
   * @param int Destination port.
   * @param int Source port.
   * @param string Admin password.
   * @param string MST message.
   */
  
function insim_mst($ip$port$fromport$admin$msg) {
    
$socket fsockopen("udp://" $ip$port);
    
fwrite($socket"ISI\0" pack("Scc"$fromport00) . str_pad($admin16"\0"));
    
fwrite($socket"MST\0" str_pad(substr($msg064), 64"\0"));
    
fwrite($socket"ISC\0" pack("i"0));
    
fclose($socket);
  }
  
insim_mst("127.0.0.1""29999""30000""adminpass""/welcome=file.txt");
?>

A bit of dibloink i guess, maybe some flibble too, but it does work.
filur
S2 licensed
Quote from SamH :Any advice/guidance would be greatly appreciated!

Install PHP.
filur
S2 licensed
After you press calibrate, turn the wheel lock-to-lock several times and push the pedals from fully off to fully on several times.
filur
S2 licensed
Great.
filur
S2 licensed
Quote from St4Lk3R :... I incremented it after trying to open a listening socket and when the "listener" is at port 30000, LFS will send replys to port 30001 and so on. thanks all for your help anyway.

I don't get it, did you stop incrementing it or did you get it working with the exact port you specified? Because LFS will respond to the exact port as sent in the packet.

Quote from Dygear :I hope so, I'm making quite a few plugins for it.

Dumped my code already?

J/k, i think you're confusing St4Lk3R's class with my stuff.
filur
S2 licensed
You might have to accept the connection or something, i moved to PHP 5 rather quickly when i started writing insim stuff.

Check out socket_accept()
filur
S2 licensed
Quote from St4Lk3R :It is a dedicated box for me alone, but why shouldn't I run this under apache?

Because it has nothing to do with webserving, talking to insim is not a 1-second-operation thing - you want the script to run for hours.

You'd probably want a console for printing debug messages, you'd probaby want to be able to stop a script without having to wait for apache to finally kill the thread after x amount of time, etc.
filur
S2 licensed
Quote from Dygear :No middle man needed.

.. equals no username / license check.
filur
S2 licensed
Quote from St4Lk3R :I have a confixx-Installation on my Rootserver and can not setup a php5-package for this purpose because php is running as an apache module and not as CGI-version.

Which is kind of exactly why you should install a separate setup for this, you really don't want to run this under apache.
filur
S2 licensed
Quote from St4Lk3R :well... I do not find anything anywhere, so i'll ask here: how can I set up a listening port in php4? sorry for the noob question and I know that you are not an approved substitute for my brain, but I really have a blackout right now... thanks in advance again.

Look up socket_create(), socket_listen(), socket_create_listen(), fsockopen() is for connecting to a destination, not listen for incoming connections.

I do however remember a major hassle with PHP 4's sockets, major problems with not being able to run them fully non-blocking (atleast on windows), meaning a read operation won't instantly complete if there's nothing to read, it will need to wait for something to read, or wait for a timeout (atleast 1 second iirc), halting your script.

If you for some reason don't want to upgrade your 'global' php installation, why not set up a PHP 5 package for just this project? Streams are so much simpler.
filur
S2 licensed
Quote from St4Lk3R :do I have to use a separate input-server? I only have php 4 and it would be great if it would also work with this version... thanks again for your help anyway.

Yes, you need to open a server socket for LFS to respond to.

It'll all work in PHP4 as well, just not the same commands, maybe a few more lines. PHP5 has been out for quite some time now (years), maybe it's time to upgrade?
filur
S2 licensed
Quote from Dygear :.. All of them are 720p, and I think they are at 921600Bytes Per Second or 7200 Kilobits per second. I don't think that's bad for HD .

Converted FunInADryer.exe (47,6mb) to xvid, topping at 9231 kbit/s (limit at ~9700), 26,4mb.
Converting from RGB to xvid took 2m 13s, converting from RGB to Bink at 7200 kbit/s estimated time to ~25 minutes.

Strange codec, i'd say.
filur
S2 licensed
Quote from lalathegreat :1.99% of the cars arent real.

~16% of the cars are "real", you're a bit off.
filur
S2 licensed
http://www.lfsforum.net/showthread.php?p=84876#post84876

Quote from Yaamboo :I think you can't send packages using php? Or am I wrong?

You're incredibly wrong.

http://php.net/manual/en/ref.sockets.php
http://php.net/manual/en/ref.stream.php
filur
S2 licensed
Quote from samyip :The Bink videos don't seems to be compressing as the best quality as you described.

I don't think anyone (game developers etc.) is choosing bink for quality, it's probably more about it being relatively cheap, the small / fast player code and multi-platform support in the sdk.

Question is, why is dygear using it?
filur
S2 licensed
Quote from Dygear :.. That's 4608 kilobits per second.

Bink seems a bit strange, xvid at insane settings makes your latest clip 4.51mb maxing out at ~4200kbit. Since it never hits the limiter (~9700kbit) it means there's no more data to compress, where does bink find extra data to compress?
filur
S2 licensed
Quote from Dygear :The bit rate is 196608 Bytes Per Second.

4.6mb at that bitrate (1536kbit/s?) ? Your video converted to xvid at 9708 kbit/s weighs in at 1.8mb, never even being close to hitting the bitrate limit.
filur
S2 licensed
I'm getting full force feedback, steering tension, self counter-steering etc. with centering unchecked, absolutely nothing changes with centering checked.

Wingman 4.60.349, DFP rev.B
FGED GREDG RDFGDR GSFDG