Forum C# Exchange Data Between Server And Client

Exchange Data Between Server And Client

Postby kidkid » January 18th, 2011, 10:34 am

Hi,
In my game, I want to send a data ( as object) to server. But I don't find any method to do that.
Hope we could develop it soon.
kidkid
 
Posts: 54
Joined: December 1st, 2010, 4:43 am

Re: Exchange Data Between Server And Client

Postby Oliver » January 19th, 2011, 9:52 am

Hey,

Currently you need to serialize your objects into messages and deserialize them yourself on the receiving side.

We've considered finding an easy way of sending complex data structures over the wire, but haven't found a good solution yet.

- Oliver
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am

Re: Exchange Data Between Server And Client

Postby phil.peron » January 19th, 2011, 3:56 pm

We've found a good solution for our project but it definitely requires some major boilerplate code to get it up and running properly. Essentially, what it does is break the process of sending a message down into three steps. The first is a message specification that knows the inner workings of it's target object. The second, is a handler that specializes in encoding and decoding that message based on the spec. And finally we have a "router" of sorts that knows where incoming messages should be routed to.

I realize after typing this that it's not an easy problem to solve elegantly (or perhaps my explanation is off the mark) but the end result of our setup means that creating or editing a new message is relatively simple. It's a repeatable and often brainless process that we can automate later on.

I'd love a dead-simple solution but haven't found one yet.
phil.peron
 
Posts: 35
Joined: September 24th, 2010, 7:50 pm

Re: Exchange Data Between Server And Client

Postby Benjaminsen » January 19th, 2011, 5:18 pm

I know of a project using ProtoBuf as their internal message system for sending messages back and forward and are loving it. They are however able to do it as both their server and client is coded in C#
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark


Return to C#