aboutsummaryrefslogtreecommitdiff
path: root/hop.go
diff options
context:
space:
mode:
Diffstat (limited to 'hop.go')
-rw-r--r--hop.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/hop.go b/hop.go
index b54277e..c065e16 100644
--- a/hop.go
+++ b/hop.go
@@ -8,6 +8,9 @@ import (
"github.com/anon55555/mt"
)
+// Hop connects the ClientConn to the specified upstream server.
+// At the moment the ClientConn is NOT fixed if an error occurs
+// so the player may have to reconnect.
func (cc *ClientConn) Hop(serverName string) error {
cc.hopMu.Lock()
defer cc.hopMu.Unlock()
@@ -32,7 +35,7 @@ func (cc *ClientConn) Hop(serverName string) error {
return fmt.Errorf("inexistent server")
}
- // This needs to be done before the serverConn is closed
+ // This needs to be done before the ServerConn is closed
// so the clientConn isn't closed by the packet handler
cc.server().mu.Lock()
cc.server().clt = nil
@@ -144,7 +147,7 @@ func (cc *ClientConn) Hop(serverName string) error {
return err
}
- Connect(conn, serverName, cc)
+ connect(conn, serverName, cc)
for ch := range cc.modChs {
cc.server().SendCmd(&mt.ToSrvJoinModChan{Channel: ch})