The online racing simulator
Searching in All forums
(79 results)
NeOn_sp
S3 licensed
Im having problem with IS_PIT.Work.

When I try to get every PitWork done, I dont know how to do it..

What im trying is:



if ((pit.Work & PitWorkFlags.PSE_NOTHING) == PitWorkFlags.PSE_NOTHING)
insim.Send(new IS_MTC { Msg = verde + "PSE_NOTHING detectado0", PLID = pit.PLID });
if ((pit.Work & PitWorkFlags.PSE_STOP) == PitWorkFlags.PSE_STOP)
insim.Send(new IS_MTC { Msg = verde + "PSE_STOP detectado0", PLID = pit.PLID });
if ((pit.Work & PitWorkFlags.PSE_FR_DAM) == PitWorkFlags.PSE_FR_DAM)
insim.Send(new IS_MTC { Msg = verde + "PSE_FR_DAM detectado0", PLID = pit.PLID });
if ((pit.Work & PitWorkFlags.PSE_FR_WHL) == PitWorkFlags.PSE_FR_WHL)
insim.Send(new IS_MTC { Msg = verde + "PSE_FR_WHL detectado0", PLID = pit.PLID });

if ((pit.Work & PitWorkFlags.PSE_LE_FR_DAM) == PitWorkFlags.PSE_LE_FR_DAM)
insim.Send(new IS_MTC { Msg = verde + "PSE_LE_FR_DAM detectado0", PLID = pit.PLID });
if ((pit.Work & PitWorkFlags.PSE_LE_FR_WHL) == PitWorkFlags.PSE_LE_FR_WHL)
insim.Send(new IS_MTC { Msg = verde + "PSE_LE_FR_WHL detectado0", PLID = pit.PLID });
if ((pit.Work & PitWorkFlags.PSE_RI_FR_DAM) == PitWorkFlags.PSE_RI_FR_DAM)
insim.Send(new IS_MTC { Msg = verde + "PSE_RI_FR_DAM detectado0", PLID = pit.PLID });
if ((pit.Work & PitWorkFlags.PSE_RI_FR_WHL) == PitWorkFlags.PSE_RI_FR_WHL)
insim.Send(new IS_MTC { Msg = verde + "PSE_RI_FR_WHL detectado0", PLID = pit.PLID });

if ((pit.Work & PitWorkFlags.PSE_LE_RE_DAM) == PitWorkFlags.PSE_LE_RE_DAM)
insim.Send(new IS_MTC { Msg = verde + "PSE_LE_RE_DAM detectado0", PLID = pit.PLID });
if ((pit.Work & PitWorkFlags.PSE_LE_RE_WHL) == PitWorkFlags.PSE_LE_RE_WHL)
insim.Send(new IS_MTC { Msg = verde + "PSE_LE_RE_WHL detectado0", PLID = pit.PLID });
if ((pit.Work & PitWorkFlags.PSE_RI_RE_DAM) == PitWorkFlags.PSE_RI_RE_DAM)
insim.Send(new IS_MTC { Msg = verde + "PSE_RI_RE_DAM detectado0", PLID = pit.PLID });
if ((pit.Work & PitWorkFlags.PSE_RI_RE_WHL) == PitWorkFlags.PSE_RI_RE_WHL)
insim.Send(new IS_MTC { Msg = verde + "PSE_RI_RE_WHL detectado0", PLID = pit.PLID });


if ((pit.Work & PitWorkFlags.PSE_SETUP) == PitWorkFlags.PSE_SETUP)
insim.Send(new IS_MTC { Msg = verde + "PSE_SETUP detectado0", PLID = pit.PLID });
if ((pit.Work & PitWorkFlags.PSE_REFUEL) == PitWorkFlags.PSE_REFUEL)
insim.Send(new IS_MTC { Msg = verde + "PSE_REFUEL detectado0", PLID = pit.PLID });

But it doesnt work. Looking for a solution, i found this class helper http://hugoware.net/blog/enums-flags-and-csharp

Very easy and pretty, but didnt worked neither..


