The online racing simulator
Searching in All forums
(929 results)
detail
S3 licensed
Quote from mkinnov8 :500servers is also not a webhosting company, 500servers hosts lfs servers and sometimes provides webspace to clients.

Im not sure how many vps providers give access to the virtual machine, it sounds to me like you are looking for a dedicated box.

Khm, you apparently don't know what you are talking about. By definition, virtual private server is a virtual machine, and that's what I'm searching for.
Last edited by detail, .
detail
S3 licensed
What config do you have and what do you run there?
VPS hosting: locations and prices
detail
S3 licensed
I'd like to find a VPS hosting somewhere in Europe or US (in one that would have reasonable latency with Europe). Can anybody recommend any particular company?

One thing that is important is - no faxing or other paperwork for non-EU-US citizens, everything done online for everybody.

(Why I don't aim at 500servers is simpe: I need to run additional software, and 500servers do not provide a virtual machine).

I've found a company based in Georgia, US
http://www.vpsland.com/xlseries.html
and this hosting in UK
http://www.uk-vps.com

any opinions on these companies?
detail
S3 licensed
Another version, now with Livedb plugin, a "database", which is actually a set of arrays that copy data from some packets. Tested just to function in general. As I've seen, it writes data that seems ok. To test it more, I've added outputting of the whole db into db.log file.

So, Dygear speaks of a special addition that may allow writing text in more readable or more human style than me. I, on the contrary, implemented the simplest interface, just a copy of InSim structures and names, and the values are InSim constants. Consequently you need to know InSim well to navigate well in this db. It's not about my style or minimalizm. I just want to make it work as quicker as possible and leave making a comfortable interface for later. The good point is that knowledge of my db is compatible with InSim, and by learning to work with one thing you learn the other one.

P.S. In the version published yesterday, I've found and fixed an error: unpackStructure didn't work as was supposed with complex multi-level arrays.
Last edited by detail, .
detail
S3 licensed
BTW, I'm working on the live "database". I thought of referencing the players/connections lists in the classes, like

<?php 
$name 
$this->player[$PLID]["SName"];
$uname $this->connection[$UCID]["UName"];
?>

and cross-referencing them with each other, like

<?php 
$connUsername 
$this->livedbPlayer[$PLID]["Connection"]["UName"];
?>

["Connection"] element is a reference to $this->livedbConnection.

Though, this way looks ugly and requires more code than get_player_name(), suggested by Dygear. I think, I'll stick to references, because right now a standalone function needs to know the objects or to use a general naming convention.
Last edited by detail, .
detail
S3 licensed
What do you mean by these handlers?

Right now it works the following way: $conn is a Connection class object. $conn->plugin is an array of plugins, for example $conn->plugin["Speaker"] is a Speaker class object. In each plugin object there is a reference to $conn and to $conn->plugin to shorten the queries to them.
detail
S3 licensed
Ok, here is a dirty version of plugins system. Thanks to Dygear for the idea. The previous version didn't work actually, because correcting one mistake, I've made another. This time I've tested the app and all the functions, didn't see anything going wrong and didn't change anything then

Delete the previous version, because this one doesn't need anything from there.

So, see the plugins folder for details. One of the plugins co-works with another one. Unfortunately, calling functions from other plugins coudn't be shorter. But now it is possible to have several plugins handling the same packet and interoperating with each other. Dygear's get_client_name($PLID) function and the "database" beyond it can be made with a plugin.

I've avoided making a function like "register_plugin" to minimize and simplify the code. Plugins system uses the same naming convention.

Some settings should be moved from the main scripts into config. This version is less optimized, because it unpacks any packet when receives it. Actually, it's better to decode only if there is a handler for the packet. Need to work on this, but it's late night already, have to work tomorrow.
detail
S3 licensed
Quote from Dygear :Each plugin should be it's own file, and there really should be a plugin directory.
Something like this code would make writing plugins for InSim so much easier.

Ok, I'll think about it.

Actually, right now you can already write a bit easier than in your example. The constants are already defined, you don't need to write bare numbers.

<?php 
    $Laps 
get_client_lap($PLID);

// I'd define an array to avoid copying many if's. Just more compact code.
$WorkString = array(PITLANE_EXIT => 'left pit lane',
        
PITLANE_ENTER =>'entered pit lane',
        
PITLANE_NO_PURPOSE => 'entered for no purpose',
        
PITLANE_DT => 'entered for drive-through',
        
PITLANE_SG => 'entered for stop-go');
        
ISP_MST("{$PName} {$WorkString[$Work]} on lap ${Laps}.");
    }
}
?>

