Ejemplo n.º 1
0
        /// <summary>
        /// Handles chat messages from other players and objects in game
        /// </summary>
        /// <param name="packet">The packet.</param>
        private void OnGameMessage(GameServerPacket packet)
        {
            GameMessageIn fromServer = new GameMessageIn(packet);

            Log(fromServer);

            if (fromServer.ChatType == GameMessageIn.ChatTypes.ChatMessage)
            {
                if (String.CompareOrdinal(fromServer.CharacterName, settings.MasterName) == 0)
                {
                    switch (fromServer.Message.Trim().ToLower())
                    {
                    case "#exit":
                        Say("Bye");
                        FireOnShutdownEvent();
                        LeaveGame();
                        return;
                    }
                }
            }
        }
        /// <summary>
        /// Handles chat messages from other players and objects in game
        /// </summary>
        /// <param name="packet">The packet.</param>
        private void OnGameMessage(GameServerPacket packet)
        {
            GameMessageIn fromServer = new GameMessageIn(packet);
            Log(fromServer);

            if (fromServer.ChatType == GameMessageIn.ChatTypes.ChatMessage)
            {
                if (String.CompareOrdinal(fromServer.CharacterName, settings.MasterName) == 0)
                {
                    switch (fromServer.Message.Trim().ToLower())
                    {
                        case "#exit":
                            Say("Bye");
                            FireOnShutdownEvent();
                            LeaveGame();
                            return;
                    }
                }
            }
        }