Add support for servers that don't use : properly

This commit is contained in:
raylu 2010-10-29 14:06:18 -04:00
parent 8765d3f178
commit 14ebeac6ee
1 changed files with 5 additions and 1 deletions

View File

@ -217,10 +217,14 @@ func (conn *Conn) recv() {
if len(args) > 1 {
line.Text = args[1]
}
args = strings.Split(args[0], " ", -1)
args = strings.Fields(args[0])
line.Cmd = strings.ToUpper(args[0])
if len(args) > 1 {
line.Args = args[1:len(args)]
// some servers (Gamesurge) don't use : properly
if line.Text == "" {
line.Text = args[1]
}
}
conn.in <- line
}