detail
S3 licensed
Quote from Ian.H :Silly question


Quote from detail :(Actually, I already don't need that since I've made the parser I needed).



It could be useful if someone shares this stuff. BTW, I have published a PHP parser for InSim (it's not yet able to make dynamic structures, like CMX where an int defines the number of blocks, but it won't be hard to implement).
detail
S3 licensed
I know that. Those in the wiki repeat the descriptions from the official site. But I want a different thing. Look into InSim.txt for the example. That file effectively is a C header file, you can include it into code and have all the structures defined. You don't have to rewrite them in your code as I'm doing right now with CMX files.

See the difference.

CMX specification. Just a text.

LIGHTSCHEME BLOCK :

16 char 0 lightscheme name : name
16 char 16 sky texture name : texture
16 char 32 environment texture : texture
1 col 48 sky colour : rgb0 - average sky colour
1 col 52 sun colour : rgb0 - artist defined
1 float 56 sun intensity : sun colour multiplier
1 float 60 sky boost : sky colour multiplier
1 float 64 sun heading : radians, CCW from forward(Y)
1 float 68 sun pitch : radians, up from ground

InSim: an includable header.
struct IS_ISI // InSim Init - packet to initialise the InSim system
{
byte Size; // 44
byte Type; // ISP_ISI
byte ReqI; // If non-zero LFS will send an IS_VER packet
byte Zero; // 0

word UDPPort; // Port for UDP replies from LFS (0 to 65535)
word Flags; // Bit flags for options (see below)

byte Sp0; // 0
byte Prefix; // Special host message prefix character
word Interval; // Time in ms between NLP or MCI (0 = none)

char Admin[16]; // Admin password (if set in LFS)
char IName[16]; // A short name for your program
};

I'd like, for example, the CMX specs to be presented like the latter. (Actually, I already don't need that since I've made the parser I needed).

If somebody has made those structures for other projects, please, share them.
Request to Scawen: specifications of cmx, lyt & other files
detail
S3 licensed
I don't ask just for specifications, I know they are here. My request is to release a C header file, like InSim.txt, so that other programmers could include them or parse.

I have a PHP parser of InSim.txt that imports all the consants and structures into PHP. I could use it for file formats if there were a file of the same format.
detail
S3 licensed
Updated.

1. Added a simple scheduler of the packets to be sent (better to say delayed delivery). Some debugging work needed on this, because sometimes I get one packet twice. I'm out of ideas what's the reason (adding and removing var_dump's and print's in some unknown way made it work properly or not)
2. Added a callback mechanism for text commands.
3. Commented most of the code.

The demo script says "hello" to each visitor (after random number of seconds). If you type "!say" command, it will reply to you.

[edit] Reuploaded the file (serious bugs, corrupted structures).
Last edited by detail, .
detail
S3 licensed
What will change in InSim with introduction of multibyte codepages?
detail
S3 licensed
So, here is a simple working demo of the app that maintains a connection and calls back user functions when receiving packets.

You have to name your callback function like CBF_ISP_NCN (callback function for new connection packet) and set standard arguments.

Here the first time I faced the limitations of PHP. It's tempting, but I can't do like in JavaScript:

<?php 
define
("ISP_ISI"1);
...
userfunc[ISP_ISI] = function($param1$param2) {
// code 
};
?>

Anyway, I already have a dirty workaround for this.

Of course, to make a more functional and stable app, I need 1) error handling in the functions to prevent wrong calls from a user 2) connection/LFS failure handling 3) keeping state info in memory so that all of it were available to user functions instantly.

Anyway, I wanted to output a working thing AFAP, and here it is.

