示例#1
0
    /// <summary>
    /// 发送私聊
    /// </summary>
    public bool SendPrivateChat(string msg, bool isRobot, string fileid = "", uint length = 0)
    {
        if (!ChatDataManager.CanSendChatMsgWithBlack(silentFriendUID, silentOPDestName, true))
        {
            return(false);
        }
        stCommonMChatUserCmd_CS cmd = new stCommonMChatUserCmd_CS()
        {
            szInfo      = msg,
            byChatType  = CHATTYPE.CHAT_SILENT,
            dwOPDes     = silentFriendUID,
            szOPDes     = silentOPDestName,
            profession  = (GameCmd.enumProfession)Client.ClientGlobal.Instance().MainPlayer.GetProp((int)Client.PlayerProp.Job),
            voiceFildId = fileid,
            voiceLength = length,
        };

        SendMyChatCmdM(cmd); // 密聊不会回发给自己,所以发一份。
        if (!isRobot)
        {
            NetService.Instance.Send(cmd);
        }
        return(true);
    }