Added /VERSION command and set version to 1.0.0
This commit is contained in:
parent
f4deca40ea
commit
0d91cad155
@ -173,6 +173,8 @@ func (c *Client) reply(code replyCode, args ...string) {
|
||||
c.outputChan <- fmt.Sprintf(":%s KICK %s %s %s", args[0], args[1], args[2], args[3])
|
||||
case rplInfo:
|
||||
c.outputChan <- fmt.Sprintf(":%s 371 %s :%s", c.server.name, c.nick, args[0])
|
||||
case rplVersion:
|
||||
c.outputChan <- fmt.Sprintf(":%s 351 %s %s", c.server.name, c.nick, args[0])
|
||||
case errMoreArgs:
|
||||
c.outputChan <- fmt.Sprintf(":%s 461 %s :Not enough params", c.server.name, c.nick)
|
||||
case errNoNick:
|
||||
|
2
main.go
2
main.go
@ -20,7 +20,7 @@ func main() {
|
||||
|
||||
flag.Parse()
|
||||
|
||||
log.Printf("Rosella Initialising.")
|
||||
log.Printf("Rosella v%s Initialising.", VERSION)
|
||||
|
||||
//Init rosella itself
|
||||
server := NewServer()
|
||||
|
@ -2,6 +2,10 @@ package main
|
||||
|
||||
import "net"
|
||||
|
||||
const (
|
||||
VERSION = "1.0.0"
|
||||
)
|
||||
|
||||
type Server struct {
|
||||
eventChan chan Event
|
||||
running bool
|
||||
@ -110,6 +114,7 @@ const (
|
||||
rplChannelModeIs
|
||||
rplKick
|
||||
rplInfo
|
||||
rplVersion
|
||||
errMoreArgs
|
||||
errNoNick
|
||||
errInvalidNick
|
||||
|
@ -64,6 +64,8 @@ func (s *Server) handleEvent(e Event) {
|
||||
switch {
|
||||
case command == "INFO":
|
||||
e.client.reply(rplInfo, "Rosella IRCD github.com/eXeC64/Rosella")
|
||||
case command == "VERSION":
|
||||
e.client.reply(rplVersion, VERSION)
|
||||
case command == "NICK":
|
||||
if len(args) < 1 {
|
||||
e.client.reply(errNoNick)
|
||||
|
Loading…
Reference in New Issue
Block a user