PDA

View Full Version : MTC restriction? (InSim)


Leifde
25th December 2006, 20:31
I'm sending 20 messages one after another through Insim and after about 10 the server blocks the connection and won't let the app connect again.

Is there a restriction on the amount of messages you can send in a certain amount of time?

Dygear
25th December 2006, 20:33
I would not think that InSim would implement a spam protection mechanism, seeing as you have to have the admin password to connect to it. I'll do some testing now. . .

Leifde
25th December 2006, 20:36
I'm using filur's lurLFSd if that helps. :shrug:

Dygear
25th December 2006, 20:48
Really?!? He released it?

Alright, I'm going to use this plugin for testing then, with Patch V ... of the dedicated server ...

<?php
/*#updinfo
version 0.0.0.1
saveto plugins
*/

$this->register('spam');
$this->attach('spam', NULL, 'NPL', 'spamTime');

class spam {
function __construct($parent) {
$this->parent = $parent;
$this->splits = array();
}
function spamTime() {
for ($i = 0; $i < 20; $i++) {
$this->parent->send('MTC', 0, NULL, NULL, NULL, "!!!Spam!!!");
}
}
}
?>

Dygear
25th December 2006, 20:59
The code I'm using seems to work fine ... Sent 20 messages, but I only see 16, think that's due to the buffer. Should be ok ...

Leifde
25th December 2006, 21:01
It's not been released yet, I got a copy from filur though.

Dygear
25th December 2006, 21:02
It's not been released yet, I got a copy from filur though.

Alright :). Anyway, as you can see the code works fine.
Could you post the code your using?

Leifde
25th December 2006, 21:04
I'll PM it to you, I'd rather not post it here for all to see. :)

EDIT: I've just tried your code and it seems to be the server, not Insim or my code. I'll ask 500servers about it then :)

filur
25th December 2006, 21:12
Really?!? He released it?

:Kick_Can_ :juggle:

I actually worked on some insim code today! ... in Ruby

Leifde
25th December 2006, 21:19
It sends 11 messages to the server then gets locked out. I'll contact 500servers tomorrow. :)

EDIT: Do you think this could have anything to do with the server being 11 slots?

Dygear
25th December 2006, 21:26
:Kick_Can_ :juggle:

I actually worked on some insim code today! ... in Ruby

SAY IT AIN'T SO!

It sends 11 messages to the server then gets locked out. I'll contact 500servers tomorrow. :)

EDIT: Do you think this could have anything to do with the server being 11 slots?

I might ... I would have to see some code to have an idea what is going on.

Leifde
25th December 2006, 21:58
Code attached. Password in PM Dygear. :)

Dygear
26th December 2006, 01:25
Forced to go to a party, and now I'm extremely sleepy, so I'll look at this in the morning.

Frankmd
26th December 2006, 08:52
I was also working on some InSim stuff (starting tool for running starts), and was trying to use MTC packets as well, but couldn't get it to work at all... Didnt work in MPR, multiplayer server or single player.


public void sendMTC (String mes, int uId)
{
byte[] temp = new byte[68];
Arrays.fill(temp, (byte)0);

temp[0] = (byte)'M';
temp[1] = (byte)'T';
temp[2] = (byte)'C';
temp[3] = (byte)0;

temp[4] = (byte)0;
temp[5] = (byte)uId;

for (int i=0; i < Math.min (mes.length(), 64); i++)
temp[i+8] = (byte)mes.charAt(i);

temp[67] = (byte)0;

for (int i=0; i < temp.length; i++)
System.out.print ((char)temp[i]);

System.out.println ("\n" + uId);

IO_OUT.sendPacket.setData(temp);
IO_OUT.send();
}


It's Java code and pretty nasty, but it works in a very similar way for MST packets. The MTC messages are supposed to pop up in the chat area, correct?

Leifde
26th December 2006, 12:25
MTC packets are like an admin typing /msg <insert message> but with the message only appearing for a certain player. I think that makes sense. :)

MST packets are like an admin typing /msg <insert message> where the message appears for everyone.

I don't know about constructing the packet for MTC, I'm using an API so I've never done any of the actual connecting and sending. I would guess that there's something wrong with your code. I'll try finding what the packet should look like.

EDIT: @Dygear - ok, no problem, I'm not really bothered when it gets fixed. :)

EDIT2: MTC ☺ ^7Welcome to the server!That is sent to Insim for MTC packets, try comparing it to what your app sends Frank. :)

Frankmd
26th December 2006, 15:32
Looks very similar, even the smiley is the same.

filur
26th December 2006, 15:45
There's probably some MTC stuffs in JInSim (http://sourceforge.net/projects/jinsim/)