rdp.go 374 B

123456789101112131415161718192021222324
  1. package handler
  2. import (
  3. "ehang.io/nps/lib/enet"
  4. )
  5. type RdpHandler struct {
  6. DefaultHandler
  7. }
  8. func (rh *RdpHandler) GetName() string {
  9. return "rdp"
  10. }
  11. func (rh *RdpHandler) GetZhName() string {
  12. return "rdp协议"
  13. }
  14. func (rh *RdpHandler) HandleConn(b []byte, c enet.Conn) (bool, error) {
  15. if b[0] == 3 && b[1] == 0 {
  16. return rh.processConn(c)
  17. }
  18. return false, nil
  19. }