Refactored telnet code
This commit is contained in:
		
							
								
								
									
										10
									
								
								telnet.lua
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								telnet.lua
									
									
									
									
									
								
							@@ -26,12 +26,12 @@ function startTelnetServer()
 | 
				
			|||||||
	    end)
 | 
						    end)
 | 
				
			||||||
	    c:on("sent", function()        
 | 
						    c:on("sent", function()        
 | 
				
			||||||
		if (#lines > 0) then
 | 
							if (#lines > 0) then
 | 
				
			||||||
		  l1=nil
 | 
							  local line1=nil
 | 
				
			||||||
		  for k,v in pairs(lines) do if (k==1) then l1=v end end
 | 
							  for k,v in pairs(lines) do if (k==1) then line1=v end end
 | 
				
			||||||
		  if (l1 ~= nil) then
 | 
							  if ( line1 ~= nil ) then
 | 
				
			||||||
		   table.remove(lines, 1)
 | 
							   table.remove(lines, 1)
 | 
				
			||||||
                    print( tostring(l1) )
 | 
							   print( tostring(line1) )
 | 
				
			||||||
		    telnetClient:send(l1)
 | 
							   telnetClient:send(line1)
 | 
				
			||||||
		  end
 | 
							  end
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
	    end)
 | 
						    end)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user