Notes on norms server and DLL....

The server app is named proxy.exe
when first launched it will auto configure for
port 2003. If you desire a dif port,
select the shutdown option from the menu.
Then select the configure option and port.
Enter any port desired. This will be saved into 
an ini file for later use. You may wish to repeat
this for the buffer size.... Allow about 10 bytes per
expected user as a minimum. The server will use that
space for relaying the names of all users to clients.

Server Message Formats
the first 6 letters are reserved for the server use.
1   - always chr(147) to flag valid data
2/4 - Room number
5 - targeted user number for message
6   - message type (the server uses capitol letters)

setting (5) to "0" would broadcast message to all users.
in the room. "9" is from the server
message types

C server assumes a chat message.
D commands server to disconnect the targeted user.
  WARNING sending a "0000D" will disconnect all users
  except the sender(password protected)
N if sent to the server, informs the server of your name
  From the server indicates a player list has arived
  Player Names are limited to 8 characters
Q BBBBXXXXXX send binary data unformatted
  B= number of bytes of data includeing the server header
  BBBB is ascii chars to represent number of bytes
  X = data upto max buffer size
R informs server of text data not intended for viewing

T request user count and bandwidth information
  the return data is in this format
  9999TXXXXBBBBBBBBBBBBBBBBBBBBBB
  9999T=here is the data
  XXXX=user count
  BBBBBBB can be of any length
  and is the "typical" bandwidth usage in KBPM
++++++++++++++++++++++++++++++++++++++++++++
special messages
These are password protected in this format
KPPPPPPPPXXXXXXXXXXXXXXXXXXXXX
where K=message type and pppppppp=password and X=other data

BPPPPPPPPXXXX change buffer size to XXXX
DPPPPPPPP     disconnect all users.
SPPPPPPPP     restart server (will disconnect all users)
PPPPPPPPPXXXX Change Port usage for next restart
WPPPPPPPPXXXXXXXX change password to XXXXXXXX
              If something is not right, the server will
              send a chat message
Player List Format:
|rrr9Nrrrxyournamerrrxyournamerrrxyourname

|rrr9=message from server
N=player list follows
rrrx=player ID number determined by server.
   WARNING this number may change during program run.
yourname= 8 letters or spaces for each player name.
rrr=room number. Use rrrx to refrence a user.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++
the DLL
Functions:

>>>>>>>>>>>>>
PrepLibrary - no parameters, returns a long integer
Call this function first or the DLL will crash.
returns a non zero if no errors

>>>>>>>>>>>>>
ConnectToProxy(*ISP,port,size,*name,room) returns a long integer
port and size are integers.
*ISP is a pointer to a string holding ISP address of proxy
port is the port used by the server
size is the buffer size used by the server
*name is a pointer to a name string that this client
      will log in with.
room is desired room to log in to
this function will attempt to connect to the server.
Upon connection will send a message to the server:
      |RR99Nyourname

function returns a 1 on success

>>>>>>>>>>>>
SendData(*mem,size) no return value
*mem is a memory buffer containing data
size is the size of the data to send

>>>>>>>>>>>>
CheckData(*mem,size) return value is how much data returned
*mem is a memory buffer to store the data
size is how large the buffer
if the return value=size, you will need to check the data
again to ensure that all data was recieved
A value of 0 indicates no data

>>>>>>>>>>>>
CloseConnection - no parameters, no return value
closes the connection with the server

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
if using this DLL with DB or DBPro

the easiest method to handle pointers is with
MEMBLOCK commands. DB can provide the address of the
memblock and you simply provide that to the DLL.

You could probably get away with using strings too, if you are carefull, but thats not recomended.

Modifications NOV262003

Added support for up to 9999 users. Server is user 9999.

Added more error message reporting for if a connection
failes to go through (in the DLL)
 
Added norms about box function in DLL.....
undocumented feature :)

Modifications 01Dec2003
devided user ID into room/user
4205 indicates user 05 in room 42.

player lists are only updated for users in current room

Added TProxy.exe
this tool can be used to test the proxy.
Both the TProxy and Proxy look the same and work the same way.... they both show all received chat data.
Use this tool to connect to the proxy to validate its working.

02Dec2003
Add DBPro source code to demonstrate Lib usage.

09Dec2003
Added menu options to the server to prepare for bandwidth
monitoring. Not fully implimented. I can't decide exactly
how to handle excessive usage over desired BW...