Example #1
0
class Server(ShowBase):

	# Load and setup basic needed things
	def __init__(self):
		args = str(sys.argv)

		if "-window" in args:
			ShowBase.__init__(self)
		else:
			ShowBase.__init__(self, windowType = 'none')

		# Load config
		self.config = Config()

		# Set "global server vars"
		self.isPersistent = False
		self.core = None
		self.gnframework = None
		self.clients = {}

		# Start the default server
		self.startDefaultServer()


		

	def startDefaultServer(self):
		# Stand alone
		#
		print ("Trying to start server... wait...")
		print ("Checking for config...")
		if self.config.hasConfig:
			print ("Config found : GOOD")
			self.start(self.config.MOTD)
			self.isPersistent = self.config.ISPERSISTENT
		else:
			print ("Something is wrong...")
			print ("Running Make Config File ()...")
			self.MakeConfigFile()

			print ("Trying again...")
			self.start(self.config.MOTD)
			self.isPersistent = self.config.ISPERSISTENT

	def MakeConfigFile(self):
		self.config.WritePRCFile()

		## Call to get a server started ##
	def start(self,_motd):
		# Start the basics. Core>protocols, database<,
		self.core = Core(self)
		self.gnframework = GameNetFramework(self)

		self.core.start_all()

	def stop(self):
		pass
Example #2
0
class Server(ShowBase):

    # Load and setup basic needed things
    def __init__(self):
        args = str(sys.argv)

        if "-window" in args:
            ShowBase.__init__(self)
        else:
            ShowBase.__init__(self, windowType='none')

        # Load config
        self.config = Config()

        # Set "global server vars"
        self.isPersistent = False
        self.core = None
        self.gnframework = None
        self.clients = {}

        # Start the default server
        self.startDefaultServer()

    def startDefaultServer(self):
        # Stand alone
        #
        print("Trying to start server... wait...")
        print("Checking for config...")
        if self.config.hasConfig:
            print("Config found : GOOD")
            self.start(self.config.MOTD)
            self.isPersistent = self.config.ISPERSISTENT
        else:
            print("Something is wrong...")
            print("Running Make Config File ()...")
            self.MakeConfigFile()

            print("Trying again...")
            self.start(self.config.MOTD)
            self.isPersistent = self.config.ISPERSISTENT

    def MakeConfigFile(self):
        self.config.WritePRCFile()

        ## Call to get a server started ##
    def start(self, _motd):
        # Start the basics. Core>protocols, database<,
        self.core = Core(self)
        self.gnframework = GameNetFramework(self)

        self.core.start_all()

    def stop(self):
        pass
Example #3
0
    def start(self, _motd):
        # Start the basics. Core>protocols, database<,
        self.core = Core(self)
        self.gnframework = GameNetFramework(self)

        self.core.start_all()
Example #4
0
	def start(self,_motd):
		# Start the basics. Core>protocols, database<,
		self.core = Core(self)
		self.gnframework = GameNetFramework(self)

		self.core.start_all()