Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by rtainc · May 22, 2015 at 02:19 AM · networkingmultiplayermultiplayer-networkingcheat

Validating User Actions on the Server

I am currently working on a networked first person shooter. I have created a server implementation that can synchronize player data. But while implementing a damage system, I realized that I almost simply sent a packet with

 PLAYER DAMAGE [target id] [amount]

But that would likely be open for any player to save a list of IDs and inject that packet to damage every ID. Unfortunately the server is unable to know what the environment is like -- meaning it cannot check if there is something between the two players or likewise.

How would I keep this from being possible?

Comment
Add comment · Show 5
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image spiceboy9994 · May 22, 2015 at 02:45 PM 0
Share

Here's an idea:

1-Once the player connects to the server, have the server to create a Communication Session Token. That token needs to be present on all client communications to be a valid call. If the token is not present, or is not equal to the one stored on the server, discard the communication.

2-Encrypt the data sent to client. Your messages do not look like having much info, so you could encrypt the data sent to your server. Here's an example of using TripleDes encryption.

http://forum.unity3d.com/threads/encryption-to-use-or-not-to-use.199843/

And an example of using Rijndael based encryption

http://stackoverflow.com/questions/10168240/encrypting-decrypting-a-string-in-c-sharp.

That way you could complicate the things for your users for sending communications to your server directly.

avatar image rtainc · May 23, 2015 at 01:33 AM 0
Share

@spiceboy9994 I've thought about something like this, but what's stopping them from looking at the server source to find the decryption method, decrypt the outgoing packet, and then just inject their own packet?

avatar image spiceboy9994 · May 24, 2015 at 02:33 PM 0
Share

How exactly do you think they can "look in the server"?, by "look in the server" I just think a RDP session, which is not possible with unity and unless you grant that access, the users cannot do that. Server code resides there, within compiled code... as dlls or other compiled elements. Those can be obfuscated as well. You cannot download the server code dll easily to check what code the server is executing. The only way they can hack to that method is send a lots of packages to "infer" the decryption method, but that takes time and its not easy to do that. Besides that, you're coding a game right? not a banking solution. I think adding extra security like https channels, transport security and all that kind of stuff, may be overwhel$$anonymous$$g just to prevent cheating. That's my humble opinion.

avatar image rtainc · May 25, 2015 at 01:03 AM 0
Share

@spiceboy9994 I would compile the server code and just rely on encoded packets, but my goal is to have a fully modifiable server source.

avatar image spiceboy9994 · May 25, 2015 at 01:06 PM 0
Share

sorry man... encryption, obfuscation and https chanel communication is absolutely not related with the "fully modifiable" feature on your code. The fully modifiable feature is kind of more related to a good architecture. What is your main backend program$$anonymous$$g skill?, .net?, php?, ruby?

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

20 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity networking tutorial? 6 Answers

create android multiplayer game using wifi ? 0 Answers

Not calling OnServerAddPlayer() when client connect 0 Answers

Multiplayer advanced - Single Player in Multiplayer game, using another Hosting services. 0 Answers

Unity networking solution (PUN or Bolt) 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges