I am looking into designing an application that can run on multiple platforms (i.e. windows, macintosh, android, iphone) but which all interact with data stored and processed on one central server.
Basically:
The server hosts state of world – including active clients, their entity within the world, and rules for rendering the world from the perspective of that entity.
Clients hold a reference to that entity and send requests to the server to update its state and retrieve the renderings based on their entity.
My strongest language above all is C# so I would prefer to write the server using that.
I know that I will need to develop my own sort of command syntax that can be be interpreted by the server and be universal to all clients. What I don’t know is much of anything about the practical implementation of coding the server, just the high-level idea of what is necessary.
Is the .Net sockets API usable with non-.Net socket clients? Is that even a valid question?
Basically I would like to know how best to send and receive data in a structured way, but a way that is independent of platform.
A sample of the data needed for a request would be something like
Entity: [Entity Name]
RequestType: [Request Type] (Lets say its an action command)
ActionType: [Action Type]
ActionProp1: [Action Property]
.
.
or
Entity: [Entity Name]
RequestType: [Request Type] (Lets say request render)
RenderDimX: [X Dimension of Render]
RenderDimY: [Y Dimension of Render]
I haven’t actually planned out the request syntax yet, so don’t criticize 🙂
This is just the kind of message I want to be sending from client to server.
So how do I set up a C# server to handle clients that will be sending these types of messages? Or am I going about this all wrong?
Thanks!
I ended up using sockets. The standardized protocols made it fairly easy.