The online racing simulator
[beta] LFS Online Status -> Jabber Transport
Hi,
I've made a jabber transport which sends the online status of a lfs racer through the jabber protocol.
If you don't know jabber: http://www.jabber.org (it's an open source IM protocol)
you can use every jabber client to register with the transport lfs.sphene.net and then add contacts like tehkahless@lfs.sphene.net (<lfsracername>@lfs.sphene.net)

If someone in your contact list then joins a LFS server the transport will send a away presence with the status string where he is playing and with how many other racers. (see attachment: psi_goim_transport_window.JPG)

---
I also made my own jabber client: http://goim.sphene.net which displays a LFS icon beside the contact who joined a server, which can be clicked to launch LFS and connect to the same server. (see attachment: GOIMscr15_lfstransport_window.JPG )

(it is currently in an early alpha stage, so usage is not too smooth right now)

cu
Herbert Poul
Attached images
psi_goim_transport_window.JPG
GOIMscr15_lfstransport_window.JPG
nice...

so there are many possibillities to join LFS by mates:
- LFS World
- mates@track II
- XFire
- Jabber

so...the users have now the agony of choice!
Very nice
But what about users with spaces in their username? I don't think something like "cool name@lfs.sphene.net" will work...

Thanks
Christian
yeah .. that wouldn't work yet .. i actually didn't knew that spaces are allowed in LFS usernames .. i guess i'll implement JEP-0106 (JID escaping) .. then cool\20name@lfs.sphene.net should do the trick

cu
Herbert Poul
Can anyone tell me how to put "online status" like the one in this forum to your local forum?

I think it is a nice feature, witch I would like to put next to "users online" on our PHP Nuke site if possible.

Othervice I will put it in our forum(phpBB) if possible.

PLZ help.

Thx

Visit www.dprt.dk
erm.. you are a little wrong in this thread.. check out http://www.lfsforum.net/showthread.php?t=183 .. it is the way i'm checking who gets online/offline .. but i don't know if there is any direct way on checking someone's online status.. but anyway .. getting the host list and parsing the players online .. will get you all plaers which are currently playing lfs ..

i guess my jabber transport won't help you .. unless you got a jabber online status on your board.. which i doubt .. anyway ..
if you like i can make a small addition to my server to generate status images of people currently playing on lfs .. since i always download the hosts and players every few seconds .. and hold that information .. it shouldn't be much of a problem for me to generate images ..

but.. then .. a small link to my IM http://goim.sphene.net would be nice

just tell me if you're interested.. otherwise .. maybe someone knows of an already established service for that .. or you look at the other forum thread which describes the interface ..

cu
Herbert Poul
okay .. i actually just get a little bored.. and therefore .. made such images ..

the url to retrieve them is http://goim.sphene.net/lfs/statusImage/<username>

e.g. http://goim.sphene.net/lfs/statusImage/tehkahless .. you can append a ?small=1 for a smaller version of it .. and a width=xxx to specify the width of the image in pixels ..
currently colors are just stripped..
i also created a small page to confirm that the recognisation of online stats actually work .. http://goim.sphene.net/lfs/ .. which lists all online racers ..

e.g.:
and

anyway . i don't know if that is what you've expected.. but yeah .. if you want to use them or need some changes tell me
Quote from tehkahless :.. since i always download the hosts and players every few seconds .. and hold that information ..

A question: how long does it keep the information?
I use your jabber transport with Miranda IM, and the players are only shown for a very short time.
online-offline...... and then around 20 seconds later... online-offline... and again...
Quote from Wiehrwolf :A question: how long does it keep the information?
I use your jabber transport with Miranda IM, and the players are only shown for a very short time.
online-offline...... and then around 20 seconds later... online-offline... and again...

actually it should save it as long as someone is online .. maybe there is some error in the algorithm .. altough it worked fine for me when i tried it ..
i'll check it out tomorrow (have no time now, sorry).. shouldn't be a problem to fix it though.. thx for the report ..

cu
Herbert Poul
hmm.. i've now tried it myself .. adding me (tehkahless@lfs.sphene.net) and joining a game .. i've played about 15 minute s.. and just got 1 presence packet when i joined the server .. and 1 when i left it ..

maybe it was just a temporary bug .. have you tried it recently ?
could you tell me with which playernames you get this problem ? and .. did you register with the component ?
try sending a message with the body:
show

(ie. just "show" without anything else)
to the component lfs.sphene.net .. it should display all usernames which you have in your contact list ..

you can add me directly to your jabber roster if you like so we can discuss this faster: kahless@sphene.net
-solved-
as discussed in jabber .. it was a problem with me not comparing case insensitive ..
it seams to work now ..
JID escaping now also works .. adding jack\20bauer@lfs.sphene.net would add 'jack bauer'
if anyone else notices further problems just tell me ..
Thanks for the help.
How can I now display it in a block in our php nuke site.

It would be nice to have a block with all members and there "online status"

I just don´t know how to create a block tha can display links eg. http://goim.sphene.net/lfs/statusImage/iceberg

