OK - thanks! It's possible I've looked at this before and don't remember, but if you could find some steps to reproduce the error that would be great.
This may be a silly question, but what's the problem that occurs when you send all those buttons to all those players? Is it that there is an error, does the connection close, does LFS grumble, or is it just really slow? I know we may have talked about this before, but I don't work on the library often and so will forget things. The main problem is that I don't have a server with 47 players to test it on, I just test on my own machine, and in that case I can send 239 buttons each with 240 characters of text over and over again and it works fine.
I was going to post about the EventHelper, it's an experimental thing I knocked together in a short while. Basically, I thought the best way to deal with multiple hosts was just to be able to think of them as one host. So EventHelper is a wrapper that wraps a collection of InSim objects, when you bind a packet or send a packet, it loops through the collection of hosts and performs the operation on all of them. Here is some code to demonstrate:
<?php
void Test() {
var hosts = new EventHelper();
// Add the settings for each host you want to connect to
hosts.AddInSim(new InSimSettings {
// host 1 settings
});
hosts.AddInSim(new InSimSettings {
// host 2 settings
});
hosts.AddInSim(new InSimSettings {
// host 3 settings
});
// Bind packets and events as normal
hosts.InSimError += hosts_InSimError;
// when you bind a packet or event it's bound to all the InSim objects
hosts.Bind<IS_STA>(StateChanged);
// Initialize all the hosts you added earlier.
hosts.Initialize();
// You can send a packet to all hosts.
hosts.Send(new IS_TINY { ReqI = 1, SubT = TinyType.TINY_SST });
}
void hosts_InSimError(object sender, InSimErrorEventArgs e) {
// the sender object is the host that raised the event.
InSim insim = (InSim)sender;
}
void StateChanged(InSim insim, IS_STA packet) {
// the insim parameter is the host that received the packet, so you can use it to send a packet back
insim.Send("got yer state");
}
?>