feat: connection protocol refactoring

This commit is contained in:
Swann
2020-06-16 00:02:02 +02:00
parent 19946794f6
commit e9029b1414
3 changed files with 10 additions and 1 deletions

View File

@ -117,6 +117,9 @@ class SessionStartOperator(bpy.types.Operator):
# Host a session
if self.host:
for scene in bpy.data.scenes:
client.add(scene)
try:
client.host(
id=settings.username,
@ -136,6 +139,9 @@ class SessionStartOperator(bpy.types.Operator):
utils.clean_scene()
# regular client, no password needed
admin_pass = None
else:
for scene in bpy.data.scenes:
client.add(scene)
try:
client.connect(
id=settings.username,

View File

@ -25,6 +25,7 @@ from .libs.replication.replication.constants import (ADDED, ERROR, FETCHED,
STATE_CONFIG, STATE_SYNCING,
STATE_INITIAL, STATE_SRV_SYNC,
STATE_WAITING, STATE_QUITTING,
STATE_LOBBY,
STATE_LAUNCHING_SERVICES)
ICONS_PROP_STATES = ['TRIA_DOWN', # ADDED
@ -72,6 +73,8 @@ def get_state_str(state):
state_str = 'QUITTING SESSION'
elif state == STATE_LAUNCHING_SERVICES:
state_str = 'LAUNCHING SERVICES'
elif state == STATE_LOBBY:
state_str = 'LOBBY'
return state_str