The online racing simulator
Searching in All forums
(921 results)
DarkTimes
S2 licensed
Off the top of my head:
  • Latest versions of DirectX need VS2008 or above
  • Latest versions of MFC requires VS2008 or above
  • VS2003 supports .NET 2.0, need VS2005 for 3.0, VS2008 for 3.5, VS2010 for 4.0
  • VS2003 should support Win32 OK, I'm not 100% sure about this. I don't think it's changed much for a while.
I'm not sure exactly what VS2003's feature set was, but certainly VS 2010 Express' core programming features are vastly improved. The main things missing from the Express versions are support for working on teams, unit testing support, plugins, plus a few other kinda "high-end" features. The core coding experience though is very similar to the premium version.

Edit: And yeah, VS C++ Express supports DirectX. The only really annoying thing missing from VS Express is a resource editor, but you can find free ones online.
Last edited by DarkTimes, .
DarkTimes
S2 licensed
Pushed pyinsim 2.0.0 final to release, which you can find on CodePlex.
DarkTimes
S2 licensed
It's not that there are too many cruise servers, it's that there are too many people asking for cruise servers. I think part of this is down to the fact that no one has ever created a nice, user-friendly cruise server, that people can download and deploy. Really, where is the Lapper or AIRIO of cruise servers?

At the moment if people want a cruise server they have to download and compile a buggy Visual Studio solution, learn how to program and spend hours tweaking the code, even just to add there own server name.

I've said this for the last few years, but you guys need to get together and create a full user-friendly configurable cruise server that "normal" people can download, the way that the Lapper guys have done. A real program with configuration and help files, that someone who isn't a programmer can actually understand.

If you do this, not only will you reduce about 99% of the spam on the programmer forum, you'll become heroes. Hell you could probably even charge money for it!
Last edited by DarkTimes, .
DarkTimes
S2 licensed
Quote from Dygear :I'm not 100% sure if I need the new keyword, but I might.

It came from C++. In C++ new means something specific. In PHP it doesn't do anything, it's just syntax noise. In fairness C# and Java also needlessly copied it. I blame Java.
DarkTimes
S2 licensed
Quote from dawesdust_12 :Well.. now for a bit of a rant.

I can't stand PHP with it's -> way to call methods... a freaking . is so much easier to type.

Yeah, that annoys me a little. Also how you need to use the "new" keyword to create an object even though every object in PHP is declared on the heap.
Last edited by DarkTimes, .
DarkTimes
S2 licensed
Ah, method chaining. That's a brilliant idea! I'm kind of annoyed I didn't think of that myself, seeing as how much I work with LINQ. You could do code like this:

this->sendPacket(new IS_TINY()->ReqI(255)->SubT(TINY_NCN))

