コード例 #1
0
        /// <summary>
        /// Process when a player says something.
        /// </summary>
        /// <param name="player">The player who is talking.</param>
        /// <param name="world">A reference to the gameworld.</param>
        private void ProcessChat(Player player, GameWorld world)
        {
            byte   speakType = netmsg.GetByte();
            string reciever  = null;
            ushort channelID = 0;

            if (speakType == Constants.SPEAK_PRIVATE_MSG ||
                speakType == Constants.SPEAK_RV_COUNSELLOR)
            {
                reciever = netmsg.GetStringL();
                return;
            }
            else if (speakType == Constants.SPEAK_CHANNEL_YELLOW)
            {
                channelID = netmsg.GetU16();
                return;
            }

            string msg = netmsg.GetStringL();

            Console.WriteLine("msg: " + msg);
            //Test for acceptable string length
            if (msg.Length > MAX_STRING_LENGTH)
            {
                return;
            }

            world.HandleChat(player, msg);
        }
コード例 #2
0
        /// <summary>
        /// Process when a player says something.
        /// </summary>
        /// <param name="player">The player who is talking.</param>
        /// <param name="world">A reference to the gameworld.</param>
        private void ProcessChat(Player player, GameWorld world)
        {
            string msg; //Thing that the player is saying

            msg = netmsg.GetStringL();

            //Test for acceptable string length
            if (msg.Length > MAX_STRING_LENGTH)
            {
                return;
            }
#if DEBUG
            Log.WriteDebug("In ProcessChat()");
            Log.WriteDebug("msg: " + msg);
#endif
            world.HandleChat(player, msg);
        }
コード例 #3
0
        /// <summary>
        /// Process when a player says something.
        /// </summary>
        /// <param name="player">The player who is talking.</param>
        /// <param name="world">A reference to the gameworld.</param>
        private void ProcessChat(Player player, GameWorld world)
        {
            byte speakType = netmsg.GetByte();
            string reciever = null;
            ushort channelID = 0;
            if (speakType == Constants.SPEAK_PRIVATE_MSG ||
                speakType == Constants.SPEAK_RV_COUNSELLOR) {
                reciever = netmsg.GetStringL();
                return;
            } else if (speakType == Constants.SPEAK_CHANNEL_YELLOW) {
                channelID = netmsg.GetU16();
                return;
            }

            string msg = netmsg.GetStringL();
            Console.WriteLine("msg: " + msg);
            //Test for acceptable string length
            if (msg.Length > MAX_STRING_LENGTH) {
                return;
            }

            world.HandleChat(player, msg);
        }
コード例 #4
0
        /// <summary>
        /// Process when a player says something.
        /// </summary>
        /// <param name="player">The player who is talking.</param>
        /// <param name="world">A reference to the gameworld.</param>
        private void ProcessChat(Player player, GameWorld world)
        {
            string msg; //Thing that the player is saying
            msg = netmsg.GetStringL();

            //Test for acceptable string length
            if (msg.Length > MAX_STRING_LENGTH) {
                return;
            }
            #if DEBUG
            Log.WriteDebug("In ProcessChat()");
            Log.WriteDebug("msg: " + msg);
            #endif
            world.HandleChat(player, msg);
        }