Esempio n. 1
0
        public bool HandlePacket(Peer peer, byte[] data, Game game)
        {
            var emotion = new EmotionPacket(data);

            //for later use -> tracking, etc.
            switch (emotion.id)
            {
            case 0:
                //dance
                //Logging->writeLine("dance");
                break;

            case 1:
                //taunt
                //Logging->writeLine("taunt");
                break;

            case 2:
                //laugh
                //Logging->writeLine("laugh");
                break;

            case 3:
                //joke
                //Logging->writeLine("joke");
                break;
            }
            var response = new EmotionPacket(emotion.id, emotion.netId);

            return(game.PacketHandlerManager.broadcastPacket(response, Channel.CHL_S2C));
        }
Esempio n. 2
0
        public bool HandlePacket(Peer peer, byte[] data)
        {
            var emotion = new EmotionPacket(data);
            //for later use -> tracking, etc.
            var playerName = _playerManager.GetPeerInfo(peer).Champion.Model;

            switch (emotion.id)
            {
            case (byte)Emotions.Dance:
                _logger.LogCoreInfo("Player " + playerName + " is dancing.");
                break;

            case (byte)Emotions.Taunt:
                _logger.LogCoreInfo("Player " + playerName + " is taunting.");
                break;

            case (byte)Emotions.Laugh:
                _logger.LogCoreInfo("Player " + playerName + " is laughing.");
                break;

            case (byte)Emotions.Joke:
                _logger.LogCoreInfo("Player " + playerName + " is joking.");
                break;
            }

            var response = new EmotionPacket(emotion.id, emotion.netId);

            return(_game.PacketHandlerManager.broadcastPacket(response, Channel.CHL_S2C));
        }