The online racing simulator
Searching in All forums
(921 results)
DarkTimes
S2 licensed
The suggestion I was making was for Povo, because he is also a .NET programmer, not for PRISM itself.
DarkTimes
S2 licensed
http://twitter.com/#!/billybragg/status/94847195110580225

Quote from Billy Bragg :It's not age that Hendrix, Jones, Joplin, Morrison, Cobain & Amy have in common - it's drug abuse, sadly

DarkTimes
S2 licensed
Quote from U4IK ST8 :What happens when his sentence is up? 21 years I believe I read is the maximum in Norway.

Nah, this is wrong. It's 21 years then assessed every five years after that. They have the power to never release him if he still poses a thread to society. I've seen this reported in a few places today, but it's misleading.
Last edited by DarkTimes, .
DarkTimes
S2 licensed
You can also write a small .NET app to manage/restart your PRISM program. You can do a lot of process management stuff on Windows with .NET, such as redirect PHP errors to your .NET app for logging. Check the Process docs.

using System.Diagnostics;

class Program {
static void Main() {
string path = @"X:\Path\To\PRISM.bat";

while (true) {
using (Process prism = Process.Start(path)) {
prism.WaitForExit();
}
}
}
}

Last edited by DarkTimes, .
DarkTimes
S2 licensed
On BBC F1 Brundle said he spoke to Webber, and it's the changes Pirelli have made to make the tyres more durable that are really suiting him. He said, "it's playing right into my hands."

Edit: Apparently Pirelli have been getting a lot of flack from their competitors about how they can't make a tyre that lasts, which any real F1 fan knows is complete bullshit.
Last edited by DarkTimes, .
DarkTimes
S2 licensed
Quote from U4IK ST8 :And just to add something else I read, in '06 on the farm he later rented, 3 men were arrested for cultivating marijuana. So, imo, he was definitely involved with a shady bunch of folks.

Bunch of wasters grow weed. Nutter murders 90 people. Yeah, I see the connection.
DarkTimes
S2 licensed
Quote from Bose321 :I was just about to PM you for some codes...

