The online racing simulator
Messages Limit problem
(12 posts, started )
Messages Limit problem
hello
i added a line in my insim code in C# to show a message, it shows the player name and some text after it.
but sometimes it doesn't appear because the name of the player maybe a bit longer than the InSim.Send_MST_Message can take.
how can i fix that problem?? cuz i don't want to split the text into 2 lines.
thanks in advance
You have to fix the problems source, so I guess in your case you should simply ban players with too long name and problem is fixed


BTW, if you are not sending commands, you might consider another packet (MSX)

Quote :struct IS_MST // MSg Type - send to LFS to type message or command
{
byte Size; // 68
byte Type; // ISP_MST
byte ReqI; // 0
byte Zero;

char Msg[64]; // last byte must be zero
};

struct IS_MSX // MSg eXtended - like MST but longer (not for commands)
{
byte Size; // 100
byte Type; // ISP_MSX
byte ReqI; // 0
byte Zero;

char Msg[96]; // last byte must be zero
};

If i use: InSim.Send_MSX_ExtendedMessage("Some Text"); it works fine, and it looks like the host sent the message, like this: host: Some Text.
but when i tried InSim.Send_MSX_ExtendedMessage("/msg Some Text"); it didn't appear, and as you said the MSX can't be used for commands, but i need to send a long message with /msg
Is that possible??

Thank You
If all you want to do is display a message, use MTC (Message To Connection) which gives you 128 characters to play with IIRC.
If it's a client-side InSim, set the UCID to 0.
Sorry but I don't get it !!
MTC is used for sending a message to only one player: InSim.Send_MTC_MessageToConnection("/msg Some Long Text", MSO.UCID, 0);

My point is that I want to display a message to all players, but that message is a bit long, and I don't want to split the text into two lines.
I've noticed and seen (via remote) some servers in which their InSim can display long messages.
If I use InSim.Send_MST_Message("/msg Some Long Text"), it doesn't appear because it's long.
And If I try InSim.Send_MSX_ExtendedMessage("/msg Some Long Text"), it doesn't appear too because there is a command within that text.

Thank You
Set UCID to 255 to display message to all :P
InSim.Send_MTC_MessageToConnection("/msg Some Long Text", 255, 0);
right? That didn't appear O.o
That should work, however you don't need the /msg:

InSim.Send_MTC_MessageToConnection("Some Long Text", 255, 0);

I can't really help you more than that, as I've never used LFSExternal - it's possible that LFSExternal is being "helpful" by treating the UCID 255 as invalid (which it normally would be) and rejecting the command instead of sending it anyway. This is quite likely, as I believe LFSExternal is older than the "send to all" feature that introduced the 255 special case.

You may just have to be inefficient and write a loop to send the message to each player, one by one.
Well, I tried to do a loop:
foreach (clsConnection C in Connections)
{
InSim.Send_MTC_MessageToConnection("Some Long Text", C.UniqueID, 0);
}

but it didn't appear too

As I've read in this page: http://en.lfsmanual.net/wiki/InSim
IS_MST Send LFS a message or command (64 characters)
IS_MSX Extended version of IS_MST (96 characters), not for commands
IS_MTC Send message to specific connection or player

So MSX is the longest, but it must not contain a command

I'm really confused now

Thank You
-
(zazcoisa1998) DELETED by zazcoisa1998
Is there anyone who can help me with this?
Please
I tried to use InSim.NET library and it appeared
and by setting UCID to 255 in MTC
so the problem is solved now

Thanks Everyone

Messages Limit problem
(12 posts, started )
FGED GREDG RDFGDR GSFDG