View Full Version : Need help, big problem with InSim
KuHS
4th September 2009, 12:17
Hello i'm using LFS External lib, and i have one really really big problem. Ok, then player connects it's everything ok, then is ~+9 players in the server then appears a lot of problems, no errors is giving, just, you drive atm XFG, you drive 1-2 metres and your cash and licence points is resetting to zero or just then you connected to it... Idk what's the problem the InSim gives no error, just problem with players, btw in my server there's a lot of stuff, like bank, shop, energy, maiby that? And i'm added CompCar to my code, i think it's the problem, but anyways, then in the server is 1-5 people everything is ok, nothing disappears. Anybody knows how to fix this problem?
Fire_optikz001
4th September 2009, 12:43
Hello i'm using LFS External lib, and i have one really really big problem. Ok, then player connects it's everything ok, then is ~+9 players in the server then appears a lot of problems, no errors is giving, just, you drive atm XFG, you drive 1-2 metres and your cash and licence points is resetting to zero or just then you connected to it... Idk what's the problem the InSim gives no error, just problem with players, btw in my server there's a lot of stuff, like bank, shop, energy, maiby that? And i'm added CompCar to my code, i think it's the problem, but anyways, then in the server is 1-5 people everything is ok, nothing disappears. Anybody knows how to fix this problem?
looks like the compcar might have an error
amp88
4th September 2009, 15:07
Each MCI packet can contain information for a maximum of 8 players. If you have 9 players it takes two MCI packets to give you all of their information. If you've got something in your code which needs every player in the server to appear in every MCI packet then this will be what's causing your problem.
struct IS_MCI // Multi Car Info - if more than 8 in race then more than one of these is sent
{
byte Size; // 4 + NumC * 28
byte Type; // ISP_MCI
byte ReqI; // 0 unless this is a reply to an TINY_MCI request
byte NumC; // number of valid CompCar structs in this packet
CompCar Info[8]; // car info for each player, 1 to 8 of these (NumC)
};
KuHS
4th September 2009, 16:16
How InSim would send 2 or more MCI packets? Thanks for explaining.
the_angry_angel
4th September 2009, 16:29
How InSim would send 2 or more MCI packets? Thanks for explaining.It would send 1 MCI packet containing a compcar with the first 8 players, and then a second MCI packet with a compcar containing 1 player. You use "NumC" to determine how many are in each.
Or have I misunderstood your question?
KuHS
4th September 2009, 16:37
It would send 1 MCI packet containing a compcar with the first 8 players, and then a second MCI packet with a compcar containing 1 player. You use "NumC" to determine how many are in each.
Or have I misunderstood your question?
Ok but then i get players num, how i can send them more packets? And how much packets will need for 14 players? 5, if players num +8 and for others 1 players will send 1 packet?
DarkTimes
4th September 2009, 17:17
With 14 players it would send one MCI with the first 8 players, then a second MCI with the next 6. For 21 players it would send one MCI with the first 8, a second with the next 8, and then a final one with the last 5.
You can get a better idea for how it works by using InSimSniffer (see sig). Connect to a host and then do Request > TINY_MCI.
KuHS
4th September 2009, 17:36
With 14 players it would send one MCI with the first 8 players, then a second MCI with the next 6. For 21 players it would send one MCI with the first 8, a second with the next 8, and then a final one with the last 5.
You can get a better idea for how it works by using InSimSniffer (see sig). Connect to a host and then do Request > TINY_MCI.
Ok thanks, but anyways, how i can request more packets? Sorry, but i don't know, i just need a line of code, like example, thanks for helping but at last i need to know how it would be in C# ://
the_angry_angel
4th September 2009, 20:11
Ok thanks, but anyways, how i can request more packets?You don't need to request more MCI packets, it will automatically send as many as needed. You just need to modify your MCI handling code, thats all :)
KuHS
5th September 2009, 06:33
You don't need to request more MCI packets, it will automatically send as many as needed. You just need to modify your MCI handling code, thats all :)
Ok, i've got it, but what i would modify? :shrug:
Silox
5th September 2009, 07:02
Ok, i've got it, but what i would modify? :shrug:
Your MCI handling code.
KuHS
5th September 2009, 07:47
// Detailed car information packet (max 8 per packet)
private void MCI_CarInformation(Packets.IS_MCI MCI)
{
int idx = 0;
for (int i = 0; i < Connections.Count; i++)
{
idx = GetConnIdx2(MCI.Info[i].PLID);
Connections[idx].CompCar.AngVel = MCI.Info[i].AngVel; //They aren't structures so you cant serialize!
Connections[idx].CompCar.Direction = MCI.Info[i].Direction;
Connections[idx].CompCar.Heading = MCI.Info[i].Heading;
Connections[idx].CompCar.Info = MCI.Info[i].Info;
Connections[idx].CompCar.Lap = MCI.Info[i].Lap;
Connections[idx].CompCar.Node = MCI.Info[i].Node;
Connections[idx].CompCar.PLID = MCI.Info[i].PLID;
Connections[idx].CompCar.Position = MCI.Info[i].Position;
Connections[idx].CompCar.Speed = MCI.Info[i].Speed;
Connections[idx].CompCar.X = MCI.Info[i].X;
Connections[idx].CompCar.Y = MCI.Info[i].Y;
Connections[idx].CompCar.Z = MCI.Info[i].Z;
MCI_Update(MCI.Info[i].PLID); //We want everyone to update before checking them.
}
}
This is my MCI packet code, any idea what's wrong and how to fix it?
morpha
5th September 2009, 07:52
// Detailed car information packet (max 8 per packet)
private void MCI_CarInformation(Packets.IS_MCI MCI)
{
int idx = 0;
for (int i = 0; i < Connections.Count; i++)
{
This is where it goes wrong, the MCI only holds up to 8 packets, but the loop runs up to the number of connections. Should be
for (int i = 0; i < MCI.NumC; i++)instead :thumb:
KIMA
27th September 2009, 17:13
Hi all I have such problemma an error.
Here is a picture
MCI Index nohoditsya outside the boarders of the array.
bunder9999
28th September 2009, 06:24
MCI Index ((???)) outside the bounds of the array.
that's a coding error. :shrug:
KIMA
28th September 2009, 15:11
that's a coding error. :shrug:
And as this problemma solve?
amp88
28th September 2009, 15:16
There are a MAXIMUM of 8 players in each MCI packet. If your code can only handle there being EXACTLY 8 players but the packet contains information for only 5 players then when your code looks for the 6th player it will not be able to find it (it will go off the end of the array) and cause an error. The solution is to look at the value for NumC in the MCI packet. NumC tells you how many players are in this packet (e.g. if NumC is 4 then you need to look for only 4 players in this packet, not 8).
Shadowww
28th September 2009, 15:16
To KIMA: Привет! Компилятор, который ты используешь, показывает строку, на которой находится эта ошибка?
KIMA
28th September 2009, 15:52
to kima: Привет! Компилятор, который ты используешь, показывает строку, на которой находится эта ошибка?
А если ты шариш может поможеш мне,а то уже кругом голова.
amp88
28th September 2009, 16:03
If the problem is to do with an invalid index of an array (e.g. trying to index the 4th location on an array of size 3) then it is a runtime exception, not an error in the syntax or semantics of the code which can be determined at compile time.
KIMA, please look here (http://www.lfsforum.net/showthread.php?p=1272689#post1272689).
Snake552023
28th September 2009, 16:32
to kima: Привет! Компилятор, который ты используешь, показывает строку, на которой находится эта ошибка?
Нет не показывает, оно выбивает окно когда на сервер заходит человек 12, можиш нам помочь???
KIMA
28th September 2009, 16:44
If the problem is to do with an invalid index of an array (e.g. trying to index the 4th location on an array of size 3) then it is a runtime exception, not an error in the syntax or semantics of the code which can be determined at compile time.
KIMA, please look here (http://www.lfsforum.net/showthread.php?p=1272689#post1272689).
No no-shows, it knocks out the window when the server comes to a man 12, mozhish You Help?
amp88
28th September 2009, 16:53
No no-shows, it knocks out the window when the server comes to a man 12, mozhish You Help?
Post your code.
Shadowww
28th September 2009, 17:10
No no-shows, it knocks out the window when the server comes to a man 12, mozhish You Help?Please, don't use Google Translate. I would suggest you PROMT instead.
KIMA
28th September 2009, 17:16
Please, don't use Google Translate. I would suggest you PROMT instead.
And if you Šariš can help me, but it is already around the head.
KIMA
28th September 2009, 18:31
All thanks to all, like everything is working, but now problemma work if there is anyone package from work.
Snake552023
10th October 2009, 14:07
that's a coding error. :shrug:
How to correct this error?
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.