void OnFileAdded(BestHTTP.SocketIO.Socket socket, Packet packet, params object[] args) { string pathInCamfi = args[0].ToString(); //Debug.Log("拍照成功,其Url: " + pathInCamfi); HTTPRequest request = new HTTPRequest(new Uri(CamfiServerInfo.CamFiGetRawDataByEnCodeUrlStr(UrlEncode(pathInCamfi))), HTTPMethods.Get, GetRawDataFinished); request.Send(); }
void OnConnected(BestHTTP.SocketIO.Socket socket, BestHTTP.SocketIO.Packet packet, object[] args) { IsConnected = true; if (Connected != null) { Connected(this, null); } }
private void OnConnected(BestHTTP.SocketIO.Socket socket, Packet packet, params object[] args) { if (PlayerPrefs.HasKey("Nick")) { this.Nick = PlayerPrefs.GetString("Nick", "NickName"); this.Join(); } else { this.State = States.WaitForNick; } this.AddMessage("connected"); }
private void OnFrame(BestHTTP.SocketIO.Socket socket, Packet packet, params object[] args) { if (this.State == States.Joined) { if (this.FrameTexture == null) { this.FrameTexture = new Texture2D(0, 0, TextureFormat.RGBA32, false); this.FrameTexture.filterMode = FilterMode.Point; } byte[] data = packet.Attachments[0]; this.FrameTexture.LoadImage(data); } }
/// <summary> /// Called when a "connect" event received to the root namespace /// </summary> private void OnTransportOpen(Socket socket, Packet packet, params object[] args) { // If this is not the root namespace, then we send a connect message to the server if (this.Namespace != "/") (Manager as IManager).SendPacket(new Packet(TransportEventTypes.Message, SocketIOEventTypes.Connect, this.Namespace, string.Empty)); // and we are no open IsOpen = true; }
public EventTable(BestHTTP.SocketIO.Socket socket) { this.Socket = socket; }
void OnLiveshowData(BestHTTP.SocketIO.Socket socket, Packet packet, params object[] args) { //print(packet.AttachmentCount); }
void OnLiveshowError(BestHTTP.SocketIO.Socket socket, Packet packet, params object[] args) { Debug.LogWarning("实时取景发送错误"); }
void OnCameraRemove(BestHTTP.SocketIO.Socket socket, Packet packet, params object[] args) { Debug.LogWarning("CamFi丢失相机连接"); _connectCameraSuccess = false; _onBreakCameraAction.Invoke(); }
private void OnConnections(BestHTTP.SocketIO.Socket socket, Packet packet, params object[] args) { this.connections = Convert.ToInt32(args[0]); }
void OnDisConnected(BestHTTP.SocketIO.Socket socket, Packet packet, params object[] args) { Debug.LogWarning("与CamFi的SokectIO连接 断开"); _connectCamfiSuccess = false; _onBreakCamfiAction.Invoke(); }
void OnConnected(BestHTTP.SocketIO.Socket socket, Packet packet, params object[] args) { Debug.LogWarning("与CamFi的SokectIO连接建立"); _connectCamfiSuccess = true; _onConnectCamfiAction.Invoke(); }
/// <summary> /// Internal function to remove a Socket instance from this manager. /// </summary> /// <param name="socket"></param> void IManager.Remove(Socket socket) { Namespaces.Remove(socket.Namespace); Sockets.Remove(socket); if (Sockets.Count == 0) Close(); }
/// <summary> /// Returns with the specified namespace /// </summary> public Socket GetSocket(string nsp) { if (string.IsNullOrEmpty(nsp)) throw new ArgumentNullException("Namespace parameter is null or empty!"); /*if (nsp[0] != '/') nsp = "/" + nsp;*/ Socket socket = null; if (!Namespaces.TryGetValue(nsp, out socket)) { // No socket found, create one socket = new Socket(nsp, this); Namespaces.Add(nsp, socket); Sockets.Add(socket); (socket as ISocket).Open(); } return socket; }
private void OnError(BestHTTP.SocketIO.Socket socket, Packet packet, params object[] args) { this.AddMessage($"--ERROR - {args[0].ToString()}"); }
void OnCameraAdd(BestHTTP.SocketIO.Socket socket, Packet packet, params object[] args) { Debug.LogWarning("CamFi连接了相机"); _connectCameraSuccess = true; _onConnectCameraAction.Invoke(); }
void OnConnected(BestHTTP.SocketIO.Socket socket, BestHTTP.SocketIO.Packet packet, object[] args) { Debug.Log("Connected to socket server"); }
/// <summary> /// Internal function to remove a Socket instance from this manager. /// </summary> /// <param name="socket"></param> void IManager.Remove(Socket socket) { Namespaces.Remove(socket.Namespace); Sockets.Remove(socket); }