Though, I doubt if this thing, with such a complex callback mechanism, can handle 32 cars with 10 MCI packets per second... (40 packets to be exact)
php InSim application demo/POC
detail
S3 licensed
Here is a bare and dirty concept demo that connects, maintains connection and logs the events, and surprise! CALLS USER FUNCTIONS FOR PACKETS! (something similar to LuaLFS)

This is an early working demo, so don't expect too much from it.

how to run it
Modify config.inc.php (and php_insim_base.php for admin password) and run
> php.exe -q php_insim_base.php

You need a dedicated host to run (config and .bat attached).

Why I do this? So far, I want to make a PHP app for myself. To make it, I need a base application. I hope this can be a base for others and there will be other contributors. Though I like the concept of LuaLFS and it looks very tempting, still I don't want to spread myself into many languages. (Having to work in VBA at my work and at the same time to code something in PHP for hobby, is such a pain...)

P.S. lurLFSd is a nice thing, yet I can't (rely on|wait for) this project.
Last edited by detail, .
detail
S3 licensed
Ok, now I understand: it happens when my InSim app disconnects and LFS tries to send keepalive packets. LFS tries to connect to the same port, and there are no slots. That's what causes this message.
InSim: why so many message packets? [resolved]
detail
S3 licensed
I study the InSim.txt and can't understand why there are so many different packets for text messages and commands.

What's the difference between IS_MSO, IS_MSX and IS_MTC?
What is IS_MSX for?
What does "messages in" and "messages out" mean? (I thought I got the logic, but now I'm confused)
PHP InSim app draft
detail
S3 licensed
Last edited by detail, .
detail
S3 licensed
Probably you didn't get it: I don't run the script again. I get these messages after the first and the only run of the host and the script.

0) No LFS is running for much time.
1) I start a new instance of LFS host
2) then I run a script just once. As soon as it recieves the ISP_VER packet, it ends.

And still there are those junk messages.
[php] Strange behaviour of LFS host
detail
S3 licensed
I run LFS nogfx host and then connect to it with a php script

> php\php.exe -q script.php


<?php 
include("insim_constants.inc.php");

set_time_limit (0);

$address '192.168.0.2';
$speakPort 29999;
$listenPort 30000;
$maxClients 1;

$sockIn socket_create(AF_INETSOCK_DGRAMSOL_UDP) or die("Couldn't create listen socket");
socket_bind($sockIn$address$listenPort) or die('Could not bind to address'); 

$sockOut socket_create(AF_INETSOCK_DGRAMSOL_UDP) or die("Couldn't create send socket");
socket_connect($sockOut$address$speakPort) or die('Could not connect to address'); 

$pack pack("CCCxSSxCSa16a16"44ISP_ISI1$listenPortISF_NLP361000"detail""detail");
socket_write($sockOut$packstrlen($pack));
print(
bin2hex(socket_read($sockIn20PHP_BINARY_READ)));

exit;
?>

Actually, the script makes a connection, receives ISP_VER and prints its contents to stdout, then closes. LFS should close the connection on timeout.

Strange thing is that in LFS window I see


InSim - UDP : detail (port 30000)
InSim - UDP : no slots available
InSim - UDP : no slots available
InSim timeout : detail

What causes those 2 "no slots" messages? I don't run the script twice.
detail
S3 licensed
Quote from senn :Do you think ppl who use a mouse are gonna put "MOUSE" into their name? wtf is wrong with ppl.

Nice idea! I'll do that!
Problem with 3 language layouts in patch Y
detail
S3 licensed
I use 3 layouts: Russian, English and Italian. I need all them in LFS as well. Before all three worked fine, but in Y Italian doesn't work correctly for me. Instead of symbols like è à ò ù ì, I get those without diacritic signs: e a o u i. Windows XP64. Before patch Y it always worked.
detail
S3 licensed
наконец-то ещё один кирилический перевод
detail
S3 licensed
The joke about a pink wheel is useless, because for a mouse driver nothing has changed in LFS. I continue driving with mouse and don't see a problem to change gear. Yes, I'd like to buy a rudder & pedals (not a round wheel), but don't want to bother myself with mounting and unmount it to the table.
Last edited by detail, .
FGED GREDG RDFGDR GSFDG