Is it possible to display the short version next to "who is online" like if you (like me) use your LFS 2 username as account name, it can display that you are online. See below my status when racing.
Iceberg vbmenu_register("postmenu_15574", true);
S2 licensed

Online at: [url="lfs://|DPRT%20/#2|1|S2|/"]DPRT #2[/url]
Join Date: Aug 2005
Posts: 5
hmm.. i have no expierience with php nuke .. but isn't there some sort of general block which allows you to display html code ?
altough you would have to maintain the list by hand .. and add a <img src="http://goim.sphene.net/lfs/statusImage/iceberg" /><br/> tag by yourself for each member ..
but well .. sry .. can't help you with that .. never used php nuke ..
hmm.. nope .. not this way at least .. because it is just an image ..
if you want to create a link around it i would need to use javascript i guess .. hmm.. i'll think about it .. (then it would also be possible to use normal text .. and add colors to the server name & co much easier...)
ok .. i've now created a simple javascript output ..
just include the following code in the block of phpnuke or anywhere else:

<script language="JavaScript" type="text/javascript" src="http://goim.sphene.net/lfs/listRacersJS?racer=tehkahless&racer=iceberg&racer=wierwolf" />

you can also customize the images displayed before the names by appending a &imageurl=http://myurl.com/images/lfs to the url .. (it has to contain two images: online.png and offline.png )

you can view a example at: http://yourhell.com/~kahless/testgoimlfs.html

(doesn't look too spectecular .. but i guess it would look much better embedded in a real site )

and .. yeah .. you can add as many racer=... as you like .. and it (should) be possible to add racer names with spaces: racer%20name ..
I tried to put the string <script language="JavaScript" type="text/javascript" src="http://goim.sphene.net/lfs/listRacersJS?racer=tehkahless&racer=iceberg&racer=wierwolf" /> in to a block, but it is not working.

I see only at "just testing ..." when clicking the example link http://yourhell.com/~kahless/testgoimlfs.html

But you can see the list I am using now at http://www.dprt.dk
I know it is in Danish, but you will get the idea on the frontpage
hmmmm strange.. it seams to only work with firefox ..
i'll try to find out why ..

btw. have you already included the javascript at dprt.dk too ? (to see if it works .. for me)
ok .. i've now found an explanation .. after hours of trying to find the problem somewhere completely different .. i came back to the basics .. IE/opera just don't get the XHTML syntax right .. maybe it only supports XHTML with the XHTML DOCTYPE .. but anyway
the right code is <script language="JavaScript" type="text/javascript" src="http://goim.sphene.net/lfs/listRacersJS?racer=tehkahless&racer=iceberg&racer=wierwolf"></script>

note the added </script> tag .. i've corrected the code at http://yourhell.com/~kahless/testgoimlfs.html .. so you can try that .. (make sure to reload .. or even shift + reload if it still doesn't work)

i actually just encounted it because i tried embedding the JS code in the html .. and forgot to remove the </script> tag when trying again to use the src="..." version of the script tag ..

anyway .. pls tell me if it works now
Quote from tehkahless :ok .. i've now found an explanation .. after hours of trying to find the problem somewhere completely different .. i came back to the basics .. IE/opera just don't get the XHTML syntax right .. maybe it only supports XHTML with the XHTML DOCTYPE .. but anyway
the right code is <script language="JavaScript" type="text/javascript" src="http://goim.sphene.net/lfs/listRacersJS?racer=tehkahless&racer=iceberg&racer=wierwolf"></script>

note the added </script> tag

Hm, valid XHTML would read as <script language="JavaScript" type="text/javascript" src="http://goim.sphene.net/lfs/listRacersJS?racer=tehkahless&racer=iceberg&racer=wierwolf" />

Note the slash before the greater than sign closing the tag. Perhaps it is picky about that? (Would really be something, thinking about the way IE ignores each and every standard)

Edit: And the ampersands would have to be escaped by & too...
that's why i have written <script language="JavaScript" type="text/javascript" src="http://goim.sphene.net/lfs/listRacersJS?racer=tehkahless&racer=iceberg&racer=wierwolf" /> ..
note the slash .. and .. yes.. i know that i would have to escape & .. but since i'm lazy i've just copied the URL from my test which i made by entering it into the Location field of my browser.. and there a & is not necessary since it's not embedded in (x)html

thx for your info though ..
Thx very much for this.

I createt this block, but it is slowing the page down (unabel to load) when enabled.
By pressing CTRL-F5 it reloads?
Here is the code:
Quote :<?php
if (eregi("block-online.php", $PHP_SELF)) {
Header("Location: index.php");
die();
}
$content = "<left>";
$content .= "<script language=\"JavaScript\" src=\"http://goim.sphene.net/lfs/lis ... berg&racer=retrohero\" charset=\"UTF-8\"></script>\n";
$content .= "</left>";
?>

completely unable to load ? hmm.. that's strange ..
a way to circumvent this would be to create an iframe (http://www.w3.org/TR/REC-html40/present/frames.html#h-16.5) which loads a html page on your server which includes the java script ..
this way your page would load even if the javascript needs longer to load .. for whatever reason ..

FGED GREDG RDFGDR GSFDG