Passing Integers through a server C# [help],
Members - Reputation: 80
Posted 30 April 2011 - 07:24 PM
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.
Members - Reputation: 406
Posted 01 May 2011 - 04:05 AM
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?
Members - Reputation: 1154
Posted 01 May 2011 - 08:52 AM
The solution is that you need to send your players a packet that says "Player 1 now has 80hp" or "Player 1 lost 20hp".