Beispiel #1
0
 public void Connect(string ip, int port)
 {
     ClientSocketMgr.GetIns().Connect(ip, port, () =>
     {
         SetState(ClientStateEnum.Keyboard);
     });
 }
Beispiel #2
0
    void ProcessMouse(string name, object data)
    {
        string        key = (string)data;
        Cmd4SendMouse cmd = new Cmd4SendMouse();

        cmd.mouseData = key;
        ClientSocketMgr.GetIns().Send(cmd);
    }
Beispiel #3
0
    void OnDestroy()
    {
        Ins = null;

        if (ClientSocketMgr.GetIns().BeConnect())
        {
            ClientSocketMgr.GetIns().Close("scn destroy");
        }
    }
Beispiel #4
0
    void ProcessKBPress(string name, object data)
    {
        string key = (string)data;

        Debug.Log("KBPanel.ProcessKBPress->客户端按下:" + key);

        if (BeShiftOn)
        {
            BeShiftOn = false;

            CurPanel?.ProcessPressAbleKeyUI("shift", BeShiftOn);
        }

        if (BeAltOn)
        {
            BeAltOn = false;
            CurPanel?.ProcessPressAbleKeyUI("alt", BeAltOn);
        }

        if (BeCtrlOn)
        {
            BeCtrlOn = false;
            CurPanel?.ProcessPressAbleKeyUI("ctrl", BeCtrlOn);
        }

        if (ClientSocketMgr.GetIns().BeConnect())
        {
            Debug.Log("PanelMgr.ProcessKBPress sendMsg key:" + key);
            Cmd4SendKB cmd = new Cmd4SendKB();
            cmd.key = key;
            ClientSocketMgr.GetIns().Send(cmd);
        }
        else
        {
            Debug.LogError("sen msg when unconnect!!!");
        }
    }