|  | @@ -420,40 +420,6 @@ class Game(protocol.Protocol):
 | 
	
		
			
				|  |  |          self.transport.loseConnection()
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -class GlueFactory(protocol.ClientFactory):
 | 
	
		
			
				|  |  | -    # class GlueFactory(protocol.Factory):
 | 
	
		
			
				|  |  | -    maxDelay = 10
 | 
	
		
			
				|  |  | -    protocol = Game
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -    def __init__(self, player: Player):
 | 
	
		
			
				|  |  | -        self.player = player
 | 
	
		
			
				|  |  | -        self.queue_player = player.queue_player
 | 
	
		
			
				|  |  | -        self.queue_game = player.queue_game
 | 
	
		
			
				|  |  | -        self.observer = player.observer
 | 
	
		
			
				|  |  | -        self.game = None
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -    def closeIt(self):
 | 
	
		
			
				|  |  | -        log.msg("closeIt")
 | 
	
		
			
				|  |  | -        self.queue_game.put(False)
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -    def getUser(self, user):
 | 
	
		
			
				|  |  | -        log.msg("getUser( %s )" % user)
 | 
	
		
			
				|  |  | -        self.twgs.logUser(user)
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -    # This was needed when I replaced ClientFactory with Factory.
 | 
	
		
			
				|  |  | -    # def clientConnectionLost(self, connector, why):
 | 
	
		
			
				|  |  | -    #     log.msg("clientconnectionlost: %s" % why)
 | 
	
		
			
				|  |  | -    #     self.queue_client.put(False)
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -    def clientConnectionFailed(self, connector, why):
 | 
	
		
			
				|  |  | -        log.msg("connection to game failed: %s" % why)
 | 
	
		
			
				|  |  | -        self.queue_game.put(b"Sorry!  I'm Unable to connect to the game server.\r\n")
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -        # syncterm gets cranky/locks up if we close this here.
 | 
	
		
			
				|  |  | -        # (Because it is still sending rlogin information?)
 | 
	
		
			
				|  |  | -        reactor.callLater(2, self.closeIt)
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |  class Player(protocol.Protocol):
 | 
	
		
			
				|  |  |      def __init__(self):
 | 
	
		
			
				|  |  |          self.buffer = ""
 | 
	
	
		
			
				|  | @@ -566,6 +532,42 @@ class Player(protocol.Protocol):
 | 
	
		
			
				|  |  |          log.msg("connectionFailed: %s" % why)
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +class GlueFactory(protocol.ClientFactory):
 | 
	
		
			
				|  |  | +    # class GlueFactory(protocol.Factory):
 | 
	
		
			
				|  |  | +    maxDelay = 10
 | 
	
		
			
				|  |  | +    protocol = Game
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    def __init__(self, player: Player):
 | 
	
		
			
				|  |  | +        self.player = player
 | 
	
		
			
				|  |  | +        self.queue_player = player.queue_player
 | 
	
		
			
				|  |  | +        self.queue_game = player.queue_game
 | 
	
		
			
				|  |  | +        self.observer = player.observer
 | 
	
		
			
				|  |  | +        self.game = None
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    def closeIt(self):
 | 
	
		
			
				|  |  | +        log.msg("closeIt")
 | 
	
		
			
				|  |  | +        self.queue_game.put(False)
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    def getUser(self, user):
 | 
	
		
			
				|  |  | +        log.msg("getUser( %s )" % user)
 | 
	
		
			
				|  |  | +        self.twgs.logUser(user)
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    # This was needed when I replaced ClientFactory with Factory.
 | 
	
		
			
				|  |  | +    # def clientConnectionLost(self, connector, why):
 | 
	
		
			
				|  |  | +    #     log.msg("clientconnectionlost: %s" % why)
 | 
	
		
			
				|  |  | +    #     self.queue_client.put(False)
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    def clientConnectionFailed(self, connector, why):
 | 
	
		
			
				|  |  | +        log.msg("connection to game failed: %s" % why)
 | 
	
		
			
				|  |  | +        self.queue_game.put(b"Sorry!  I'm Unable to connect to the game server.\r\n")
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        # syncterm gets cranky/locks up if we close this here.
 | 
	
		
			
				|  |  | +        # (Because it is still sending rlogin information?)
 | 
	
		
			
				|  |  | +        reactor.callLater(2, self.closeIt)
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  if __name__ == "__main__":
 | 
	
		
			
				|  |  |      if "logfile" in config and config["logfile"]:
 | 
	
		
			
				|  |  |          log.startLogging(DailyLogFile("proxy.log", "."))
 |