Anyone know?
Purge - Mon May 02, 2005 3:34 am
Post subject:
No, it's not possible. If you enter more than one, it'll look only at the first IP.
Maverick - Mon May 02, 2005 5:35 am
Post subject:
bah, too bad
liito-orava - Mon May 02, 2005 6:59 am
Post subject:
Guess would need to set somekind of proxy thing so that it'd look like all are from same IP or use shared connection..
It's quite surprising that since such feature was added to subgame they didn't make multiple ip's configurable to it.
Cyan~Fire - Mon May 02, 2005 12:45 pm
Post subject:
Try and catch? What does that have to do with this?
Solo Ace - Mon May 02, 2005 1:18 pm
Post subject:
Heh, Cyan, I was waiting for someone to ask about it.
I might be wrong ^ 2 here, but as what Mav said "(got kinda sick one plugin can d/c the whole bot lol)" I think he complains there about it how plugins can mess the whole bot up when something fails.
But, I guess in the newer versions catid already prevented plugins from crashing the bot, so that might not be what he meant.
I was thinking about using try and catch to prevent the code from crashing the bot, but, after all I think I was wrong.
Let's ask Mav what he actually meant with that, function calls deadlocking the bot or something?
Heh, liito-orava, as I think I've seen in other posts of yours, what you're saying in your post here is irrelevant to the topic, maybe more than what I said.
Maverick - Mon May 02, 2005 4:36 pm
Post subject:
What I exactly meant was that when a single plugin takes up 100% CPU time for a single operation it can d/c one or multiple bots/spawns since its unresponsive and gets d/c due to no data.
Bot crashes are more the fault of the coder of the plugin, and indeed, catid thought of that and made a catch method for it
Having the bot threaded would solve this problem (i think).
Solo Ace - Mon May 02, 2005 5:52 pm
Post subject:
How would another thread solve the issue if the plugin's taking the whole CPU for itself already?
D1st0rt - Mon May 02, 2005 8:24 pm
Post subject:
Because with the sockets on another thread it wouldn't timeout while waiting for a plugin to do something?
Maverick - Tue May 03, 2005 6:21 am
Post subject:
Exactly
Solo Ace - Tue May 03, 2005 1:35 pm
Post subject:
The point of my post, was, in theory: If the CPU hangs on one thread, how would it be able to run the other one then?
Cyan~Fire - Tue May 03, 2005 4:15 pm
Post subject:
He means that if one plugin (which would be in its own thread) deadlocks, it won't deadlock the entire bot, which would be true. But it's quite impractical to have each plugin in its own thread.
Now what would be good is to have each spawn in its own thread.
Maverick - Tue May 03, 2005 5:13 pm
Post subject:
yea, agreed cyan~fire
Cyan~Fire - Tue May 03, 2005 9:20 pm
Post subject:
//////// Multi-threading ////////
DWORD WINAPI ReceiveLoop(LPVOID parameter)
{
Host *h = (Host *)parameter;
UDPPacket packet;
int len, FromLen = sizeof(INADDR);
while (len = recvfrom(h->sid, packet.msg, PACKET_MAX_LENGTH, 0, packet.src.getAddress(), &FromLen))
{
WaitForSingleObject(h->mutex, INFINITE);
packet.len = len;
if (h->validateSource(packet.src))
{
h->gotPacket(packet.msg, packet.len);
if (h->killMe)
{
ReleaseMutex(h->mutex);
break;
}
}
ReleaseMutex(h->mutex);
}
SetEvent(h->done); //any better way of telling when a thread exits?
return 0;
} |
It's working. (Shhh, Ekted, don't criticize my code, it's just a hack for now!)