0
\$\begingroup\$

I'm developing some game with server/client structure, and the client will predict the movements, but it should be validated by the server. In the client part, I got it moving nice, but now I'm trying to test it with the server calculating the movement. The problem is the client I use the xna classes like Quaternion, Vector3, Matrix, etc. Is there anyway to get this XNA classes in the server without making it a xna project??

I found a site with sources of the classes like XNA geomtries, but when I tried it out, it dont got the same results, so I'm still looking for the sources of it, or someother sources that gets at the same results for me to add into the server

\$\endgroup\$
1
  • \$\begingroup\$ An easier way to check movement validation is to just verify if a player/item/etc is allowed to be there. Let the client interpolate the movement etc. Just detect for collision on the server end. \$\endgroup\$ – Joe Swindell Jan 15 '15 at 18:18
0
\$\begingroup\$

Assuming you're using a custom server written in C# with Visual Studio and you have access to the source...

  1. Open Visual Studio, and go to your server project
  2. Right mouse click on 'References' and then left click 'Add Reference'
  3. Switch to the .NET tab, and scroll down to find 'Microsoft.Xnz.Framework'
  4. Select it and then click on OK
  5. Add 'using Microsoft.Xna.Framework;' to your server class files.
  6. Use Vector, Matrix and Quaternion objects as normal.

Of course, this relies on the server having the Xna game studio installed on it. If you don't have the Xna framework installed on the server, you can either download and run the installer from here or search the GAC (Global Assembly Cache) on your build computer for the Microsoft.Xna.Framework.dll file, and then drop it into the bin folder of your server program when it gets deployed, but the framework installer is (IMO) the easier and safer way to go.

You can also add Xna assemblies to a project without making it an Xna project, its just that an Xna project has all the Xna framework references added by default. I currently have a Form and a Class Library project using Xna references, and they still run/compile as a Forms project and a Class Library .dll

\$\endgroup\$
1
  • \$\begingroup\$ I found the better way being addind the .dlls files as reference, but ur answear is more complete so I'll accept it. \$\endgroup\$ – Caio Keto Jan 16 '15 at 23:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.