fix: admin password root
This commit is contained in:
parent
b87e733ddc
commit
0c6491590e
@ -163,7 +163,7 @@ class SessionStartOperator(bpy.types.Operator):
|
||||
settings = utils.get_preferences()
|
||||
runtime_settings = context.window_manager.session
|
||||
users = bpy.data.window_managers['WinMan'].online_users
|
||||
admin_pass = runtime_settings.password
|
||||
admin_pass = settings.password
|
||||
|
||||
users.clear()
|
||||
deleyables.clear()
|
||||
@ -921,7 +921,6 @@ class SessionPresetServerAdd(bpy.types.Operator):
|
||||
assert(context)
|
||||
|
||||
settings = utils.get_preferences()
|
||||
runtime_settings = context.window_manager.session
|
||||
|
||||
if settings.server_name in settings.server_preset.keys():
|
||||
|
||||
@ -936,7 +935,7 @@ class SessionPresetServerAdd(bpy.types.Operator):
|
||||
new_server.name = settings.server_name
|
||||
new_server.server_ip = settings.ip
|
||||
new_server.server_port = settings.port
|
||||
new_server.server_password = runtime_settings.password
|
||||
new_server.server_password = settings.password
|
||||
|
||||
settings.server_preset_interface = settings.server_name
|
||||
|
||||
@ -979,13 +978,12 @@ class SessionPresetServerOverwrite(bpy.types.Operator):
|
||||
assert(context)
|
||||
|
||||
settings = utils.get_preferences()
|
||||
runtime_settings = context.window_manager.session
|
||||
|
||||
old_server = settings.server_preset.get(settings.server_name)
|
||||
|
||||
old_server.server_ip = settings.ip
|
||||
old_server.server_port = settings.port
|
||||
old_server.server_password = runtime_settings.password
|
||||
old_server.server_password = settings.password
|
||||
|
||||
settings.server_preset_interface = settings.server_name
|
||||
|
||||
|
@ -70,7 +70,6 @@ def update_server_preset_interface(self, context):
|
||||
self.ip = self.server_preset.get(self.server_preset_interface).server_ip
|
||||
self.port = self.server_preset.get(self.server_preset_interface).server_port
|
||||
self.password = self.server_preset.get(self.server_preset_interface).server_password
|
||||
# TODO: do password
|
||||
|
||||
def update_directory(self, context):
|
||||
new_dir = Path(self.cache_directory)
|
||||
@ -173,6 +172,12 @@ class SessionPrefs(bpy.types.AddonPreferences):
|
||||
description="Custom name of the server",
|
||||
default='local host',
|
||||
)
|
||||
password: bpy.props.StringProperty(
|
||||
name="password",
|
||||
default=random_string_digits(),
|
||||
description='Session password',
|
||||
subtype='PASSWORD'
|
||||
)
|
||||
sync_flags: bpy.props.PointerProperty(
|
||||
type=ReplicationFlags
|
||||
)
|
||||
@ -545,12 +550,6 @@ class SessionProps(bpy.types.PropertyGroup):
|
||||
description='Connect as admin',
|
||||
default=False
|
||||
)
|
||||
password: bpy.props.StringProperty(
|
||||
name="password",
|
||||
default=random_string_digits(),
|
||||
description='Session password',
|
||||
subtype='PASSWORD'
|
||||
)
|
||||
internet_ip: bpy.props.StringProperty(
|
||||
name="internet ip",
|
||||
default="no found",
|
||||
|
@ -168,7 +168,7 @@ class SESSION_PT_settings_network(bpy.types.Panel):
|
||||
row.prop(settings, "init_method", text="")
|
||||
row = box.row()
|
||||
row.label(text="Admin password:")
|
||||
row.prop(runtime_settings, "password", text="")
|
||||
row.prop(settings, "password", text="")
|
||||
row = box.row()
|
||||
row.operator("session.start", text="HOST").host = True
|
||||
else:
|
||||
@ -193,7 +193,7 @@ class SESSION_PT_settings_network(bpy.types.Panel):
|
||||
if runtime_settings.admin:
|
||||
row = box.row()
|
||||
row.label(text="Password:")
|
||||
row.prop(runtime_settings, "password", text="")
|
||||
row.prop(settings, "password", text="")
|
||||
row = box.row()
|
||||
row.operator("session.start", text="CONNECT").host = False
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user