View Full Version : [beta] LFS Online Status -> Jabber Transport
tehkahless
21st August 2005, 17:40
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 (http://www.lfsforum.net/attachment.php?attachmentid=628))
---
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 (http://www.lfsforum.net/attachment.php?attachmentid=629) )
(it is currently in an early alpha stage, so usage is not too smooth right now)
cu
Herbert Poul
CrazyICE
22nd August 2005, 10:13
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! :)
Wiehrwolf
22nd August 2005, 15:40
Very nice :)
But what about users with spaces in their username? I don't think something like "cool name@lfs.sphene.net" (name@lfs.sphene.net)will work...
Thanks
Christian
tehkahless
22nd August 2005, 17:53
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
Iceberg
8th September 2005, 10:31
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 (http://www.phpbb.com/)) if possible.
PLZ help.
Thx
Visit www.dprt.dk (http://www.dprt.dk/)
tehkahless
8th September 2005, 10:49
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
tehkahless
8th September 2005, 14:15
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.: http://goim.sphene.net/lfs/statusImage/tehkahless
and http://goim.sphene.net/lfs/statusImage/tehkahless?small=1
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 ;)
Wiehrwolf
8th September 2005, 22:18
.. 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...
tehkahless
8th September 2005, 22:24
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
tehkahless
9th September 2005, 18:23
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
Wiehrwolf
11th September 2005, 21:14
-solved-
tehkahless
11th September 2005, 21:53
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 .. :)
Iceberg
12th September 2005, 08:21
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.
http://www.lfsforum.net/images/flagpics_tiny/Denmark.gif Iceberg (http://www.lfsforum.net/member.php?u=48886) vbmenu_register("postmenu_15574", true);
S2 licensed
Online at: DPRT #2 (lfs://|DPRT%20/#2|1|S2|/)
Join Date: Aug 2005
Posts: 5
tehkahless
12th September 2005, 08:29
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 ..
Iceberg
13th September 2005, 12:27
Is it possible for you to put the "<a href='lfs://|$servername|0|S2|/'></a>" tag on the page you created (http://goim.sphene.net/lfs/statusImage/iceberg)
tehkahless
13th September 2005, 14:12
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...)
tehkahless
13th September 2005, 16:51
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 (http://yourhell.com/%7Ekahless/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 ..
Iceberg
14th September 2005, 09:43
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 :thumb:
tehkahless
14th September 2005, 14:08
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)
tehkahless
14th September 2005, 16:02
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 :)
Ayahuasca
15th September 2005, 14:00
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...
tehkahless
15th September 2005, 14:07
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 ..
Iceberg
19th September 2005, 07:51
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:
<?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/listRacersJS?racer=dan%20jeppson&racer=iceberg&racer=retrohero\" charset=\"UTF-8\"></script>\n";
$content .= "</left>";
?>
tehkahless
19th September 2005, 08:37
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 ..
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.