NexusConnectedClients = []
class Thread1(NexusCore.Thread):
def Run():
global NexusConnectedClients
if(IncomingCommand == "ADDCLIENT"):
NewClientOBJ = [
LastCID,
ClientType,
ClientADDR,
ClientObject,
Args[1],
Args[2],
'{"events":[]}'
]
NexusConnectedClients.append(NewClientOBJ)
elif(IncomingCommand == "LISTCLIENTS"):
SendResponse(NexusConnectedClients)
When i add an client, it is ok. When i read the NexusConnectedClients variable, it is add to the list.
But when i run the LISTCLIENTS function, the list is empty. What is wrong?
I Simplified the code a bit. all the variables are set and all other global variables work as they should.
EDIT
I found the mistake, nothing wrong with this code but another function deleted the element from the NexusConnectedClients array
Solved the problem. Didn’t remove an line of code from previous testing. That line resetted the array