Пример #1
0
    private void OnConnect(Sproto.SprotoTypeBase _)
    {
        Debug.Log("on connect");
        ClientNet.inst.Send <Protocol.handshake>(null, evt =>
        {
            SprotoType.handshake.response response = evt as SprotoType.handshake.response;
            Debug.Log("on msg " + response.msg);
        });

        SprotoType.register_account.request req = new SprotoType.register_account.request();
        req.account  = "test account";
        req.password = "******";
        ClientNet.inst.Send <Protocol.register_account>(req, evt =>
        {
            SprotoType.register_account.response response = evt as SprotoType.register_account.response;
            Debug.Log("on msg " + response.msg);
        });

        //SprotoType.login_account.request loginReq = new SprotoType.login_account.request();
        //loginReq.account = "test account";
        //loginReq.password = "******";
        //ClientNet.inst.Send<Protocol.login_account>(loginReq, e =>
        //{
        //    SprotoType.login_account.response res = e as SprotoType.login_account.response;
        //    Debug.Log("on login " + res.result);
        //});
    }
Пример #2
0
 public void OnBtnRegisterClick()
 {
     SprotoType.register_account.request req = new SprotoType.register_account.request();
     req.account  = account.text;
     req.password = password.text;
     ClientNet.inst.Send <Protocol.register_account>(req, evt =>
     {
         SprotoType.register_account.response response = evt as SprotoType.register_account.response;
         Debug.Log("on register " + response.msg);
     });
 }
    private void OnConnect(Sproto.SprotoTypeBase _)
    {
        Debug.Log("on connect");
        ClientNet.inst.Send <Protocol.handshake>(null, evt =>
        {
            SprotoType.handshake.response response = evt as SprotoType.handshake.response;
            Debug.Log("on msg " + response.msg);
        });

        SprotoType.register_account.request req = new SprotoType.register_account.request();
        req.account  = "test account";
        req.password = "******";
        ClientNet.inst.Send <Protocol.register_account>(req, evt =>
        {
            SprotoType.register_account.response response = evt as SprotoType.register_account.response;
            Debug.Log("on msg " + response.msg);
        });
    }