1 / 13

Stromcode OpenChat

Stromcode OpenChat. Extendable Chat Server Specification + Protocol. Goals. Design a thorough application specification Create a simple communication protocol Implement several advanced, modern application functions XML configuration files Plug-in hosting (DLL)

vadin
Télécharger la présentation

Stromcode OpenChat

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Stromcode OpenChat Extendable Chat Server Specification + Protocol

  2. Goals • Design a thorough application specification • Create a simple communication protocol • Implement several advanced, modern application functions • XML configuration files • Plug-in hosting (DLL) • Cross-platform communication • Version checking • Directory listing • Compact HTTP serving with PHP scripting • To create something I can keep working on

  3. Functionality • XML parsing • MSXML, TinyXML • DTD • Not required

  4. Functionality • PHP • PHP-CLI – no C++ support! • CPHPParser class • PHP.net • Windows pipes • Typically non-intuitive & poorly documented • Win32 | console vs console | console • Use CreatePipe & CreateProcess • Don’t use _popen!

  5. Functionality • More PHP • How to expose program data to external PHP scripts? • Load .php file • Construct array definition string • Push both to PHP-CLI

  6. Functionality • Version Checking • Application opens HTTP connection to version checking server • Application pushes GET data • Version Check server processes GET and returns text • Application parses text for requested data

  7. Functionality • Directory Listing • Not implemented in this version • Similar to Version Checking • Directory server simply adds application supplied information to the database and updates a timestamp

  8. Functionality • Cross-platform Communication • How to terminate a communicated string? • \n • \r • \r\n • Problem: scanning for \n character • Loss of data if not careful • Buffer too long (client pushes too much data before \n)

  9. Functionality: Plug-in Hosting • Plug-ins as objects • DLL exposes functions • CreateObject • Returns pointer to new object • Object created in DLL space! • DestroyObject • Deletes object • Must be done like this because of distinct heaps

  10. Functionality: Plug-in Hosting ////////////////////////////////////////////////////////////////// // CreateClassInstance ////////////////////////////////////////////////////////////////// extern "C" SERVERPLUGIN_API void* CreateClassInstance() { return (void*) (new GDtServerPlugin); } ////////////////////////////////////////////////////////////////// // DeleteClassInstance ////////////////////////////////////////////////////////////////// extern "C" SERVERPLUGIN_API void DeleteClassInstance(GDtServerPluginInterface* obj) { delete obj; }

  11. Functionality: Plug-in Hosting • Memory issues • Heaps • Host • Plug-in • Visual Studio • Returning values • Who deletes it?

  12. Functionality: Plug-in Hosting • Returning values (in depth) • Application function calls member method of plug-in object. • Member method of the plug-in object returns a value. • Function exits. What happens?

  13. The Future • What’s Done • Solid Framework • Easily extendable • Plug-ins, plug-in types, commands and features • What’s Next? • Three new plug-in types • Focus on the client • More protocol commands • Rooms

More Related