I don't mind helping with troublesome code, so don't be afraid to PM me. I do try to answer them, especially if I know the answer to the question (which frankly isn't often).

This is an example of the sort of PM that I'm talking about, that I got a few days ago (out of the blue).

Quote :you can help me?? with team viewer or msn?? i need help for my cruise insim.

I ignored this.

If you have a genuine programming problem that can't be solved by reading a basic programming tutorial then I'm happy to help, although I'd prefer it if you asked in one of my many programming threads instead of messaging me directly.

To sum up: please don't worry about sending me a PM, I'm happy to get them, all I ask is that you send me an answerable question. If you do I'll try my best to answer it. And if I don't you can always ask on StackOverflow, which is better than me anyway.
Last edited by DarkTimes, .
DarkTimes
S2 licensed
I don't get 'spam', but I do get a lot of 'pls can u sent me teh codez', as well a few 'pls skype me'. I hate PMs, people should just post in the threads, that way everyone gets to benefit from my banal nonsensical warblings. I do ignore a lot of PMs, some because I can't be bothered answering, others because I forget to.
DarkTimes
S2 licensed
Quote from PoVo :Let's blame COD MW2... (his played games)

They will blame videogames and music, while ignoring the horrendous villainization of Muslims in the media.
DarkTimes
S2 licensed
Bah Di Resta 12th, thought he might sneak into Q3 there.

Edit: Also where's the F1 chatter this week? It's looking good for the race, RB, Ferrari and McLaren all very competitive.
Last edited by DarkTimes, .
DarkTimes
S2 licensed
I was thinking of creating a new project called InSim.NET Contrib, where people could contribute helper classes to the library. I would first of all move the current helper classes to the new project, then let other people join as contributors, so they could add their own extensions.

Often people need to reuse a lot of the same code over and over in their programs, such as connection managers and button managers, but at the same time this sort of code doesn't belong in the library itself. By creating a contrib lib it would allow people to contribute commonly used helpers, plus pick and choose which helpers they wanted, all without messing with the integrity of the base library. It would also mean that people would all be using the same 'best possible' versions of the code they need, instead of having to write it again from scratch each time.

A good example of a similar project is ASP.NET MVC Contrib, that adds tonnes of extra functionality to Microsoft's excellent Web toolkit. Anyway it was just an idea, and would require input from other programmers, but I think it would be nice to be able to add lots of high-level helper classes without having to mess with the library itself.

Let me know if anyone would be interested in this, as there is no point me doing it if I'm the only person who cares.
Last edited by DarkTimes, .
DarkTimes
S2 licensed
On a separate note, there is a new free disassembler from Telerik called JustDecompile. It's a nice alternative to Reflector, which is no longer free. I've been using it quite a bit recently and it's quite good.

http://www.telerik.com/products/decompiling.aspx
DarkTimes
S2 licensed
I don't know the answer. You might need to add ISF_LOCAL to the initialization flags.

insim.Initialize(new InSimSettings {
Flags = InSimFlags.ISF_LOCAL,
});

DarkTimes
S2 licensed
It's not about OOP, or any one technology, it's just about sharing the knowledge. It's also not about teaching people to program. All I'm suggesting is that people read the programming section on the wiki and edit anything they feel is appropriate.
DarkTimes
S2 licensed
Quote from SpooNJaB :by a tramp on meth.

by a ned on buckfast.
DarkTimes
S2 licensed
A realistic Glasgow simulator would just involve being stabbed to death on the underground.
Last edited by DarkTimes, .
DarkTimes
S2 licensed
Yup, the Python site is down for me too.

It also appears to be down for everyone else as well....

http://www.downforeveryoneorju ... om/http://www.python.org/
DarkTimes
S2 licensed
Imma let you finish, but first I'm gonna bump this thread. I made a start on rewriting the Wiki a couple of years ago, but we still need people to add and edit pages. I've updated some stuff for LFS 0.6B, but a lot remains incomplete. The Wiki rewrite was predicated on the idea that 'if you build it they will come', however very few people have come yet.

The great thing about the Wiki is that it canonises our knowledge in a single place, and makes it much easier for new programmers to get up and running quickly. Back when I first located InSim.txt I had no idea what any of it meant and I had to work out how to write InSim apps myself by trial and error. It would be great if there was a comprehensive resource available that would prevent people from having to go through the same pain that I did.

So if you are an InSim programmer with a passing knowledge of how all this stuff works, it would be cool if you could edit or even add a page.
Last edited by DarkTimes, .
DarkTimes
S2 licensed
Quote from DarkTimes :An extension that turns Visual Studio 2010 into a Python IDE. Supports IronPython and CPython.

http://pytools.codeplex.com/

They've released a new update for this. It's actually getting quite good, although the autocomplete still isn't perfect and it still has one or two bugs. I might move development of pyinsim from Eclipse PyDev to Visual Studio now, as I can keep all my projects together and I really like the Visual Studio Mercurial plugin. The Mercurial plugin for Eclipse is so confusing I can't understand how to use it.
DarkTimes
S2 licensed
You can also use InSim.NET with Mono, which is supported on Mac. Although I've not personally tested it on a Mac, I have tested it on Mono for Windows and Ubuntu, and it seems to work fine.

Edit: and of course pyinsim and Python are cross-platform.
Last edited by DarkTimes, .
DarkTimes
S2 licensed
You can look at the packet receive code that InSim.NET uses, which is in the TcpSocket class. Undoubtably not perfect, but it seems to work pretty well. Of course it deals with multiple packets and split packets etc.. If you have any improvement suggestions I'm happy to hear them.

This is the simplest receive loop I can think of. Obviously not the most efficient code, but it makes it easy to see all the parts working.


<?php 
// Store buffer in generic list.
List<bytebuffer = new List<byte>();

// Temp array to store received data.
byte[] temp = new byte[2048]; // Receive up to 2kb of data at a time.

while (true) {
    
// Receive data from socket.
    
int received socket.Receive(temp);
    
    
// Nothing received means connection dropped.
    
if (received == 0){
        throw new 
Exception("lost connection");
    }

    
// Append received data to buffer.
    
buffer.AddRange(temp.Take(received));
    
    
// Loop through each completed packet in the buffer. The first byte in 
    // the buffer is the size of the first packet.
    
while (buffer.Any() && buffer.Count >= buffer.First()) {
        
int size buffer.First();
        
        
// Check packet is multiple of 4.
        
if (size 0){
            throw new 
Exception("corrupt packet");
        }
        
        
// Read first packet from buffer and remove it.
        
byte[] packet buffer.Take(size).ToArray();
        
buffer.RemoveRange(0size); 
        
        
// Do something with the packet.
        // HandlePacket(packet);
    
}
}
?>

Edit: It should be noted as well, as many InSim devs seem to forget this, that when sending packets you also need to pay attention to how many bytes are sent. The send function returns the number of bytes transferred, and if this is less than the size of the packet you need to resend any data that was omitted. This is simple however.


<?php 
byte
[] buffer GetPacketToSend();

// Keep looping while there is unsent data.
int sent 0;
do {
    
sent += socket.Send(buffersentbuffer.Length sent);
} while (
sent buffer.Length);
?>

Last edited by DarkTimes, .
DarkTimes
S2 licensed
Quote from P5YcHoM4N :He gets on with Button, but that is because he knows give it a couple of years and Button will hang up his gloves too.

Button is only 31, even if he retires at 38 or 39, which seems about the normal age for a successful F1 driver, he's still got seven or eight seasons left.
DarkTimes
S2 licensed
Yes, still overridable, the OutSim and OutGauge stuff's not really changing.
DarkTimes
S2 licensed
Quote from GeForz :additionally - as a fan of oop - I hate the thought that some magically vars exists outside of the object-context and you don't know where they come from ^^

I think, far worse than globals, is when someone forces an OPP construct into a place where a global would have done. The main problem with OOP is the idea that everything should be encapsulated in an object. Sometimes globals just make the code simpler.
Last edited by DarkTimes, .
FGED GREDG RDFGDR GSFDG