Forum C# Marshal-by-reference class error

Marshal-by-reference class error

Postby equus » January 11th, 2017, 6:45 pm

Hello!

I don't know why my code doesn't work. I'm using a math library to do all calculations on the server.
Here is my code. The attachment contains the error.

Code: Select all
using MathS = MathNet.Spatial.Euclidean;

public class Player : BasePlayer {
    (...)
    public MathS.Quaternion rotation;
    public MathS.Vector3D position;
    public MathS.Vector2D curVelocity;
    public float maxVelocity;
    public Player()
    {
        (...)
        rotation = QuaternionExt.identity();
        position = new MathS.Vector3D(0, 0, 0);
        curVelocity = new MathS.Vector2D(0, 0);
        maxVelocity = 15f;
    }
}

public override void GotMessage(Player player, Message message) {
    switch (message.Type) {
        case "Move":
            (...)
            if (player.curVelocity.Length > player.maxVelocity)
            {
                (...)
            }


error.png
error.png (7.74 KiB) Viewed 8925 times
equus
 
Posts: 6
Joined: January 7th, 2017, 1:53 am

Re: Marshal-by-reference class error

Postby equus » January 13th, 2017, 1:30 am

Forget... I changed the logic and I will implement math by myself.
equus
 
Posts: 6
Joined: January 7th, 2017, 1:53 am


Return to C#