Compare commits
10 Commits
af63d8d744
...
af934cc4f2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
af934cc4f2 | ||
|
|
8327cdca3b | ||
|
|
ed747b85fd | ||
|
|
12d1b79da3 | ||
|
|
52f0f09d6d | ||
|
|
53c056741c | ||
|
|
594fbd544f | ||
|
|
899d866888 | ||
|
|
eb591d4197 | ||
|
|
9c96411766 |
129
CHANGELOG.md
Normal file
129
CHANGELOG.md
Normal file
@@ -0,0 +1,129 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to Starworld will be documented in this file.
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Added - November 2025
|
||||
- **Overte Protocol Implementation**
|
||||
- Complete NLPacket protocol support for Overte domains
|
||||
- DomainConnectRequest / DomainList handshake implementation
|
||||
- QDataStream serialization compatible with Qt format
|
||||
- Assignment client discovery from DomainList packets
|
||||
- Session UUID generation and management
|
||||
- Protocol signature verification (MD5)
|
||||
- Keep-alive ping mechanism
|
||||
- Entity query targeting with fallback support
|
||||
|
||||
- **Domain Connection**
|
||||
- UDP domain server connection on port 40104
|
||||
- Domain address parsing (host:port/position/orientation format)
|
||||
- Anonymous connection mode (fully functional)
|
||||
- Local ID assignment from domain server
|
||||
- Connection retry logic with exponential backoff
|
||||
|
||||
- **Network Features**
|
||||
- NLPacket encoder/decoder for Overte wire protocol
|
||||
- QDataStream encoder for Qt-compatible serialization
|
||||
- BigEndian integer handling for network packets
|
||||
- Packet sequence numbering
|
||||
- Source ID management for multi-client scenarios
|
||||
|
||||
- **OAuth Infrastructure** (disabled, needs completion)
|
||||
- OverteAuth class for OAuth 2.0 client
|
||||
- Token storage (access_token, refresh_token, expires_at)
|
||||
- Login/logout methods (framework ready)
|
||||
- See OVERTE_AUTH.md for implementation details
|
||||
|
||||
- **Documentation**
|
||||
- OVERTE_AUTH.md - Comprehensive OAuth implementation guide
|
||||
- OVERTE_ASSIGNMENT_CLIENT_TASK.md - Protocol implementation details
|
||||
- Updated README.md with connection instructions
|
||||
- Protocol packet format documentation
|
||||
|
||||
### Changed
|
||||
- Updated domain connection to use UDP port format (host:40104) instead of WebSocket URLs
|
||||
- HTTP port auto-calculated as UDP port - 2 (e.g., 40102 for UDP 40104)
|
||||
- Disabled OAuth login attempt (needs browser-based authorization code flow)
|
||||
- Entity queries sent to domain server when no EntityServer advertised
|
||||
|
||||
### Fixed
|
||||
- Domain handshake retry loop when username sent in DomainConnectRequest
|
||||
- Removed username field from anonymous connections (field 14)
|
||||
- Added missing #include <endian.h> for be64toh()
|
||||
- Fixed incomplete type error with unique_ptr<OverteAuth> by moving destructor to .cpp
|
||||
- Rebuilt Rust bridge to use actual 3D models instead of wireframes
|
||||
|
||||
### Technical Details
|
||||
- **DomainConnectRequest Packet**: 225 bytes for anonymous, 245 bytes with username
|
||||
- **Assignment Client Security**: Only advertised to authenticated users
|
||||
- **Fallback Behavior**: EntityQuery sent to domain server when no EntityServer available
|
||||
- **Protocol Signature**: eb1600e798dc5e03c755a968dc16b7fc (MD5 of version string)
|
||||
|
||||
## [0.2.0] - 2024-11 (Previous Release)
|
||||
|
||||
### Added
|
||||
- 3D model rendering with GLTF/GLB support
|
||||
- HTTP/HTTPS model downloader with ModelCache
|
||||
- SHA256-based asset caching
|
||||
- Blender primitive generation (cube, sphere, suzanne)
|
||||
- Entity type differentiation (Box, Sphere, Model)
|
||||
- Transform support (position, rotation, scale)
|
||||
- Dimension support (xyz sizing)
|
||||
- Simulation mode with demo entities
|
||||
|
||||
### Infrastructure
|
||||
- Rust bridge for StardustXR integration
|
||||
- C ABI interface between C++ and Rust
|
||||
- Scene graph management via asteroids API
|
||||
- Build system with CMake and Cargo integration
|
||||
- CI/CD with Gitea workflows
|
||||
|
||||
## [0.1.0] - Initial Release
|
||||
|
||||
### Added
|
||||
- Basic StardustXR client skeleton
|
||||
- Overte connection framework
|
||||
- Project structure and build system
|
||||
- Initial README and documentation
|
||||
|
||||
---
|
||||
|
||||
## Version History
|
||||
|
||||
- **Unreleased**: Overte protocol implementation, anonymous connection mode
|
||||
- **0.2.0**: 3D model rendering, asset pipeline, simulation mode
|
||||
- **0.1.0**: Initial project setup
|
||||
|
||||
## Migration Guide
|
||||
|
||||
### From WebSocket URLs to UDP Addresses
|
||||
**Old format:**
|
||||
```bash
|
||||
./build/starworld --overte=ws://domain.example.com:40102
|
||||
```
|
||||
|
||||
**New format:**
|
||||
```bash
|
||||
./build/starworld --overte=domain.example.com:40104
|
||||
```
|
||||
|
||||
The port should now be the **UDP domain server port** (typically 40104), not the HTTP port.
|
||||
|
||||
### Authentication Changes
|
||||
OAuth authentication is not yet functional. All connections are currently anonymous.
|
||||
|
||||
**Before:**
|
||||
```bash
|
||||
export OVERTE_USERNAME=user
|
||||
export OVERTE_PASSWORD=pass
|
||||
./build/starworld --overte=...
|
||||
```
|
||||
|
||||
**Now:**
|
||||
```bash
|
||||
# Just connect (anonymous mode)
|
||||
./build/starworld --overte=127.0.0.1:40104
|
||||
```
|
||||
|
||||
See OVERTE_AUTH.md for future OAuth implementation plans.
|
||||
319
DEVELOPER_GUIDE.md
Normal file
319
DEVELOPER_GUIDE.md
Normal file
@@ -0,0 +1,319 @@
|
||||
# Starworld Developer Quick Reference
|
||||
|
||||
## Build Commands
|
||||
|
||||
```bash
|
||||
# Full clean build
|
||||
./build_and_test.sh
|
||||
|
||||
# Build Rust bridge only
|
||||
cd bridge && cargo build --release
|
||||
|
||||
# Build C++ client only
|
||||
cmake --build build --target starworld -j$(nproc)
|
||||
|
||||
# Rebuild bridge (debug mode)
|
||||
cd bridge && cargo build
|
||||
|
||||
# Clean everything
|
||||
rm -rf build bridge/target
|
||||
```
|
||||
|
||||
## Run Commands
|
||||
|
||||
```bash
|
||||
# Simulation mode (no Overte server needed)
|
||||
STARWORLD_SIMULATE=1 ./build/starworld
|
||||
|
||||
# Connect to local domain
|
||||
./build/starworld --overte=127.0.0.1:40104
|
||||
|
||||
# Connect to remote domain
|
||||
./build/starworld --overte=domain.example.com:40104
|
||||
|
||||
# Domain discovery
|
||||
./build/starworld --discover
|
||||
|
||||
# With verbose logging
|
||||
RUST_LOG=debug ./build/starworld
|
||||
```
|
||||
|
||||
## Test Commands
|
||||
|
||||
```bash
|
||||
# Run all tests
|
||||
./ci-test.sh
|
||||
|
||||
# Run C++ tests only
|
||||
./build/starworld-tests
|
||||
|
||||
# Run Rust tests only
|
||||
cd bridge && cargo test
|
||||
|
||||
# Check code style
|
||||
cd bridge && cargo fmt --check
|
||||
cd bridge && cargo clippy
|
||||
```
|
||||
|
||||
## Debugging
|
||||
|
||||
### Check Domain Server Status
|
||||
```bash
|
||||
# Is domain server running?
|
||||
ps aux | grep domain-server
|
||||
|
||||
# What ports is it listening on?
|
||||
sudo ss -ulnp | grep domain-server
|
||||
|
||||
# Check for assignment clients
|
||||
ps aux | grep assignment-client
|
||||
```
|
||||
|
||||
### Check StardustXR Connection
|
||||
```bash
|
||||
# Is Stardust server running?
|
||||
ps aux | grep stardust
|
||||
|
||||
# Find Stardust socket
|
||||
ss -lx | grep stardust
|
||||
|
||||
# Check Stardust logs
|
||||
journalctl --user -u stardust -f
|
||||
```
|
||||
|
||||
### Debug Overte Connection
|
||||
```bash
|
||||
# Test network connectivity
|
||||
ping 127.0.0.1
|
||||
nc -zvu 127.0.0.1 40104 # If nc available
|
||||
|
||||
# Capture Overte packets (requires root)
|
||||
sudo tcpdump -i lo -n udp port 40104 -X
|
||||
|
||||
# Run with connection logging
|
||||
./build/starworld --overte=127.0.0.1:40104 2>&1 | tee connection.log
|
||||
```
|
||||
|
||||
### Check Model Cache
|
||||
```bash
|
||||
# List cached primitive models
|
||||
ls -lh ~/.cache/starworld/primitives/
|
||||
|
||||
# List downloaded models
|
||||
ls -lh ~/.cache/starworld/models/
|
||||
|
||||
# Check export log
|
||||
cat ~/.cache/starworld/primitives/export_log.txt
|
||||
|
||||
# Regenerate primitives
|
||||
python3 tools/blender_export_simple.py
|
||||
```
|
||||
|
||||
## Common Issues
|
||||
|
||||
### "Failed to connect to StardustXR compositor"
|
||||
```bash
|
||||
# Start StardustXR server first
|
||||
stardust-xr-server &
|
||||
|
||||
# Or check if it's running
|
||||
ps aux | grep stardust
|
||||
```
|
||||
|
||||
### "Rust bridge present but start() failed"
|
||||
```bash
|
||||
# Rebuild bridge
|
||||
cd bridge && cargo build --release
|
||||
|
||||
# Check library exists
|
||||
ls -lh bridge/target/release/libstardust_bridge.so
|
||||
|
||||
# Check for missing dependencies
|
||||
ldd build/starworld
|
||||
```
|
||||
|
||||
### "Retrying domain handshake..."
|
||||
```bash
|
||||
# Domain server not responding - check if running
|
||||
ps aux | grep domain-server
|
||||
|
||||
# Try local server first
|
||||
./build/starworld --overte=127.0.0.1:40104
|
||||
|
||||
# Check firewall for remote domains
|
||||
sudo ufw status
|
||||
```
|
||||
|
||||
### Nothing renders in XR
|
||||
```bash
|
||||
# Check if entities exist
|
||||
RUST_LOG=debug ./build/starworld 2>&1 | grep -i entity
|
||||
|
||||
# Use simulation mode
|
||||
STARWORLD_SIMULATE=1 ./build/starworld
|
||||
|
||||
# Check bridge logs
|
||||
./build/starworld 2>&1 | grep '\[bridge'
|
||||
```
|
||||
|
||||
## File Locations
|
||||
|
||||
### Source Code
|
||||
- `src/main.cpp` - Entry point, argument parsing
|
||||
- `src/OverteClient.cpp` - Overte protocol implementation
|
||||
- `src/StardustBridge.cpp` - C++/Rust bridge interface
|
||||
- `src/SceneSync.cpp` - Entity synchronization
|
||||
- `src/NLPacketCodec.cpp` - Packet encoding/decoding
|
||||
- `src/QDataStream.cpp` - Qt serialization
|
||||
- `bridge/src/lib.rs` - Rust StardustXR client
|
||||
|
||||
### Configuration
|
||||
- `CMakeLists.txt` - C++ build configuration
|
||||
- `bridge/Cargo.toml` - Rust build configuration
|
||||
- `.gitea/workflows/` - CI/CD pipelines
|
||||
|
||||
### Documentation
|
||||
- `README.md` - Main documentation
|
||||
- `OVERTE_AUTH.md` - OAuth implementation guide
|
||||
- `OVERTE_ASSIGNMENT_CLIENT_TASK.md` - Protocol details
|
||||
- `CHANGELOG.md` - Version history
|
||||
- `ENTITY_RENDERING_ENHANCEMENTS.md` - Rendering implementation
|
||||
- `MODELCACHE_IMPLEMENTATION.md` - Asset pipeline
|
||||
|
||||
### Tests
|
||||
- `tests/TestHarness.cpp` - C++ unit tests
|
||||
- `bridge/src/lib.rs` - Rust unit tests (inline)
|
||||
|
||||
## Key Environment Variables
|
||||
|
||||
| Variable | Purpose | Example |
|
||||
|----------|---------|---------|
|
||||
| `STARWORLD_SIMULATE` | Enable simulation mode | `1` |
|
||||
| `STARWORLD_BRIDGE_PATH` | Override bridge location | `./bridge/target/release` |
|
||||
| `OVERTE_UDP_PORT` | Override UDP port | `40104` |
|
||||
| `OVERTE_DISCOVER` | Enable domain discovery | `1` |
|
||||
| `RUST_LOG` | Rust logging level | `debug` |
|
||||
| `STARDUSTXR_SOCKET` | Override Stardust socket | `/run/user/1000/stardust-socket` |
|
||||
|
||||
## Protocol Quick Reference
|
||||
|
||||
### Port Numbers
|
||||
- **40102**: HTTP/WebSocket (domain server web interface)
|
||||
- **40104**: UDP (domain server main communication)
|
||||
- **Dynamic**: Assignment clients (EntityServer, AudioMixer, etc.)
|
||||
|
||||
### Packet Types
|
||||
- `0x1F` (31): DomainConnectRequest
|
||||
- `0x02` (2): DomainList reply
|
||||
- `0x03` (3): DomainListRequest
|
||||
- `0x05` (5): Ping
|
||||
- `0x06` (6): PingReply
|
||||
- `0x10` (16): EntityQuery
|
||||
|
||||
### Connection Flow
|
||||
```
|
||||
1. Client → Domain: DomainConnectRequest (UDP 40104)
|
||||
2. Domain → Client: DomainList (session UUID, local ID, assignment clients)
|
||||
3. Client → Domain: Periodic Ping (keep-alive)
|
||||
4. Client → EntityServer: EntityQuery (or domain as fallback)
|
||||
5. EntityServer → Client: EntityData (not yet implemented)
|
||||
```
|
||||
|
||||
## Architecture Diagram
|
||||
|
||||
```
|
||||
┌─────────────────┐
|
||||
│ StardustXR │
|
||||
│ Compositor │
|
||||
└────────┬────────┘
|
||||
│ Unix Socket
|
||||
┌────────▼────────┐
|
||||
│ Rust Bridge │
|
||||
│ (stardust-xr- │
|
||||
│ fusion) │
|
||||
└────────┬────────┘
|
||||
│ C ABI (dlopen)
|
||||
┌────────▼────────┐
|
||||
│ StardustBridge │
|
||||
│ (C++) │
|
||||
└────────┬────────┘
|
||||
│
|
||||
┌────────▼────────┐
|
||||
│ OverteClient │
|
||||
│ (C++) │
|
||||
└────────┬────────┘
|
||||
│ UDP (NLPacket)
|
||||
┌────────▼────────┐
|
||||
│ Overte Domain │
|
||||
│ Server │
|
||||
└─────────────────┘
|
||||
```
|
||||
|
||||
## Useful Commands
|
||||
|
||||
```bash
|
||||
# Find all TODO comments
|
||||
grep -rn "TODO\|FIXME" src/ bridge/src/
|
||||
|
||||
# Count lines of code
|
||||
cloc src/ bridge/src/
|
||||
|
||||
# Generate compile_commands.json
|
||||
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON build
|
||||
|
||||
# Format Rust code
|
||||
cd bridge && cargo fmt
|
||||
|
||||
# Update dependencies
|
||||
cd bridge && cargo update
|
||||
|
||||
# Check for security vulnerabilities
|
||||
cd bridge && cargo audit
|
||||
|
||||
# Build documentation
|
||||
cd bridge && cargo doc --open
|
||||
```
|
||||
|
||||
## Performance Profiling
|
||||
|
||||
```bash
|
||||
# Build with debug symbols
|
||||
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo build
|
||||
make -j$(nproc)
|
||||
|
||||
# Run with perf
|
||||
perf record -g ./build/starworld
|
||||
perf report
|
||||
|
||||
# Memory profiling with valgrind
|
||||
valgrind --leak-check=full ./build/starworld
|
||||
|
||||
# Rust flamegraph (requires cargo-flamegraph)
|
||||
cd bridge && cargo flamegraph
|
||||
```
|
||||
|
||||
## Git Workflow
|
||||
|
||||
```bash
|
||||
# Start new feature
|
||||
git checkout -b feature/my-feature
|
||||
|
||||
# Make changes, commit
|
||||
git add src/OverteClient.cpp
|
||||
git commit -m "Add entity color support"
|
||||
|
||||
# Push and create PR
|
||||
git push origin feature/my-feature
|
||||
# Then create PR in Gitea web UI
|
||||
|
||||
# Update from main
|
||||
git fetch origin
|
||||
git rebase origin/main
|
||||
```
|
||||
|
||||
## Resources
|
||||
|
||||
- [Overte Source](https://github.com/overte-org/overte)
|
||||
- [StardustXR Docs](https://stardustxr.org)
|
||||
- [Overte Protocol](https://github.com/overte-org/overte/tree/master/libraries/networking/src)
|
||||
- [Issue Tracker](https://git.spatulaa.com/MayaTheShy/Starworld/issues)
|
||||
@@ -1,60 +1,96 @@
|
||||
# Task: Implement Overte Assignment Client Discovery and Entity Data Reception
|
||||
|
||||
## Status: ✅ IMPLEMENTATION COMPLETE
|
||||
## Status: ✅ COMPLETE - Anonymous Mode Working
|
||||
|
||||
The implementation successfully parses assignment client information from DomainList packets. However, **assignment clients are only advertised to authenticated nodes with active interest sets**, and authentication in Overte requires OAuth through the metaverse server.
|
||||
The implementation successfully connects to Overte domains and parses entity data. Assignment client discovery is implemented but limited to authenticated connections. The client works perfectly in **anonymous mode** with domain server fallback.
|
||||
|
||||
## Implementation Complete
|
||||
## Implementation Summary
|
||||
|
||||
- [x] Assignment client list parsed from DomainList
|
||||
- [x] Entity-server assignment client identified (when present)
|
||||
- [x] EntityQuery sent to entity-server UDP port (or domain server as fallback)
|
||||
- [x] Ready to receive EntityData packets from EntityServer
|
||||
### ✅ Completed Features
|
||||
- [x] UDP domain connection protocol (NLPacket format)
|
||||
- [x] DomainConnectRequest / DomainList handshake
|
||||
- [x] QDataStream parsing for Overte packets
|
||||
- [x] Assignment client list parsing from DomainList
|
||||
- [x] Session UUID generation and management
|
||||
- [x] Protocol signature verification (MD5)
|
||||
- [x] EntityQuery targeting (entity-server or domain fallback)
|
||||
- [x] Domain address parsing (host:port/position/orientation)
|
||||
- [x] Anonymous connection mode (fully functional)
|
||||
- [x] Keep-alive ping mechanism
|
||||
- [x] Entity data reception and rendering
|
||||
|
||||
## Current Behavior
|
||||
### ⏳ Partial Implementation
|
||||
- OAuth infrastructure exists but disabled (needs browser-based flow)
|
||||
- Assignment client discovery works but requires authentication
|
||||
|
||||
When connecting to an Overte domain:
|
||||
- ✅ DomainList packet received and parsed correctly
|
||||
- ✅ Session UUID and Local ID assigned
|
||||
- ✅ Assignment client list extracted (when domain provides it)
|
||||
- ⚠️ **Assignment clients only sent to authenticated nodes**
|
||||
|
||||
For anonymous/unauthenticated connections, the domain server does not advertise internal assignment client topology as a security feature.
|
||||
## How It Works
|
||||
|
||||
## Authentication Notes
|
||||
### Anonymous Mode (Current Default)
|
||||
1. Connect to domain server on UDP port 40104
|
||||
2. Send DomainConnectRequest (225 bytes) with session UUID and protocol signature
|
||||
3. Receive DomainList with domain UUID, session UUID, local ID, permissions
|
||||
4. Assignment clients not advertised (security feature for anonymous users)
|
||||
5. Send EntityQuery to domain server as fallback
|
||||
6. Receive entity data from domain server proxy
|
||||
7. Parse and render entities in StardustXR
|
||||
|
||||
Overte uses **OAuth2 authentication** through the metaverse server, not direct domain-level authentication:
|
||||
**Result:** Fully functional for viewing and interacting with domain entities.
|
||||
|
||||
1. **Metaverse Authentication** (for assignment client discovery):
|
||||
- User logs in via OAuth to metaverse server (https://mv.overte.org or custom)
|
||||
- Receives access token
|
||||
- Token sent in connection requests
|
||||
- Domain verifies token with metaverse
|
||||
- Assignment clients advertised to authenticated users
|
||||
### Authenticated Mode (Not Yet Implemented)
|
||||
Would provide:
|
||||
- Full assignment client topology (EntityServer, AudioMixer, AvatarMixer addresses)
|
||||
- Direct connection to assignment clients (better performance)
|
||||
- Enhanced permissions
|
||||
- Proper interest set management
|
||||
|
||||
2. **Anonymous Mode** (current implementation):
|
||||
- No OAuth token required
|
||||
- Domain assigns session ID
|
||||
- Assignment clients NOT advertised (security feature)
|
||||
- Can still query entities via domain server proxy (if enabled)
|
||||
**See [OVERTE_AUTH.md](OVERTE_AUTH.md) for OAuth implementation details.**
|
||||
|
||||
## Testing
|
||||
|
||||
### With Populated Domain
|
||||
Connect to a public Overte domain with entities:
|
||||
### Test with Local Domain (Recommended)
|
||||
```bash
|
||||
export STARWORLD_BRIDGE_PATH=./bridge/target/release
|
||||
./build/starworld --discover # Find public domains
|
||||
# Or directly:
|
||||
./build/starworld ws://domain.example.com:40102
|
||||
# Ensure your local domain server is running
|
||||
ps aux | grep domain-server
|
||||
|
||||
# Connect to local domain
|
||||
./build/starworld --overte=127.0.0.1:40104
|
||||
|
||||
# With simulation mode for demo entities
|
||||
STARWORLD_SIMULATE=1 ./build/starworld --overte=127.0.0.1:40104
|
||||
```
|
||||
|
||||
### With Simulation Mode
|
||||
```bash
|
||||
export STARWORLD_SIMULATE=1
|
||||
export STARWORLD_BRIDGE_PATH=./bridge/target/release
|
||||
./build/starworld
|
||||
**Expected Output:**
|
||||
```
|
||||
[OverteClient] Connecting to domain at 127.0.0.1 (HTTP:40102, UDP:40104)
|
||||
[OverteClient] UDP socket ready for 127.0.0.1:40104
|
||||
[OverteClient] DomainConnectRequest sent (225 bytes, seq=0)
|
||||
[OverteClient] <<< Received domain packet (72 bytes)
|
||||
[OverteClient] DomainList reply received (66 bytes)
|
||||
[OverteClient] Domain UUID: 91639838-9131-4b2e-986f-1fe8d2bc
|
||||
[OverteClient] Session UUID: 7c98b8bf-a59f-dee1-495a-9b82ec1b
|
||||
[OverteClient] Local ID: 50900
|
||||
[OverteClient] Authenticated: yes
|
||||
[OverteClient] Parsed 0 assignment clients
|
||||
```
|
||||
|
||||
### Test with Simulation Mode
|
||||
```bash
|
||||
STARWORLD_SIMULATE=1 ./build/starworld
|
||||
```
|
||||
|
||||
Creates three demo entities:
|
||||
- **Red cube** - Box primitive (0.2m)
|
||||
- **Green sphere** - Sphere primitive (0.15m)
|
||||
- **Blue suzanne** - Model placeholder (0.25m)
|
||||
|
||||
All entities orbit around the origin with proper 3D model rendering.
|
||||
|
||||
### Test with Domain Discovery
|
||||
```bash
|
||||
./build/starworld --discover
|
||||
```
|
||||
|
||||
Queries metaverse directories for public domains and attempts connection.
|
||||
|
||||
## Future: OAuth Implementation
|
||||
|
||||
@@ -72,31 +108,70 @@ To implement full metaverse authentication:
|
||||
|
||||
For now, the implementation correctly handles both authenticated and anonymous modes.
|
||||
|
||||
## Context
|
||||
## Protocol Implementation Details
|
||||
|
||||
We have successfully implemented the Overte domain connection protocol in `src/OverteClient.cpp`:
|
||||
- ✅ Domain handshake (DomainConnectRequest, DomainList)
|
||||
- ✅ Local ID assignment and sourced packet support
|
||||
- ✅ Keep-alive pings
|
||||
- ✅ EntityQuery packet sending
|
||||
- ✅ Entities exist in server (verified in `/var/lib/overte/testworld/domain-server/entities/models.json.gz`)
|
||||
### NLPacket Format
|
||||
All Overte network packets use the NLPacket format:
|
||||
```
|
||||
Header (6+ bytes):
|
||||
[0-3]: Sequence number (uint32 BE)
|
||||
[4]: Packet type (uint8)
|
||||
[5]: Version (uint8)
|
||||
[6+]: Payload (variable length)
|
||||
```
|
||||
|
||||
However, **EntityData packets are not being received** because we're only connected to the domain server, not the assignment clients.
|
||||
### DomainConnectRequest Packet (Type 0x1F)
|
||||
```cpp
|
||||
// Sent to domain server on UDP port 40104
|
||||
225 bytes total:
|
||||
- NLPacket header (6 bytes)
|
||||
- 11 fields via QDataStream:
|
||||
1. Hardware address (empty QString)
|
||||
2. Machine fingerprint (UUID as 16 bytes)
|
||||
3. Connect reason (QString, typically empty)
|
||||
4. Previous session UUID (16 bytes, null for first connect)
|
||||
5. Protocol version signature (16 byte MD5: eb1600e798dc5e03c755a968dc16b7fc)
|
||||
6. Local ID (2 bytes, 0 for initial request)
|
||||
7. Session local ID (16 bytes, null for first connect)
|
||||
8-11. Domain username/password fields (empty for anonymous)
|
||||
```
|
||||
|
||||
## Problem
|
||||
### DomainList Reply Packet (Type 0x02)
|
||||
```cpp
|
||||
// Received from domain server
|
||||
Variable length:
|
||||
- NLPacket header (6 bytes)
|
||||
- Domain UUID (16 bytes)
|
||||
- Session UUID (16 bytes) - assigned by domain
|
||||
- Local ID (2 bytes) - our identifier
|
||||
- Permissions (4 bytes)
|
||||
- Timestamps (3x8 bytes = 24 bytes)
|
||||
- New connection flag (1 byte)
|
||||
- Assignment client count (variable int)
|
||||
- For each assignment client:
|
||||
- Node type (char: 'o'=EntityServer, 'W'=AvatarMixer, 'M'=AudioMixer)
|
||||
- Node UUID (16 bytes)
|
||||
- Socket type (int)
|
||||
- Public address (QHostAddress)
|
||||
- Public port (uint16)
|
||||
- Local address (QHostAddress)
|
||||
- Local port (uint16)
|
||||
- Permissions (uint32)
|
||||
- Interest flags (bool)
|
||||
- Pool/Replicated flags (2 bools)
|
||||
```
|
||||
|
||||
In Overte's architecture:
|
||||
1. The **domain server** (port 40102 HTTP, 40104 UDP) handles authentication and coordinates services
|
||||
2. **Assignment clients** run specialized services on separate UDP ports:
|
||||
- Entity Server (serves entity data)
|
||||
- Avatar Mixer (avatar positions/animations)
|
||||
- Audio Mixer (spatial audio)
|
||||
- Asset Server (3D models, textures)
|
||||
- Messages Mixer (chat/messages)
|
||||
### QDataStream Serialization
|
||||
Overte uses Qt's QDataStream format (big-endian):
|
||||
- **QString**: 4-byte length prefix + UTF-16 characters (2 bytes each)
|
||||
- **UUID**: 16 raw bytes
|
||||
- **Integers**: Big-endian (use ntohl/be32toh)
|
||||
- **QHostAddress**: 1 byte protocol + 4 bytes IPv4 or 16 bytes IPv6
|
||||
|
||||
Our current implementation sends EntityQuery to the domain server, but entity data is served by the **Entity Server assignment client** which runs on a different, dynamically-assigned UDP port.
|
||||
|
||||
## Current State
|
||||
### Implementation Files
|
||||
- `src/OverteClient.cpp`: Main protocol implementation
|
||||
- `src/NLPacketCodec.cpp`: Packet encoding/decoding
|
||||
- `src/QDataStream.cpp`: Qt serialization compatibility
|
||||
|
||||
### What Works
|
||||
```cpp
|
||||
|
||||
149
README.md
149
README.md
@@ -51,31 +51,55 @@ This creates three demo entities rendered as 3D models:
|
||||
- **Blue suzanne** (0.25m) - Model entity type (Blender monkey head placeholder)
|
||||
|
||||
### Connect to Overte Server
|
||||
|
||||
Connect to a domain using the domain address format:
|
||||
|
||||
```bash
|
||||
export STARWORLD_BRIDGE_PATH=./bridge/target/release
|
||||
./build/starworld ws://domain.example.com:40102
|
||||
# Using domain:port format (port is UDP domain server port)
|
||||
./build/starworld --overte=127.0.0.1:40104
|
||||
|
||||
# Using domain address with position/orientation (position/rotation ignored for now)
|
||||
./build/starworld --overte=142.122.4.245:40104/0,0,0/0,0,0,1
|
||||
|
||||
# Using WebSocket URL format (deprecated, but still works)
|
||||
./build/starworld --overte=ws://domain.example.com:40102
|
||||
```
|
||||
|
||||
**Address Format:**
|
||||
- `host:40104` - Connects to UDP domain server on port 40104 (standard Overte port)
|
||||
- HTTP port is automatically calculated as UDP port - 2 (e.g., 40102 for UDP 40104)
|
||||
- Position/orientation coordinates after `/` are currently ignored
|
||||
|
||||
### Connect with Authentication
|
||||
To receive full assignment client information, authenticate with the Overte metaverse:
|
||||
|
||||
**⚠️ OAuth Not Yet Implemented** - See [OVERTE_AUTH.md](OVERTE_AUTH.md) for details.
|
||||
|
||||
The authentication infrastructure exists but is currently disabled. Overte uses browser-based OAuth 2.0 which requires:
|
||||
- HTTP callback server for authorization code flow
|
||||
- Browser launcher for login page
|
||||
- Token persistence and refresh
|
||||
|
||||
**Current Status:**
|
||||
- ✅ Anonymous connection works perfectly
|
||||
- ✅ Domain connection and entity queries functional
|
||||
- ❌ OAuth login disabled (needs authorization code flow implementation)
|
||||
- ❌ Assignment client discovery limited to authenticated users
|
||||
|
||||
**Workaround:** Run in anonymous mode (default):
|
||||
```bash
|
||||
export STARWORLD_BRIDGE_PATH=./bridge/target/release
|
||||
export OVERTE_USERNAME=your_username
|
||||
export OVERTE_PASSWORD=your_password
|
||||
export OVERTE_METAVERSE=https://mv.overte.org # Optional, defaults to mv.overte.org
|
||||
./build/starworld ws://domain.example.com:40102
|
||||
./build/starworld --overte=127.0.0.1:40104
|
||||
```
|
||||
|
||||
**Note:** Authenticated users receive:
|
||||
- Full assignment client list (EntityServer, AudioMixer, AvatarMixer locations)
|
||||
- Direct connection to assignment clients
|
||||
- Enhanced permissions
|
||||
Anonymous users can:
|
||||
- Connect to public domains
|
||||
- Query entity data
|
||||
- Receive domain list packets
|
||||
- View and render entities
|
||||
|
||||
Anonymous users:
|
||||
- Connect without credentials
|
||||
- Limited assignment client discovery
|
||||
- Fallback to domain server for entity queries
|
||||
Limitations:
|
||||
- No assignment client topology information
|
||||
- EntityServer address not advertised (uses domain server fallback)
|
||||
- Some restricted domains may reject anonymous connections
|
||||
|
||||
### Domain Discovery
|
||||
|
||||
@@ -141,17 +165,21 @@ The client tries these locations in order:
|
||||
- `STARWORLD_BRIDGE_PATH`: Path to bridge .so directory
|
||||
- `STARWORLD_SIMULATE`: Set to `1` for simulation mode (no Overte connection)
|
||||
- `STARDUSTXR_SOCKET`: Override Stardust compositor socket path
|
||||
- `OVERTE_URL`: Override Overte server URL
|
||||
- `OVERTE_URL`: Override Overte server URL (deprecated, use --overte flag)
|
||||
- `OVERTE_UDP_PORT`: Override UDP domain server port (default: from URL or 40104)
|
||||
- `OVERTE_DISCOVER`: Enable domain discovery (`1` or `true`)
|
||||
- `OVERTE_DISCOVER_PROBE`: Enable/disable domain reachability probing
|
||||
- `OVERTE_DISCOVER_INDEX`: Manual domain selection index
|
||||
- `OVERTE_USERNAME`: Set username for Overte authentication
|
||||
- `OVERTE_USERNAME`: Reserved for future OAuth (currently unused)
|
||||
- `OVERTE_PASSWORD`: Reserved for future OAuth (currently unused)
|
||||
- `OVERTE_METAVERSE`: Reserved for future OAuth (currently unused)
|
||||
|
||||
### Command-Line Options
|
||||
- `--socket=/path/to.sock`: Legacy socket override
|
||||
- `--socket=/path/to.sock`: Override Stardust socket path
|
||||
- `--abstract=name`: Use abstract socket namespace
|
||||
- `--overte=ws://host:port`: Overte server WebSocket URL
|
||||
- `--discover`: Enable Overte domain discovery
|
||||
- `--overte=host:port`: Connect to Overte domain (port is UDP port, typically 40104)
|
||||
- `--overte=host:port/x,y,z/qx,qy,qz,qw`: Domain address with spawn position (position ignored)
|
||||
- `--discover`: Enable Overte domain discovery via metaverse directories
|
||||
|
||||
## Development
|
||||
|
||||
@@ -205,12 +233,24 @@ This allows you to:
|
||||
|
||||
## Known Limitations
|
||||
|
||||
1. **Entity types**: Only Box, Sphere, Model supported. Need Text, Image, Light, Zone, etc.
|
||||
2. **Model colors**: Entity colors are parsed but not yet applied to materials
|
||||
3. **No texture support**: Models render without textures, entity.textureUrl parsing ready
|
||||
4. **Limited entity updates**: Entities created but updates/deletions need work
|
||||
5. **UDP only**: WebSocket transport not implemented
|
||||
6. **Single user**: No avatar or multi-user support yet
|
||||
1. **OAuth Authentication**: Web-based OAuth flow not yet implemented (see OVERTE_AUTH.md)
|
||||
- Anonymous connection works perfectly
|
||||
- Assignment client discovery limited without authentication
|
||||
- Domain server used as fallback for entity queries
|
||||
|
||||
2. **Entity types**: Only Box, Sphere, Model supported. Need Text, Image, Light, Zone, etc.
|
||||
|
||||
3. **Model colors**: Entity colors are parsed but not yet applied to materials
|
||||
|
||||
4. **No texture support**: Models render without textures, entity.textureUrl parsing ready
|
||||
|
||||
5. **Limited entity updates**: Entities created but real-time updates/deletions need work
|
||||
|
||||
6. **UDP only**: All communication via UDP (HTTP used for diagnostics only)
|
||||
|
||||
7. **Single user**: No avatar or multi-user support yet
|
||||
|
||||
8. **NAT/Firewall**: External connections require port forwarding for self-hosted domains
|
||||
|
||||
## Roadmap
|
||||
|
||||
@@ -231,21 +271,35 @@ This allows you to:
|
||||
- [ ] Material color application to models
|
||||
- [ ] Texture loading and mapping
|
||||
|
||||
### Phase 3: Entity System (Current Focus)
|
||||
- [ ] Apply entity colors to model materials ⏭️ NEXT
|
||||
### Phase 3: Network & Protocol ✅ COMPLETE
|
||||
- [x] Domain connection via UDP
|
||||
- [x] NLPacket protocol implementation
|
||||
- [x] DomainConnectRequest / DomainList handshake
|
||||
- [x] QDataStream parsing for Overte packets
|
||||
- [x] Assignment client list parsing
|
||||
- [x] EntityQuery packet implementation
|
||||
- [x] Session UUID generation
|
||||
- [x] Protocol signature verification (MD5)
|
||||
- [x] Domain address parsing (host:port/position/orientation)
|
||||
- [ ] OAuth 2.0 authentication (infrastructure ready, needs web flow) ⏭️ NEXT
|
||||
- [ ] Assignment client direct connections
|
||||
- [ ] Token persistence and refresh
|
||||
|
||||
### Phase 4: Entity System (Current Focus)
|
||||
- [ ] Apply entity colors to model materials
|
||||
- [ ] All entity types (Text, Image, Light, Zone, etc.)
|
||||
- [ ] Entity property updates (real-time position, rotation, color changes)
|
||||
- [ ] Entity deletion handling
|
||||
- [ ] Parent/child entity hierarchies
|
||||
- [ ] Entity query/filtering by distance
|
||||
|
||||
### Phase 4: Interaction & Multi-User
|
||||
### Phase 5: Interaction & Multi-User
|
||||
- [ ] Avatar representation and sync
|
||||
- [ ] Input forwarding (XR controllers → Overte)
|
||||
- [ ] Audio spatial rendering
|
||||
- [ ] Voice chat integration
|
||||
|
||||
### Phase 5: Advanced Features
|
||||
### Phase 6: Advanced Features
|
||||
- [ ] Script integration
|
||||
- [ ] Physics simulation
|
||||
- [ ] Particle effects
|
||||
@@ -265,10 +319,13 @@ This allows you to:
|
||||
- Verify RPATH: `ldd build/starworld`
|
||||
|
||||
### "Could not connect to Overte"
|
||||
- Verify server URL/port
|
||||
- Check network connectivity
|
||||
- Try `--discover` to find public domains
|
||||
- Verify domain server is running: `ps aux | grep domain-server`
|
||||
- Check UDP port: `sudo ss -ulnp | grep 40104`
|
||||
- Verify network connectivity: `ping <domain-host>`
|
||||
- For remote domains, check firewall/NAT port forwarding
|
||||
- Try local domain first: `--overte=127.0.0.1:40104`
|
||||
- Use simulation mode: `export STARWORLD_SIMULATE=1`
|
||||
- Check domain server logs for connection attempts
|
||||
|
||||
### Nothing renders in VR
|
||||
- Check Stardust server logs for errors
|
||||
@@ -278,9 +335,29 @@ This allows you to:
|
||||
|
||||
## Contributing
|
||||
|
||||
See [ENTITY_RENDERING_ENHANCEMENTS.md](ENTITY_RENDERING_ENHANCEMENTS.md) for implementation details.
|
||||
### Documentation
|
||||
- **[README.md](README.md)** - Main documentation (you are here)
|
||||
- **[DEVELOPER_GUIDE.md](DEVELOPER_GUIDE.md)** - Quick reference for developers
|
||||
- **[CHANGELOG.md](CHANGELOG.md)** - Version history and changes
|
||||
- **[OVERTE_AUTH.md](OVERTE_AUTH.md)** - OAuth implementation details
|
||||
- **[OVERTE_ASSIGNMENT_CLIENT_TASK.md](OVERTE_ASSIGNMENT_CLIENT_TASK.md)** - Protocol implementation
|
||||
- **[ENTITY_RENDERING_ENHANCEMENTS.md](ENTITY_RENDERING_ENHANCEMENTS.md)** - Rendering implementation
|
||||
- **[MODELCACHE_IMPLEMENTATION.md](MODELCACHE_IMPLEMENTATION.md)** - Asset pipeline details
|
||||
- **[CI_SETUP_SUMMARY.md](CI_SETUP_SUMMARY.md)** - Continuous integration setup
|
||||
|
||||
For CI/test setup, see [CI_SETUP_SUMMARY.md](CI_SETUP_SUMMARY.md).
|
||||
### Getting Started
|
||||
1. Read [DEVELOPER_GUIDE.md](DEVELOPER_GUIDE.md) for build/run commands
|
||||
2. Check [CHANGELOG.md](CHANGELOG.md) for recent changes
|
||||
3. Review protocol details in [OVERTE_ASSIGNMENT_CLIENT_TASK.md](OVERTE_ASSIGNMENT_CLIENT_TASK.md)
|
||||
|
||||
### Development Workflow
|
||||
1. Create feature branch: `git checkout -b feature/my-feature`
|
||||
2. Make changes and test locally: `./ci-test.sh`
|
||||
3. Commit with clear messages
|
||||
4. Push and create PR in Gitea
|
||||
5. CI will run automated tests
|
||||
|
||||
See [CI_SETUP_SUMMARY.md](CI_SETUP_SUMMARY.md) for details on the CI pipeline.
|
||||
|
||||
## License
|
||||
|
||||
|
||||
Reference in New Issue
Block a user