MsgCommunicator: Delphi Instant Messaging (IM) SDK
for easy creation of custom messenger system


MsgCommunicator

Brief Memo
Top  Previous  Next


How to start.
Compile Client and Server demos. Run Server on one machine and distribute Client to all users' computers.

Networking.
TCP/IP network of any configuration, UDP protocol. If you need something special, please contact [email protected].
Do not forget to allow local/remote ports in firewalls.

Connecting, Login and Registration.
- Registered user. Set UserID then call Connect or set Connected to True.
- New user. Call Connect then prepare UserInfo (you must set UserName at least) and register new user.
Connection settings can be tuned in ConnectionParams before connecting.
You can add connecting depended specific actions by setting BeforeConnect and/or AfterConnect event handlers.

Connect or RegisterNewUser implicitly calls Logon. You should specify Password property before calling one of these methods. You must be logged to get the full access to the server. If the user is connected but not logged, it is in a guest mode (Connected is set to True, Logged is set to False, UserID is equal to MSG_INVALID_USER_ID default value). In the guest mode, the following commands are available only to enable you to switch to a full access mode and to get some information from the server you possibly need to logon or to register a new user: Logon, RegisterNewUser, IsUserExisting, FindUsers.

Messaging.
- Methods:
   procedure SendMessage(ToUserID: Cardinal; const Text: String); overload;
   procedure SendMessage(ToUserID: Cardinal; Buffer: PChar; Size: Integer); overload;
   procedure SendMessage(ToUserID: Cardinal; Stream: TStream); overload;
   FindMessages - Searches messages in message history (available with a database module only).
- Events:
   OnReceiveTextMessage
   OnReceiveBinaryMessage
   OnReceiveStreamMessage

User details and users database.
- Methods:
RegisterNewUser - Registers new user at server.  
UpdateUserInfo - Changes user details.  
IsUserExisting - Determines if user is already registered at server.  
IsUserOnLine - Determines if user is on-line or off-line now.  
GetUserInfo - Determines if user with specified UserID exists in the server database and gets its details.  
FindUsers - Search for the user/users in the server database by user details (available with a database module only).  

Working with contact list.
- Methods:
AddUserToContacts - Adds new user to contact list of the client (i.e. current user specified by UserID property).  
RemoveUserFromContacts - Removes user from contact list of this client.  
UpdateUserInContact - Removes user from contact list of this client.  
GetContacts - Re-reads contact list from the server.  
- Properties:
ContactCount - Indicates the total number of users in a contact list.  
Contacts - Contains contact list with details of users.  
- Events:
OnUserOnLine - Occurs when user presented in your contact list sets connection to the server.  
OnUserOffLine - Occurs when user presented in your contact list disconnects from the server.  

Custom commands.
To send commands, call SendCommand.
To receive custom commands, set OnReceiveCommand event handler.

Disconnect.
- Methods:
   Disconnect
   DisconnectAll
- Events:
   BeforeDisconnect
   AfterDisconnect
   OnServerShutdown

Writing server application.
See TMsgServer.


© AidAim Software MsgCommunicator: