Passing Integers through a server C# [help]

Started by
2 comments, last by nfries88 12 years, 11 months ago
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.

meaning

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.
Advertisement
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?
i wouldn't even open visual studio for 20$
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".

This topic is closed to new replies.

Advertisement