예제 #1
0
파일: server.py 프로젝트: Try4W/MagicPewPew
 def start_update_loop(self):
     """ Update every server object in main loop and then send object's data to players """
     while self.working:
         self.update_objects()
         json_data_to_send = client_server_tools.pack_patch(self.server_objects)
         # print("Send loop... ")
         for address, connection in self.connections.items():
             messager.send_msg(connection, json_data_to_send)
         time.sleep(0.2)
예제 #2
0
파일: client.py 프로젝트: Try4W/MagicPewPew
 def on_key_pressed(self, key_code):
     messager.send_msg(self.connection, str(key_code))