The online racing simulator
Uhhh... bad news , thanks Brilwing.
Hi there!

Is there a documentation for the JInsim package? I started to do something with and inside game gui (clickable buttons, fields, whatsoever). But i actually couldnt find out how to create a button in the game. The ButtonRequest thing sounded promising, but without docu or source code i have no idea what it does.

Or if JInsim isn't the way to walk, lighten me up
Quote from GabbO :Hi there!

Is there a documentation for the JInsim package? I started to do something with and inside game gui (clickable buttons, fields, whatsoever). But i actually couldnt find out how to create a button in the game. The ButtonRequest thing sounded promising, but without docu or source code i have no idea what it does.

Or if JInsim isn't the way to walk, lighten me up

There is only the java api docu, but you can have a look into the examples that are in the jinsim package or in the svn.
For a simple button see:
http://jinsim.svn.sourceforge. ... ton/Main.java?view=markup

I hope that helps
Thanks, it helped.

Now i worked offline and created a buttonfactory that helps manipulate/handle buttons. The tool i created is working very well,
but now when i wanted to test it online i can't see the buttons. I created them with my connectionId, so it should be visible for me. It hard to do without docs . Any hints what could be the problem?
Quote from GabbO : I created them with my connectionId, so it should be visible for me. It hard to do without docs

Yes with your connection id you should see the button.
Quote from GabbO :Thanks, it helped.

Now i worked offline and created a buttonfactory that helps manipulate/handle buttons. The tool i created is working very well,
but now when i wanted to test it online i can't see the buttons. I created them with my connectionId, so it should be visible for me. It hard to do without docs . Any hints what could be the problem?

Do you have a code sample you can share? Did you hard code the connection id. I have never checked it out, but in single and multiplayer they could be different since the host take a connection in multiplayer.
I can give a pseudocode example

i start the app with a user message, so i do:

connectionId= messageResponse.getConnectionId();

button.setConnectionId(connectionId);

sendButton();

works perfectly on singleplayer (connId == 0)
when im on a server the Id != 0, and i see no buttons
I have always had trouble displaying buttons whenever I don't set the request info and clickid before sending the button.

b1.setRequestInfo((byte)(1));
b1.setClickId(BTN_ID);

of course i also set these, thats just a sampe how i get the connId

butReq = new ButtonRequest();
butReq.setButtonStyle(butStyle);
butReq.setText(butText);
butReq.setLeft((byte)butPosition.x);
butReq.setTop((byte)butPosition.y);
butReq.setWidth((byte)butDimension.width);
butReq.setHeight((byte)butDimension.height);
butReq.setConnectionId(butConnectionId);
butReq.setClickId(butClickId);
butReq.setRequestInfo(butRequestId);

Thats what i set
Check your flags parameter in SimpleClient().connect() method.


...
Channel channel = new TCPChannel("127.0.0.1", 29999);
SimpleClient client = new SimpleClient();
client.addListener(this);

client.connect(channel,
"somepassword",
"someInsimName",
(short) (InitRequest.[I]RECEIVE_NODE_LAP | [/I][COLOR=Red]InitRequest.[I]LOCAL[/I][/COLOR]),
0, 0, '!');
...

Insim.txt
Quote :
// The ISF_LOCAL flag is important if your program creates buttons.
// It should be set if your program is not a host control system.
// If set, then buttons are created in the local button area, so
// avoiding conflict with the host buttons and allowing the user
// to switch them with SHIFT+B rather than SHIFT+I.

that was it
Outgauge
Hi java friends

In OutGaugeResponse packet when i call getWaterTemperatur(), getOilPressure(), getTurbo() I always get a return of 0.0, other methods works perfect (fuel, brake, throttle, displays, etc.) ; could anyone confirm this please?

Also I think I found an error in Client class close() method:

0.5.RC5

public void close() throws IOException {
if (channel != null && channel.isConnected()) {
send(new TinyRequest(Tiny.CLOSE));
if (outChannel != null) {
disableOutGauge();
disableOutSim();
outChannel.close();
}
channel.close();
}
}

