Package: idewavecore
Welcome!This is framework for creating custom servers. Can be used as foundation for MMO RPG servers, or web servers. Developed and tested on Python 3.6 on Linux.InstallationYou need Python 3.6. To install needed dependencies run next command:pip3 install -r requirements.txtDatabaseFramework contains DB connection builder, that support mysql, postgresql or sqlite. You possible will need to install additional db drivers from dict below:SUPPORTED_DB_DRIVERS={'mysql':('mysqlconnector','pymysql','pyodbc',),'postgresql':('psycopg2','pg8000','pygresql',)}Please find how to install additional db drivers (and how to install and configure db) depending on your platform and operation system.For example, forpsycopg2(Linux Mint) you will need to run next commands:sudo aptitude install libpq-dev python-dev
pip3 install psycopg2Forpg8000(Linux Mint) just run:pip3 install pg8000Please note!Possible you will need to install extra dependencies for this drivers depends on your platform and operation system.How to useimportasynciofromidewavecoreimportAssemblerfromidewavecore.sessionimportStorageif__name__=='__main__':loop=asyncio.get_event_loop()global_storage=Storage()assembler=Assembler(global_storage=global_storage,config_path='settings.yml')servers=assembler.assemble()forserverinservers:server.start()loop.run_until_complete(asyncio.gather(*[server.get()forserverinservers]))try:loop.run_forever()exceptKeyboardInterrupt:passfinally:loop.close()ConfigConfig is main part of application. You will use it to describe all your servers and db connections.Please look intosettings.yml.distfor example. You can use any name for config and also you can split config into multiple.ymlfiles by using!inject <path>custom tag.StoragesFramework use three type of storages: global storage, server storage and session storage. All storages are instances ofStorage.All servers of application connected with global storage. You can modify global storage from any part of your application.Each server has server storage. Basically it use for broadcast.Each connection will generate session storage. This type of storage keep client session info.MiddlewaresEach server use middlewares. It is special function that can access all types of storages.Middlewares can communicate between each other by setting fields inside one of the storages.Framework contains some predefined middlewares that can be used for common purposes. There middlewares for read, write, broadcast, parse http request, for testing and for encrypt (decrypt) data.You can implement own middlewares. To use them all you need is createmiddlewaresdir inside root of your project and use same structure as native middlewares has.To allow framework to recognize if middleware is native or not you will need to addnative.prefix to the path of native middleware. For custom middleware just use its path.GratefulnessI am grateful to all guys who shared their ideas and suggestions, or explained how mmo rpg server works. In particular to Kyoril, sundays and brotalnia. I believe I will extend this list.Also thanks to MANGOS community for great project and for responsiveness.AdditionalSome approaches for my framework I took from my another project with similar namehttps://github.com/sergio-ivanuzzo/idewave-core. But they are not same.DocumentationFor now only README, source code and tests. I will update this section when project's wiki will be ready.