Turned comms into typeclassed objects.
This commit is contained in:
parent
39b69dcdc2
commit
851e6d00cc
28 changed files with 1000 additions and 291 deletions
|
|
@ -278,11 +278,9 @@ def handle_setup(last_step):
|
|||
for profile in PlayerDB.objects.all():
|
||||
profile.delete()
|
||||
elif last_step + num == 3:
|
||||
from src.comms.models import Channel, PlayerChannelConnection
|
||||
for chan in Channel.objects.all():
|
||||
chan.delete()
|
||||
for conn in PlayerChannelConnection.objects.all():
|
||||
conn.delete()
|
||||
from src.comms.models import ChannelDB, PlayerChannelConnection
|
||||
ChannelDB.objects.all().delete()
|
||||
PlayerChannelConnection.objects.all().delete()
|
||||
raise
|
||||
ServerConfig.objects.conf("last_initial_setup_step", last_step + num + 1)
|
||||
# We got through the entire list. Set last_step to -1 so we don't
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import time
|
|||
from datetime import datetime
|
||||
from django.conf import settings
|
||||
from src.scripts.models import ScriptDB
|
||||
from src.comms.models import Channel
|
||||
from src.comms.models import ChannelDB
|
||||
from src.utils import logger, utils
|
||||
from src.utils.utils import make_iter, to_str
|
||||
from src.commands import cmdhandler, cmdsethandler
|
||||
|
|
@ -143,7 +143,7 @@ class ServerSession(Session):
|
|||
if channel:
|
||||
try:
|
||||
cchan = settings.CHANNEL_CONNECTINFO
|
||||
cchan = Channel.objects.get_channel(cchan[0])
|
||||
cchan = ChannelDB.objects.get_channel(cchan[0])
|
||||
cchan.msg("[%s]: %s" % (cchan.key, message))
|
||||
except Exception:
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue