OK this as mostly been covered somewhere if so please link me lol
I have a table I want to rename
Client = {}
Client['clientname'] = {
id='',
handle='',
ip=''
}
I want to replace 'clientname' without losing the details in the table, I am using web's sockets demo and trying to convert his multi chat demo to support more like private messages that only get sent to one given user, I really don't understand how hes done it its really confusing me lol
looks like he collects all the in coming messages and the pushs them back out to all the clients, this is good but trying to make it work 1to1 is killing my brain cells lol
What I have done so is the you connect to the server and the server sends back a username request what in the future can be bind to your IP, the client and server send room:user:message:addedswtichs
eg
mainroom:all:hello world:none
this will send the messange to everyone
priavte will be mainroom:james
rivate message:switch
so I need the username to be part of the table I not really sure how to loop thought the table to find the right handle but that is also a option :P
I have a table I want to rename
Client = {}
Client['clientname'] = {
id='',
handle='',
ip=''
}
I want to replace 'clientname' without losing the details in the table, I am using web's sockets demo and trying to convert his multi chat demo to support more like private messages that only get sent to one given user, I really don't understand how hes done it its really confusing me lol
looks like he collects all the in coming messages and the pushs them back out to all the clients, this is good but trying to make it work 1to1 is killing my brain cells lol
What I have done so is the you connect to the server and the server sends back a username request what in the future can be bind to your IP, the client and server send room:user:message:addedswtichs
eg
mainroom:all:hello world:none
this will send the messange to everyone
priavte will be mainroom:james

so I need the username to be part of the table I not really sure how to loop thought the table to find the right handle but that is also a option :P
Comment