Entrega v1 aula: shell com abas, PITIUPI_HOME e plugins de referência.
Consolida núcleo (presença, peer actions, MessageDispatcher), chat e screencast na galeria, documentação PT-BR e testes JUnit; remove mpChat do catálogo em favor do chat unificado. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
b10c196fc9
commit
eeb1936f6d
178 files changed
+7641
-1481
No files matched your search
@@ -1,60 +1,31 @@
|
||||
# Plugins de referência
|
||||
|
||||
Três exemplos no repositório para comparar estilos de integração. Todos devem ser empacotados em `pitiupi/plugins/`.
|
||||
Dois módulos buildáveis no catálogo; o chat unifica o antigo mpChat (multicast, unicast, TCP e canal TCP privado).
|
||||
|
||||
## Comparativo
|
||||
|
||||
| | pitiupi.chat | pitiupi.screenCast | pitiupi.mpChat |
|
||||
| --- | --- | --- | --- |
|
||||
| Build | Ant | Ant | Make |
|
||||
| id (`plugins.registry.json`) | `chat` | `screencast` | `mpchat` |
|
||||
| Classe | `ChatPlugin` | `ScreenCastPlugin` | `MultiProtocolChat` |
|
||||
| Categoria menu | `Social` | `Streaming` | `Social` (multicast + unicast) |
|
||||
| Mensagem | `ChatMessage` | `ScreenCastMessage` | `MpChatMessage` |
|
||||
| Transporte principal | UDP (via `ConnectionManager`) | UDP / payloads maiores | UDP público + **TCP privado** |
|
||||
| TCP avançado | Não | Depende da versão do módulo | `receivePrivateConnection`, `receiveBytes` |
|
||||
| | plugins/chat | plugins/screencast |
|
||||
| --- | --- | --- |
|
||||
| Build | Ant | Ant |
|
||||
| id | `chat` | `screencast` |
|
||||
| Classe | `ChatPlugin` | `ScreenCastPlugin` |
|
||||
| Mensagem | `ChatMessage`, `LegacyMpChatMessage` | `ScreenCastMessage` |
|
||||
| UI | `ChatPanel` (destino + transporte) | `ScreenCastPanel` (destino + transporte) |
|
||||
| TCP privado | Toggle no `ChatPanel` + hooks `receiveBytes` (histórico `private:<IP>`) | — |
|
||||
|
||||
## pitiupi.chat
|
||||
## plugins/chat
|
||||
|
||||
- **Referência canônica** alinhada ao contrato atual `Plugin` + `ConnectionManager` / `GuiManager`.
|
||||
- `createPlugin` registra `ChatMenu` em `MenuCategory.Social`.
|
||||
- `getMessages()` retorna `ChatMessage.class`; `receiveMessage` atualiza `ChatWindow`.
|
||||
- Sala geral ou um peer (lista + IP).
|
||||
- Transportes: multicast UDP, unicast UDP, TCP via `MessageDispatcher`.
|
||||
- Peer actions: abrir sala geral; conversar com peer; canal TCP privado.
|
||||
- Caminho: `plugins/chat/src/pitiupi/chat/plugin/ChatPlugin.java`.
|
||||
|
||||
Caminhos: `pitiupi.chat/src/pitiupi/chat/plugin/ChatPlugin.java`.
|
||||
## plugins/screencast
|
||||
|
||||
## pitiupi.screenCast
|
||||
- Compartilhamento contínuo com destino geral (multicast recomendado) ou um peer (unicast/TCP).
|
||||
- Peer actions: compartilhar na rede; compartilhar com este peer.
|
||||
- Caminho: `plugins/screencast/src/pitiupi/screenCast/plugin/ScreenCastPlugin.java`.
|
||||
|
||||
- Demonstra compartilhamento de tela / imagens (`ScreenCastWindow`, `ScreenCastMessage`).
|
||||
- Útil para discutir **tamanho de datagramas**, compressão (`ImageTransformation`) e limites UDP.
|
||||
## Exercício Ping
|
||||
|
||||
Caminhos: `pitiupi.screenCast/src/pitiupi/screenCast/`. Alinhado ao contrato `Plugin` + `ConnectionManager` / `GuiManager` (como `ChatPlugin`).
|
||||
|
||||
## pitiupi.mpChat
|
||||
|
||||
- Chat **público** (multicast / unicast UDP) e **privado** (TCP).
|
||||
- `createPlugin(ConnectionManager, GuiManager)` como nos demais plugins; usa `ConnectionManager.connectPluginTcp` para abrir canal privado.
|
||||
- Sobrescreve hooks TCP do `Plugin` (`receivePrivateConnection`, `receiveBytes`, `onSocketClosed`).
|
||||
|
||||
Caminhos: `pitiupi.mpChat/src/plugin/MultiProtocolChat.java`.
|
||||
|
||||
## Fluxo UDP (todos os plugins)
|
||||
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
participant App as MainWindow
|
||||
participant UDP as SocketUDP
|
||||
participant HB as HeartbeatManager
|
||||
participant PM as PluginManager
|
||||
participant Peer as OutroPeer
|
||||
App->>UDP: join multicast
|
||||
UDP->>HB: HeartbeatMessage
|
||||
Peer->>UDP: Message plugin
|
||||
UDP->>PM: handleMessage bytes
|
||||
PM->>PM: deserialize + dispatch
|
||||
```
|
||||
|
||||
Heartbeat não passa pelos plugins — ver [08_heartbeat_e_presenca.md](08_heartbeat_e_presenca.md).
|
||||
|
||||
## Próximo passo
|
||||
|
||||
Criar plugin próprio: [10_tutorial_plugin.md](10_tutorial_plugin.md).
|
||||
Material em [17_tutorial_ping_aula.md](17_tutorial_ping_aula.md) e pasta `plugins/ping/` (sem JAR no repositório).
|
||||
Reference in new issue
Block a user