Thread: Client/server shared code

  1. #1
    Registered User
    Join Date
    Dec 2006
    Posts
    69

    Client/server shared code

    I'm programming a multiplayer game, and I'm now at the point where I want to store data about player characters. I'm thinking about creating a class for this. I think it would be a good idea to use the exact same class on both client and server. What's the best way to organize this?

    Should I include the same source file in both projects?
    Should I create a static library containing the class and link to it in both client and server?
    Should I use one single library for all shared code?

  2. #2
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,794
    I'd do 1 library for all shared code
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    David J. Wheeler

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Explain this C code in english
    By soadlink in forum C Programming
    Replies: 16
    Last Post: 08-31-2006, 12:48 AM
  2. Replies: 1
    Last Post: 03-21-2006, 07:52 AM
  3. Number of Shared Memory Segments
    By dbt3481 in forum Linux Programming
    Replies: 1
    Last Post: 10-14-2004, 02:43 PM
  4. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  5. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM