The online racing simulator
Searching in All forums
(107 results)
gru
S2 licensed
Quote from nesrulz :Hey gru, can you enable "Led" in XFG?

no, LFS doesnt show shiftlight in GT cars anymore

i made new version which works with Z25 (shiftlight, race cars only)
first post updated
gru
S2 licensed
hello

x64 problem is solved, download link in first post is updated (ds_1.0.2_x86.zip)


Solution, info for programmers using my source code:
At first DigitalSpeedo.exe was compiled with "Any CPU" option, so on x86 it was 32bit, and on x64 it was 64bit. d3d8.dll is always 32bit, so 64bit process can't load it, that's all (and it took me over a year to realize that :doh
So to make them work, U have to recompile DigitalSpeedo.exe for x86 platform (VS Express 2008 help link: http://social.msdn.microsoft.c ... 1-4ead-96a1-78bbd9ba6d3a/)
gru
S2 licensed
not sure if it was reported already
there is bug in 1.1.1.4, button text is limited to 64 chars (it should allow 240), sending longer text throws exception (method Send_BTN_CreateButton)
gru
S2 licensed
U have to modify foreach loop, add if clause checking user id

foreach (clsPlayer Player in Players)
{
if (Player.UniqueID == MSO.UCID)
{
//show info code
break;
}
}

next time post it in lfs_external or cruise thread, this is general programming section
Last edited by gru, .
gru
S2 licensed
ok, lets stop argueing, U use clsPlayer, fine, i joined it with clsConnection, fine too
gru
S2 licensed
You're right, i forgot about AIs, but this system doesn't support it, one PLID per connection
Last edited by gru, .
gru
S2 licensed
Quote from broken :Then why don't you build a method to get a connection id by PLID, and a Player id by UCID? That's quite simple to code.
Or if you're lazier you can just make a function to convert a clsConnection to clsPlayer and the opposite(that means like 5 lines of code at max).

cause thats more operations program has to make
1. loop through Players list to get UCID
2. loop through Connections list to get clsConnection object

if U store PLID in clsConnection U can skip step 1 (and remember that U have to handle MCI event few times per second)
ok, U have powerful PC, it will do job anyway, but still

also tell me, how many times U use only clsPlayer?
i bet in most cases U use clsConnection also, so isnt it better to have only one class representing player?
Last edited by gru, .
gru
S2 licensed
Quote from broken :It doesn't make it more complicated, it makes it more readable and easier to get information about a player's car at any point of your work

im not so sure about it. loop through connections list inside of player list loop is not readable and easier IMO
i prefer to store PLID in clsConnection and get whole player object with one method instead of looking for it in 2 lists

Quote from broken :...instead of setting a var, which then you have to check in MCI thread, etc...

sure, of course its better to save speed and position on MCI event so U can have it in any point of code, i just dont see advances
in storing this info in 2 classes
Last edited by gru, .
gru
S2 licensed
read this thread
http://www.lfsforum.net/showthread.php?t=43933

also check MCI handler in modded version
http://www.lfsforum.net/showthread.php?t=47913

basicly U have to loop through MCI.Info array instead of Players list
BTW U dont really need clsPlayer class, it only makes code more complicated.
check modded version (link 2), it stores all info in clsConnection
Last edited by gru, .
gru
S2 licensed
Quote from Shadowww :/shift u is possible, for example :P

sure , but comma or < (/shift , or /press <) would probably put mess in parsing process, thats why we have "less" pseudo key
Last edited by gru, .
gru
S2 licensed
Quote :gru: sorry, overlooked your first post

ye, not once

not "/ff more" but "/press more" - Ur emulating key stroke
Last edited by gru, .
gru
S2 licensed
"less" is script equivalent for "<"
U cant make command "/press <" or "/press shift+," can U?

take a look into commands.txt, less and more should work
Last edited by gru, .
gru
S2 licensed
try "/press less", "/press more"
gru
S2 licensed
Quote :I have tried changing the BTN.UCID to 255

handle NCN_Received event, struct IS_NCN has field Flags, bit 2 tells U if its local or remote connection. if its local, store UCID in some global variable, then use it for button send
but 255 should work, are U sure rest of code is proper?

Quote :Also, is there any way of viewing this insim on a server that has an insim?

sure, of course Your program must know address, port and admin password

edit:
sorry, didnt get Ya, thought U asked for using insim with remote dedi server
Last edited by gru, .
gru
S2 licensed
InSim doesnt have to be static if its declared in MainForm (Form1?)

Quote from broken :Anyway to create a insim button when pressing a form button then you would need the UCID of the user you want it to be sent to. But if you want it for everyone then as you know you can just use 255

vane, if U want to send button to just one connection, then i suppose U need some control containing all players. ListBox maybe?
ListBox.Items is typeof ObjectCollection, so U can make custom item class:


public class ListBoxItem
{
private string _name;
private ushort _id;

public ListBoxItem(string playerName, ushort connectionId)
{
_name = playerName;
_id = connectionId;
}

public override string ToString()
{
return _name;
}

public ushort ConnectionId
{
get
{
return _id;
}
}
}

adding new item to ListBox (NCN_Received event handler)


_listBox.Items.Add(new ListBoxItem(NCN.PName, NCN.UCID));

getting id on button click


private void button1_Click(object sender, EventArgs e)
{
if (_listBox.SelectedItem == null)
return;

ListBoxItem item = (ListBoxItem)_listBox.SelectedItem;
InSim.Send_BTN_CreateButton("Button Text", "Title", Flags.ButtonStyles.ISB_DARK | Flags.ButtonStyles.ISB_CLICK, 5, 30, 100, 10, 96, 1, item.ConnectionId, 40, false);
}

code not tested
Last edited by gru, .
gru
S2 licensed
Quote from kyler :I have LFS external and LFSLib but with LFSLib i can get it to do out gauge... but LFS external i can get the flags sorted...

Digital Speedo - not a lib, but does all U need, it collects OG data and sends it to dll displaying it on screen
U would have to modify source code to redirect data to Your output
Last edited by gru, .
gru
S2 licensed
Quote from Ponty46 :Doesnt work. Still invalid dll message.

i found info in some thread (LfsRelax i think), that recompiling under x64 system solves problem
dll's source code is available (dg_d3d8 project), VC++ Express is also free to download...

im not planning pc upgrade soon, so dont count on me here, sorry :/
Last edited by gru, .
gru
S2 licensed
save DateTime on user exit, load it on user join, substract from DateTime.Now - U have Your offline time span

using timer isnt best idea, U would have to loop through all txt files, and what if Your system has 5000 users?
gru
S2 licensed
hello

does Lfs External have transfer meter and packets queueing functionality? (didnt find it in docs)

we are developing cruise system (based on dougie-lampkin's code, thx dougie :-), and we have lags when broadcasting multiple messages (our insim server has weak upload :\)
first we need transfer meter, so we could diagnose and improve our code.
and i think we also need some packets queueing, so we could decrease PPS and match to our poor connection

do U think, U could add this functionality for us, or pass me source code so i could add it myself?

thx in advance

edit:
nevermind, did it myself
Last edited by gru, .
gru
S2 licensed
Quote from nesrulz :Windows XP SP3?

we talked on PM, he forgot to start insim in LFS
gru
S2 licensed
sorry, i dont implement such a requests
let me know if U want help how to do it yourself
Last edited by gru, .
gru
S2 licensed
Quote from Tits_McGee :would it be possible to put the LED light (shift light) yellow?

color values are hardcoded, U would have to recompile dll file
do U have any programming experience?
gru
S2 licensed
source code available (1st post updated)

Could some programmer using 64 vista try to look at nesrulz's problem? (posted on 2009.02.06)
thx
Last edited by gru, .
gru
S2 licensed
misiek08 asked me to share source code of Digital Speedo (it uses d3d8 proxy dll to display data)
ill post it when i get home, check this thread tonight: http://www.lfsforum.net/showthread.php?t=44054
gru
S2 licensed
hmm, cant help Ya, using 32bit XP :/

but i can send source code to some programmer using Your OS
anyone willing to help?

edit:
Quote from marek100 :BTW works on vista ultimate x64 after some work.

i guess its some user privileges issue
Last edited by gru, .
FGED GREDG RDFGDR GSFDG