if(pit.Work.Has(PitWorkFlags.PSE_NOTHING))
insim.Send(new IS_MTC { Msg = verde + "PSE_NOTHING", PLID = pit.PLID });
if(pit.Work.Has(PitWorkFlags.PSE_STOP))
insim.Send(new IS_MTC { Msg = verde + "PSE_STOP", PLID = pit.PLID });
if (pit.Work.Has(PitWorkFlags.PSE_FR_DAM))
insim.Send(new IS_MTC { Msg = verde + "PSE_FR_DAM", PLID = pit.PLID });
if (pit.Work.Has(PitWorkFlags.PSE_FR_WHL))
insim.Send(new IS_MTC { Msg = verde + "PSE_FR_WHL", PLID = pit.PLID });
if (pit.Work.Has(PitWorkFlags.PSE_RI_FR_DAM))
insim.Send(new IS_MTC { Msg = verde + "PSE_RI_FR_DAM", PLID = pit.PLID });
if (pit.Work.Has(PitWorkFlags.PSE_RE_DAM))
insim.Send(new IS_MTC { Msg = verde + "PSE_RE_DAM", PLID = pit.PLID });
if (pit.Work.Has(PitWorkFlags.PSE_RE_WHL))
insim.Send(new IS_MTC { Msg = verde + "PSE_RE_WHL", PLID = pit.PLID });
if (pit.Work.Has(PitWorkFlags.PSE_RE_WHL))
insim.Send(new IS_MTC { Msg = verde + "PSE_RE_WHL", PLID = pit.PLID });
if (pit.Work.Has(PitWorkFlags.PSE_LE_RE_DAM))
insim.Send(new IS_MTC { Msg = verde + "PSE_LE_RE_DAM", PLID = pit.PLID });
if (pit.Work.Has(PitWorkFlags.PSE_LE_RE_WHL))
insim.Send(new IS_MTC { Msg = verde + "PSE_LE_RE_WHL", PLID = pit.PLID });
if (pit.Work.Has(PitWorkFlags.PSE_RI_RE_DAM))
insim.Send(new IS_MTC { Msg = verde + "PSE_RI_RE_DAM", PLID = pit.PLID });
if (pit.Work.Has(PitWorkFlags.PSE_RI_RE_WHL))
insim.Send(new IS_MTC { Msg = verde + "PSE_RI_RE_WHL", PLID = pit.PLID });
if (pit.Work.Has(PitWorkFlags.PSE_BODY_MINOR))
insim.Send(new IS_MTC { Msg = verde + "PSE_BODY_MINOR", PLID = pit.PLID });
if (pit.Work.Has(PitWorkFlags.PSE_BODY_MAJOR))
insim.Send(new IS_MTC { Msg = verde + "PSE_BODY_MAJOR", PLID = pit.PLID });
if (pit.Work.Has(PitWorkFlags.PSE_SETUP))
insim.Send(new IS_MTC { Msg = verde + "PSE_SETUP", PLID = pit.PLID });
if (pit.Work.Has(PitWorkFlags.PSE_REFUEL))
insim.Send(new IS_MTC { Msg = verde + "PSE_REFUEL", PLID = pit.PLID });

So at this point, I just tought InSim Lib outdated, I were using 2.0.12, updated to 2.0.14b and still with problem..

So I decided to look into the InSimDotNet´s source code, as Im with Visual Studio 2010, I couldnt open 2.0.14b source, I got the .13

I changed InSimDotNet.Packets.PitWorkFlags adding their values, like next:


/// <summary>
/// No work done.
/// </summary>
PSE_NOTHING = 1,

/// <summary>
/// Stopped at pit-box.
/// </summary>
PSE_STOP = 2,

/// <summary>
/// Front damage.
/// </summary>
PSE_FR_DAM = 4,

/// <summary>
/// Front wheels changed.
/// </summary>
PSE_FR_WHL = 8,

/// <summary>
/// Left-front damage.
/// </summary>
PSE_LE_FR_DAM = 16,

/// <summary>
/// Left-front wheels changed.
/// </summary>
PSE_LE_FR_WHL = 32,

