sta / sta/websocket-sharp

Design structure to use this library for a game

Open
#620 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
6.1k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

Hi, I am building a multiplayer game with this library, and am wondering if anyone could suggest some best design practices for how I can build it. I have a Player object, and a ClientService object that implements WebSocketBehavior.

Should the ClientService have an instance variable of the player it's responsible for? Should the Player object have a WebSocketContext instance variable?

For example, the player dies, and a packet needs to be sent to the client. Should the Player class have a WebSocketContext and send the packet to it's client inside the Player class? Or should it be done in the ClientService class?

Any suggestions on design would be appreciated.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue discusses the Player and ClientService objects, WebSocketBehavior, WebSocketContext, and sending a packet when a player dies. No repository file, test, or concrete implementation target is identified, so a contributor would first need to clarify the intended architecture and scope with the project maintainers.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
game-dev, networking
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.