If Tiny.CLOSE is send before disableOutGauge() or disableOutSim() then this last two instructions are lost and the host keeps sending data, so I think it should be:


public void close() throws IOException {
if (channel != null && channel.isConnected()) {
if (outChannel != null) {
disableOutGauge();
disableOutSim();
outChannel.close();
}
send(new TinyRequest(Tiny.CLOSE));
channel.close();
}
}

Quote from Ramon F. :Hi java friends

In OutGaugeResponse packet when i call getWaterTemperatur(), getOilPressure(), getTurbo() I always get a return of 0.0, other methods works perfect (fuel, brake, throttle, displays, etc.) ; could anyone confirm this please?

Hmm, I have checked the code, but cannot find any errors, so I have to run a test.

Quote from Ramon F. :
Also I think I found an error in Client class close() method:
...

Yes this could be a bug, I will change this.

P.S. If you want change such things yourself I can give you access to the svn repo at sourceforge
Thanks Brilwing, PM sent.
Err... my bad :duck:

getTurbo() works, but getWaterTemperatur(), getOilPressure() doesn't
I'm having a little problem at the moment using the "work done" flags in the PitStopResponse class. Hopefully someone here has some experience and can help me out. It seems like the "didBodyMinor()" method always returns true even when I don't think any work has been done. I have damage repair set to No, but didBodyMinor always returns true. Has anyone used this method successfully before? I'm using JInSim 0.5rc5 (latest version on the homepage).

Thanks in advance.
It's a bug, I'm sure Brilwing will fix it in the next version, but meanwhile you could try this:

Edit: Fixed, thanks Brilwing.
Quote from Brilwing :Here is a jar with the fix: http://liveforspeed.at/download/jinsim-0.5rc6.jar

Fantastic! Thanks very much for the quick fix

For anyone else who downloads this update you'll need to switch from the commons logging library to SL4J. Download the Zip archive on that site and add in the "slf4j-api-1.5.8.jar" and "slf4j-simple-1.5.8.jar" Jars to your build path (this is what I found using trial and error, it's working for me so I believe it's correct).

I have another question I forgot to ask yesterday. Is there any way to determine the Reset/Midrace Join/Must Pit etc flags if you don't have the RaceStartResponse for a particular race? If, for example, you miss the start of the race or an admin changes these flags during the race? I've taken a look at the StateResponse class (received as a result of sending the Tiny.SEND_STATE_INFO TinyRequest), but I can't see it in there.

Thanks again for any help on this second question.
I've cheked the INSIM documentation and couldn't find those flags other than RaceStartResponse packet
Quote from Ramon F. :I've cheked the INSIM documentation and couldn't find those flags other than RaceStartResponse packet

Yeah, that's what I'm worried about. Also, there doesn't seem to be any way to detect if an admin changes them during a race. I was hoping someone had come on this problem and sorted it already, but feared it was impossible
Have you tested if Admin command such as /canreset are captured by the MessageResponse? If they are that how you can listen for the admin making changes during a race session.
Quote from bdshan :Have you tested if Admin command such as /canreset are captured by the MessageResponse? If they are that how you can listen for the admin making changes during a race session.

Yes I've tested that before. I don't see any MessageResponses when the reset/midrace/mustpit are changed.
I think I've found a small bug with the split count on AS5/AS5R. The Track class has it as 4 sectors (see first attached screenshot), but in reality it's only 3 sectors (as shown by LFS World, second screenshot). I didn't see any other problems with the sector counts but I haven't checked each one rigorously. Thanks.
Attached images
TrackClass.jpg
grandprix3sectors.jpg
Quote from amp88 :I think I've found a small bug with the split count on AS5/AS5R. The Track class has it as 4 sectors (see first attached screenshot), but in reality it's only 3 sectors (as shown by LFS World, second screenshot). I didn't see any other problems with the sector counts but I haven't checked each one rigorously. Thanks.

Changed AS5 to have 3 sectors and updated the jar: http://liveforspeed.at/download/jinsim-0.5rc6.jar

FGED GREDG RDFGDR GSFDG