/// <summary>
/// Right-front damaged.
/// </summary>
PSE_RI_FR_DAM = 64,

/// <summary>
/// Right-front wheel changed.
/// </summary>
PSE_RI_FR_WHL = 128,

/// <summary>
/// Rear damage.
/// </summary>
PSE_RE_DAM = 256,

/// <summary>
/// Rear wheels changed.
/// </summary>
PSE_RE_WHL = 512,

/// <summary>
/// Left-rear damage.
/// </summary>
PSE_LE_RE_DAM = 1024,

/// <summary>
/// Left-rear wheel changed.
/// </summary>
PSE_LE_RE_WHL = 2048,

/// <summary>
/// Right-rear damage.
/// </summary>
PSE_RI_RE_DAM = 4096,

/// <summary>
/// Right-rear wheel changed.
/// </summary>
PSE_RI_RE_WHL = 8192,

/// <summary>
/// Minor body damage.
/// </summary>
PSE_BODY_MINOR = 16384,

/// <summary>
/// Major body damage.
/// </summary>
PSE_BODY_MAJOR = 32768,

/// <summary>
/// Setup changed.
/// </summary>
PSE_SETUP = 65536,

/// <summary>
/// Refuelled.
/// </summary>
PSE_REFUEL = 131072,

I tryied again, and first code I posted worked fine, but as It was so verbose, I tryied the second one.. But that one didnt worked..

So, I want to know, Im doing it wrong since first code, its a bug of InSimDotNet?? And, Its there a way I can use the second way to check every flag?

Thanks in advance

PS. Sorry for that long code posting, but I want to help C&P for if someone want to try easy..
NeOn_sp
S3 licensed
Hi..

Im using SMALL packet to know when race is restarted. First, I tried this:

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

But didnt work, then I used Sniffer to know the param of UVal on restart and modified the code to

if (small.SubT == SmallType.SMALL_VTA && small.UVal == long.Parse("2"))
{
...
}

Working fine..

Whats wrong with the first way?
NeOn_sp
S3 licensed
The only time I request NPL packet is in :

static void InSimMulti(InSim insim, IS_ISM ism)
{
_log.Info("ENTRANDO A: InSimMulti");
...
insim.Send(new IS_TINY { ReqI = 1, SubT = TinyType.TINY_NPL });
...
_log.Info("SALIENDO DE:InSimMulti");
}

But, the program didnt join in that part of the code :S
NeOn_sp
S3 licensed
Maybe there is a problem with this lib. Im getting NewPlayer packet reported twice sometimes.. It happend rarely..

Here some of the log working fine:

[INFO] 2011-09-04 19:17:22,603 Program - ENTRANDO A: NewConnection ( Cajiao )
[INFO] 2011-09-04 19:17:22,603 Program - AÑADO A ESTE PILOTO ( Cajiao )
[INFO] 2011-09-04 19:17:22,603 Program - ENTRANDO A: ConnectToCesavStats
[INFO] 2011-09-04 19:17:22,775 Program - SALIENDO DE: ConnectToCesavStats
[INFO] 2011-09-04 19:17:22,775 Program - SALIENDO DE: NewConnection ( Cajiao )
[B][INFO] 2011-09-04 19:17:31,931 Program - ENTRANDO A: NewPlayer ( ^0-^1VR^0- ^7Borjita )[/B]
[INFO] 2011-09-04 19:17:31,931 Program - SUBLOG: NewPlayer ( Cajiao )
[INFO] 2011-09-04 19:17:31,931 Program - ENTRANDO A: ConnectToCesavStats
[INFO] 2011-09-04 19:17:32,321 Program - SALIENDO DE: ConnectToCesavStats
[INFO] 2011-09-04 19:17:32,321 Program - SALIENDO DE: numeroVueltas Valor=0
[INFO] 2011-09-04 19:17:32,321 Program - ENTRANDO A: creaVuelta
[INFO] 2011-09-04 19:17:32,321 Program - SALIENDO DE: creaVuelta
[INFO] 2011-09-04 19:17:32,321 Program - SALIENDO DE:NewPlayer

