Jump to content
  • Advertisement
Sign in to follow this  
jha0

[.net] .NET Remoting

This topic is 3748 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Greetings! I don't know whether I should bring this up. But I'm really very troubled with the ongoing issue that's been bugging me from week 1 of the semester. I've posted this issue on XNA forums and was put off by the developer. I know its not nice to use .net remoting to do gaming. Well, by decree of the all mighty school, I'm required to use this piece of technology to make an online chess game via the internet. I have finish coding my chess in C#, but implementing it with .net remoting is something I still can't figured out. Well you can say why not try other ready technology. But if I could, I surely will do that. But this is after all one of my major project criteria. The idea is to create a game room that allow a maximum of 2 players to play chess. I was thinking in terms of .net remoting, how is it going to make a chess move in real time for both players. Simply put, Player A move a chess piece, Player B will get a realtime update of the move from his view. Hope someone can explain to me the logic. If possible, I'm willing to upload my source code for you to show me part of the example for me to get a better understanding Thanks a million for the help. Will be very grateful

Share this post


Link to post
Share on other sites
Advertisement
Since it is homework I can only point you in the right direction.

What remoting allows you to do, is call class methods and properties on a different computer. So there is a chess board on each computer. Computer A, calls the Move method of the ChessBoard class on computer B. When Computer B wants to move it does the reverse.

Things you will need to look up and use.

MarshelByRefObject
RemotingConfiguration
ChannelServices
ActivatesServiceTypeEntry

Once you read up on those you should be able to get it working.

theTroll

Share this post


Link to post
Share on other sites
I like to thank you for the hint. I have do some research on that and have more or less understand what .net remoting is about. Basically, I know that its a must to write both the client and the server programs. The server will implements the remote objects. The client consumes the services offered by the remote objects.

In other words, to write a server program, I must write the remote object (implement the object's methods, properties, etc), create a method of hosting the object on the server so client can connect to the server, prepare for client connections so the object can recieve client connections and waiting for client connections to consume its services.

As for the client program, it must be able to detect the remote object on the server, create a communication channel to connect the serverm, activate the remote object and create a reference to it, allowing the client program to use the remote objects like local objects.

Therefore there is 3 main types of file: SERVER.CS, CLIENT.CS, REMOTEOBJECT.CS

However, by relatin this concept to my chess project, I'm not so sure to which .cs files is to be lin to the 3 above files. Kindly advise from a game perspective. Basically, the chess project consist of .c files that intialize graphics, turn-based logic, calculate current and new chess position, logic on the rule of how the chess can move and which chess can be eaten.

A million billion thanks! CHeers!!!

Share this post


Link to post
Share on other sites
In this context, client and server are not exactly what exactly what a lot of people think of when talking client and sever.

Server - the part that listens to incoming connections and passes on the networking request to the class.

Client - the part that connected to the client.

Both computers will have a client and server component.

If I was doing it, I would just have a single file for the Remoting part called Remoting.cs. In that file I would put all of the remoting code. Then I would have a ChessBoard class that would inherit from MarshelByRefObject that would be the class that is going to be the remote object. The reason that I think ChessBoard should be the remote object is because that is what you are actually going to be moving things on. So your remove call would be RemoteBoard.Move(B4, B6); or something like that.

It looks like you are trying to make too many classes here. I see only a few classes. A UI class, a player class, a chess board class and a remoting class. I might be missing something but that should just about cover it.

theTroll

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!