]> git.r.bdr.sh - rbdr/mobius/blobdiff - hotline/client_conn.go
Fix handshake test
[rbdr/mobius] / hotline / client_conn.go
index ce9d7f1c320b27c5709ecb163c0f599c5337240c..65e18eead5ea526b963f9515486ec55cc8d8e42b 100644 (file)
@@ -151,21 +151,21 @@ func (cc *ClientConn) Authorize(access int) bool {
 }
 
 // Disconnect notifies other clients that a client has disconnected
 }
 
 // Disconnect notifies other clients that a client has disconnected
-func (cc ClientConn) Disconnect() {
+func (cc *ClientConn) Disconnect() {
        cc.Server.mux.Lock()
        defer cc.Server.mux.Unlock()
 
        delete(cc.Server.Clients, binary.BigEndian.Uint16(*cc.ID))
 
        cc.Server.mux.Lock()
        defer cc.Server.mux.Unlock()
 
        delete(cc.Server.Clients, binary.BigEndian.Uint16(*cc.ID))
 
-       cc.NotifyOthers(*NewTransaction(tranNotifyDeleteUser, nil, NewField(fieldUserID, *cc.ID)))
+       cc.notifyOthers(*NewTransaction(tranNotifyDeleteUser, nil, NewField(fieldUserID, *cc.ID)))
 
        if err := cc.Connection.Close(); err != nil {
                cc.Server.Logger.Errorw("error closing client connection", "RemoteAddr", cc.Connection.RemoteAddr())
        }
 }
 
 
        if err := cc.Connection.Close(); err != nil {
                cc.Server.Logger.Errorw("error closing client connection", "RemoteAddr", cc.Connection.RemoteAddr())
        }
 }
 
-// NotifyOthers sends transaction t to other clients connected to the server
-func (cc ClientConn) NotifyOthers(t Transaction) {
+// notifyOthers sends transaction t to other clients connected to the server
+func (cc *ClientConn) notifyOthers(t Transaction) {
        for _, c := range sortedClients(cc.Server.Clients) {
                if c.ID != cc.ID && c.Agreed {
                        t.clientID = c.ID
        for _, c := range sortedClients(cc.Server.Clients) {
                if c.ID != cc.ID && c.Agreed {
                        t.clientID = c.ID