Sign in to follow this  

Passing Integers through a server C# [help]

Recommended Posts

Hello guys,

I am trying to develop some basic networking skills using C#, i want to design a small game, not anything fancy or big.

I have a chat server going, that works over the network, and internet if i could open my ports.

I need some basic tutoring on how to assign an int to a player.


Player1 has joined the game... --- player 1 now has the default of 100 health.
Player2 has joined the game... --- player 2 now has the default of 100 health

player1 looses 20 health.

so now player1 has 80 health, and player2 has 100 health still, and this is reading through the server.

I have looked for Numerous demonstrations for things like this, and cannot find any, so if anybody can help me with this, i am willing to pay up to $20.

Share this post

Link to post
Share on other sites
ravengangrel    406
Hello, Chris,

I guess (and hope) you are quite young. Your $20 dollar offer seems quite funny to me. People around here will gladly help you for free if you ask questions the right way (and if you act like an asshole it's probably that someone will help you anyway). If I wasn't willing to help you for free, I wouldn't do it for $20 anyway; knowledge is hard to acquire and if I was to sell it it wouldn't be cheap.
But I digress. What I'm trying to say is that someone could even get offended by your offer, no matter how good-intended it is, and, even if it's not my case, I would understand anyone who did. We are not your programming whores, keep it in mind.

Now about your question, what's exactly our problem? Show us your code, and explain what you are trying to achieve and what problems you are encountering. AFAICT sendind an int throught he network is everything you need and you say you already have done that.

Could you please clarify a bit?

Share this post

Link to post
Share on other sites
nfries88    1154
It sounds like the problem is that your "Player 1" is still receiving that he has 100hp, or that your "Player 2" is still receiving that your "Player 1" has 100hp.

The solution is that you need to send your players a packet that says "Player 1 now has 80hp" or "Player 1 lost 20hp".

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this