Ejemplo n.º 1
0
        //Mostly useless since commands are important however the UDPINIT command relies on sending a datagram to expose remote endpoint to the server
        public void SendCommandUDP(string cmd)
        {
            cmdtosend.command = cmd;
            Packet pts = new Packet();

            pts.data = PacketUtils.Pack(cmdtosend.EncodeRaw(), PacketUtils.GenerateHeader(cid, NetData.TYPE_CMD, 0, cmdtosend.GetLength()));
            UDPout.Enqueue(pts);
        }
Ejemplo n.º 2
0
        public void SendTransform(Transform t, byte id)
        {
            ttosend          = new NetTransform();
            ttosend.position = t.localPosition;
            ttosend.rotation = t.localRotation.eulerAngles;
            ttosend.scale    = t.localScale;
            Packet pts = new Packet();

            pts.data = PacketUtils.Pack(ttosend.EncodeRaw(), PacketUtils.GenerateHeader(cid, NetData.TYPE_NETTRANSFORM, id, ttosend.GetLength()));
            UDPout.Enqueue(pts);
        }