Compare commits
No commits in common. "7eb991a4e4bcd00da936a6e2f522eaaba6f3e6f0" and "80da12cfcf3fa4deaa7ec29e775ae1a3d8fdbc26" have entirely different histories.
7eb991a4e4
...
80da12cfcf
10
README.md
10
README.md
|
@ -1,11 +1,11 @@
|
||||||
# mini-chat
|
# mini-chat
|
||||||
|
|
||||||
Tiny IRC-like chat server written in Go
|
Tiny IRC-like chat server built for compatibility with netcat and written in Go
|
||||||
|
|
||||||
## Usage examples
|
## Usage
|
||||||
|
|
||||||
### Starting the server:
|
### Starting the server
|
||||||
./mini-chat server --port 1337
|
./mini-chat server --port 1337
|
||||||
|
|
||||||
### Connecting to the server:
|
### Connecting to the server
|
||||||
./mini-chat client --ip 192.168.0.100 --port 1337
|
nc $SERVER_IP $SERVER_PORT
|
||||||
|
|
|
@ -161,7 +161,7 @@ func initKeybindings(g *gocui.Gui) error {
|
||||||
func layout(g *gocui.Gui) error {
|
func layout(g *gocui.Gui) error {
|
||||||
maxX, maxY := g.Size()
|
maxX, maxY := g.Size()
|
||||||
|
|
||||||
if chatbox, err := g.SetView("chatbox", 2, 1, maxX-28, maxY-5); err != nil {
|
if chatbox, err := g.SetView("chatbox", 2, 1, maxX/2+40, maxY-5); err != nil {
|
||||||
if err != gocui.ErrUnknownView {
|
if err != gocui.ErrUnknownView {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -169,7 +169,7 @@ func layout(g *gocui.Gui) error {
|
||||||
chatbox.Title = "Chat Box"
|
chatbox.Title = "Chat Box"
|
||||||
}
|
}
|
||||||
|
|
||||||
if button, err := g.SetView("button", maxX/2+32, maxY-4, maxX-28, maxY-2); err != nil {
|
if button, err := g.SetView("button", maxX/2+32, maxY-4, maxX/2+40, maxY-2); err != nil {
|
||||||
if err != gocui.ErrUnknownView {
|
if err != gocui.ErrUnknownView {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -179,7 +179,7 @@ func layout(g *gocui.Gui) error {
|
||||||
fmt.Fprintln(button, "Send it")
|
fmt.Fprintln(button, "Send it")
|
||||||
}
|
}
|
||||||
|
|
||||||
if textarea, err := g.SetView("textarea", 2, maxY-4, maxX-40, maxY-2); err != nil {
|
if textarea, err := g.SetView("textarea", 2, maxY-4, maxX/2+28, maxY-2); err != nil {
|
||||||
if err != gocui.ErrUnknownView {
|
if err != gocui.ErrUnknownView {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue