The online racing simulator
Searching in All forums
(314 results)
DarkKostas
S3 licensed
The video forgot about the variety of the cars that cops use. Oh wait they only use FXR.
DarkKostas
S3 licensed
Quote from MadCatX :V 1.02 is out. Hopefully it will not need to be updated to maintain compatibility with possible further versions of LFS.

Works fine. I just replaced the .dll because i dont use OutGauge(the actual outgauge) so i didn't even copy the .exe and the .bat file. (i want to have everything tidy haha)

Good work once again!
DarkKostas
S3 licensed
Quote from AnyBodyKilla :Been testing this out and haven't had any problems, Thanks a lot!

Also I found this via Google, not sure if they are perfect, probably needs some adjusting

http://www.lfsforum.net/showthread.php?p=1659917#post1659917
One page back, my last post. I hope you like them!


Quote from S3ANPukekoh3 :how do you make it go?

Read the readme file and also make sure you have OutGauge enabled(if you don't know how to enable it search a bit on this topic and you will find it)
DarkKostas
S3 licensed
Quote from Nadeo4441 :He already commented on this, afaik. Something about logitech's bad drivers or something, I can't remember...

//found it

The thing is that THIS mod is not using Logitech API(at least that's what i noticed), so it can be made the same way this one is working and maybe without the need to send the RPM "request" to all devices(maybe getting the name of the device and if its equal to "Logitech G27"[its not exactly like that] then send it).

EDIT: The name of the device is "Logitech G27 Racing Wheel USB" in case you try to implement this improvement.
Last edited by DarkKostas, .
DarkKostas
S3 licensed
Quote from Mountaindewzilla :The engine was running. I was under the impression that the new version of MatCatX' program no longer used outgauge.

I tested a newly installed LFS, so the configuration hasn't been modified, other than enabling my wheel.

OutSim Mode 0
OutSim Delay 1
OutSim IP 127.0.0.1
OutSim Port 0
OutSim ID 0
OutGauge Mode 0
OutGauge Delay 1
OutGauge IP 127.0.0.1
OutGauge Port 0
OutGauge ID 0


It doesn't need it, but maybe when OutGauge Mode is 0(like it is now, it doesnt report the RPM to the memory. Can you please try Mode 2?(I just came up with this idea... Port doesn't matter just mode)

EDIT: I just sent this idea to a friend who had the same problem AND IT WORKED! So it seems that you need to have OutGauge enabled to send RPM values to RAM(Memory) so it will work.
Small warning, make sure the Port is not zero, because you will come up with an error.
Last edited by DarkKostas, .
DarkKostas
S3 licensed
Quote from Mountaindewzilla :I re-installed LFS, and ran the test app.

Windows x86 version: 6.1.1.0
LFS HWND: 001702D4
LFS PID: 3992 570
Trying full access mode.
RPM: 0
Car: XRT
Trying read only mode.
RPM: 0
Car: XRT
Press any key to continue . . .


Can you post your Outgauge settings at the .cfg file? I am just curious. Also was your engine running when you run the program?
DarkKostas
S3 licensed
Quote from Stefani24 :LFS supports pretty much any usb device that is registered by Windows...I think even my Guitar Hero instruments work.

They do, i even drifted with my GH Guitar!

Anything is getting connected with USB is supported. You just need to set the buttons/axis based on what you want.
DarkKostas
S3 licensed
I voted yes, but game needs some more "optimise features", like multicore support. I am sure most of the players have more than one core, so increasing in-track slots wouldn't be that good for clients.

About server you will just need a bigger upload connection. More slots, more cash, better PC. Isn't it obvious?

Also there is no need to have every single server with maximum slots(both spectators and in-track); its your choice. That's why you shouldn't say "It will be more expensive" and bla bla bla. Of course it will. If you don't want it, you can stay on 47 and 32(i hope the numbers were correct, i am not sure).

+1!
DarkKostas
S3 licensed
Finally i am able to post! (had some issues with GPU; changed 4 in this week lol)

Anyway.
The last versions works perfect! Good job on finally doing it.

Also here are 2 small suggestions:
1) As already said before, reset leds when close lfs(or even when lose focus[alt+tab for example])
2) At readme file it says about "g27cfg.cfg" but the real name is "g27leds.cfg"(not big deal but just saying!)

Finally here is my cfg file with all cars including having the right RPM min/max values and ULTRA SYNCED formula cars(FBM,FOX,FO8,BF1)!

http://pastebin.com/0SkLctWd
DarkKostas
S3 licensed
Quote from Flame CZE :When I try to run it, it gives me an error, something like "could not create socket, g27 leds won't work" and LFS crashes.

are you sure outgauge port is 30000?

Ok, my story now:

Leds are working.
No feedback.
Game can't exit(black screen and process stays active, have to CTRL+ALT+DEL)

Not compatible with other DX "plugins"(it didn't work when i was using the DirectX overlay plugin of TeamSpeak3)
DarkKostas
S3 licensed
It's crashing for me(only when G27 is plugged in)
DarkKostas
S3 licensed
Quote from hyntty :there is no button in that piece of code. That's why.

His button is 62, that's why he is on BTC packet.


Are you sure ClickID when creating the button is the same as when clicking it?
Also are you sure the code with buttons is working? You can use something like

InSim.Send_MTC_MessageToConnection("^3You clicked " + BTC.ClickID, Connections[GetConnIdx(BTC.UCID)].UniqueID, 0);

so you can make sure the code is working.
DarkKostas
S3 licensed
Quote from sankkuq :Nice job :P

http://www.lfsforum.net/showthread.php?p=1651859#post1651859

Layout naming won't work for demo servers, as you are a demo player, so you can remove it.
DarkKostas
S3 licensed
Here is a sample i made with full control of connections and players with some examples on how to use commands MCI packet and tracking Track and Layout name(if you load a layout through a remote player the name wont be available. to 'fix it' you can make a command which will do /axsave [yourname] and /axload so it will save it to the server and reload it with the connect name)

Suggestions are welcome and fixes in case i've done something wrong.

Link: http://www.mediafire.com/?qqhhrr1mtk4x0qh
and @ attachment
DarkKostas
S3 licensed
Recently i started playing with InSim again and i remembered 2 things i wanted. The 1st one is this one which was posted long time ago.
Quote from DarkKostas :As the previous topic about insim changes is locked ill post it here.
I would like a small change to this

struct IS_AXI // AutoX Info
{
byte Size; // 40
byte Type; // ISP_AXI
byte ReqI; // 0 unless this is a reply to an TINY_AXI request
byte Zero;

byte AXStart; // autocross start position
byte NumCP; // number of checkpoints
word NumO; // number of objects

[B]char LName[32];[/B] // the name of the layout last loaded [B](if loaded locally)[/B]
};

Is it possible to make it so when a remote player loads a layout, we can get the name of it? Because i want to store layout name and use it.

The 2nd is to make PLC packet work as /cars command. What i mean is that when someone for example is driving with XFG(and its the only available car on server), when you type /cars UF1, he will get spectated AND when he tries to join in the race, he goes to the car selection menu to change car.

These are not happening with PLC packet. If you send PLC packet and remove all cars available he 1)wont get spectated, 2)when he goes to pit, he is still able to join the race with same car(he should go to the car selection menu).

A good and simple use of this "fix" use to make a !spec_all command which will send a PLC packet with value 0 and one more with value 0xffffffff.

Even if it there wont be any new LFS version soon, at least please implement it for the future version.

kthxbye
Dark_Kostas
DarkKostas
S3 licensed
Quote from sankkuq :And thank you shoud be better if i just dowload insims :PP

I was thinking of making a "sample" on InSim.NET, with full tracking on connections/players and some extra things just as an example. I'll probably start cleaning my InSim and add more comments by Monday to publish it.
DarkKostas
S3 licensed
My much much smaller code for admins

