view plugins/server/examplePlugin.py @ 99:a647e0e8f520 alpha

Traipse Alpha 'OpenRPG' {090925-00} Traipse is a distribution of OpenRPG that is designed to be easy to setup and go. Traipse also makes it easy for developers to work on code without fear of sacrifice. 'Ornery-Orc' continues the trend of 'Grumpy' and adds fixes to the code. 'Ornery-Orc's main goal is to offer more advanced features and enhance the productivity of the user. Update Summary: 00: Update forwards to the 090909-02 Server code that now works. New default Lobby Map, designed for Traipse. Feel free to change it. Updates to Server GUI: * Admin can Ban from Backend. * Prework to modify Ban List in back end. * Server GUI finds your Lobby Name * New users default as Lurker unless a Role is set New Addition to Chat Die Roll commands. Math Ordering. Ex. [(X+Y)dZ]. Currently does pairs only, no nesting either. Cleaner TraipseSuiteAttention portability and clean up in Main (Beta!) 01: Die Roll Commands addition removed in favor of Core code {090925-00}: Updates to Server GUI: *Admin can Modify Ban List and Un Ban users. New About Dialog. A more uniform About Dialog. 01: Corrects image loading of duplicate images.
author sirebral
date Fri, 25 Sep 2009 20:37:54 -0500
parents 4385a7d0efd1
children
line wrap: on
line source

import os
import sys
from base_plugin import BasePluginClass

class Plugin(BasePluginClass):
    def __init__(self):
        BasePluginClass.__init__(self)

        self.Name = "examplePlugin"
        self.File = __file__
        self.Author = "Dj Gilcrease"
        self.Help = "Help"
        self.InputPriority = -1 # -1 = not used; 99 = priority doesn't matter
                                # Any other number is priority, lowest number
                                # executes first
        self.OutputPriority = -1# -1 = not used; 99 = priority doesn't matter
                                # Any other number is priority, lowest number
                                # executes first
        self.PollPriority = -1  # -1 = not used; 99 = priority doesn't matter
                                # Any other number is priority, lowest number
                                # executes first

    def start(self):
        #Do you DB connection here
        pass

    def stop(self):
        #Close your DB connection here
        pass

    def preParseIncoming(self, xml_dom, data):
        #Do something with the Data or Dom, and return it

        return xml_dom, data

    def postParseIncoming(self, data):
        #Do something with the Data before it gets sent to the room

        return data

    def preParseOutgoing(self):
        #Fetch messages from somewhere that need to be sent out

        return []