Ejemplo n.º 1
0
        public void SendPingMessage(int pingMessageId)
        {
            var myId    = PlayerIdStorage.TmpPlayerIdForMatch;
            var message = new PlayerPingMessage(myId, matchId, pingMessageId);

            byte[] data = MessageFactory
                          .GetSerializedMessage(MessageFactory.GetMessage(message, false, out uint messageId));
            udpClientWrapper.Send(data);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Sends a packet
        /// </summary>
        /// <param name="responsePacket"></param>
        /// <param name="remoteEndpoint"></param>
        void SendResponsePacket(IRadiusPacket responsePacket, IPEndPoint remoteEndpoint)
        {
            var responseBytes = RadiusPacketParser.GetBytes(responsePacket);

            Server.Send(responseBytes, responseBytes.Length, remoteEndpoint);

            //TODO log output here
            //$"{responsePacket.Code} sent to {remoteEndpoint} Id={responsePacket.Identifier}"
        }
Ejemplo n.º 3
0
        public void SendInputMessage(float movementX, float movementY, float attackAngle, bool useAbility)
        {
            ushort myId = PlayerIdStorage.TmpPlayerIdForMatch;

            // Debug.LogWarning($"{nameof(myId)} {myId}");
            var message = new PlayerInputMessage(myId, matchId, movementX, movementY,
                                                 attackAngle, useAbility);

            byte[] data = MessageFactory.GetSerializedMessage(message, false, out uint messageId);
            udpClientWrapper.Send(data);
        }