Server Help

Bot Questions - Bot with usergroups, users can send group-wide ?messages

Jason - Mon Aug 09, 2004 7:33 pm
Post subject: Bot with usergroups, users can send group-wide ?messages
First of all, yes I am aware that Rifleman has already written Message_Bot, which does exactly what I'm proposing. I'd like to try this project out for myself though, use it as a learning experience.

I'm going to write it in Java. Obviously, before I start writing code, I want to put together a plan of attack. I've got most of my plan in place, but I have one question for you fellas. What do you think would be the best type of Collection to use to store the actual messages? The major thing is I want to maximize overall efficiency.
Mr Ekted - Mon Aug 09, 2004 8:09 pm
Post subject:
More info please.

Are you going to write your own bot from scratch? Are you going to use TWCore? When you say maximize efficiency, do you mean make it as fast as possible? Use the least amount of memory?
Jason - Mon Aug 09, 2004 9:23 pm
Post subject:
I'm going to use TWCore because it'll allow me to get the bot written faster than if I started from scratch. And I'm also not familiar enough with the Continuum protocol to do it from scratch.

When I say efficiency, I'd like to use the least amount of memory as possible, whilst not comprising speed, and by speed I mean response time to the user. I don't want a user to send a command to the bot and then have to sit and wait an undesirably long time to get something back.

EDIT: Speaking of not being very familiar with the Continuum protocol, where would one go to learn more about it, i.e. - the packet definitions and such?
Mr Ekted - Mon Aug 09, 2004 10:03 pm
Post subject:
I don't know if "Collection" is some Java term, but in general I would simply use an array of structures where the structure contains group name and player name. When a command comes in, walk to array. If the group name matches, issue the message. Of course, you can only do one ?message per player from a given player/bot, so I'm not sure how useful this system is.

If you wanted to get fancier, you could have an array/list of group structures, with an array/list or player name structures hanging off that. Would be a hair less memory, but I when you are talking about a few K, I don't think it's that important.

If you can understand C/C++, the MERV source is an implementation of the protocol.
D1st0rt - Tue Aug 10, 2004 7:25 pm
Post subject:
Heres one I like to use:
http://explody.ssihosting.com/misc/fpl/fpl.txt
It lists all of the packets, and a bunch of other useful stuff
Bak - Tue Aug 10, 2004 10:39 pm
Post subject:
any normal data structure you use will appear to work instantly save the connection time.

So Vector and LinkedList will both achive what you want.
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group