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

CLIENT-SERVER Architecture #4

Closed
dragosc1 opened this issue Oct 22, 2024 · 0 comments · Fixed by #21
Closed

CLIENT-SERVER Architecture #4

dragosc1 opened this issue Oct 22, 2024 · 0 comments · Fixed by #21
Assignees
Labels
enhancement New feature or request refactoring Improvements or simplifications in code and/or logic
Milestone

Comments

@dragosc1
Copy link
Contributor

dragosc1 commented Oct 22, 2024

Split the code into client and server components:


Server Tasks:
  • Implement a Server Class in the Code:
  • Ensure the server class is instantiated correctly.
  • Multithreading: Enable multithreading for the server.
  • Handle packets: The server receives inputs from clients and sends updates back.
  • Stringify/Unstringify JSON packets.
  • Ensure consistent packet update logic between the client and server.

  • Client Tasks:
  • Establish server connection.
  • Send input data packets to the server in JSON format.
  • Process server updates and display them on the screen.
  • Implement multithreading to handle input packets and display updates.
  • Refactor client as a class, containing instances of the necessary components (as listed in the table).

  • Server Class Components:
  • WaveManager : Manages waves of entities or enemies.
  • Random : Handles random number generation.
  • Map : Manages the game map or environment data.
  • InteractionManager : Coordinates interactions between entities.
  • GlobalClock : Keeps track of the server’s global time or tick count.
  • Game : Central game logic manager.
  • Entity : Manages entities in the game (players, zombies, etc.).
  • CollisionManager : Handles collision detection and responses.
  • maps : Potentially stores or manages multiple maps or sections of a map.

  • Client Class Components:
  • WindowManager : Manages the client-side game window.
  • SoundManager : Controls sound and music playback.
  • ResourceManager : Loads and manages game resources (textures, sounds, etc.).
  • Renderer : Handles rendering graphics and visuals on the client-side.
  • MenuManager : Manages the game menus and UI navigation.
  • Input : Manages player inputs (keyboard, mouse, etc.).
  • HUD : Manages the heads-up display (HUD) elements shown to the player.
  • Camera : Handles the game camera movement and positioning.
  • ButtonGroup & ButtonBuilder : Manages the grouping and construction of buttons in the UI.
  • Shaders : Manages shaders (though the server does not handle drawing).
  • config : Holds configuration data or settings for the client.
  • @Razvan48 Razvan48 added refactoring Improvements or simplifications in code and/or logic enhancement New feature or request labels Oct 22, 2024
    @sebimih13 sebimih13 added this to the v0.2 release milestone Oct 23, 2024
    @sebimih13 sebimih13 pinned this issue Oct 23, 2024
    @sebimih13 sebimih13 linked a pull request Jan 5, 2025 that will close this issue
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    enhancement New feature or request refactoring Improvements or simplifications in code and/or logic
    Projects
    None yet
    Development

    Successfully merging a pull request may close this issue.

    6 participants