dusk-rs / dusk-social

Cross-world social communication server.
https://dusk.rs
Other
4 stars 1 forks source link

Decide on what exactly the social server is responsible for #6

Open kiairatech opened 4 years ago

kiairatech commented 4 years ago

Distribution only

Pros

Processing & distribution

Pros

GregHib commented 4 years ago

One of the issues with hestia's social server that I put off sorting out was because the social server held the relationship information (friends/ingores lists) the game server didn't have that information when it was needed so would've had to queery the social server to obtain that information.

I think distribution is the way to go. It keeps the logic with the rest of the game logic, the event bus doesn't need to be moved into the shared library to use twice in two places. And if the social server goes down or isn't needed then only cross-world communication is interfered, local world communications will continue to work fine.

kiairatech commented 4 years ago

Whether or not the social server does processing, the social client(s) will have some logic to do themselves.

Take for example a player logs out from world 1. The social client will send a message to the social server, which may process it or not (depending on our choice), and then relay it to the other clients. The client must then handle that message being received. The logic for receiving relayed messages must be done on all clients.

Now, the question is how to model this logic.

GregHib commented 4 years ago

The client must then handle that message being received. The logic for receiving relayed messages must be done on all clients.

Now, the question is how to model this logic.

Is there any logic needed at all? Due to where the information is coming from the messages are trusted, so they can be decoded and emitted straight to the event bus to be handled by content systems.

kiairatech commented 4 years ago

Is there any logic needed at all? Due to where the information is coming from the messages are trusted, so they can be decoded and emitted straight to the event bus to be handled by content systems.

I should've said the handling of the message from the social server. For example, handling a private message received event on world 2 for player a (which was sent from world 1 by player b).

kiairatech commented 4 years ago

Social Core

States

  1. Handshake
  2. Identification
  3. Relay

Handshake

  1. Connection is made between client and server
  2. Client sends build major and minor information
  3. Server receives build major and minor information Server anaylzes the data to see if it matches the current data
  4. Server sends response to client
    • in the case of a non-match, the connection is terminated after the data is sent
  5. Client receives build response and transfers to the identification state

Identification

  1. Client sends identification information
  2. Server receives identification information Server analyzes the data to see if the world can exist
  3. Server sends response to the client
    • in the case where the world cannot exist, the server closes the connection after the data is sent
  4. Client receives identification response and transfers to the relay state

Relay

  1. Server receives a packet
  2. Server relays to all connected worlds

Considerations

  1. In order for relay to work, the server must know:
    • channel information for each world in order to send data to it therefore the server must hold all connected worlds and be able to map them to a channel

Requirements

Sessions must be verifiable, and timeout after not being able to be verified

  • this requires a methodology to hold all current connections in an efficient way