The online racing simulator
Searching in All forums
(921 results)
DarkTimes
S2 licensed
OK - cause she has a look on her face like she's his mum.
DarkTimes
S2 licensed
Who is that middle-aged blonde woman always skulking around in the background of Petrov?
DarkTimes
S2 licensed
They patched Visual Studio 2010 recently (go to Windows Update), and it seems they've changed the way the Console works (this might be to do with the unicode support they're adding to the console, which is good for InSim.NET apps). Anyway, it means you cannot do a WriteLine if you've already called ReadKey, that means you cannot do...

Console.ReadKey(true);

... to stop the program closing. Instead I recommend just going with the old...

while (insim.IsConnected) {
Thread.Sleep(200);
}

... method.

I might be wrong about this, of course, but it seems to be the case on the two computers I've tested. I need to investigate more.
Last edited by DarkTimes, .
DarkTimes
S2 licensed
I've been messing around with Visual Studio 11 and I'm quite impressed with the new async stuff in .NET 4.5.

It doesn't work on sockets directly, so you need to use it in conjunction with the TcpClient and NetworkStream classes. I had a go at writing a InSim.NET style TcpSocket with .NET 4.5. It's not complete, just a proof of concept, but you can see how much it simplifies the asynchronous code.


<?php 
public class TcpSocket {
    private const 
int BufferSize 1024;

    private 
TcpClient _client;
    private 
NetworkStream _stream;
    private 
byte[] _temp = new byte[BufferSize];
    private List<
byte_buffer = new List<byte>(BufferSize);

    public 
TcpSocket() {
        
_client = new TcpClient();
        
_client.Client.NoDelay true;
    }

    public 
async Task ConnectAsync(string hostint port) {
        
await _client.ConnectAsync(hostport);

        
_stream _client.GetStream();

        
HandleReceive();
    }

    public 
void Close() {
        if (
_stream != null) {
            
_stream.Close();
        }

        
_client.Close();
    }

    public 
async Task SendAsync(byte[] buffer) {
        
await _stream.WriteAsync(buffer0buffer.Length);
    }

    private 
async void HandleReceive() {
        
int count await _stream.ReadAsync(_temp0_temp.Length);

        if (
count == 0) {
            
Close(); // Lost connection.
        
}
        else {
            
_buffer.AddRange(_temp.Take(count));

            while (
_buffer.Any() && _buffer.Count >= _buffer.First()) {
                
int size _buffer.First();

                
byte[] packet _buffer.Take(size).ToArray();

                
HandlePacket(packet);

                
_buffer.RemoveRange(0size);
            }

            
HandleReceive();
        }
    }

    private 
void HandlePacket(byte[] packet) {
        
// do something...
        
Debug.WriteLine(packet.Length);
    }
}
?>

Last edited by DarkTimes, .
DarkTimes
S2 licensed
You're asking in the wrong forum, you should ask in the Airio thread.

http://www.lfsforum.net/showthread.php?t=52368
DarkTimes
S2 licensed
I think the stewards have been dishing out too many penalties this year, I prefer them to give out warnings. My heart always sinks when I see that little modal-box pop up to say drivers are being investigated. If you want drivers to race wheel-to-wheel then you will inevitably get contact, you cannot have it both ways.
DarkTimes
S2 licensed
Schumacher's rears were completely shot, that's why Button passed so easily. He pitted immediately afterwards. Anyway, invincible drive from Vettel, good drive from Button, decent for Alonso. I actually though Hamilton was quite mature today, no crazy lunges or mistakes. I don't think you would have seen the Hamilton of a few years ago content to sit behind Schumacher for so many laps, he would have done a kamikaze move down the inside.
DarkTimes
S2 licensed
You need to cast the UVal to a VoteAction.

if (small.SubT == SmallType.SMALL_VTA && VoteAction.VOTE_RESTART == (VoteAction)small.UVal)
{

}

DarkTimes
S2 licensed
Sorry, but I don't really have a solution to this issue. Turns out the .NET encoding code has decided that Č should turn into C. The InSim.NET EncodingHelper class relies on the fact that Windows will return an error if you try to convert a unicode char to a Windows codepage char that doesn't exist. While the codepage 1252 doesn't have Č, it seems happy to provide an alternative. I don't see any way to change this default behaviour.

If anyone has a better idea please let me know! Seriously.
Last edited by DarkTimes, .
DarkTimes
S2 licensed
Quote from student :Before you're calling for nurse you could read what I linked with an open mind. There is actual proof for what I'm writing.

Sorry, you're right, I didn't read it with an open mind, I read it with extreme scepticism. There is no scientific 'proof' for what this guy is saying. Absolutely none. Zero. All there is evidence for is that he wrote this stuff in a book once. That's not evidence, that's just something some guy wrote in a book once. There is no evidence that those are pictures of real UFOs, and certainly no evidence that this guy is actually in contact with telepathic psychic aliens. Frankly that guy is a complete nutjob and I feel sad for anyone misguided enough to believe him.

Edit: And in terms of the 'metal samples' part? I think this says enough:

Quote :This biographical section of an article needs additional citations for verification.

It has absolutely zero citations. Even Wikipedia doesn't think it's true.
Last edited by DarkTimes, .
DarkTimes
S2 licensed
Quote from student :Here some real UFO photos.

Here is the article telling how Billy Meier released information about Jupiter rings years before scientists knew about them.
http://www.rense.com/general35/jup.htm

There is a lot of information he released before Earth scientists or whoever knew it. For example ozone layer depletion and a lot more. All of that information was given to him by intelligent humanoids known as Plejaren.

He was also given extraterrestrial metal samples that he gave to Marcel Vogel, a scientist known for inventing the magnetic coating for the hard disk drives. After examining the samples he said it was impossible to produce them on Earth with the technologies known to man.
http://en.wikipedia.org/wiki/Billy_Meier#The_metal_samples

Nurse! Nurse! He's out of his room again! Nurse!
DarkTimes
S2 licensed
Do I believe in little green men who abduct rednecks, do experiments on them, wipe their memories (but not very well apparently), and then dump them back in their trucks? No. No, I don't.

Do I think there is life on other planets? Yes, that seems highly likely. As others have said, given the number of planets, stars and galaxies in our universe, some of them must have developed life. Some of that life may even be as smart as humans. The question then becomes whether interstellar travel is possible within the lifespan of a sapient being, although that's a question I'm not equipped to answer
DarkTimes
S2 licensed
Quote from M.M.L. :Also have problem with Serbian characters like "Ć Č Š Đ Ž". What i need to do?

What do you mean by "problem"? You'll need to be more specific if you want me to help you.

Edit: I've had a look at the encoding for those characters, it seems that .NET is happy to convert something like 'Ć' into a basic latin 'C'. I'm not sure what solution, if any, there is to this issue. Fact is that CP1252 encoding (the default) doesn't regard 'Ć' as an error, it just converts it to the closest match. I'm not sure if there is any way to make the encodings more strict about what they accept, which will cause InSim.NET to search the codepages for the correct character. 'Ć' is in CP1250.

Of course I don't know if this is the problem you are referring to.
Last edited by DarkTimes, .
DarkTimes
S2 licensed
Is the first exception being thrown when this happens? One issue I can see that would cause that error message is that, if the first exception is thrown, the rest of the code will still try to execute, even though the connection has not been established. What I would do is this:

try
{
insim.Initialize(new InSimSettings
{
Host = IPAddress,
Port = Port,
Admin = AdminPW,
Prefix = '!',
Flags = InSimFlags.ISF_MCI | InSimFlags.ISF_CON | InSimFlags.ISF_MSO_COLS,
Interval = 50, // The interval at which updates are sent (milliseconds)
});
Logiraj("################### Uspesno konektovan: ################### ", IPAddress + "; " + Port + "; " + AdminPW + ";");
}
catch(InSimException ex)
{
Logiraj("Insim greska pri konektovanju 1",ex.ToString());

[b]// Connection to LFS has failed, exit program.
Environment.Exit(1);[/b]
}

Program.UcitajPodesavanja();
UcitajJezik();
TimerReset(insim);
UcitajPorukeIzFajla();
if (userest == true)
{
UcitajRest(insim, 0);
}

try
{
insim.Send("/msg " + uspesnakonekcija);
insim.Send(new IS_TINY { SubT = TinyType.TINY_NCN, ReqI = 255 });
insim.Send(new IS_TINY { SubT = TinyType.TINY_NPL, ReqI = 255 });
insim.Send(new IS_TINY { SubT = TinyType.TINY_SST, ReqI = 255 });
insim.Send(new IS_TINY { SubT = TinyType.TINY_RST, ReqI = 255 });
}
catch (InSimException ex)
{
Logiraj("Insim greska pri konektovanju 2", ex.ToString());
}

