Ejemplo n.º 1
0
        /// <summary>
        /// Searches in the market for comment by the player.
        /// </summary>
        /// <param name="cpkt"></param>
        private void CM_MARKET_COMMENT(CMSG_MARKETGETCOMMENT cpkt)
        {
            if (cpkt.SessionId != this.character.id) return;

            //OBTAIN COMMENT
            string comment = Singleton.Database.FindCommentById(cpkt.ItemId);
            if (comment == null) comment = string.Empty;

            //SEND THE ATTAINED COMMENT OVER TO THE PLAYER
            SMSG_MARKETCOMMENT spkt = new SMSG_MARKETCOMMENT();
            spkt.SessionId = this.character.id;
            spkt.Reason = (comment.Length == 0) ? (byte)0x0B : (byte)0;
            spkt.Message = comment;
            this.Send((byte[])spkt);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Changes your own comment.
        /// </summary>
        /// <param name="cpkt"></param>
        private void CM_MARKET_CHANGECOMMENT(CMSG_MARKETMESSAGE cpkt)
        {
            //SET COMMENT
            uint result = Singleton.Database.UpdateCommentByPlayerId(this.character.ModelId, cpkt.Comment);

            //INDICATES WHETHER COMMENT COULD BE CHANGED
            SMSG_MARKETMESSAGERESULT spkt = new SMSG_MARKETMESSAGERESULT();
            spkt.SessionId = this.character.id;
            this.Send((byte[])spkt);

            //ACTUALLY APPLIES THE COMMENT
            SMSG_MARKETCOMMENT spkt2 = new SMSG_MARKETCOMMENT();
            spkt2.SessionId = this.character.id;
            spkt2.Message = cpkt.Comment;
            this.Send((byte[])spkt2);
        }