The online racing simulator
Searching in All forums
(921 results)
broken
S3 licensed
Quote from DarkTimes :Although Scawen has fixed this bug in the latest LFS patch, I'm not going to change it in InSim.NET for the moment, as that would break backwards compatibly with old LFS versions (which still have the bug). For the time being the maximum length of the BTN text field will remain 239 bytes.

Just a Q: When an official/stable version of LFS arrives, what do you plan on doing? I think it would be better to keep it compatible only as far as stable versions are concerned. But, anyway, we have the source, so we can tweak-a-la-freak as much as we want. Which means, that in the end, it doesn't really matter.

@Nasty! : I think you would need to provide the exact string of the problematic nickname, or maybe a replay would work too. Though, I think, the string is preferred.
Last edited by broken, .
broken
S3 licensed
Ah, don't worry, I'm just dumb. Yeah, who knew you had skype, and were on my friends list! Not me...
broken
S3 licensed
ZanZi, "неможе" не са ли 2 думи? До колкото знам е така, но не искам да променям превода преди да потвъриш. Така де, проверих и в google translate, дали ще ми предложи "не може" като напиша "неможе" и така и стана!

Понеже го има на много места, за сега няма да пипам.


And since this is not a Bulgarian forum, let me translate what I just said:
Zanzi, isn't "cant" actually 2 words? As far as I am aware it is, but I don't want to change the translation before your confirmation. I mean, I checked google translate too, if it would suggest "can not" to me if I write "cant", and it did!

Since the word is on many places, I'm not going to touch the translation for now.
broken
S3 licensed
Quote from speedboy86 :I tried to put spec when wrong way pits but it dont works i tried MSO and also C.playername but till wont work. Can any one help me with this.

Please, when you paste code on the forums, indent it appropriately, to a level that is sufficient enough to scan through it well.

Second, please put the code in [CODE] tags, or even better - [PHP] ones, if the language is compatible enough, which, imo, C# is.

Third - Please try to resolve the issue yourself first. Look at the code around, especially when it's that much. Look for similarities between your and the other code. Then, when such found, look for differences in the problematic place. This one, is very obvious. But I'm not going to fix it for you just like that. Put some effort in it! You'll find more details in the code and after it.

[PHP]// Pit EXIT
if (((MCI.Info[i].X / 196608) <= -203) && ((MCI.Info[i].Y / 196608) >= -65) && ((MCI.Info[i].Y / 196608) <= -45) && (Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsInPitZone == 0))
{
if (((MCI.Info[i].Direction / 180) < 80) || ((MCI.Info[i].Direction / 180) > 280))
{
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsInPitZone = 1;
InSim.Send_MST_Message("/msg ^6>^7 " + Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].PlayerName + " ^1was fined £200 for wrong way out of pits");
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].Cash -= 200;
// Situation 1
InSim.Send_MST_Message("/spec " + Connections[GetConnIdx(NPL.UCID)].Username);
InSim.Send_MST_Message("/msg ^6>^7 " + Connections[GetConnIdx(NPL.UCID)].PlayerName + "^7spectated wrong way pits " + NPL.CName);
// END of Situation 1
}
}
if (((MCI.Info[i].Y / 196608) < -65) || ((MCI.Info[i].Y / 196608) > -45))
{
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsInPitZone = 0;
}

// Pit ENTRY
if (((MCI.Info[i].X / 196608) <= -203) && ((MCI.Info[i].Y / 196608) >= -158) && ((MCI.Info[i].Y / 196608) <= -145) && (Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsInPitZone2 == 0))
{
if (((MCI.Info[i].Direction / 180) < 80) || ((MCI.Info[i].Direction / 180) > 280))
{
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsInPitZone2 = 1;
InSim.Send_MST_Message("/msg ^6>^7 " + Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].PlayerName + " ^1was fined £200 for wrong way in pits");
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].Cash -= 200;
// Situation 2
InSim.Send_MST_Message("/spec " + Connections[GetConnIdx(NPL.UCID)].Username);
InSim.Send_MST_Message("/msg ^6>^7 " + Connections[GetConnIdx(NPL.UCID)].PlayerName + "^7spectated wrong way pits " + NPL.CName);
// END of Situation 2
}
}
if (((MCI.Info[i].Y / 196608) < -158) || ((MCI.Info[i].Y / 196608) > -145))
{
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].IsInPitZone2 = 0;
}[/PHP]

