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NT5XVSLIITQOVP7Y7LSLTK5YUOSHT7JOAC
KTEEKYZJYM54MZP3BONOGHMGIYWZRYR2GO7TL56RQJ26CORF3EEQC
KIMLP4FXKI3DGXPQNN4Z6R2MM2XSKV5E5LBHCMRVNAG4Z3MK4VCAC
T63X37GGBT6PXZMA3MJKNO65FWL7STX62K72Q3RMZDE377BFGCYQC
for mut ghost in ircnet.ghosts.ghosts {
g_ghost := *ghost // vbug
if g_ghost.state == ConnState.disconnected {
self.dial(mut ircnet, g_ghost.nick)
}
mut ghost := ircnet.find_ghost(ircnet.nick) or { mut ghost := self.add_ghost(mut ircnet, ircnet.nick)
ircnet.ghosts.add(mut ghost) }
mut g_ghost := *ghost // vbug
if g_ghost.state == ConnState.disconnected {
g_ghost.sock = self.dial(mut ircnet, ircnet.nick) or { continue }
mut sock := net.dial_tcp(host) or {
println('irc connect fail $host $err')
return
}
mut sock := net.dial_tcp(host) ?
mut ghost := &Ghost{
nick: nick
sock: sock
}
mut added := ircnet.ghosts.add(mut ghost)
ghost.state = ConnState.connected
go self.comm(mut ircnet, mut added)
nick_cmd := 'nick $nick'
ircnet.write(mut ghost, nick_cmd)
user_cmd := 'user a b c :full name'
ircnet.write(mut ghost, user_cmd)
return sock
pub fn (mut self IrcActor) add_ghost(mut ircnet Network, nick string) &Ghost {
mut ghost := &Ghost{
nick: nick
}
go self.comm(mut ircnet, mut ghost)
nick_cmd := 'nick $nick'
ircnet.write(mut ghost, nick_cmd)
user_cmd := 'user a b c :full name'
ircnet.write(mut ghost, user_cmd)
return ghost
}
mut reader := io.new_buffered_reader(reader: ghost.sock)
for {
if line := reader.read_line() {
parsed := self.proto(line, mut ircnet, mut ghost)
if parsed.len > 0 {
if mut ghost.sock is net.TcpConn {
mut reader := io.new_buffered_reader(reader: ghost.sock)
for {
if line := reader.read_line() {
parsed := self.proto(line, mut ircnet, mut ghost)
if parsed.len > 0 {
}
} else {
println('$ircnet.hostname $ghost.nick: TCP closed $err')
ghost.hangup()
self.cin <- Payload(Disconnect{
network: ircnet
ghost: ghost
})
break
}
if ircnet.stop {
break
} else {
println('$ircnet.hostname $ghost.nick: TCP closed $err')
ghost.hangup()
self.cin <- Payload(Disconnect{
network: ircnet
ghost: ghost
})
break
println('$self.hostname $ghost.nick: $msg')
ghost.sock.write_string(msg + '\n') or {}
if mut ghost.sock is net.TcpConn {
println('$self.hostname $ghost.nick: $msg')
ghost.sock.write_string(msg + '\n') or {}
} else {
println('NO SOCK: $self.hostname $ghost.nick: dropped $msg')
}