But check this other:

[INFO] 2011-09-04 21:02:03,900 Program - ENTRANDO A: NewConnection ( rariga2 )
[INFO] 2011-09-04 21:02:03,900 Program - AÑADO A ESTE PILOTO ( rariga2 )
[INFO] 2011-09-04 21:02:03,900 Program - ENTRANDO A: ConnectToCesavStats
[INFO] 2011-09-04 21:02:04,040 Program - SALIENDO DE: ConnectToCesavStats
[INFO] 2011-09-04 21:02:04,040 Program - SALIENDO DE: NewConnection ( rariga2 )
[B][INFO] 2011-09-04 21:02:10,712 Program - ENTRANDO A: NewPlayer ( ^0-^1VR^0- ^7Rafa )[/B]
[INFO] 2011-09-04 21:02:10,712 Program - SUBLOG: NewPlayer ( rariga2 )
[INFO] 2011-09-04 21:02:10,712 Program - ENTRANDO A: ConnectToCesavStats
[INFO] 2011-09-04 21:02:11,290 Program - SALIENDO DE: ConnectToCesavStats
[INFO] 2011-09-04 21:02:11,290 Program - SALIENDO DE: numeroVueltas Valor=0
[INFO] 2011-09-04 21:02:11,290 Program - ENTRANDO A: creaVuelta
[INFO] 2011-09-04 21:02:11,290 Program - SALIENDO DE: creaVuelta
[INFO] 2011-09-04 21:02:11,290 Program - SALIENDO DE:NewPlayer
[B][INFO] 2011-09-04 21:02:36,181 Program - ENTRANDO A: NewPlayer ( ^0-^1VR^0- ^7Rafa )[/B]
[INFO] 2011-09-04 21:02:36,181 Program - SUBLOG: NewPlayer ( rariga2 )
[INFO] 2011-09-04 21:02:36,181 Program - ENTRANDO A: ConnectToCesavStats
[INFO] 2011-09-04 21:02:36,321 Program - SALIENDO DE: ConnectToCesavStats
[INFO] 2011-09-04 21:02:36,321 Program - SALIENDO DE: numeroVueltas Valor=0
[INFO] 2011-09-04 21:02:36,321 Program - ENTRANDO A: creaVuelta
[INFO] 2011-09-04 21:02:36,321 Program - SALIENDO DE: creaVuelta
[INFO] 2011-09-04 21:02:36,321 Program - SALIENDO DE:NewPlayer

I attach the replay of this second log part..


I forgot to add the version Im using, 2.0.12.0 version.
Last edited by NeOn_sp, .
NeOn_sp
S3 licensed
I would like to ask something related about efficiency..

I have a comand like !top , which shows best laps and bla bla. The problem is that sometimes, when an user request that list, got disconected.

The way i´m sending those buttons are:

insim.Send(new IS_BTN { Text = blanco + "Pista: " + amarillo + strArray[1] + "(" + strArray[2] + ") ", BStyle = ButtonStyles.ISB_LEFT | ButtonStyles.ISB_DARK, UCID = mso.UCID, H = 6, W = 70, T = 30, L = 15, ClickID = 8, ReqI = 8 });
insim.Send(new IS_BTN { Text = blanco + "Coches: " + amarillo + strArray[4], BStyle = ButtonStyles.ISB_LEFT | ButtonStyles.ISB_DARK, UCID = mso.UCID, H = 6, W = 70, T = 36, L = 15, ClickID = 9, ReqI = 9 });
and more BTNs, up to 30...

The question is, is this the correct way of doing this? Or there are better ways?
NeOn_sp
S3 licensed
Thanks Scawen for extend the qual time up to 240minutes. I want to add something about this, doing the same with mustpit comand.

We could force by lfs to stop X times instead of just mustpit on/off. Actually, in leagues, if some user forget to do the second stop, he wins race, causing LFS Stats with incorrect data, and more fails derivated from this.

To keep more compatibility with actual host setus, could work in this way:

/mustpit=
yes-> 1 stop
no-> 0 stop
And now add numerical options..
0-> 0 stops
2-> 2 stops
...

