Compare commits
9 Commits
231-server
...
234-user-i
Author | SHA1 | Date | |
---|---|---|---|
de9255f71c | |||
99528ea3e0 | |||
bb342951a5 | |||
438a79177b | |||
08fc49c40f | |||
d7e25b1192 | |||
1671422143 | |||
a9620c0752 | |||
583beaf6fe |
@ -212,14 +212,14 @@ You can run the dedicated server on any platform by following these steps:
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
replication.server
|
replication.serve
|
||||||
|
|
||||||
.. hint::
|
.. hint::
|
||||||
You can also specify a custom **port** (-p), **timeout** (-t), **admin password** (-pwd), **log level (ERROR, WARNING, INFO or DEBUG)** (-l) and **log file** (-lf) with the following optional arguments
|
You can also specify a custom **port** (-p), **timeout** (-t), **admin password** (-pwd), **log level (ERROR, WARNING, INFO or DEBUG)** (-l) and **log file** (-lf) with the following optional arguments
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
replication.server -p 5555 -pwd admin -t 5000 -l INFO -lf server.log
|
replication.serve -p 5555 -pwd admin -t 5000 -l INFO -lf server.log
|
||||||
|
|
||||||
Here, for example, a server is instantiated on port 5555, with password 'admin', a 5 second timeout, and logging enabled.
|
Here, for example, a server is instantiated on port 5555, with password 'admin', a 5 second timeout, and logging enabled.
|
||||||
|
|
||||||
@ -562,7 +562,7 @@ The default Docker image essentially runs the equivalent of:
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
replication.server -pwd admin -p 5555 -t 5000 -l DEBUG -lf multiuser_server.log
|
replication.serve -pwd admin -p 5555 -t 5000 -l DEBUG -lf multiuser_server.log
|
||||||
|
|
||||||
This means the server will be launched with 'admin' as the administrator password, run on ports 5555:5558, use a timeout of 5 seconds, verbose 'DEBUG' log level, and with log files written to 'multiuser_server.log'. See :ref:`cmd-line` for a description of optional parameters.
|
This means the server will be launched with 'admin' as the administrator password, run on ports 5555:5558, use a timeout of 5 seconds, verbose 'DEBUG' log level, and with log files written to 'multiuser_server.log'. See :ref:`cmd-line` for a description of optional parameters.
|
||||||
|
|
||||||
@ -572,7 +572,7 @@ For example, I would like to launch my server with a different administrator pas
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
python3 -m replication.server -pwd supersecretpassword -p 5555 -t 3000 -l DEBUG -lf logname.log
|
replication.serve -pwd supersecretpassword -p 5555 -t 3000 -l DEBUG -lf logname.log
|
||||||
|
|
||||||
Now, my configuration should look like this:
|
Now, my configuration should look like this:
|
||||||
|
|
||||||
@ -691,7 +691,7 @@ We're finally ready to launch the server. Simply run:
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
python3 -m replication.server -p 5555 -pwd admin -t 5000 -l INFO -lf server.log
|
replication.serve -p 5555 -pwd admin -t 5000 -l INFO -lf server.log
|
||||||
|
|
||||||
See :ref:`cmd-line` for a description of optional parameters
|
See :ref:`cmd-line` for a description of optional parameters
|
||||||
|
|
||||||
|
@ -374,9 +374,9 @@ class SessionPrefs(bpy.types.AddonPreferences):
|
|||||||
description="sidebar_advanced_log_expanded",
|
description="sidebar_advanced_log_expanded",
|
||||||
default=False
|
default=False
|
||||||
)
|
)
|
||||||
sidebar_advanced_hosting_expanded: bpy.props.BoolProperty(
|
sidebar_advanced_uinfo_expanded: bpy.props.BoolProperty(
|
||||||
name="sidebar_advanced_hosting_expanded",
|
name="sidebar_advanced_uinfo_expanded",
|
||||||
description="sidebar_advanced_hosting_expanded",
|
description="sidebar_advanced_uinfo_expanded",
|
||||||
default=False
|
default=False
|
||||||
)
|
)
|
||||||
sidebar_advanced_net_expanded: bpy.props.BoolProperty(
|
sidebar_advanced_net_expanded: bpy.props.BoolProperty(
|
||||||
|
115
multi_user/ui.py
115
multi_user/ui.py
@ -149,10 +149,8 @@ class SESSION_PT_settings(bpy.types.Panel):
|
|||||||
col.template_list("SESSION_UL_network", "", settings, "server_preset", context.window_manager, "server_index")
|
col.template_list("SESSION_UL_network", "", settings, "server_preset", context.window_manager, "server_index")
|
||||||
col.separator()
|
col.separator()
|
||||||
connectOp = col.row()
|
connectOp = col.row()
|
||||||
connectOp.operator("session.host", text="Host")
|
connectOp.enabled =is_server_selected
|
||||||
connectopcol = connectOp.column()
|
connectOp.operator("session.connect", text="Connect")
|
||||||
connectopcol.enabled =is_server_selected
|
|
||||||
connectopcol.operator("session.connect", text="Connect")
|
|
||||||
|
|
||||||
col = row.column(align=True)
|
col = row.column(align=True)
|
||||||
col.operator("session.preset_server_add", icon="ADD", text="") # TODO : add conditions (need a name, etc..)
|
col.operator("session.preset_server_add", icon="ADD", text="") # TODO : add conditions (need a name, etc..)
|
||||||
@ -173,11 +171,17 @@ class SESSION_PT_settings(bpy.types.Panel):
|
|||||||
info_msg = None
|
info_msg = None
|
||||||
|
|
||||||
if current_state == STATE_LOBBY:
|
if current_state == STATE_LOBBY:
|
||||||
|
usr = session.online_users.get(settings.username)
|
||||||
row= layout.row()
|
row= layout.row()
|
||||||
info_msg = "Waiting for the session to start."
|
info_msg = "Waiting for the session to start."
|
||||||
|
if usr and usr['admin']:
|
||||||
if info_msg:
|
info_msg = "Init the session to start."
|
||||||
info_box = row.box()
|
info_box = layout.row()
|
||||||
|
info_box.label(text=info_msg,icon='INFO')
|
||||||
|
init_row = layout.row()
|
||||||
|
init_row.operator("session.init", icon='TOOL_SETTINGS', text="Init")
|
||||||
|
else:
|
||||||
|
info_box = layout.row()
|
||||||
info_box.row().label(text=info_msg,icon='INFO')
|
info_box.row().label(text=info_msg,icon='INFO')
|
||||||
|
|
||||||
# PROGRESS BAR
|
# PROGRESS BAR
|
||||||
@ -192,10 +196,57 @@ class SESSION_PT_settings(bpy.types.Panel):
|
|||||||
length=16
|
length=16
|
||||||
))
|
))
|
||||||
|
|
||||||
|
class SESSION_PT_host_settings(bpy.types.Panel):
|
||||||
|
bl_idname = "MULTIUSER_SETTINGS_HOST_PT_panel"
|
||||||
|
bl_label = "Hosting"
|
||||||
|
bl_space_type = 'VIEW_3D'
|
||||||
|
bl_region_type = 'UI'
|
||||||
|
bl_parent_id = 'MULTIUSER_SETTINGS_PT_panel'
|
||||||
|
bl_options = {'DEFAULT_CLOSED'}
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def poll(cls, context):
|
||||||
|
settings = get_preferences()
|
||||||
|
return not session \
|
||||||
|
or (session and session.state == 0) \
|
||||||
|
and not settings.sidebar_advanced_shown \
|
||||||
|
and not settings.is_first_launch
|
||||||
|
|
||||||
|
def draw_header(self, context):
|
||||||
|
self.layout.label(text="", icon='NETWORK_DRIVE')
|
||||||
|
|
||||||
|
def draw(self, context):
|
||||||
|
layout = self.layout
|
||||||
|
settings = get_preferences()
|
||||||
|
|
||||||
|
#HOST
|
||||||
|
host_selection = layout.row().box()
|
||||||
|
host_selection_row = host_selection.row()
|
||||||
|
host_selection_row.label(text="Init the session from:")
|
||||||
|
host_selection_row.prop(settings, "init_method", text="")
|
||||||
|
host_selection_row = host_selection.row()
|
||||||
|
host_selection_row.label(text="Port:")
|
||||||
|
host_selection_row.prop(settings, "host_port", text="")
|
||||||
|
host_selection_row = host_selection.row()
|
||||||
|
host_selection_col = host_selection_row.column()
|
||||||
|
host_selection_col.prop(settings, "host_use_server_password", text="Server password:")
|
||||||
|
host_selection_col = host_selection_row.column()
|
||||||
|
host_selection_col.enabled = True if settings.host_use_server_password else False
|
||||||
|
host_selection_col.prop(settings, "host_server_password", text="")
|
||||||
|
host_selection_row = host_selection.row()
|
||||||
|
host_selection_col = host_selection_row.column()
|
||||||
|
host_selection_col.prop(settings, "host_use_admin_password", text="Admin password:")
|
||||||
|
host_selection_col = host_selection_row.column()
|
||||||
|
host_selection_col.enabled = True if settings.host_use_admin_password else False
|
||||||
|
host_selection_col.prop(settings, "host_admin_password", text="")
|
||||||
|
|
||||||
|
host_selection = layout.column()
|
||||||
|
host_selection.operator("session.host", text="Host")
|
||||||
|
|
||||||
|
|
||||||
class SESSION_PT_advanced_settings(bpy.types.Panel):
|
class SESSION_PT_advanced_settings(bpy.types.Panel):
|
||||||
bl_idname = "MULTIUSER_SETTINGS_REPLICATION_PT_panel"
|
bl_idname = "MULTIUSER_SETTINGS_REPLICATION_PT_panel"
|
||||||
bl_label = "Advanced"
|
bl_label = "General Settings"
|
||||||
bl_space_type = 'VIEW_3D'
|
bl_space_type = 'VIEW_3D'
|
||||||
bl_region_type = 'UI'
|
bl_region_type = 'UI'
|
||||||
bl_parent_id = 'MULTIUSER_SETTINGS_PT_panel'
|
bl_parent_id = 'MULTIUSER_SETTINGS_PT_panel'
|
||||||
@ -216,30 +267,19 @@ class SESSION_PT_advanced_settings(bpy.types.Panel):
|
|||||||
layout = self.layout
|
layout = self.layout
|
||||||
settings = get_preferences()
|
settings = get_preferences()
|
||||||
|
|
||||||
#ADVANCED HOST
|
#ADVANCED USER INFO
|
||||||
host_selection = layout.row().box()
|
uinfo_section = layout.row().box()
|
||||||
host_selection.prop(
|
uinfo_section.prop(
|
||||||
settings, "sidebar_advanced_hosting_expanded", text="Hosting",
|
settings,
|
||||||
icon=get_expanded_icon(settings.sidebar_advanced_hosting_expanded),
|
"sidebar_advanced_uinfo_expanded",
|
||||||
|
text="User Info",
|
||||||
|
icon=get_expanded_icon(settings.sidebar_advanced_uinfo_expanded),
|
||||||
emboss=False)
|
emboss=False)
|
||||||
if settings.sidebar_advanced_hosting_expanded:
|
if settings.sidebar_advanced_uinfo_expanded:
|
||||||
host_selection_row = host_selection.row()
|
uinfo_section_row = uinfo_section.row()
|
||||||
host_selection_row.prop(settings, "host_port", text="Port:")
|
uinfo_section_split = uinfo_section_row.split(factor=0.7, align=True)
|
||||||
host_selection_row = host_selection.row()
|
uinfo_section_split.prop(settings, "username", text="")
|
||||||
host_selection_row.label(text="Init the session from:")
|
uinfo_section_split.prop(settings, "client_color", text="")
|
||||||
host_selection_row.prop(settings, "init_method", text="")
|
|
||||||
host_selection_row = host_selection.row()
|
|
||||||
host_selection_col = host_selection_row.column()
|
|
||||||
host_selection_col.prop(settings, "host_use_server_password", text="Server password:")
|
|
||||||
host_selection_col = host_selection_row.column()
|
|
||||||
host_selection_col.enabled = True if settings.host_use_server_password else False
|
|
||||||
host_selection_col.prop(settings, "host_server_password", text="")
|
|
||||||
host_selection_row = host_selection.row()
|
|
||||||
host_selection_col = host_selection_row.column()
|
|
||||||
host_selection_col.prop(settings, "host_use_admin_password", text="Admin password:")
|
|
||||||
host_selection_col = host_selection_row.column()
|
|
||||||
host_selection_col.enabled = True if settings.host_use_admin_password else False
|
|
||||||
host_selection_col.prop(settings, "host_admin_password", text="")
|
|
||||||
|
|
||||||
#ADVANCED NET
|
#ADVANCED NET
|
||||||
net_section = layout.row().box()
|
net_section = layout.row().box()
|
||||||
@ -543,8 +583,7 @@ class SESSION_PT_repository(bpy.types.Panel):
|
|||||||
admin = usr['admin']
|
admin = usr['admin']
|
||||||
return hasattr(context.window_manager, 'session') and \
|
return hasattr(context.window_manager, 'session') and \
|
||||||
session and \
|
session and \
|
||||||
(session.state == STATE_ACTIVE or \
|
session.state == STATE_ACTIVE and \
|
||||||
session.state == STATE_LOBBY and admin) and \
|
|
||||||
not settings.sidebar_repository_shown
|
not settings.sidebar_repository_shown
|
||||||
|
|
||||||
def draw_header(self, context):
|
def draw_header(self, context):
|
||||||
@ -590,12 +629,6 @@ class SESSION_PT_repository(bpy.types.Panel):
|
|||||||
else:
|
else:
|
||||||
layout.row().label(text="Empty")
|
layout.row().label(text="Empty")
|
||||||
|
|
||||||
elif session.state == STATE_LOBBY and usr and usr['admin']:
|
|
||||||
row = layout.row()
|
|
||||||
row.operator("session.init", icon='TOOL_SETTINGS', text="Init")
|
|
||||||
else:
|
|
||||||
row = layout.row()
|
|
||||||
row.label(text="Waiting to start")
|
|
||||||
|
|
||||||
class VIEW3D_PT_overlay_session(bpy.types.Panel):
|
class VIEW3D_PT_overlay_session(bpy.types.Panel):
|
||||||
bl_space_type = 'VIEW_3D'
|
bl_space_type = 'VIEW_3D'
|
||||||
@ -614,6 +647,9 @@ class VIEW3D_PT_overlay_session(bpy.types.Panel):
|
|||||||
pref = get_preferences()
|
pref = get_preferences()
|
||||||
layout.active = settings.enable_presence
|
layout.active = settings.enable_presence
|
||||||
|
|
||||||
|
row = layout.row()
|
||||||
|
row.prop(settings, "enable_presence",text="Presence Overlay")
|
||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.prop(settings, "presence_show_selected",text="Selected Objects")
|
row.prop(settings, "presence_show_selected",text="Selected Objects")
|
||||||
|
|
||||||
@ -667,6 +703,7 @@ classes = (
|
|||||||
SESSION_UL_users,
|
SESSION_UL_users,
|
||||||
SESSION_UL_network,
|
SESSION_UL_network,
|
||||||
SESSION_PT_settings,
|
SESSION_PT_settings,
|
||||||
|
SESSION_PT_host_settings,
|
||||||
SESSION_PT_advanced_settings,
|
SESSION_PT_advanced_settings,
|
||||||
SESSION_PT_user,
|
SESSION_PT_user,
|
||||||
SESSION_PT_sync,
|
SESSION_PT_sync,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# Download base image debian jessie
|
# Download base image debian jessie
|
||||||
FROM python:slim
|
FROM python:slim
|
||||||
|
|
||||||
ARG replication_version=0.1.13
|
ARG replication_version=0.9.1
|
||||||
ARG version=0.1.1
|
ARG version=0.1.1
|
||||||
|
|
||||||
# Infos
|
# Infos
|
||||||
@ -22,4 +22,4 @@ RUN pip install replication==$replication_version
|
|||||||
|
|
||||||
# Run the server with parameters
|
# Run the server with parameters
|
||||||
ENTRYPOINT ["/bin/sh", "-c"]
|
ENTRYPOINT ["/bin/sh", "-c"]
|
||||||
CMD ["python3 -m replication.server -pwd ${password} -p ${port} -t ${timeout} -l ${log_level} -lf ${log_file}"]
|
CMD ["replication.serve -apwd ${password} -spwd '' -p ${port} -t ${timeout} -l ${log_level} -lf ${log_file}"]
|
Reference in New Issue
Block a user