forked from irmen/Tale
-
-
Notifications
You must be signed in to change notification settings - Fork 7
update v0.42.0 #129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
update v0.42.0 #129
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Added FastAPI, websockets, and uvicorn to requirements.txt - Created TaleFastAPIApp class with WebSocket endpoint in if_browser_io.py - Updated HttpIo class to support both WSGI and FastAPI modes - Modified driver_if.py to support WebSocket mode via use_websocket flag - Updated script.js to support WebSocket connections with EventSource fallback - WebSocket sends/receives JSON messages for bidirectional communication Co-authored-by: neph1 <[email protected]>
- Added --websocket flag to main.py for enabling WebSocket mode - Updated aiohttp requirement to >=3.9.0 for Python 3.12 compatibility - WebSocket mode can now be enabled with: python -m tale.main --game <path> --web --websocket Co-authored-by: neph1 <[email protected]>
- Extract error message display logic into reusable function in script.js - Remove unused Empty exception import from if_browser_io.py - Fix WebSocket exception handling to remove unreachable code - Fix JavaScript syntax error in protocol detection - Add documentation for WebSocket feature (WEBSOCKET.md) Co-authored-by: neph1 <[email protected]>
- Fix race condition in WebSocket connection detection using connectionEstablished flag - Add adaptive timeout in WebSocket loop: short timeout (0.1s) when active, long timeout (0.5s) when idle - Reduce CPU usage by sleeping longer (0.1s) when no activity detected - Improve error handling for initial connection failures vs established connection errors Co-authored-by: neph1 <[email protected]>
- Add error handling for WebSocket send failures with fallback to AJAX - Extract sendViaAjax helper function to reduce code duplication - Improve WebSocket exception handling with proper logging and traceback - Add specific handling for asyncio.CancelledError - Extract _process_command method to eliminate duplicate command processing logic - Add player context to error messages for better debugging Co-authored-by: neph1 <[email protected]>
- Created IMPLEMENTATION_SUMMARY.md with complete implementation details - Documented all components, message protocol, and quality assurance - Added testing recommendations and future enhancement ideas - Includes compatibility notes and usage examples Co-authored-by: neph1 <[email protected]>
…layer_connection The player_connection object doesn't have a driver attribute. Changed to access story config through self.fastapi_server.driver.story.config instead of player_connection.driver.story.config in singleplayer_mainloop method. Co-authored-by: neph1 <[email protected]>
Co-authored-by: neph1 <[email protected]>
Co-authored-by: neph1 <[email protected]>
Co-authored-by: neph1 <[email protected]>
Co-authored-by: neph1 <[email protected]>
Co-authored-by: neph1 <[email protected]>
…q_nr logic Co-authored-by: neph1 <[email protected]>
…er to server The HttpIo.__init__() signature was changed to use 'server' instead of 'wsgi_server' as part of the WebSocket implementation. Updated the tests to use the new parameter name. Co-authored-by: neph1 <[email protected]>
Add WebSocket support to browser IO using FastAPI
Add !reset_story wizard command to restart story without server restart
Co-authored-by: neph1 <[email protected]>
Co-authored-by: neph1 <[email protected]>
Co-authored-by: neph1 <[email protected]>
Remove EventSource-based WSGI API from IF mode
fix items and races in prancing llama
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
reset_story command
add websocket api