About cows processes
cow.pl contains these major parts:
command manager
- finds next un-processed command on command table and processes it
message manager
- finds all messages in messages table the user should see and returns them
tick manager
- finds objects that react to tick and add them to the command table
messages adder
- adds new messages to message table
- checks for reacting objects to the key word and adds them to the command table
command adder
- adds new commands to commands table
- proccess oldest cmmand found
userinterface manager
- whole bunch of bits to display html to the user
cow.pl responds to different modes of operation quite independantly:
&m=login A user trying to login
&m=msgr Find al new messages for a user
&m=cmdr Processes oldest unprocessed command and processes it
&m=input Display cmd/say form
&m=textbox Display textbox form or handle results from textbox form post
&m=feedback Display feedback form or handle results from feedback form post
&m=messages Prepare the messages frame (used once)
&m=location prepare location frame (used once)
The sequence of things:
user sends a command like 'get the cat'
1. add it to the commands table
2. run command manager (usually this processes last command 'get the cat')
3. run message manager to find new commands since last call
4. run tick manager
The refeshing top-bar does this:
1. run tick manager
2. find al new messages for the user and retrn them
Optional:
No need for it at present but cow can run the command manager at any time (on a refreshing window) making sure all commands are processed.
All params can be in iether form post of url eg:
&m=input is the same as a <intput type="hidden" name="m" value="input">
If a pid passed, find object with that pid and process all commands for that objects and its location - this is for getting messages and processing user