
The bionet SDK 2 has been extended so that you may also write client side plugins.
These client plugins may connect with server plugins and send/recieve data.


Server Plugins.

Server plugins are written as dll files.
They are loaded into the remote server by the bionet client.
These dll files are dynamically loaded and event procedures are called by the server.



Server PLugin Events
--------------------------


 -> procedure OnConnected                            - called when the server opens its ports
 -> procedure OnDisconnect                           - called when the server closes its ports

 -> function  OnICQ (uin : pchar) : word             - called before ICQ notify is sent to the uin
                                                       return zero to allow the server to send the ICQ pager
                                                       if the result is nonzero the server wont send the pager

 the IP is in standard dotted notation XXX.XXX.XXX.XXX

 -> function  OnClientAttatch (IP : pchar) : word    - called when a client connects to the server
                                                       return zero to allow the client to connect
                                                       a value of non zero will disconnect and refuse the client.

 -> procedure OnActivatePlugin                       - called when plugin is activated 
 -> procedure OnDeactivatePlugin                     - called when plugin is deactivated



 -> GetPluginIdent         - called to retrieve a unique string used for conencting to a client plugin
                             both the server and client must return the same string.
                             when the client plugin calls SendData the data will be sent to the server plugin
                             with the same ID


 -> OnRecieveData(Data : pointer; size : integer): pchar;

    - this is called when a client plugin calls "SendData"
      All the recieved data will be stored in the "Data" pointer.

      return zero if you do not wish to send any data back to the client.
      Otherwise you may return a null terminated string of data and it will be
      sent to the client.

--------------------------------------------------------------------------------------------------------


Client Plugins..
 
 Client plugins are also written as dll files. These also have their own seperate events
 that are called by the client. These plugins must be saved in the plugin folder.
 e.g if bionet.exe is in c:\bionet\ the plugins must be in c:\bionet\plugins\
 Client Plugins also have access to the BNPLUG.DLL this contains functions for sending data
 to the server. A Delphi unit is included for using the functions.

 When writing a client/server plugin they need to be able to talk to each other.
 This is done by having a unique ID that both the client and server share.
 The function "GetPluginIdent" must return this ID.


 Client Plugin Events..
------------------------

 all client plugins must be stored in the bionet_main_path_folder\plugins\
 
  -> procedure OnActivateClientPlugin   - called when the bionet client deactivates the plugin
  -> procedure OnDeactivateClientPlugin - called when the bionet client activates the plugin
  -> function  GetPluginIdent : pchar   - called to retrieve a unique string used for conencting to a client plugin to a
                                          server plugin.
                                          both the server and client must return the same string.
                                          when the client plugin calls SendData the data will be sent to the server plugin
                                          with the same IDent

  -> procedure OnRecieveClientData(RemoteIP : pchar;  RemotePort , LocalListenPort : integer; Data : pointer ; DataSize : integer);

     When a server plugin sends data back to a client plugin this even will be called once all
     of the data is recieved.
  
    the IP is in standard dotted notation XXX.XXX.XXX.XXX
    
  -> OnLoggedOnToServer(TargetIP : pchar() ;  TargetPort , LocalPort : integer );



Client BNPLUG.DLL functions


  the IP is in standard dotted notation XXX.XXX.XXX.XXX
procedure SendDataEX(TargetIP : pchar; TargetPort  : word; TargetID : pchar ; ReplyPort : word;
                      Data : pointer; size : integer  ); stdcall;

  - Use SendDataEX to send data to a server plugin.
    The ID is the Identifier of the server which is defined by
    the "GetPluginIdent" function in the server.

    See the "OnLoggedOnToServer" event for obtaining the Server IP and
    port numbers.




