Author |
Message |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Sun May 01, 2005 11:19 am Post subject: |
 |
|
|
|
Are you kidding? Multi-threaded plugins would go absolutely insane with synchronization! It would require a re-write of essentially the entire MERVBot code and all existing plugins...
You should really read up on threads and the problems associated with them before you start suggesting their use.  _________________ This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him. |
|
Back to top |
|
 |
Maverick

Age:40 Gender: Joined: Feb 26 2005 Posts: 1521 Location: The Netherlands Offline
|
Posted: Sun May 01, 2005 11:53 am Post subject: |
 |
|
|
|
oooh cool lol
Well I was only thinking about the good sides of threading then of the bad sides ;p
(got kinda sick one plugin can d/c the whole bot lol) _________________
|
|
Back to top |
|
 |
Solo Ace Yeah, I'm in touch with reality...we correspond from time to time.

Age:37 Gender: Joined: Feb 06 2004 Posts: 2583 Location: The Netherlands Offline
|
Posted: Sun May 01, 2005 12:27 pm Post subject: |
 |
|
|
|
Try, and catch. |
|
Back to top |
|
 |
50% Packetloss Server Help Squatter

Age:40 Gender: Joined: Sep 09 2003 Posts: 561 Location: Santa Clarita, California Offline
|
Posted: Sun May 01, 2005 1:04 pm Post subject: |
 |
|
|
|
Just wait until ekted releases powerbot. I'm not sure when that will be though, and the core will probably remain closed-source.
In my opinion, powerbot is far superior to mervbot, just the mysql support will blow your load. The documentation is awesome, plus everything you need is in one header file. |
|
Back to top |
|
 |
Maverick

Age:40 Gender: Joined: Feb 26 2005 Posts: 1521 Location: The Netherlands Offline
|
Posted: Sun May 01, 2005 2:08 pm Post subject: |
 |
|
|
|
neato
(However I would hate to port all my mervbot plugins to powerbot though lol) |
|
Back to top |
|
 |
Maverick

Age:40 Gender: Joined: Feb 26 2005 Posts: 1521 Location: The Netherlands Offline
|
Posted: Mon May 02, 2005 3:17 am Post subject: |
 |
|
|
|
Maverick wrote: | Do you, or anyone else, know if you can specify more then one IP at botsip server.ini setting? (I assume comma seperated if its possible) |
Anyone know? |
|
Back to top |
|
 |
Purge Episode I > Eposide III Jar-Jar is kool

Age:35 Gender: Joined: Sep 08 2004 Posts: 2019 Offline
|
Posted: 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. |
|
Back to top |
|
 |
Maverick

Age:40 Gender: Joined: Feb 26 2005 Posts: 1521 Location: The Netherlands Offline
|
Posted: Mon May 02, 2005 5:35 am Post subject: |
 |
|
|
|
bah, too bad |
|
Back to top |
|
 |
liito-orava Novice

Gender: Joined: Sep 24 2003 Posts: 41 Offline
|
Posted: 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. _________________ "Do you hear that? That is the sound of nobody giving a fuck!"
Wolfix> Lesbian transvestites trapped in man's bodies spanking their monkeys to freq 395 |
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Mon May 02, 2005 12:45 pm Post subject: |
 |
|
|
|
Try and catch? What does that have to do with this? |
|
Back to top |
|
 |
Solo Ace Yeah, I'm in touch with reality...we correspond from time to time.

Age:37 Gender: Joined: Feb 06 2004 Posts: 2583 Location: The Netherlands Offline
|
Posted: 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.  |
|
Back to top |
|
 |
Maverick

Age:40 Gender: Joined: Feb 26 2005 Posts: 1521 Location: The Netherlands Offline
|
Posted: 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). |
|
Back to top |
|
 |
Solo Ace Yeah, I'm in touch with reality...we correspond from time to time.

Age:37 Gender: Joined: Feb 06 2004 Posts: 2583 Location: The Netherlands Offline
|
Posted: 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? |
|
Back to top |
|
 |
D1st0rt Miss Directed Wannabe

Age:37 Gender: Joined: Aug 31 2003 Posts: 2247 Location: Blacksburg, VA Offline
|
Posted: 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? _________________
 |
|
Back to top |
|
 |
Maverick

Age:40 Gender: Joined: Feb 26 2005 Posts: 1521 Location: The Netherlands Offline
|
Posted: Tue May 03, 2005 6:21 am Post subject: |
 |
|
|
|
Exactly |
|
Back to top |
|
 |
Solo Ace Yeah, I'm in touch with reality...we correspond from time to time.

Age:37 Gender: Joined: Feb 06 2004 Posts: 2583 Location: The Netherlands Offline
|
Posted: 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?  |
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: 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. |
|
Back to top |
|
 |
Maverick

Age:40 Gender: Joined: Feb 26 2005 Posts: 1521 Location: The Netherlands Offline
|
Posted: Tue May 03, 2005 5:13 pm Post subject: |
 |
|
|
|
yea, agreed cyan~fire |
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: 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!) |
|
Back to top |
|
 |
|