Example #1
0
    public override string MakeDiffFrame()
    {
        BinaryFormatter bf = new BinaryFormatter();
        MemoryStream    ms = new MemoryStream();

        SphereDiffFrameData data = new SphereDiffFrameData();

        data.position = VectorArrayConverter.vector3ToArray(transform.position);
        data.rotation = VectorArrayConverter.vector3ToArray(transform.rotation.eulerAngles);

        bf.Serialize(ms, data);

        return(Convert.ToBase64String(ms.ToArray()));
    }
Example #2
0
    public string MakeDiffFrame(Guid killer)
    {
        BinaryFormatter bf = new BinaryFormatter();
        MemoryStream    ms = new MemoryStream();

        PlayerDiffFrameData frameData = new PlayerDiffFrameData();

        frameData.position   = VectorArrayConverter.vector3ToArray(transform.position);
        frameData.rotation   = VectorArrayConverter.vector3ToArray(transform.rotation.eulerAngles);
        frameData.killerGUID = new Byte[killer.ToByteArray().Length];
        killer.ToByteArray().CopyTo(frameData.killerGUID, 0);

        bf.Serialize(ms, frameData);

        return(Convert.ToBase64String(ms.ToArray()));
    }
Example #3
0
    public override string MakeFrame()
    {
        BinaryFormatter bf = new BinaryFormatter();
        MemoryStream    ms = new MemoryStream();

        PlayerBaseFrameData frameData = new PlayerBaseFrameData();

        frameData.id = new Byte[id.ToByteArray().Length];
        id.ToByteArray().CopyTo(frameData.id, 0);

        frameData.position = VectorArrayConverter.vector3ToArray(transform.position);
        frameData.rotation = VectorArrayConverter.vector3ToArray(transform.rotation.eulerAngles);

        bf.Serialize(ms, frameData);

        return(Convert.ToBase64String(ms.ToArray()));
    }
Example #4
0
    public override string MakeFrame()
    {
        BinaryFormatter bf = new BinaryFormatter();
        MemoryStream    ms = new MemoryStream();

        BulletBaseFrameSave data = new BulletBaseFrameSave();

        data.id = new Byte[id.ToByteArray().Length];
        id.ToByteArray().CopyTo(data.id, 0);

        data.speed     = speed;
        data.position  = VectorArrayConverter.vector3ToArray(transform.position);
        data.rotation  = VectorArrayConverter.vector3ToArray(transform.rotation.eulerAngles);
        data.direction = VectorArrayConverter.vector3ToArray(transform.forward);

        bf.Serialize(ms, data);

        return(Convert.ToBase64String(ms.ToArray()));
    }