Situation 1: Ok, where do you see a variable named NPL being used in the MCI handler? NPL is usually the name of the packet you receive when a player joins the race. You've changed only the text part, expecting the code to be universal. Well, sorry, but it's not. I want you to resolve this yourself, because around 2 or 3 lines above, a message already is being sent, and let me bet - it sends it successfully.

Situation 2: Absolutely the same thing. Right 2 lines above, I see a message, that will be sent successfully.

So, here's the deal. You fix those, and come back showing me how you've done it. If it's correct, I'll help you make your code in that part a lot more readable, and I'll explain what steps I've taken and why.
broken
S3 licensed
I think that fixed it. Will reply if things get odd again.
broken
S3 licensed
Quote from DarkTimes :The timer gets disposed when the timer object is removed from scope, just like all .NET objects (more or less). The only thing you need to watch out for is that there are no stray event-handlers or references lurking in the background. These can cause memory leaks and other issues, but this is the same for all .NET objects, not just timers.

There are at least five different timers in .NET (from the top of my head) and each one works slightly differently. The only way to know how to use each one is to read the documentation (select the object and press F1 in VS2010).

Thanks for the clarification. I just decided to go back on that timer, because it's all working perfectly now, but indeed, I am thinking that it's leaking memory.. Well, not exactly memory, but whole event-handling references (if that's what they are) lol! I mean, nothing is suggesting that, because after all, it doesn't really have time to build that much loops, but with those new things I know (exciting, I am starting to feel like I'm finally about to stop drowning, and have a chance to swim on top of multithreading) I am definitely going to check and optimize it if needed. It was like the opening of Pandora's box whenever I took a step into multithreading till now. And I was mindeffed yesterday, because I dug a bit into it, and yeah... My head failed in multitasking, as I was failing to understand multithreading, if you allow me to put it that way. But now the basic concept makes perfect sense in my mind, yay!

Quote from DarkTimes :Really the only important thing you need to know is that if there is a possibility that two threads may try to access a resource at the same time, then you will need to synchronise the access with locks. If you don't your app will work 99.9% of the time, but that last 0.1% will make you go insane.

And I just had the perfect idea what to do. I will be building a string, as long as the timer is running. Before I lock the whole thing, I will add "Attempt to access resource (", and if the lock is entered - I will simply add "success". After the lock, simply another ")" and a new line added. That would make a perfect report. Ha! Thanks!


But first, I'm now going to press that F1 key on the timer object.
broken
S3 licensed
"GaZ" (quotes included in nickname). I said that in a previous reply, as I was reporting this tho, but nevermind.
broken
S3 licensed
Ah, could be my nickname too, yes.. Didn't think about that.
My nickname is this: ¡¸THC¡áBroken¡¸, OR

I even made a quick log to give me the nickname and the base64 value of it. There it is, all from the app, originally:
^7☆THC﹥^3Broken^7☆

Base64 encoded: XjfimIZUSEPvuaVeM0Jyb2tlbl434piG

Edit: If I need to hook up an event to InSim.InSimError, wouldn't that mean going into multithreading? I'll try... But after I get some sleep, because it's totally not my day today!
Last edited by broken, .
broken
S3 licensed
Awhh! Sorry, forgot to save the replay.. :doh:
I've been distracted the whole day today, couldn't do a thing normally..

Globals.MS is simply the server message start character, to make the messages from the InSim app differ from normal text..:

<?php 
public static readonly string MS "^3» ";
?>

But IS_CON fails rarely. Also, it used to disconnect from the host, before I decided to catch the exceptions thrown from it. And just that - it disconnected, without crashing my app.

Sorry for being zero help, really, I don't know how I forgot to do that! Just.. stupid.. ;d
Anyway, I'll make sure to get a replay if/when it happens again.
broken
S3 licensed
I am just having my insim running on my client, on a server that's not mine. And when I crashed into the person with the following nickname: "GaZ" (quotes included in nickname) , I get the following error:

Message: Index was outside the bounds of the array.

StackTrace: at InSimDotNet.EncodingHelper.GetBytes(String value, Byte[] buffer, Int32 index, Int32 length) in C:\Users\Loran\Desktop\Random\InSimDotNet\insimdotnet_6b678d6ab605\InSimDotNet\EncodingHelper.cs:line 92
at InSimDotNet.PacketWriter.Write(String value, Int32 length) in C:\Users\Loran\Desktop\Random\InSimDotNet\insimdotnet_6b678d6ab605\InSimDotNet\PacketWriter.cs:line 121
at InSimDotNet.Packets.IS_MST.GetBuffer() in C:\Users\Loran\Desktop\Random\InSimDotNet\insimdotnet_6b678d6ab605\InSimDotNet\Packets\IS_MST.cs:line 50
at InSimDotNet.InSim.Send(ISendable packet) in C:\Users\Loran\Desktop\Random\InSimDotNet\insimdotnet_6b678d6ab605\InSimDotNet\InSim.cs:line 231
at InSimDotNet.InSim.Send(String message, Object[] args) in C:\Users\Loran\Desktop\Random\InSimDotNet\insimdotnet_6b678d6ab605\InSimDotNet\InSim.cs:line 265
at Dizplay_Cruise.Dizplay.iSendMsg(String Message) in D:\Loran\Programming\C#\Live for Speed\Dizplay\Cruise A.0.1\Dizplay Cruise\Dizplay Cruise\Dizplay.cs:line 240
at Dizplay_Cruise.Dizplay.Received_CON(InSim InSim, IS_CON CON) in D:\Loran\Programming\C#\Live for Speed\Dizplay\Cruise A.0.1\Dizplay Cruise\Dizplay Cruise\Dizplay.cs:line 553

Target: Int32 GetBytes(System.String, Byte[], Int32, Int32)

Line 553 in Dizplay.cs:

<?php 
                iSendMsg
("^7Crash: " A.NCN.PName " ^7>< " B.NCN.PName " ^7(" Speed " km/h)");
?>

iSendMsg in Dizplay.cs:

<?php 
        
public static void iSendMsg(string Message)
        {
            
InSim.Send(Globals.MS Message); // This is line 240
        
}
?>

Is that you or me?

Edit: It happened before and after I updated to that last update in the repository. But I couldn't copy the error from the previous version. Also, if needed, I could save the replay and send it to you. In fact I will save it now, you say if you want me to upload it here.
broken
S3 licensed
If I ever visit Glasgow, I'll make sure to drop by with some beer, or whatever it is that you drink. I definitely learned a hell of a lot, in just a few minutes of reading this and the article you've sent me. And you can be sure that I'll be reading the rest of it, very soon.

Just to clarify one thing tho, because it's still very blurry in my head: When I create those threads, they stay running, right? Is the code in my last post going to kill the thread, or is it going to just keep on running? I mean... Even if 1 player is on the server, I would like to keep the thread running, but I could achieve that with a more global var. But when the server is empty, I have nobody to send buttons to - so why keep it? I'm getting a bit off the question here - I just wanted to ask - how to kill the timer's thread?
broken
S3 licensed
Wanted to bump (now I'm getting really annoying, haha).

So, how do I check if I have already created a thread, without having a global variable, which I set to true immediately after I start the first one? Or is that the most optimized way? Multithreading is just not my thing, yet(positivity FTW!).

Edit: God, I didn't even google it before asking the question. Will do now.

Edit2: Ok, is this efficient enough, and does it actually work as you would suggest I expect it to work?
At the bottom of the elapsed event (look snippet above if needed):

<?php 
                
if (QueueHolder.Count 1)
                {
                    
QueueProcessor.Stop();
                    
QueueProcessor.Enabled false;
                    ---> 
QueueProcessor.Elapsed -= new ElapsedEventHandler(Processor.QueueProcessor_Elapsed);
                }
?>

Last edited by broken, .
broken
S3 licensed
Oh man.. Multithreading - not my territory. I think that when I'm starting the timer, I'm actually creating another thread, and then when I'm stopping it I'm not clearing it? So, that would mean that when I create another thread and start the timer, it starts the other threads as well?

Just restarted my lappy, so I'll take 5mins and edit the post, to tell you if this is what's really happening (to run C#). If that's the case tho, I won't be able to reply very fast, because one of my palms will need to stay on my face for a while.

Edit: Oh god! -.-

<?php 
        
public static void Start()
        {
            if (
QueueProcessor.Enabled != true)
            {
                
QueueProcessor.Elapsed += new ElapsedEventHandler(Processor.QueueProcessor_Elapsed);
                
QueueProcessor.Interval 10;
                
QueueProcessor.Start();
                
QueueProcessor.Enabled true;
            }
        }
?>

And I'm calling that each time a button is added to the queue.
broken
S3 licensed
Quote from DarkTimes :1. What is the data-structure for the U.Buttons collection? It is array, list, dictionary, hashset etc..?

2. The error is that you are calling into a collection for a index/key that does't exist. Either the U.Buttons collection does not contain an index/key for ClickID, or the QueueHolder does not contain an index/key for 0. As you are already checking that QueueHolder.Count > 0 that would suggest that the ClickID does not exist in U.Buttons. I think that the error lies in where you are adding items to U.Buttons and that this exception is just a side-effect. Of course it's impossible to really know without seeing the code in context.

3. Also -1 for spelling display with a z.

4. Edit: note as well that the exception popout in VS covers part of line where the error occurs, so I can't see what's on the right-hand side of the assignment. The popout is the like the least important thing in that screenshot.

1. IS_BTN Array.

2. CopyButton needed? :

<?php 
        
public static IS_BTN CopyButton(IS_BTN BGlobals.xAlign xAlign Globals.xAlign.leftGlobals.yAlign yAlign Globals.yAlign.top)
        {
            
byte T B.T;
            
byte L B.L;

            switch (
xAlign)
            {
                case 
Globals.xAlign.center:
                    
= (byte)((100 B.2) + B.L);
                    break;

                case 
Globals.xAlign.right:
                    
= (byte)((200 B.W) - B.L);
                    break;

            }

            switch (
yAlign)
            {
                case 
Globals.yAlign.middle:
                    
= (byte)((100 B.2) + B.T);
                    break;

                case 
Globals.yAlign.bottom:
                    
= (byte)((200 B.H) - B.T);
                    break;
            }

            return new 
IS_BTN BStyle B.BStyleClickID B.ClickIDB.HB.WLTReqI B.ReqIText B.TextTypeIn B.TypeInCaption B.CaptionInst B.InstUCID B.UCID };
        }
?>

3. That's intentional.

4. The code:

<?php 
        
public static void QueueProcessor_Elapsed(object sourceElapsedEventArgs e)
        {
#if !DEBUG
            
try
            {
#endif
                
int[] UCIDTimes = new int[256];
                
int Count QueueHolder.Count;

                for (
int i 0Counti++)
                {
                    if (
QueueHolder.Count && QueueHolder[0] != null && QueueHolder[0].Button != null)
                    {
                        
int UCID QueueHolder[0].Button.UCID;
                        
int idx Dizplay.getUserIdxByUCID(UCID);

                        if (
UCIDTimes[UCID] < maxPerUCID)
                        {
                            
clsUser U Dizplay.Users[idx];

                            
Dizplay.InSim.Send(QueueHolder[0].Button);
                            
U.Buttons[QueueHolder[0].Button.ClickID] = CopyButton(QueueHolder[0].Button);
                            
UCIDTimes[UCID] += 1;

                            
QueueHolder.RemoveAt(0);
                        }
                    }
                }
                if (
QueueHolder.Count 1)
                {
                    
QueueProcessor.Stop();
                    
QueueProcessor.Enabled false;
                }
#if !DEBUG
            
}
            catch (
Exception E)
            {
                
Dizplay_Cruise.Processor.ErrorRecord(E);
            }
#endif
        
}
?>

If anything more is needed I will provide it. But I'm feeling as if I'm being annoying already.
if (Count > 0) does not work?! What?
broken
S3 licensed
I will attach a screenie, because that's the best way to explain what happens.

As you can see, I remove the item AFTER I get the info I need out of it.

Can someone confirm that this is impossible and I must thoroughly investigate if I'm not clearing something from the list somewhere else? Because, I have. But I will go into S&D mode if you tell me that's 100% the problem. I'll just turn the app upside-down, tare it apart if I must, till I find the little effer.

Seriously, it's been bugging me from like a week now, and I'm going :gnasher:
It happens in some cases, which really makes me think that I'm clearing a record somewhere else too. The problem is probably very small, and I'm just being very very lame..

So, sorry if this is a really lame question, I just haven't been able to get my thoughts around it from like a week.. if not two.
broken
S3 licensed
Quote from vistaman :Alright. I dont know if this was reported too. Could you close it there because its like hitting barriers where u flew with the old patch.

[IMG 1 /]
[IMG 1 /]

That's the best place in Fern Bay, don't close it!

*hint* Maybe in the future we could have those metal fences as layout objects?
broken
S3 licensed
May I suggest something? Let's all who think that the devs should take the holidays off, say it. Because, after all - holidays are holidays, and most of the people don't work at that time. But being on your own can make you feel guilty about not working, or.. something. So, Scavier, in an all not-telling-you-what-to-do way, we won't die if this release is a little late. Scawen said 1-2 weeks, yes, but for those who don't know, 1-2 weeks, in the real business world, mean 1-2 weeks of work days. Which means that, technically the release won't be late anyway. And everyone deserves to have fun at the holidays. So, I'm totally +100 if you, devs, decide to take these 4 days off and have fun with family, friends, etc, because that's what really matters after all, isn't it?

And to all who think that they should work - shut up!

But seriously - if anyone complains, because they haven't been able to have fun during the holidays, due to the patch not being released yet - check yourself again, because holidays aren't made for gaming.
broken
S3 licensed
I think that those 2 simple facts
1. InSim.NET is actively being developed, while LFS_External is currently on hold;
2. InSim.NET is open-source, while LFS_External, is not /which means that even if development stops on it*, you can still update it yourself, if you want to/.

show why InSim.NET, currently, is the way to go.

And so, now you've got 3:0 for InSim.NET. Guess it can't get more obvious than this.

At least that's what I think. If you can prove me wrong, do it.

*it = InSim.NET
Last edited by broken, . Reason : it = InSim.NET
broken
S3 licensed
Hahaha..

Though, you would do the same, Dygear, wouldn't you?
broken
S3 licensed
From what I know/remember, features as choosing width, length, etc of objects will be available in some of the patches in the future? So, I guess the wider ramp is like a temporary solution. And so will be the longer barrier.
broken
S3 licensed
Quote from T3charmy :Broken with Scawen making the ramps in to concrete, do you still have that BL3 sky bridge layout?

Looking forward to this patch, open configs, will be great for cruise servers

Yup. (It's not "mine" tho. Me and Ales built it.)
And with concrete barriers(which you won't really need on the bridge layout), you can be 100% sure that you just won't fall out.

Also, since I replied anyway, I would like to raise the Barrier2 (= 20m long Barrier) question again. Would that be easy to make? And do you guys think it would be useful /- I meant that as a question to everyone/?
broken
S3 licensed
Sorry if anyone suggested this already, but since ramps can get bigger, can barriers become longer too? Like, have 20m long barriers, instead of the standard(7m?) ones. This would be really helpful, especially when making new combos.

..If it's a quick change of course.

[Correction] Can we have Barrier2, which will be longer - not making current barriers longer. But, I hope that was pretty much obvious.
Last edited by broken, .
broken
S3 licensed
I just want to give you a little hint: It's not "just a little thing". If you want to count wins/points/driven distance, and have those things saved offline(I mean, in a database), you need ... well ... a database. And to make it unique, I don't know how you can use Airio or Lapper to do it, but if you want it from scratch - well, it's not that small of a project.

When you say what it does, really, it sounds easy. But to make it work flawlessly, that's a whole other world.

No offence or anything, I just wanted to try and explain why it's not really the small project you think it is (which, you obviously are not a programmer, and are in no way obligated to know - it's understandable). But yet, maybe it's easy to accomplish with Airio or Lapper. Anyway, since I don't know about that, we will have to wait and see if someone familiar with those applications will say something on the question.
broken
S3 licensed
Why would the developers want to blow this out more, by giving us these videos? If some of them starts a thread about the videos, in the end, it's just going to turn into another "Progress Report December 2010" thread. Yes, I did mean this thread. It's ridiculous. I'm sure they know we want to know about these videos. I'm sure they want to show them to us really bad. But think a bit vice-versa here, you know perfectly well why they aren't doing it too. So, why do you find the need to bite? You know that Scawen is eventually going to be annoyed by the constant moaning in the videos thread, and he will reply again, which will bring a few good comments, till the moaners come and spam everyone out again. HE KNOWS THAT TOO. That's why, if I were him, I would do exactly the same thing.

What more do you not understand?

I haven't quoted anyone, so:
In case you haven't got it, this goes mainly to you - RasmusL.
As well as everyone who feels offended by reading it.
And maybe a bit to you two: Udris1992, Xenix74.
broken
S3 licensed
Well, that's actually inevitable, unless it is somebody you already know from a long time. And if that's the case - then, again, you don't need a CV. Handing over your source to someone you can't really trust, is, in itself, a pretty bad idea (unless you make them sign a contract or something, but now that, is not my territory any more).

But don't get me wrong, I am not telling you what to do here. I am just giving suggestions. After all, it's perfectly your choice.

In the end, I'll just tell you my final opinion: Just postpone the update(s), it's going to make your life easier.
FGED GREDG RDFGDR GSFDG