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,6 +1,6 @@
|
||||
# pitiupi
|
||||
|
||||
Ferramenta **P2P** para práticas de Redes de Computadores: núcleo em Java com arquitetura de **plugins** (chat, compartilhamento de tela, chat multi-protocolo).
|
||||
Ferramenta **P2P** para práticas de Redes de Computadores: núcleo em Java com arquitetura de **plugins** (conversa na rede e compartilhamento de tela).
|
||||
|
||||
**Documentação completa:** [docs/README.md](docs/README.md) · **Quickstart:** [docs/documentation/00_quickstart.md](docs/documentation/00_quickstart.md)
|
||||
|
||||
@@ -15,10 +15,10 @@ chmod +x scripts/pitiupi.sh # só na primeira vez
|
||||
./scripts/pitiupi.sh run --all
|
||||
```
|
||||
|
||||
Compila o núcleo, os plugins do [catálogo](plugins.registry.json), instala JARs em `pitiupi/plugins/` e abre a aplicação.
|
||||
Compila o núcleo, os plugins do [catálogo](plugins.registry.json), cria symlinks em **`PITIUPI_HOME/plugins`** (padrão `~/pitiupi/plugins`) e abre a aplicação.
|
||||
|
||||
1. Login: **nome** e **porta** (ex.: `5000`).
|
||||
2. Menus dos plugins: barra **Plugin → Social | Jogos | Streaming** (cada plugin registra a categoria no código).
|
||||
2. Abra plugins na aba **Plugins** (galeria) ou pelas ações na lista **Usuários nesta rede** (peer actions).
|
||||
3. P2P no mesmo PC: segunda instância com **porta diferente** (ex.: `5001`).
|
||||
|
||||
```bash
|
||||
@@ -35,38 +35,37 @@ Novos módulos entram no repositório adicionando uma entrada no JSON (não é p
|
||||
| Campo | Significado |
|
||||
| --- | --- |
|
||||
| `id` | Usado em `--plugins chat,meuJogo` |
|
||||
| `dir` | Pasta do módulo (ex.: `pitiupi.xadrez`) |
|
||||
| `dir` | Pasta do módulo (ex.: `plugins/xadrez`) |
|
||||
| `build` | `ant` ou `make` |
|
||||
| `jar` | Caminho do JAR relativo a `dir` |
|
||||
| `menuCategory` | `Social`, `Jogos` ou `Streaming` — filtro CLI e documentação |
|
||||
|
||||
Plugins de referência hoje:
|
||||
|
||||
| id | Categoria (menu) | Pasta |
|
||||
| id | Uso didático | Pasta |
|
||||
| --- | --- | --- |
|
||||
| `chat` | Social | `pitiupi.chat` |
|
||||
| `mpchat` | Social | `pitiupi.mpChat` |
|
||||
| `screencast` | Streaming | `pitiupi.screenCast` |
|
||||
| `chat` | Sala geral, peer por IP, TCP privado | `plugins/chat` |
|
||||
| `screencast` | Multicast ou unicast de tela | `plugins/screencast` |
|
||||
|
||||
A **categoria na interface** vem do `MenuCategory` no Java (`guiManager.createMenu(...)`), não do nome do JAR. O campo `menuCategory` no JSON alinha build/link com a doc.
|
||||
Na interface, o texto das abas vem de `getDisplayName()` em cada plugin. O campo `menuCategory` no JSON alinha build/link com a documentação.
|
||||
|
||||
```bash
|
||||
./scripts/pitiupi.sh run --all
|
||||
./scripts/pitiupi.sh run --category Social
|
||||
./scripts/pitiupi.sh run --plugins chat,screencast
|
||||
./scripts/pitiupi.sh discover # pastas pitiupi.* com SPI ainda não no catálogo
|
||||
./scripts/pitiupi.sh discover # pastas em plugins/ com SPI ainda não no catálogo
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Novo plugin (resumo)
|
||||
|
||||
1. Copiar estrutura de `pitiupi.chat` → `pitiupi.meuPlugin` ([tutorial](docs/documentation/10_tutorial_plugin.md)).
|
||||
2. Em `createPlugin`, registrar menu: `guiManager.createMenu(MenuCategory.Jogos, ...)` (ou Social / Streaming).
|
||||
1. Copiar estrutura de `plugins/chat` → `plugins/meuPlugin` ([tutorial](docs/documentation/10_tutorial_plugin.md)).
|
||||
2. Em `createPlugin`, registrar painel com `PluginWorkspace` / `bindShellWorkspaceContent` e, se fizer sentido, **peer actions** na lista lateral.
|
||||
3. Adicionar entrada em [`plugins.registry.json`](plugins.registry.json).
|
||||
4. `./scripts/pitiupi.sh run --plugins meuId`.
|
||||
4. `./scripts/pitiupi.sh link --all` e reiniciar o app.
|
||||
|
||||
O núcleo carrega **todos os `*.jar`** em `pitiupi/plugins/` (pasta única). Detalhes: [pitiupi/plugins/README.md](pitiupi/plugins/README.md).
|
||||
O núcleo carrega **todos os `*.jar`** em `PITIUPI_HOME/plugins`. Detalhes: [pitiupi/plugins/README.md](pitiupi/plugins/README.md).
|
||||
|
||||
---
|
||||
|
||||
@@ -74,14 +73,14 @@ O núcleo carrega **todos os `*.jar`** em `pitiupi/plugins/` (pasta única). Det
|
||||
|
||||
| Ferramenta | Uso |
|
||||
| --- | --- |
|
||||
| **JDK** com `javac` | Compilação (OpenJDK **25** recomendado) |
|
||||
| **JDK** com `javac` | Compilação (OpenJDK **25** recomendado; núcleo Java 17) |
|
||||
| **Apache Ant** | Módulos NetBeans |
|
||||
| **GNU Make** | `pitiupi.mpChat` |
|
||||
| **python3** | Script `scripts/pitiupi.sh` (ler o catálogo) |
|
||||
|
||||
```bash
|
||||
sudo apt install openjdk-25-jdk ant make
|
||||
sudo apt install openjdk-25-jdk ant
|
||||
./scripts/pitiupi.sh check
|
||||
cd pitiupi && ant test # testes JUnit do núcleo
|
||||
```
|
||||
|
||||
**GUI:** Swing — WSLg / `DISPLAY=:0`.
|
||||
@@ -92,11 +91,11 @@ sudo apt install openjdk-25-jdk ant make
|
||||
|
||||
| Comando | Ação |
|
||||
| --- | --- |
|
||||
| `run` | Build + `plugins/` + app |
|
||||
| `build` | Build + `plugins/` |
|
||||
| `run` | Build + link + app |
|
||||
| `build` | Build + link |
|
||||
| `link` | Só symlinks (JARs já existem) |
|
||||
| `list` | Catálogo e status do JAR |
|
||||
| `discover` | Sugestão de módulos `pitiupi.*` |
|
||||
| `discover` | Sugestão de módulos com SPI |
|
||||
| `check` | PATH + JSON válido |
|
||||
|
||||
Opções: `--all` (padrão), `--plugins ids`, `--category Social|Jogos|Streaming`.
|
||||
@@ -105,7 +104,10 @@ Opções: `--all` (padrão), `--plugins ids`, `--category Social|Jogos|Streaming
|
||||
|
||||
## Teste em rede
|
||||
|
||||
Duas instâncias, portas distintas, mesma LAN. Ver [docs/documentation/15_testes_e_gate.md](docs/documentation/15_testes_e_gate.md) e [appendix_portas_e_multicast.md](docs/documentation/appendix_portas_e_multicast.md).
|
||||
- **Mesmo PC:** duas instâncias, portas distintas (ex. 5000 e 5001).
|
||||
- **Dois PCs na mesma Wi‑Fi:** mesma porta (ex. 5000), nomes diferentes, mesmos JARs em `~/pitiupi/plugins` em cada máquina.
|
||||
|
||||
Ver [docs/documentation/15_testes_e_gate.md](docs/documentation/15_testes_e_gate.md) e [appendix_portas_e_multicast.md](docs/documentation/appendix_portas_e_multicast.md).
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in new issue
Block a user