I hope to be possible and easy to implement.

Thanks in advance.
NeOn_sp
S3 licensed
Quote from Scawen :I can't reproduce this. I've been trying at BL1 and BL1X, both with checkpoints and without checkpoints, single player and multiplayer.

If I create a checkpoint and restart I'll be at the checkpoint, if I delete the checkpoint then restart I'll be on the grid.

Does anyone know how to create the conditions for this bug to appear?

I can confirm that this bug exists, but I didn´t report it since I thought It already exists in Z28, but well, I haven´t use layouts so much in that versions..

How I get this, I loadead a layout, I make some changes on it, barriers etc.. Then I set a start point just to test a part of the layout, without need to drive the entire track.

I moved that start place some time, restarted race several times, etc, and then, I deleted start point.

Shift + P and participate and I was in the start point..

I hope I could be useful to try to reproduce it.. I cant try myselft now..
NeOn_sp
S3 licensed
Quote from Victor :i've read this :P
I don't have much time until the end of the week though. But I'll have a look then.

Victor, Did you look that?
NeOn_sp
S3 licensed
Quote from Scawen :OK, I see why this happens. If it's the first lap in practice or qualifying mode LFS just makes sure that split (or lap) times are one hour or more when it sends the packet. This indicates to the packet receive function not to display split times, lap time, or record a qualifying lap in this case, where the time is really invalid. It does allow the split or lap to be greater than one hour - I think the idea is so that it only makes the split or lap time longer than it really is, and never shorter.

The problem is that I though that I should be always 1 hour, exactly 1 hour.

So, in my League Qual InSim, I was comparing SPX with 1 hour to know if it´s in warm up lap, and don´t store splits then.

But no problem then, I have changed the comparation to >= 1 hour and ended.

Thanks for reply.
NeOn_sp
S3 licensed
Quote from Scawen :Heh, this is like talking to my 5 year old son, who asks so many questions!

That´s easy.. Just don´t answer questions, as you did with mine.. ( wind direction and no repair )
NeOn_sp
S3 licensed
Yes, the reason why I´m suggesting about this, it´s for league use. I would like to have the same weather conditions in our 4 servers. At the moment, as LFS don´t allow us to have same wind conditions, so we have all our races without wind.

Quote from boothy :So once F1 does Friday practice at a track, the wind doesn't change at all from that point through the weekend?.

You can´t compare that. In lfs, you start a race, and it gives 5km/h and 80º direction. Ok.

If you restart again 10 second after that, and it gives totally different wind parameters..

Quote from Dygear :Although the first thing I would do after this was released is make a mod to ensure that the wind is at my back when I'm using the accelerator, and to over my front when I'm breaking.

That command just would work for next race. Or in entry screen, just like weather command do. That would solve the possible hack without any kind of problem.
Last edited by NeOn_sp, .
NeOn_sp
S3 licensed
Now we are talking about this, I would like to suggest one very very easy thing..

We have an option to set wind, intensity. But the direction is totally random.

As League Admin, we can´t create races with wind active, because everytime the race starts again, the direction changes.. And all your training and car set up go to trash..

So I think It would be very useful and easy to implement a comand like:

/w_direction [0-360º]

If /w_direction isn´t set up, w_direction would be random as it was until now.

I hope to get a answer from Scawen to this since I think that is very useful and easy to implement.

Thanks in advance.


PS. In topic, I don´t see what´s the problem about using the actual /weather comand.. Just, save reloading the track twice.. But no more..

Edit: I forgot, /w_force would be useful too, but no so necesary as /w_direction
Last edited by NeOn_sp, .
NeOn_sp
S3 licensed
Scawen, anything about what I posted on #112?
NeOn_sp
S3 licensed
I think I have found a bug in SPX.

By definition, on Lap 1 in practise mode, STime and ETime must have 3600000 (1 hour) value.

When you play in a server for more than an hour ( or the game in that server started 1 hour ago), SPX sends instead of that 3600000, the time of the game started.