private bool GetUserAdmin(string Username)
{
StreamReader CurrentFile = new StreamReader(SaveDataFolder + "/admins.ini");

string line = null;
while ((line = CurrentFile.ReadLine()) != null)
{
if (line.Trim() == Username)
{
CurrentFile.Close();
return true;
}
}
CurrentFile.Close();
return false;
}

private void OnConnectionJoin(InSim insim, IS_NCN NCN)
{
try
{
_connections.Add(NCN.UCID, new Connections
{
UCID = NCN.UCID,
UName = NCN.UName,
PName = NCN.PName,
IsAdmin = NCN.Admin,

IsCustomAdmin = GetUserAdmin(NCN.UName)
});
}
catch (Exception EX) {}
}

A useful function to combine real admin and .ini admin

private bool IsConnectionAdmin(Connections CurrentConnection)
{
if (CurrentConnection.IsAdmin == true || CurrentConnection.IsCustomAdmin == true) return true;
return false;
}

And an in-game command to add admins(you will need to modify it a bit because im using if statements for each command instead of break.

else if (command[0] == "!makeadmin")
{
if (!IsConnectionAdmin(_connections[MSO.UCID]))
{
MessageToUCID(MSO.UCID, "You are not an admin");
return;
}
if (command.Length == 1)
{
MessageToUCID(MSO.UCID, "Invalid Format. ^7!makeadmin [username]");
return;
}

bool UsernameFound = false;
string Username = Text.Remove(0, command[0].Length + 1);

foreach (var CurrentConnection in _connections.Values)
{
if (CurrentConnection.UName.ToLower() == Username.ToLower())
{
UsernameFound = true;

if (IsConnectionAdmin(CurrentConnection)) MessageToUCID(MSO.UCID, "^7" + CurrentConnection.PName + " ^3is already an admin");
else
{
CurrentConnection.IsCustomAdmin = true;

StreamReader ApR = new StreamReader(SaveDataFolder + "/admins.ini");
string TempAPR = ApR.ReadToEnd();
ApR.Close();
StreamWriter Ap = new StreamWriter(SaveDataFolder + "/admins.ini");
Ap.WriteLine(TempAPR + CurrentConnection.UName);
Ap.Flush();
Ap.Close();
}

break;
}
}

if (UsernameFound == false) MessageToUCID(MSO.UCID, Username + " ^3not found");
}

You can replace MessageToUCID with your message function or the default way.(anything you like to use)
DarkKostas
S3 licensed
Here is my npl and pll and cpr a bit modified for you. You will have to bind and create dictionary/class for this to work. But this is how packets are.

private void OnPlayerJoin(InSim insim, IS_NPL NPL)
{
try
{
if (_players.ContainsKey(NPL.PLID))
{
// Leaving pits, just update NPL object.
_players[NPL.PLID].PLID = NPL.PLID;
_players[NPL.PLID].PName = NPL.PName;
}
else
{
// Add new player.
_players.Add(NPL.PLID, new Players
{
PLID = NPL.PLID,
PName = NPL.PName
});
}
}
catch (Exception EX) {}
}

private void OnPlayerSpectate(InSim insim, IS_PLL PLL)
{
try { _players.Remove(PLL.PLID); }
catch (Exception EX) {}
}

private void OnPlayerRename(InSim insim, IS_CPR CPR)
{
try
{
_connections[CPR.UCID].PName = CPR.PName;
foreach (var CurrentPlayer in _players.Values) if (CurrentPlayer.UCID == CPR.UCID) CurrentPlayer.PName = CPR.PName;
}
catch (Exception EX) {}
}

Im sure "takeover" packet is needed too. But haven't managed(tested yet) on how to do it. Someone could help here for this too.

Anyway, usage of the code

_players[con.A.PLID].PName//This is the player name.

DarkKostas
S3 licensed
I forgot to tell that after creating the class you will need to create the dictionary

private Dictionary<byte, Connections> _connections = new Dictionary<byte, Connections>();

About PLID you will have to do the same as UCID but with different packets, NPL and PLL.

LogTextToFile

const string SaveDataFolder = "files";

private void LogTextToFile(string file, string text, bool AdminMessage = true)
{
//Console.WriteLine(file + ": {0}", text); You dont need this one as you use form application.

if (AdminMessage == true) MessageToAdmins("There was a " + file + " : " + text);

if (System.IO.File.Exists(SaveDataFolder + "/" + file + ".log") == false) { FileStream CurrentFile = System.IO.File.Create(SaveDataFolder + "/" + file + ".log"); CurrentFile.Close(); }

StreamReader TextTempData = new StreamReader(SaveDataFolder + "/"+ file + ".log");
string TempText = TextTempData.ReadToEnd();
TextTempData.Close();

StreamWriter TextData = new StreamWriter(SaveDataFolder + "/" + file + ".log");
TextData.WriteLine(TempText + DateTime.Now + ": " + text);
TextData.Flush();
TextData.Close();
}

And MessageToAdmins which is used by LogTextToFile

private void MessageToAdmins(string Message)
{
foreach (var CurrentConnection in _connections.Values)
{
if (CurrentConnection.IsAdmin == true) MessageToUCID(CurrentConnection.UCID, Message);
}
}

Last edited by DarkKostas, . Reason : EDIT: Added SaveDataFolder definition. If anything else is missing tell me
DarkKostas
S3 licensed
Now you are getting into more complicated things. You have to add "directories" and add each player at NCN(NewConnection), CNL(ConnectionLeave) packets.


class Connections//Somewhere at the top of your code
{
public byte UCID;
public string UName;
public string PName;
public bool IsAdmin;
}

//Before "insim.Initialize(new InSimSettings blablabla"
insim.Bind<IS_NCN>(OnConnectionJoin);
insim.Bind<IS_CNL>(OnConnectionLeave);

//Add these anywhere you want
private void OnConnectionJoin(InSim insim, IS_NCN NCN)
{
try
{
_connections.Add(NCN.UCID, new Connections
{
UCID = NCN.UCID,
UName = NCN.UName,
PName = NCN.PName,
IsAdmin = NCN.Admin,
});
}
catch (Exception EX) { LogTextToFile("packetError", "NCN - " + EX.Message); }
}

private void OnConnectionLeave(InSim insim, IS_CNL CNL)
{
try { _connections.Remove(CNL.UCID); }
catch (Exception EX) { LogTextToFile("packetError", "CNL - " + EX.Message); }
}

LogTextToFile is a function i made to log text "type"(packetError in this case) to a file. PM me if you want it. You can just replace it for now to add the error to a richtextbox(just an example)

EDIT:
I forgot about flags. You can use more than one by using |
Example: Flags = InSimFlags.ISF_MCI | InSimFlags.ISF_MSO_COLS,

EDIT2:
Here is an example at MSO on how to use first code in case you don't know

case "!ialwaysforget":

insim.Send("/msg ^3" + _connections[mso.UCID].PName + " always forget his username which is " + _connections[mso.UCID].UName);
break;

Last edited by DarkKostas, . Reason : Added example using the code above
DarkKostas
S3 licensed
Its ok, thanks anyway. My first searching was failed because i was asleep and didnt think correctly. Then i understood what exactly i wanted to do and a way to parse parameters with timers, so that it worked!
DarkKostas
S3 licensed
Based on my previous post, today i wanted to give one more try and search further about how to do it and i found a solution

Here is what i wanted to do

private void SendRCMToUsername(string Username, string Text, int Duration)
{
insim.Send("/rcm " + Text);
insim.Send("/rcm_ply " + Username);

Timer timer = new Timer { Interval = Duration, AutoReset = false };
timer.Interval = Duration;
timer.Elapsed += delegate { ClearRCMFromUsername(Username); };
timer.Start();
}

private void ClearRCMFromUsername(string Username)
{
insim.Send("/rcc_ply " + Username);
}

Usage:

SendRCMToUsername("DarkKostas", "^1Hi Mom", 5000);

DarkKostas
S3 licensed
Allowed: !()_-=.@[]{} and Alphanumeric
Space is also valid

I dont think i forgot anything else.
FGED GREDG RDFGDR GSFDG