It's hard to bug fix someone else's code by looking at a small section of it, but that's the first thing that jumps out at me.
DarkTimes
S2 licensed
This works fine for me:


<?php 
var insim = new InSim();

insim.Initialize(new InSimSettings {
    
Host "127.0.0.1",
    
Port 29999,
    
UdpPort 30000,
    
Interval 50// Milliseconds
});

insim.Send("/msg I don't know what this contains...");
insim.Send(new IS_TINY SubT TinyType.TINY_NCNReqI 255 });
insim.Send(new IS_TINY SubT TinyType.TINY_NPLReqI 255 });
insim.Send(new IS_TINY SubT TinyType.TINY_SSTReqI 255 });
insim.Send(new IS_TINY SubT TinyType.TINY_RSTReqI 255 });

Console.ReadKey();
?>

That error message means you are trying to send a packet when LFS is not connected. Where in your code are you trying to send the packets? Have you made sure that you have initialized the connection (InSim.Initialize()) before sending those packets?
DarkTimes
S2 licensed
Quote from M.M.L. :What is best time for Interval? I am trying from 10ms but program will not connect. Sometimes with 1000 also will not connect from the first.

According to InSim.txt the minimum interval is 40ms.
DarkTimes
S2 licensed
In the replay you posted there are no NPL packets sent, I've tested it and InSim.NET does not raise any NPL events during that replay. That suggests to me that the problem is in your code, you are requesting the packets somehow, but without knowing more or seeing your code I can't say for certain.
DarkTimes
S2 licensed
I watched the packets in InSimSniffer and no NPL packets are sent by LFS during the replay. All I can imagine is that you are requesting for the NPL packet to be sent in your own code, and at some point in your logic you are requesting it twice.

These are all the packets sent by LFS during the replay, any other packets you receive you must have requested.
DarkTimes
S2 licensed
Quote from thisnameistaken :I bought that on a whim for a tenner the other week, it's the most tedious game I've played in years and reminded me why I never buy games any more. I don't even think it qualifies as a game, it's mostly over-long corny action movie -style dialogue. Hours and hours of it. Punctuated by rather routine combat sequences that feel almost turn-based they are so poorly paced. Proper rubbish.

Sorry.

Well, that's fair enough, but I have just completed the first one and really enjoyed it, so I'm not too worried.
DarkTimes
S2 licensed
Quote from thisnameistaken :Not to mention burning disks is still a handy thing to be able to do.

As for games, I would much rather buy a modern game on disk than download it. Who wants to wait for 10+Gb of game to download when you can just go buy a box containing it and take it home in a fraction of the time?

Well I prefer to buy my games on Steam, as then I don't need to worry about keeping the disk, I can download it whenever I like. Steam is definitely my preferred way to buy games. Only problem is that unless the game is on sale, it's usually prohibitively expensive to do this. For instance I just bought Mass Effect 2 for £7.99 on Amazon. On Steam it's £19.99. Even though Steam is better, that's just too much of a saving to ignore. I definitely have not moved beyond the optical, no matter how much I'd like to have.
DarkTimes
S2 licensed
Quote from E.Reiljans :Also, not sure why you'd want a optical drive in year 2011. It's like using floppies.

For watching DVDs, installing old games, also retail games are often cheaper than they are on Steam. We're not ready to wave good bye to the optical drive yet, sadly. I still use my DVD drive about once or twice a week. Also they're stupid cheap, no reason not to buy one.
DarkTimes
S2 licensed
Was it just the camera or was Vettel's dash going haywire?
DarkTimes
S2 licensed
Button always has such good race pace, just wish he could get his qualifying sorted.
DarkTimes
S2 licensed
Cue the anti-Hamilton brigade.

3, 2, 1... go!
DarkTimes
S2 licensed
All I can imagine is that at some point in the fifteen seconds it takes the timer to elapse, the connection with LFS has been lost. Perhaps it would be better to place the IsConnected check in the anonymous method.


<?php 
timer
.Elapsed += delegate {
    if (
insim.IsConnected) {
        
insim.Send(TinyType.TINY_RST5);
    }
}
?>

Also just a tip, instead of using anonymous methods, it's generally recommended to use lambdas these days, but I guess it doesn't make much difference in this instance.


<?php 
timer
.Elapsed += (sendere) => {

};
?>

FGED GREDG RDFGDR GSFDG