Replay #2: http://www.mediafire.com/file/cppk3iauf2zay0z/replay2.mpr
Replay #1: http://www.mediafire.com/file/dndo091rk5at7ni/BugInsim.mpr


I don´t know if I´m explaining myself correctly, that´s the replay, and is very easy to reproduce.

Edit: Add replay 2.. Cleaner than first..
Last edited by NeOn_sp, .
NeOn_sp
S3 licensed
Quote from DarkTimes :The MSO packet works correctly, you need to use the TextStart property to get where the text starts. This is not InSim.NET, this is how the packet is sent by LFS.

var cmd = mso.Msg.SubString(mso.TextStart);


So "nickname : " is part of the msg.. Okok

Sorry for the error. I thought that mso.Msg was supposed to be just the msg without nick and : separator..
NeOn_sp
S3 licensed
Quote from PoVo :The problem is your code.

I use the latest version from CodePlex on my cruise server 24/7 and everything works fine.

Lastest oficial version or last uploaded to source code? Anyway, I'll recheck later

Edit:

With this code:

static void MessageOut(InSim insim, IS_MSO mso)
{
try
{
if (mso.UCID != 0)
{
var npl = players[mso.PLID];
var nco = players_info[mso.UCID];

if (mso.UserType == UserType.MSO_PREFIX)
{

insim.Send("/msg MSG=" + mso.Msg);

I write: "!info " and I get: MSG=NeoN Xspa™ : !info

Edit2: Downloaded new revision 801736de8371, MTC working fine now, thanks Waiting for MSO thing..
Last edited by NeOn_sp, .
NeOn_sp
S3 licensed
The problem is that mso.Msg should contain just my msg "!top" instead of "nickname : !top"
NeOn_sp
S3 licensed
I have started to port my InSim app from LFSExternal, to this.

Great lib,

I have a trouble, and I don´t know why.

Reading MSO packets, if I write in server "!top" ( without slashes )

mso.Msg contains: "Player_Name ( without colours ) : !top" ( without slashes )..

I´m using 7d364ad0ddce with Z30 host.

And another question, If I want to send a MTC, it fails if lenght(msg)%4==0, and to solve this I have to add \0 at msg end. Wouldn´t be easier checking this internally, and add if necessary \0 in the own lib?
NeOn_sp
S3 licensed
That´s the point, if you change your tyres, from R1 to R1, LFS allows you to repair or not.

But if you want to change from R1 to R2, LFS forces you to repair, and that doesn´t make sense..
NeOn_sp
S3 licensed
Quote from TRM.13 :Already answered many times, you can't change the tyres if you don't fix the car/suspension first due of the problems you will deal with

Let me dealing with that problems. Lot of times, there just very little damage in suspension, and reparing take several seconds, and It doesn´t affect driving.

What I´m asking is know from Scawen if it´s possible to let us decide if we want our car repaired or not, just like in a normal pit stop.
NeOn_sp
S3 licensed
2 things I would like to coment..

First, related to Change Tyres changes.

Actually if you are driving R1, and decide to use R2, repair option is turned On without possibility of set it Off. Is possible of allow turn off easy?.

And second thing, related to language.

In Shift + U, there are lot of strings that appear in English, instead my selected language ( spanish )..
NeOn_sp
S3 licensed
+1 here..

Would be very useful.

Less uploading time ( zip compresed file, so less MB´s to upload ), have not to select file one by one..

I hope Victor watch at this and his aprov..
NeOn_sp
S3 licensed
Thanks for this patch..

Just a little suggestion, I think very very easy to implement.

Actually, if you are driving FOX with R2 Tyres, if you want to change to R3, the repair option turn automatly to yes.

That´s not good.. I just want my car with R3, no repair needed, so, why force to repair?

Thanks in advance.
NeOn_sp
S3 licensed
As far as I drive with mouse, I use keyboard for Acceleration ( U key ) /Braking ( J key ) and Gear down (Y key).

And Mouse for Steering, gear up ( left btn), horn ( center ), lights and TeamSpeak Control (right btn).

I think, that´s the best combination possible, gives you stability while braking and gearing down.
FGED GREDG RDFGDR GSFDG