The online racing simulator
Message packet throttle?
(8 posts, started )
Message packet throttle?
In one of my tests, I send a couple messages in quick succession. The second message wasn't making it through correctly until I waited about 500ms between messages. Is there a message throttle to prevent message floods?

--
Rob
The Java InSim library (JInSim)
http://jinsim.sourceforge.net
Yes, I believe there was a throttle implemented to avoid a spamming "exploit". I think it was a couple of months ago now and I cannot seem to dig out the thread - sorry.
what version lfs LFS are you using? The delay TAA refers to should only work "in-game" (eg. user pressing F1 10 times per second), but insim messages should not be delayed (because the connection is admin anyway - not too big a chance of spam).
In my latest insim thing, i didn't have any problems sending multiple lines anyway.
-
(MonkOnHotTinRoof) DELETED by MonkOnHotTinRoof
Looking at it again, I should've been more precise.

In JInSim, I've created a helper class that helps an add-on creator do common things easily. One that I've implemented is the ability to send a multi-colored message. There are some interesting issues related to which type of LFS application you're connected to, but that's for a future thread The multi-colored message is send as a String with escape sequences to change colors. I've just used a caret (^) and the number that corresponds to the color when you're typing it in. So for instance:

helper.sendMultiColoredMessage("^1Red and ^4Blue");

will send the message "Red and Blue" where "Red and" will be red and "Blue" will be blue. You get the picture.

To implement this, I iterate through the String character by character and test for the escape sequences, then send the appropriate character out using the "SCH" type packets.

In my test program, I send out an MST packet, then the SCH packets in quick succession. The SCH packets don't get sent correctly unless I have a 500ms delay before I start sending them. There are some other technicalities, but that's the gist of it. Victor, I think what you've said fits my scenario. The MST and SCH packets I send are all done through the "talk" interface of the client. In other words, before I start sending the messages, I send an SCH packet that types the letter "T" beforehand.

--
Rob
-
(MonkOnHotTinRoof) DELETED by MonkOnHotTinRoof
Quote from MonkOnHotTinRoof :Hmm. I don't understand why you need to send SCH packets ? Just send MST packet with text, like this: /msg ^1red^0black
and LFS will colorize (does that word exist?) text itself. Maybe I still don't understand ?

Are you certain? If I send an MST packet with the string "^1red^0black", I get "^^1red^^0black". So, the carets are escaped by LFS when they're sent. There is no way to send control character literals through the MST packet that I can see.

--
Rob
Quote from rheiser :Are you certain? If I send an MST packet with the string "^1red^0black", I get "^^1red^^0black". So, the carets are escaped by LFS when they're sent.

I use that all the time and it works great. No need for some tricks with SCH packets. I don't know where you got those extra ^s.

Quote from rheiser :
There is no way to send control character literals through the MST packet that I can see.

No need to send control characters. ^ is an ASCII symbol (0x5e).
yes, the SCH packet should just be used for in-game commands that are bound to a key (like these : http://www.liveforspeed.net/?page=keys ). Messages you just send with MST packets (for normal messages), or MTC packets (if you want to send a msg to a specific person only).
OK, I guess it does work. I wonder what I was doing before. If I run across it again and it doesn't seem right I'll say something . It eliminates the need for those helper methods, anyway. Bear with me as I ask a few stupid questions

Message packet throttle?
(8 posts, started )
FGED GREDG RDFGDR GSFDG