Files
WLUS/scripts.py
Wesley 5266db0891 Rewrite
Started rewrite on entire server so that the architecture would be more like an actual game engine. The world server is not implemented anymore so only auth will be working for now
2018-06-24 17:09:50 -04:00

27 lines
552 B
Python

import game_types
import threading
class Script():
def __init__(self, parent, script_name :str = "", script_path : str = ""):
self._parent = parent
self._name : str = script_name
self._script_path : str = script_path
def set_path(self, script_path : str):
self._script_path = script_path
def set_name(self, name):
self._name = name
def get_name(self):
return self._name
def get_parent(self):
return self._parent
def run(self):
script_file = open(self._script_path, 'r')
script_str = script_file.read()
exec(script_str)