Hi I'm thinking of writing a mmorpg game and what I would like to do is create a server I would like to send text messages over the internet to trigger events at the client or server.

A. How can I do this.

B. Is there a better way of doing this ?

Dani AI

Generated

pointed toward the basics, which is the right place to start. The short, practical plan below fills the gap between reading a primer and actually building a messaging system for a small MMO: it covers transport choices, framing, simple message formats, server authority, security and testing.

Decide the transport and message framing

  • Use a reliable, ordered channel for important events (logins, trades, mission triggers) and an unreliable, low-latency channel for frequent position/state updates. Many games use both: control over TCP (or a reliable layer) and state over UDP.
  • Over TCP avoid partial-read bugs by framing messages. A common, robust choice is a fixed-size length prefix (for example a 4-byte network-order length) followed by the payload. Text protocols can work but need a clear delimiter and escape rules.
  • Keep messages versioned and small. For fast prototyping a simple text command format like COMMAND arg1 arg2 is fine; for production consider compact binary or a schema-based format so parsing is cheap.

Server-side architecture and correctness

  • Make the server authoritative: validate every client action and never trust client-side position or state for critical decisions.
  • Use a tick or fixed-update loop on the server. Aggregate inputs, run game logic, and broadcast deltas rather than full state when possible.
  • Add sequence numbers, acknowledgements where needed, and server-side rate limiting to guard against spam and cheating.

Security, scaling and debugging

  • Authenticate clients and encrypt sensitive channels (e.g., TLS for login/purchases). For UDP-based paths use a small authenticated handshake to avoid spoofing.
  • For scale, split world regions or instances across worker servers and use a lightweight lobby/matchmaker to assign clients.
  • Debug with logs and packet captures, and simulate latency/loss to tune interpolation/extrapolation of client-side presentation.

Suggested next steps: implement a tiny echo server/client, add length-prefixed framing, then move to a two-channel model. Libraries worth exploring for C++ networking include Boost.Asio for socket I/O and game-focused stacks that add reliable-UDP features. accepted the earlier pointers; these steps make the advice actionable.

Recommended Answers

All 4 Replies

Well I cant..........But I guess you can help yourself with some basics.

commented: Thanks ! +1

Well I cant..........But I guess you can help yourself with some basics.

Thanks +rep solved

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.