Skip to content

Commit

Permalink
Merge pull request #301 from jeffreykirchner/dev
Browse files Browse the repository at this point in the history
do not pull replay data
  • Loading branch information
jeffreykirchner authored Jun 10, 2024
2 parents 1954022 + dd52fdd commit c760f9a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion main/consumers/socket_consumer_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ async def connect(self):

result = await sync_to_async(take_handle_dis_connect, thread_sensitive=self.thread_sensitive)(self.player_key, True)

session = await Session.objects.filter(channel_key=room_name).afirst()
session = await Session.objects.only("id").filter(channel_key=room_name).afirst()

#send updated connection status to all users
await self.channel_layer.group_send(
Expand Down
8 changes: 6 additions & 2 deletions main/consumers/staff/session_consumer_mixins/get_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ async def get_session(self, event):
return the session
'''

# time_start = datetime.now()

logger = logging.getLogger(__name__)
logger.info(f"get_session, thread sensitive {self.thread_sensitive}")
#logger.info(f"get_session, thread sensitive {self.thread_sensitive}")

self.connection_uuid = event["message_text"]["session_key"]
self.connection_type = "staff"
Expand All @@ -32,7 +34,7 @@ async def get_session(self, event):
if self.controlling_channel == self.channel_name and result["started"]:
self.world_state_local["timer_history"].append({"time": datetime.now().strftime("%Y-%m-%dT%H:%M:%S.%f"),
"count": 0})
await Session.objects.filter(id=self.session_id).aupdate(world_state=self.world_state_local)
await Session.objects.only("id").filter(id=self.session_id).aupdate(world_state=self.world_state_local)

for p in result["session_players"]:
session_player = result["session_players"][p]
Expand All @@ -51,6 +53,8 @@ async def get_session(self, event):

await self.send_message(message_to_self=result, message_to_group=None,
message_type=event['type'], send_to_client=True, send_to_group=False)

# logger.info(f"get_session, time: {datetime.now() - time_start}")

#local sync functions
def take_get_session(session_key):
Expand Down

0 comments on commit c760f9a

Please sign in to comment.