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