refactored player code

This commit is contained in:
amit bezalel
2017-07-19 00:23:45 +03:00
parent 2038848b8e
commit 662e8393e9
17 changed files with 423 additions and 208 deletions

View File

@@ -12,7 +12,7 @@ import (
type ServerConn struct {
c io.ReadWriter
cfg *ServerConfig
protocol string
m sync.Mutex
// If the pixel format uses a color map, then this is the color
@@ -149,7 +149,7 @@ func (c *ServerConn) SetHeight(h uint16) {
}
func (c *ServerConn) handle() error {
defer func() {
c.Listeners.Consume(&common.RfbSegment{
SegmentType: common.SegmentConnectionClosed,
@@ -197,7 +197,11 @@ func (c *ServerConn) handle() error {
return err
}
logger.Debugf("ServerConn.Handle got ClientMessage: %s, %v", parsedMsg.Type(), parsedMsg)
logger.Infof("ServerConn.Handle got ClientMessage: %s, %v", parsedMsg.Type(), parsedMsg)
//TODO: treat set encodings by allowing only supported encoding in proxy configurations
//// if parsedMsg.Type() == common.SetEncodingsMsgType{
//// c.cfg.Encodings
//// }
seg := &common.RfbSegment{
SegmentType: common.SegmentFullyParsedClientMessage,