Skip to content
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

[POC] Use socket for base save/update | Prevent multiple session #29

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sush1lemon
Copy link
Contributor

  • Add tcp server to prevent same account multiple flash intance
  • Uses redis to cache the user id with expiration (15s)

@sush1lemon sush1lemon force-pushed the feature/tcp-socket-server branch from 2e2147a to c6ffe02 Compare February 6, 2024 16:12
@BigmanGHark
Copy link
Collaborator

Will this work in the browser if we ever support that? Just curious about how that would work - think we may need to use Websockets instead of a raw tcp connection for browser unless we just dont care about ever supporting that cc: @React1-X

Maybe there is a way to do a tcp connection via webRTC protocol but IDK

@sush1lemon
Copy link
Contributor Author

I think ruffle provide a workaround for this: ruffle socket. Or we can just implement a websocket version once we start using browser

- Add tcp server to prevent same account using multiple flash intance
- Uses redis to cache the user id with expiration (20s)
- Uses instance id to determince unique connection
@sush1lemon sush1lemon force-pushed the feature/tcp-socket-server branch from 626b511 to f066dee Compare February 6, 2024 20:33
@sush1lemon sush1lemon changed the title feat: tcp server and client changes feat: tcp server and client changes (wip) Feb 7, 2024
@sush1lemon sush1lemon changed the title feat: tcp server and client changes (wip) [POC] Use socket for base save/update | Prevent multiple session Feb 9, 2024
@React1-X React1-X added enhancement New feature or request beta Beta related issue or feature server Server related issues or features client Client related issues labels Mar 7, 2024
@React1-X React1-X self-assigned this Mar 7, 2024
@tram98
Copy link
Contributor

tram98 commented Oct 30, 2024

@sush1lemon @BigmanGHark I'd suggest to use a WebSocket instead. It also would make sense to refactor the URLLoaderAPI to work more service oriented.

@React1-X
Copy link
Contributor

@sush1lemon @BigmanGHark I'd suggest to use a WebSocket instead. It also would make sense to refactor the URLLoaderAPI to work more service oriented.

I think this has been discussed before, but, the easiest solution is:

  • Store a user's session / token in the database, I believe we are doing 90% of this already except for the actual storing - and then when they try to login again on another Flash window, the token will be invalid because it will be different to the one stored in the database. This avoids the complexities of using AS3 WebSockets, and probably reduces overhead.

@React1-X React1-X marked this pull request as draft November 15, 2024 07:55
@React1-X
Copy link
Contributor

This issue has been solved using simple token invalidation on the server - however, I will keep this PR here as POC, just in case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta Beta related issue or feature client Client related issues enhancement New feature or request server Server related issues or features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants