From: <dio...@us...> - 2004-06-19 15:28:02
|
Hello, Today I completed programming the New Framework for Node 0.33. A brief = overview of the modifications and the differences with the previous = framework, as well as the OOP structure follows. If you are a developer = or interested in understanding the structure of the new code, please go = through these descriptions at least once before you use the new = framework or go through its source. New OOP Structure The first change regarding the classes structure you will notice when = you load the project is three new classes, clsWS, clsWSArray and = clsActiveServer. The two first classes are not very important for the = new framework, but the third class has a main role. Here is a small = description of these classes: clsWSArray This class represents a WinSock object array with WithEvents support. = While defining an object=20 as this: Private WithEvents MyWinSock() As WinSock would not work, defining it as this Private WithEvents MyWinSock As clsWSArray will now work. This way, a WinSock array object that supports = WithEvents is possible. clsWS This class represents a WinSock control, and is used by the class = clsWSArray to load all the children WinSock objects. The basic usage is = that it will callback methods from clsWSArray when specific WinSock = events are fired, which will then be passed by clsWSArray to the main = program. clsActiveServer This class represents a Server which a user can connect to. Each = server class contains all the basic methods, properties and functions of = IRC networking. Some of them are listed below: HostName: The hostname of the server. Description: The "Display As" property of a server. The string = displayed on the Connect Panel for the server. ConnectTime: If connected, this variable contains the time when the = connection was established (returned in GetTickCount() long format) IRCData: This array was known as txtStatus in the past. It contains = the messages that appear in all channel, private, and status windows of = the certain IRC Server. Tabs: A reference to the respective frmMain.tsTabs control. See below. WinSockConnection: The WinSock connection of the server. See below. TabInfo, TabType: These collections have been moved to = clsActiveServer, as each server has its own Tabs control, its own = channels, private tabs and its own status tab. IRC Procedures: Some procedures related with IRC Networking have been = moved to this class. These are: RealDataArrival_Proxy, RealConnect, and = preExecute, previously defined at frmMain. They are used similary to = their previous usage; the only difference is that calling them will = require the programmer to know the server (obviously, for example, for = RealConnect). These procedures need to know the ActiveServer where the = IRC Networking method should take place, in order to perform their = operations. There are also several other properties and methods specific to each = certain server: SessionPerformFile, DoSessionPerform, bCLSorting, = IPSender, AltNickVal, etc. which have been moved from frmMain to here. Modifications to Node 0.32 Framework ActiveServers: This array defined at mdlNode, contains all the loaded = servers where the user may be connected to. Its type is clsActiveServer. = To get a server's index inside ActiveServers, use the function = GetServerIndexFromActiveServer. DCC Properties: There are many properties for the DCC Files Transfers, = as they are stored as arrays inside the clsActiveServer class. They can = be read by providing the Index of the DCC Transfer and a Boolean value, = indicating whether the transfer is a DCC Send or a DCC Receive (usually = passed with the RCV argument). Some examples: DCCFile_Progress, = DCCFile_StartTime, DCCFile_WinSockIndex, DCCFile_FileName, = DCCTransfer_Speed. All the DCC Chat properties are stored in the same = class, too: DCCChats_WinSockIndex, etc. DCC Methods and Callbacks: There are several methods used to perform = DCC Transfer and Chat operations. Some examples include: = DCCFile_CancelTransfer, DCCChats_Disconnect, etc. All the callbacks that = need to be called by the WinSock objects defined at frmMain are also = included in the new class: DccSend_Connected, DccSend_ConnectionRequest, = DCCTransfer_Accepted and so on. Note that now that the transfer and chat details are stored in DCC = arrays inside each instance of the class clsActiveServer, while the = WinSock objects are defined at frmMain, the WinSockIndex of a transfer = or chat will not equal the DCCIndex of it. To get the WinSock Index from = the DCC Index use the WinSockIndex property of each DCC item. To get the = DCC Index of a WinSock DCC Transfer or Chat use the appropriate methods = defined at clsActiveServer: clsActiveServer.GetDCCFileIndexFromWsIndex = and clsActiveServer.GetDCCChatsIndexFromWsIndex. In case you don't know the clsActiveServer of a transfer use the = following two methods of mdlNode: mdlNode.GetServerFromDCCChatWsIndex = and mdlNode.GetServerFromWsDCCIndex. Get Functions: The several methods defined at mdlNode and frmMain to = get a TabIndex from a ChannelID, the ChannelID from a TabIndex, and so = on have now been moved to the new class, clsActiveServer. Some more = methods have been implemented in order to get the server index from = other known details: mdlNode.GetServerFromBrowser, = GetServerFromDCCChatWsIndex, GetServerFromWsDCCIndex, = GetServerFromWsIrcIndex, GetServerIndexFromActiveServer. Some other get = methods are, again, included in the new class: GetEmptyChannelID, = GetStatusID, GetTabFromNick. wsIdentD, wsNDC, wsDCC, wsDCCSend, wsDCCChat: These controls have been = changed from WinSock Object arrays, to clsWSArray objects, and are only = defined inside the code (unlike the old WinSock controls, which were = defined as Form Controls) WinSockConnection: The wsIRC control is no longer defined at frmMain, = but it has been moved to clsActiveServer, as each server has its own = connection. It is now named clsActiveServer.WinSockConnection. tsTabs: As you will notice, this control rarely appears in the code, = as the Tab control of the current server is usually used: = CurrentActiveServer.Tabs, which is actually a reference to a tsTabs = object. TheServer, TheServerIndex arguments: There arguments that must be = provided in some frmMain procedures require the caller to know the = server. This is required, because all these methods call specific = procedures of one clsActiveServer instance or send commands to the IRC = Server. TheServer argument is of type clsActiveServer, where as = TheServerIndex argument is an index that defined the item from = ActiveServers() to use. The source of the new framework of Node is available for download via = our CVS Repository. Although everything is not fully working while we = are converting the code, the current version will allow you to connect = to one server with the new framework. Before you start using the new = framework from the CVS please refer to the end of this message*. If you = read the descriptions above, you must have noticed that the main purpose = of the new framework is to add mutliple servers support to the program, = so this feature will be added in a few days. If you have questions or = comments about the new framework or generally about the developement of = Node 0.33, don't hesitate to use this mailing list or the Open = Discussion Forums at = http://sourceforge.net/forum/forum.php?forum_id=3D327488. Thank you, dionyziz. * There have been some problems reported with the new framework. As only = the basic things have been converted to the new framework, please do the = following in order to be sure it works for you: - Use regsvr32 to register the component prjNodeMenu.ocx, located at the = folder misc/NodeMenu. The ActiveX has been updated and is necessary if = you want to run the program using the new FrameWork. - Download and copy the files of the skin `Aqua' to the directory = data/Skins. This is the only skin that has been tested with the new = framework. - Before you proceed, disable the Startup with Web Site feature. From = the Options Dialog select Other Options > Misc and uncheck the box = "Startup Web Site" (or set the registry value = "HKEY_CURRENT_USER\Software\VB and VBA Program = Settings\Node\Options\StartAWeb" to "False") - Restore all other settings to their default values. |