Пример #1
0
        /// <summary>
        /// Send an update to the server that acknowledges that this client completed an update frame
        /// and informs it of any input that was given by this client
        /// </summary>
        internal void sendFrameUpdate(FrameInput input)
        {
            NetOutgoingMessage outMsg = netClient.CreateMessage();

            outMsg.Write((byte)NetDataType.FrameUpdate);
            input.serialize(outMsg);

            netClient.SendMessage(outMsg, NetDeliveryMethod.ReliableOrdered);
        }
Пример #2
0
        private void relayFrameInput(NetIncomingMessage inMsg)
        {
            FrameInput input = new FrameInput();
            input.deserialize(inMsg);

            //Write it to a new packet
            NetOutgoingMessage outMsg = netServer.CreateMessage();
            outMsg.Write((byte)NetDataType.FrameUpdate);
            input.serialize(outMsg);

            netServer.SendToAll(outMsg, NetDeliveryMethod.ReliableOrdered);
        }