This completely fixes my issue of having too verbose packet syntax.
Last edited by DarkTimes, .
DarkTimes
S2 licensed
I wrote a program a while back that was ment to demonstrate drawing the tracks with WPF, but it also shows the coords as well, in meters. You can select the track to view and pan and zoom with the mouse. Note that the Y axis of the tracks is flipped (didn't notice that at the time ), but the coords are still correct.
DarkTimes
S2 licensed
Pushed beta 5 to release. Only a small bug fix with using the background=True parameter of the run function. Backgound is useful when using pyinsim in a GUI app, as it makes the socket code run on a background thread so it doesn't block the message pump.

I think the next release of the library will be final.
Last edited by DarkTimes, .
DarkTimes
S2 licensed
Quote from the_angry_angel :The other reason you may not have been given an answer is because you've only provided partial snippets of code. It's all well and good if your code is doing the right thing, provided your variables are all in the right scope, etc. which you can't tell from very small snippets without the surrounding code.

Yes for me the question was too specific. I tend to answer questions that are broad, such as "how do you write a swear filter", and shy away from questions like "help me fix this specific problem using this specific API". The reason for this is that I don't really understand how the other APIs work. My advice is to make your question vague and not to require the answerer to have knowledge of any specific API or library. That way you will be more likely to have your question answered.
Last edited by DarkTimes, .
DarkTimes
S2 licensed
You can send me a PM if you need help. Of course I know HTML, CSS and Javascript, I also have experience of PHP, Java, Ruby, Python and ASP.
Last edited by DarkTimes, .
DarkTimes
S2 licensed
Here is a rough example of a program that tries to reconnect to InSim every 5 seconds, posted in response to this request.

import pyinsim
import threading

class Reconnector(object):
def __init__(self, address, delay):
self.delay = delay
self.address = address
self.do_init()

def do_init(self):
print 'Trying to connect'
self.insim = pyinsim.insim(self.address[0], self.address[1])
self.insim.bind(pyinsim.EVT_INIT, self.init)
self.insim.bind(pyinsim.EVT_CLOSE, self.close)
pyinsim.run()

def init(self, insim):
print 'Connected to InSim!'

def close(self, insim):
print 'Not connected, starting timer'
threading.Timer(self.delay, self.do_init).start()

if __name__ == '__main__':
Reconnector(('127.0.0.1', 29999), delay=5.0)

Last edited by DarkTimes, .
DarkTimes
S2 licensed
Edit: Sorry, I didn't realise this was the old thread. I don't provide support for this version of pyinsim anymore. If you really want to use it, you're on your own (the code is in site-packages if you want to read it). I suggest moving to the new and shiny version of the library.

Edit: I wrote a rough example of doing this with pyinsim 2.0.

http://www.lfsforum.net/showthread.php?p=1490842#post1490842
Last edited by DarkTimes, .
DarkTimes
S2 licensed
There is nothing to learn here. You would be far better off spending two minutes reading a "introduction to programming" tutorial than reading this thread.
DarkTimes
S2 licensed
OK - Started watching F1 at 12:00, it's finally finished at 16:45. Almost 5 hours of motoracing. I think that's enough for a fortnight.
DarkTimes
S2 licensed
Quote from Intrepid :Good result for Button? He now lies fifth in the championship! Good result if your only measuring him against Lewis, but at the end of the day he was a good second off Alonso and Vettel. it doesn't look good at all for McLaren!

He's only a win away from leading the championship, still very much in the hunt.
DarkTimes
S2 licensed
A long race. I had to go make food half way through, as I realized I would need some sustenance to make it through a 2 hour F1 afternoon. A great result for Alonso, my early prediction for him to win the championship is not looking so bad. Feel sorry for Lewis, I think that was a racing incident, Hamilton just came off the worse. Good result for Button, he's picking up the points.
Last edited by DarkTimes, .
DarkTimes
S2 licensed
Yeah, Python has a tendency to look like pseudocode.

Anyway, pushed beta 4 out to release. I rewrote the UDP timeout code, which has broken the API a little. You now specifiy a timeout when initializing the connection, so OutGauge now works like this:

import pyinsim

def outgauge_handler(og, packet):
pass # Do something with packet.

# Set timeout to 30 seconds.
pyinsim.outgauge('127.0.0.1', 30000, outgauge_handler, 30.0)

pyinsim.run()

Also fixed a small but significant bug in the tounicode() string function.
DarkTimes
S2 licensed
Klein beat Senna. I guess he's the first non-rookie who's ever driven that car. A wakeup call for Hispania I hope.
DarkTimes
S2 licensed
OK - I take back that part about it being stable.

I've released beta 3 to CodePlex. There was a bug that was making pyinsim use 100% CPU which I've now fixed. I also fixed the issue with EVT_INIT not being raised and an issue affecting disconnecting from hosts.
DarkTimes
S2 licensed
Cool thanks.

It should be pretty stable at the moment, but a few thing are still incomplete, mainly the documentation, also there are a couple of bugs I need to work out. If you find any bugs or issues please assign them to me using the Issue Tracker.

Cheers
DarkTimes
S2 licensed
Uploaded pyinsim 2.0.0 beta 2 to CodePlex with a bug fix and a couple of small changes.
DarkTimes
S2 licensed
Quote from PoVo :
if (Msg.EndsWith(" : took the wrong route"))
{
if (Connections[GetConnIdx(MSO.UCID)].UniqueID == 0)
{
string Message = Msg;
Message.Replace(" : took the wrong route", "");
for (int i = 0; i < Connections.Count; i++)
{
if (Connections[i].PlayerName == Message)
{

// You got the player that took wrong route
// Do some stuff.

}
}
}
}


I spotted a couple of small issues with your code. Firstly there is an easier way to check for system messages, and secondly strings in .NET are immutable, so string.Replace() does not affect the original.

// Check if was a system message.
if (MSO.UserType == Enums.MSO_UserType.MSO_SYSTEM &&
MSO.Msg.EndsWith(" : took the wrong route"))
{
// Strings in .NET are immutable.
string message = MSO.Msg.Replace(" : took the wrong route", "");

for (int i = 0; i < Connections.Count; i++)
{
if (Connections[i].PlayerName == message)
{

// You got the player that took wrong route
// Do some stuff.

// Exit from loop early
return;
}
}
}

I would probably have written it like this:

if (MSO.UserType == Enums.MSO_UserType.MSO_SYSTEM)
{
var index = MSO.Msg.IndexOf(" : took the wrong route");
if (index > -1)
{
var playername = MSO.Msg.Substring(0, index);
var connection = Connections.Single(c => c.PlayerName == playername);

// Do something with connection.
}
}

Hope that helps.
Last edited by DarkTimes, .
DarkTimes
S2 licensed
Reserved
Python - pyinsim - Python InSim library
DarkTimes
S2 licensed
pyinsim is a InSim library for the Python programming language. It allows you to create a socket connection with the game and to send and receive packets of data. These packets can be used to control LFS, to request information and to send various commands. pyinsim provides a high-level abstraction for dealing with InSim, to save you from having to deal with the nitty-gritty of working with sockets directly.

Here are some quick links:What's New?

pyinsim 2.0.0 has a bunch of new features!
  • A new home on GitHub!
  • Improved and more efficient networking code
  • Better support for managing multiple hosts
  • Improved API
CodePlex

As mentioned, pyinsim now has an official project page on GitHub, and this is where all future development will take place. It will also be the place to go to download the library and will always have the latest release and revision of the source code. You can find our new home at:

https://github.com/alexmcbride/pyinsim

Download

You can always download the latest version of pyinsim from its GitHub homepage.

https://github.com/alexmcbride/pyinsim
Last edited by DarkTimes, . Reason : Updated to GitHub
DarkTimes
S2 licensed
OK, sod it. I've decided not to use Google Code but to use CodePlex instead, as really that's what I'm familiar with anyway. You can visit the new CodePlex site for pyinsim here:

http://pyinsim.codeplex.com/

I've done an initial commit for the pyinsim 2.0 source code, which you should be able to access. I'm almost ready to release pyinsim 2.0, but a couple of things still need to be worked on, such as the OutGauge and OutSim support which is currently very buggy. That said, InSim and InSim relay are currently fully supported and seem to be working well.

I decided to use Mercurial for this project, as I've been messing around with it for a couple of days and it seems really good. I have to say getting the CodePlex site setup literally took less than five minutes. And to commit the source code all it took was...

hg clone https://hg01.codeplex.com/pyinsim pyinsim
cd pyinsim
hg add
hg commit
hg push

which was awesome. Anyway, I'll provide more info about pyinsim 2.0 and why I've made a project site for it later.
Last edited by DarkTimes, .
FGED GREDG RDFGDR GSFDG