Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6072509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:10:05+00:00 2026-05-23T10:10:05+00:00

Exit-games make a network library product called photon, and they have and actively develop

  • 0

Exit-games make a network library product called photon, and they have and actively develop a limited mmo demo. Rather than shooting off json or XML, etc. saying “MovePlayer” (with associated params), they nut that message down to a 2 digit int, via an enum – something like Operations.MovePlayer. There’s no denying that a 2 digit int is smaller than a longer string, however I really hate the idea of statically burning each and every message into an enum.

Would there be an alternative way to have a MessageID property assign itself a unique 2 digit int based on a lookup table or something? Has anyone dealt with this kind of thing before?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T10:10:06+00:00Added an answer on May 23, 2026 at 10:10 am

    For games, this is not the “old-school” way of doing things – it’s the norm.

    This is because, unlike typical web-services where the server will send the client data in short, rare bursts, in games, the server and client are sending packets back and forth constantly. The number of packets needed to synchronize every client’s state with every other’s balloons exponentially with the number of players, so the more players your game will have, the more important it is to keep the packet-size small.

    Also, going over the MTU size (usually about 1400 bytes) will cause packet-fragmentation, which can have a significant impact on performance.

    Note also that Microsoft has an 8 kilobytes-per-second upload and download limit on games made for the XBox 360, so you pretty much can’t create an MMO using XML for networking messages.


    As for how to translate a byte into a message type: just use a switch statement, or store a Dictionary<byte, Type> or Dictionary<byte, Func<Message>> (assuming you have a bunch of message-classes which all derive from base-class Message)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No matter what I do sys.exit() is called by unittest, even the most trivial
I am making a game and have started to work on a class called
How do I exit a script early, like the die() command in PHP?
I know about Application.Exit() but what if I'm not in a windows forms application
How can you prematurely exit from a function without returning a value if it
How do i exit a Generic list ForEach with a delegate? Break or return
I mean the small exit/cancel button marked with an X in the top right
How to exit from my application? How to add, option and exit option in
For various reasons calling System.exit is frowned upon when writing Java Applications , so
Is releasing objects on a programs exit/close needed? In other words, let us say

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.