fix: handle connexion error
This commit is contained in:
Submodule multi_user/libs/replication updated: 850456a004...0c28554719
@ -103,33 +103,23 @@ class SessionStartOperator(bpy.types.Operator):
|
|||||||
except TimeoutExpired:
|
except TimeoutExpired:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
client.connect(
|
|
||||||
id=settings.username,
|
|
||||||
address=settings.ip,
|
|
||||||
port=settings.port,
|
|
||||||
ttl_port=settings.ttl_port
|
|
||||||
)
|
|
||||||
|
|
||||||
settings.is_admin = True
|
settings.is_admin = True
|
||||||
else:
|
else:
|
||||||
utils.clean_scene()
|
utils.clean_scene()
|
||||||
|
|
||||||
|
try:
|
||||||
client.connect(
|
client.connect(
|
||||||
id=settings.username,
|
id=settings.username,
|
||||||
address=settings.ip,
|
address=settings.ip,
|
||||||
port=settings.port,
|
port=settings.port,
|
||||||
ttl_port=settings.ttl_port
|
ttl_port=settings.ttl_port
|
||||||
)
|
)
|
||||||
|
except Exception as e:
|
||||||
|
self.report({'ERROR'}, repr(e))
|
||||||
|
logger.error(f"Error: {e}")
|
||||||
|
|
||||||
time.sleep(1)
|
time.sleep(1) # Removed as soon as server will be launched from replication
|
||||||
|
|
||||||
if client.state == 0:
|
|
||||||
settings.is_admin = False
|
|
||||||
self.report(
|
|
||||||
{'ERROR'},
|
|
||||||
"A session is already hosted on this address")
|
|
||||||
return {"CANCELLED"}
|
|
||||||
|
|
||||||
if self.host:
|
if self.host:
|
||||||
for scene in bpy.data.scenes:
|
for scene in bpy.data.scenes:
|
||||||
scene_uuid = client.add(scene)
|
scene_uuid = client.add(scene)
|
||||||
|
Reference in New Issue
Block a user