黑名单优化

黑名单优化

需求

聊天优化(复制信息&黑名单优化)

客户端版本

  • v2.0.6

交互协议修改

  • 客户端需要注意对新增结果的处理
///////////////////////////////////////////////////////////////////////////////////////
// 房间邀请
CLIENT_CS_INVITE_OTHERUSER_GAME_REQ = 20415
struct ClientCsInviteOtheruserGameRep : public PacketBase
{
    enum emResult
    {
        result_ok =1 ,
        result_fail,
        result_inviteeoffline,                //被邀请人已经下线
        result_inviteegaming,                //被邀请人游戏中
        result_notexisttblid,                //这个桌子不存在
        result_gamingbegin,                    //游戏已经开始
        result_refuse,
        result_invitee_inmatch,                //被邀请者在比赛模式
        result_invitee_notallow_entermodel, //被邀请者不能进入这么模式
        result_fail_whytablefill,           //桌子已经满了
        result_desuser_inthistable,         //你邀请的对象已经在桌子上了
        result_sendinvitmsg_todes,          //通知对方你的邀请已经发送了
        result_this_model_isforbid,            //所在模式不允许邀请
        result_invitee_ack,                    //被邀请人接受邀请
        result_invitee_looking,
        result_lookon_overmax,
        result_quickstartonly,

        // 新增结果result
        result_in_blacklist=18,                //在对方黑名单中
    };
    emResult     result;
    char         Invitees[sc_max_nickname_len];
#ifdef _MOBILE
    unsigned char        invitetype;
    char comment[32];
#endif
    ClientCsInviteOtheruserGameRep() : PacketBase(CLIENT_CS_INVITE_OTHERUSER_GAME_REP, sizeof(ClientCsInviteOtheruserGameRep))
    {
        PRO_ZERO_MEMORY(this, sizeof(ClientCsInviteOtheruserGameRep));
    }
};


///////////////////////////////////////////////////////////////////////////////////////
// 天梯组队邀请
MSG_RANK_TEAM_INVITE_MEM_REQ=22102
struct MsgRankTeamInviteMemberRep : public PacketBase 
{
    enum emResult
    {
        result_ok = 0,
        result_full,
        result_not_leader,
        result_no_user,
        result_failed,
        result_in_table,
        result_in_assign_queue,
        result_in_team,

        // 新增结果result
        result_in_blacklist=8, // 在对方黑名单中
    };
    uint8 result;
    unsigned int team_id;
    char invitee[sc_max_nickname_len];    //被邀请者昵称
    MsgRankTeamInviteMemberRep() : PacketBase(MSG_RANK_TEAM_INVITE_MEM_REP, sizeof(MsgRankTeamInviteMemberRep))
    {
        team_id = 0;
        result = result_failed;
        memset(invitee, 0, sizeof(invitee));
    }
};


///////////////////////////////////////////////////////////////////////////////////////
// 战队邀请
CLIENT_GDS_INVITE_JOIN_CORPS_REQ=23903
struct ClientInviteJoinCorpsRep : public PacketBase
{
    enum
    {
        ok = 0,
        fail_no_match,        // 没有该比赛
        fail_not_signup_time, // 非报名时间
        fail_level,        // 对方等级不符合
        fail_target_has_corps,    // 已经有战队
        fail_not_leader,// 你不是队长
        fail_not_online,// 对方没在线
        fail_no_corps, // 你没有战队
        fail_member_full,    // 队伍已满

        // 新增结果 result
        fail_in_blacklist=9,// 你在对方黑名单中
    };
    int result;
    unsigned int match_id;

    ClientInviteJoinCorpsRep() :PacketBase(CLIENT_GDS_INVITE_JOIN_CORPS_REP, sizeof(ClientInviteJoinCorpsRep))
    {
        PRO_ZERO_MEMORY(this, sizeof(ClientInviteJoinCorpsRep));
    }
};


///////////////////////////////////////////////////////////////////////////////////////
// 组队邀请
CLIENT_SS_INVITE_TEAM_REQ=23648
struct ClientMsgTeamInviteRep : PacketBase
{
    enum
    {
        ok = 0,
        fail = 1,
        fail_teamid = 2,            // teamid不存在
        fail_noempty_pos = 3,        // 没有空位了
        fail_not_master = 4,        // 你不是队长
        fail_target_notonline = 5,    // 目标不在线
        fail_target_check = 6,        // 目标在游戏中
        fail_escape_punish = 7,        // 逃跑惩罚中
        fail_locked = 8,
        fail_enterpage = 9,
        fail_invalid_match = 10,
        fail_no_user_data = 11,
        fail_no_signup = 12,
        fail_max_match_cnt = 13,
        fail_max_match_cnt_per_day = 14,
        fail_escape_max_per_day = 15,
        fail_mktbl_start = 16,
        fail_no_corps = 17,
        fail_no_corps_leader = 18,
        fail_readyoffline_punish = 19,        // 准备阶段离开(超时或掉线等)惩罚中
        fail_acc_dev_limit = 20,   // 同设备

        // 新增结果result
        fail_in_blacklist = 21, // 在对方黑名单中
    };
    enum
    {
        step_rep_user_1 = 0,
        step_ntf_user_2 = 1,
        step_broadcast_all = 2,
    };

    unsigned char step;
    unsigned char optype;
    unsigned char result;
    unsigned int  teamid;
    unsigned int  model;
    unsigned int  section;
    char inviter[sc_max_nickname_len];
    char invitee[sc_max_nickname_len];
    char comment[32];
    unsigned int matchid;
    unsigned char from;

    ClientMsgTeamInviteRep() : PacketBase(CLIENT_SS_INVITE_TEAM_REP, sizeof(ClientMsgTeamInviteRep))
    {
        PRO_ZERO_MEMORY(this, sizeof(ClientMsgTeamInviteRep));
    }
};


///////////////////////////////////////////////////////////////////////////////////////
// 公会邀请
CLIENT_INVITE_JOIN_GUILD_REP=24016
enum eGuildResult
{
    ...
    fail_same_guild = 33,       //这人是同公会成员

    // 新增结果 result
    fail_in_blacklist = 34,        // 在对方黑名单中

    ...
};


///////////////////////////////////////////////////////////////////////////////////////
// 比赛再来一局
CLIENT_AUTO_INVITE_REQ=23695
struct ClientAutoInviteRep : public PacketBase
{
    enum 
    {
        ok = 0,
        fail = 1,
        fail_me_in_invite = 2,
        fail_me_invited = 3,
        fail_target_in_invite = 4,
        fail_target_invited = 5,
        fail_me_in_game,
        fail_target_in_game,
        fail_escape_punish,
        fail_readyoffline_punish,        // 准备阶段离开(超时或掉线等)惩罚中

        // 新增结果result
        fail_in_blacklist=10, // 在对方黑名单中
    };

    unsigned int result;

    ClientAutoInviteRep() : PacketBase(CLIENT_AUTO_INVITE_REP, sizeof(ClientAutoInviteRep))
    {
        PRO_ZERO_MEMORY(this, sizeof(ClientAutoInviteRep));
    }
};

///////////////////////////////////////////////////////////////////////////////////////
// 聊天
SS_C_CHATMSG_REP=20612
    struct CServerChatMsgRep : public PacketBase
{
    // 历史原因,这个协议只有失败时才会发
    enum 
    {
        fail_unknown = 0,
        fail_level,
        fail_send_cnt,
        fail_target_cnt,
        fail_no_goods,
        fail_no_guild,
        fail_report_system_forbidden, //举报系统禁言中
        fail_offline_friend_limit, //好友离线消息发送次数达到上限
        fail_offline_notfriend_limit, //非好友离线消息发送次数达到上限
        fail_offline_friend_forbid, //不可以给好友发送离线消息
        fail_offline_notfriend_forbid, //不可以给非好友发送离线消息

        // 新增结果result
        fail_in_blacklist=11, // 在对方黑名单中
        fail_in_your_blacklist=12, // 对方在你黑名单中
    };
    unsigned char   random;   //失败的时候使用来通知客户端
    unsigned char   result;
    unsigned int    param;
    CServerChatMsgRep() : PacketBase(SS_C_CHATMSG_REP, sizeof(CServerChatMsgRep))
    {
        PRO_ZERO_MEMORY(this, sizeof(CServerChatMsgRep));
    }
};
// 注意:我给离线玩家发送聊天信息,由于服务上没有离线玩家的数据,所以不能判断我是不是在离线
// 玩家的黑名单里,消息会正常推送,需要客户端离线玩家上线后,拉取离线消息时做一下筛选


///////////////////////////////////////////////////////////////////////////////////////
// 飞鸽传书
FS_CLIENT_FEIGECHUANSHU_NTF=20641
struct FS_Client_FeiGeChuanShu_NTF : public PacketBase
{
    enum Type
    {
        type_send_succeed = 0,
        type_send_failed,
        type_need_recv,
    };

    enum 
    {
        ok = 0,
        fail_not_friend,
        fail_not_enough_goods,
        fail_usecount_overmax,
        fail_samegame,

        // 新增结果subtype
        fail_in_blacklist=5, // 在对方黑名单中
    };

    unsigned char random;
    unsigned char type;
    unsigned char subtype;

    FS_Client_FeiGeChuanShu_NTF( ) : PacketBase( FS_CLIENT_FEIGECHUANSHU_NTF, sizeof(FS_Client_FeiGeChuanShu_NTF) )
    {
        random    = 0;
        type    = type_send_succeed;
        subtype = ok;
    }
};
// 注意:客户端没有该协议则不用处理