clean: remove unused vars from operator.py
doc: carry on hosting guide
This commit is contained in:
@ -29,7 +29,8 @@ In order grant server access to people from internet you have tow main option:
|
|||||||
Using a connection sharing solution
|
Using a connection sharing solution
|
||||||
-----------------------------------
|
-----------------------------------
|
||||||
|
|
||||||
1. Simple: use a third party software like `HAMACHI <https://vpn.net/>`_ (Free until 5 users) or `ZEROTIER <https://www.zerotier.com/download/>`_ to handle network sharing.
|
Many different third party software like `ZEROTIER <https://www.zerotier.com/download/>`_ (Free) or `HAMACHI <https://vpn.net/>`_ (Free until 5 users) allow you to share your private network with other peole.
|
||||||
|
For the example I'm gonna use ZeroTier because it (free and open soure).
|
||||||
|
|
||||||
.. _port-forwarding:
|
.. _port-forwarding:
|
||||||
|
|
||||||
|
Submodule multi_user/libs/replication updated: 7f9d5bfc3f...d24f92f786
@ -43,10 +43,8 @@ from .libs.replication.replication.interface import Session
|
|||||||
|
|
||||||
client = None
|
client = None
|
||||||
delayables = []
|
delayables = []
|
||||||
ui_context = None
|
|
||||||
stop_modal_executor = False
|
stop_modal_executor = False
|
||||||
modal_executor_queue = None
|
modal_executor_queue = None
|
||||||
server_process = None
|
|
||||||
|
|
||||||
|
|
||||||
def unregister_delayables():
|
def unregister_delayables():
|
||||||
@ -75,19 +73,19 @@ class SessionStartOperator(bpy.types.Operator):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
global client, delayables, ui_context, server_process
|
global client, delayables
|
||||||
|
|
||||||
settings = utils.get_preferences()
|
settings = utils.get_preferences()
|
||||||
runtime_settings = context.window_manager.session
|
runtime_settings = context.window_manager.session
|
||||||
users = bpy.data.window_managers['WinMan'].online_users
|
users = bpy.data.window_managers['WinMan'].online_users
|
||||||
admin_pass = runtime_settings.password
|
admin_pass = runtime_settings.password
|
||||||
|
|
||||||
# TODO: Sync server clients
|
unregister_delayables()
|
||||||
users.clear()
|
users.clear()
|
||||||
delayables.clear()
|
delayables.clear()
|
||||||
|
client = None
|
||||||
bpy_factory = ReplicatedDataFactory()
|
bpy_factory = ReplicatedDataFactory()
|
||||||
supported_bl_types = []
|
supported_bl_types = []
|
||||||
ui_context = context.copy()
|
|
||||||
|
|
||||||
# init the factory with supported types
|
# init the factory with supported types
|
||||||
for type in bl_types.types_to_register():
|
for type in bl_types.types_to_register():
|
||||||
@ -107,9 +105,10 @@ class SessionStartOperator(bpy.types.Operator):
|
|||||||
automatic=type_local_config.auto_push)
|
automatic=type_local_config.auto_push)
|
||||||
|
|
||||||
if type_local_config.bl_delay_apply > 0:
|
if type_local_config.bl_delay_apply > 0:
|
||||||
delayables.append(delayable.ApplyTimer(
|
delayables.append(
|
||||||
timout=type_local_config.bl_delay_apply,
|
delayable.ApplyTimer(
|
||||||
target_type=type_module_class))
|
timout=type_local_config.bl_delay_apply,
|
||||||
|
target_type=type_module_class))
|
||||||
|
|
||||||
client = Session(
|
client = Session(
|
||||||
factory=bpy_factory,
|
factory=bpy_factory,
|
||||||
@ -152,8 +151,8 @@ class SessionStartOperator(bpy.types.Operator):
|
|||||||
password=admin_pass
|
password=admin_pass
|
||||||
)
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.report({'ERROR'}, repr(e))
|
self.report({'ERROR'}, str(e))
|
||||||
logging.error(f"Error: {e}")
|
logging.error(str(e))
|
||||||
|
|
||||||
# Background client updates service
|
# Background client updates service
|
||||||
#TODO: Refactoring
|
#TODO: Refactoring
|
||||||
@ -238,8 +237,6 @@ class SessionStopOperator(bpy.types.Operator):
|
|||||||
client.disconnect()
|
client.disconnect()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.report({'ERROR'}, repr(e))
|
self.report({'ERROR'}, repr(e))
|
||||||
except zmq.ZMQError:
|
|
||||||
self.report("A client is already connected (Could be a bug). \n Retry after closing any blender instance from your task manager.")
|
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user