示例#1
0
 public static void Handle(string[] commands)
 {
     nicehu.pb.DeviceInfo deviceInfo = new nicehu.pb.DeviceInfo();
     deviceInfo.oSType     = "IOS";
     deviceInfo.oSType     = "9.3.0";
     deviceInfo.udid       = "default";
     deviceInfo.deviceName = "iphone7";
     Client.clientCore.create(Client.ip, Client.port, commands[1], commands[2], deviceInfo);
     LogU.Debug("create  " + commands[1] + "  " + commands[2]);
 }
        public bool create(string ip, int port, string account, string pass, nicehu.pb.DeviceInfo deviceInfo)
        {
            IPAddress ipAddress = IpU.GetIPV4Address(ip);

            if (ipAddress == null)
            {
                return(false);
            }
            createHandler.Create(new IPEndPoint(ipAddress, port), account, pass, deviceInfo);
            return(true);
        }
        public bool login(string ip, int port, String account, String pass, nicehu.pb.DeviceInfo deviceInfo)
        {
            string guid = Guid.NewGuid().ToString();

            IPAddress host = IpU.GetIPV4Address(ip);

            if (host == null)
            {
                return(false);
            }

            loginHandler.Login(new IPEndPoint(host, port), account, pass, guid, deviceInfo);
            return(true);
        }
 public void Create(IPEndPoint ipPort, string account, string pass, nicehu.pb.DeviceInfo deviceInfo)
 {
     if (clientCore.Connection != null && clientCore.Connection.socket.Connected)
     {
         clientCore.Connection.Disconnect(true);
     }
     this.account    = account;
     this.pass       = pass;
     this.deviceInfo = deviceInfo;
     if (deviceInfo == null)
     {
         LogU.Error("DeviceInfo is null");
     }
     clientCore.Connection             = new Connection(ipPort);
     clientCore.Connection.OnConnected = OnMyConnected;
     clientCore.Connection.OnReceived  = OnMyReceived;
     clientCore.Connection.Connect();
 }