84 posts
Posted 10 September 2012 - 07:02 AM
When I use CC on my server the keys typed is slow ;(
So I type and there is a second delay… I am guessing the way the mod works is that when you type it sends the key to the server and the server sends it back…
This cause's there to be lag between the client and the server when typing!!!
Can we change it?
or add a config option?
2447 posts
Posted 10 September 2012 - 07:55 AM
I'm afraid there is no way round this. All processing is carried out server side - which means telling the clients what they should show on their screen. The process when you type a character when read() is on is as follows:
Client presses key
Key gets picked up by Java
Key gets sent by packet to server
Server Java receives packet
Server Java sends key to server Lua
Server Lua looks at the key, decides it is text and calls term.write()
Server Java sends terminal update packet
Client Java receives, updates the terminal
As you can see, all that is what needs to happen for one key to be processed while read is active - including a round trip with processing time.
84 posts
Posted 10 September 2012 - 11:40 PM
Cant we have it so it shows you the character on your screen while sending the packet to the server.
Like
*Press's A
print's A
send's A to server
receives conformation of A
864 posts
Location
Sometime.
Posted 11 September 2012 - 03:33 AM
Cant we have it so it shows you the character on your screen while sending the packet to the server.
Like
*Press's A
print's A
send's A to server
receives conformation of A
They could but this would be inconvenient because of "ghost characters". Its going to have to stay this way, just look thru the computers on the server. Some have lag programs which are annoying.
84 posts
Posted 11 September 2012 - 07:02 AM
What are ghost characters?
Do you mean characters you have but the server didnt receive? or you mean the server cant sanitize some things if it goes through the client first!
2447 posts
Posted 11 September 2012 - 07:28 AM
What are ghost characters?
Do you mean characters you have but the server didnt receive? or you mean the server cant sanitize some things if it goes through the client first!
How does the client know what the sever is going to do with the key? Sure, if you're using read() it will be displaying it - but what if you're playing worm? If you press w s a or d there you don't want them to show on the screen.
84 posts
Posted 11 September 2012 - 07:30 AM
I see, here is a solution, add a method to the OS that allows the client to know if the key is supposed to be hidden…
2447 posts
Posted 11 September 2012 - 08:35 AM
I see, here is a solution, add a method to the OS that allows the client to know if the key is supposed to be hidden…
That is unreliable. We have no way of knowing where the key should actually be - say I press down, or up while in the shell - it will add a new block of text and set the cursor pos. How would the client know where the new cursor pos was? Due to that very same input lag you mention, if you press a character there, it will get placed at the wrong place.
Now, say we are within edit? If you press down there, the line to write on goes down. How would we predict that client side?
84 posts
Posted 11 September 2012 - 08:54 AM
I see, too many problems to make it worth it