双端交互

开黑双端交互

开黑加成

加成结算详情 [修改]

交互协议

MSG_EXP_ADD_DETAIL=21680,        // 经验加成

struct MsgExpAddDetail : public PacketBase
{
    static const unsigned char s_c_max_addtype = 9;

    enum
    {
        add_ddys        = 0,    // 多多益善加成
        add_time        = 1,    // 时间加成
        add_skin        = 2,    // skin加成
        add_vip            = 3,    // vip加成
        add_perfect        = 4,    // 完胜加成
        add_generalstar = 5,    // 武将星级加成
        add_guild        = 6,    // 公会加成
        add_marry        = 7,    // 结婚加成
        add_nj            = 8,    // 内奸加成    
        add_hgkh        = 9,    // 回归狂欢
        add_recruit        = 10,    // 战友加成
        add_team        = 11,    // 开黑加成
    };

    struct tagAddItems
    {
        BYTE type;
        unsigned short add;
    };

    struct tagPlayerExpAdd
    {
        unsigned char seatid;
        unsigned char addcnt;
        tagAddItems items[s_c_max_addtype];
    };

    unsigned int playercnt;
    tagPlayerExpAdd playerExpAdd[MAX_TABLE_SEAT];

    friend bostream& operator<<(bostream& bos, const MsgExpAddDetail& t)
    {
        bos << t.playercnt;
        for(unsigned int i = 0; i < t.playercnt; ++i)
        {
            bos << t.playerExpAdd[i].seatid;
            bos << t.playerExpAdd[i].addcnt;
            for(unsigned char j = 0 ; j < t.playerExpAdd[i].addcnt; ++j )
            {
                bos << t.playerExpAdd[i].items[j].type;
                bos << t.playerExpAdd[i].items[j].add;
            }
        }
        return bos;
    }

    MsgExpAddDetail() : PacketBase(MSG_EXP_ADD_DETAIL, sizeof(MsgExpAddDetail))
    {
        PRO_ZERO_MEMORY(this, sizeof(MsgExpAddDetail));
    }
};

说明

  • 添加了开黑加成类型add_team,客户端需要进行相应的显示处理

节日活动显示配置获取

交互协议 [新增]

ABROAD_CLIENT_FESTIVAL_INFO_REQ = 48427,       // 节日配置获取
ABROAD_CLIENT_FESTIVAL_INFO_REP = 48428,

struct ClientFestivalInfoReq : public PacketBase
{
    ClientFestivalInfoReq() :PacketBase(ABROAD_CLIENT_FESTIVAL_INFO_REQ, sizeof(ClientFestivalInfoReq))
    {
        PRO_ZERO_MEMORY(this, sizeof(ClientFestivalInfoReq));
    }
};

struct ClientFestivalInfoRep : public PacketBase
{
    static const unsigned int sc_max_festival_count = 50;

    struct FestivalInfo
    {
        unsigned int id;            // 唯一活动节日id
        unsigned int dateLeftTime;  // 大周期结束的倒计时
        unsigned int dayLeftTime;   // 当天开放时间结束的倒计时
    };

    unsigned int festivalCount;
    FestivalInfo festival[sc_max_festival_count];

    ClientFestivalInfoRep() :PacketBase(ABROAD_CLIENT_FESTIVAL_INFO_REP, sizeof(ClientFestivalInfoRep))
    {
        PRO_ZERO_MEMORY(this, sizeof(ClientFestivalInfoRep));
    }

    friend bostream& operator<<(bostream& bos, const ClientFestivalInfoRep& t)
    {
        bos << t.festivalCount;
        for (unsigned int i = 0; i < t.festivalCount && i < sc_max_festival_count; ++i)
        {
            bos << t.festival[i].id;
            bos << t.festival[i].dateLeftTime;
            bos << t.festival[i].dayLeftTime;
        }
        return bos;
    }
};

说明

  • 客户端登录成功后请求已开启的的活动配置信息,收到回复后进行相应的显示操作;
  • 可能出现在活动期间内,但客户端没有相应的显示,需要重新登录请求配置;

组队邀请回复

  • 交互协议 [修改]

    CLIENT_SS_INVITE_TEAM_REP=23649
    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,   // 同设备
      };
      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));
      }
    };
    

    ```

说明

  • 添加了失败原因fail_acc_dev_limit,同设备不能邀请(配置),客户端需要添加相应的提示等信息

排位赛结果通知

交互协议 [修改]

GS_CLIENT_ARENA_GAME_RESULT_NTF = 23667,

struct ClientMsgSyncArenaGameResult : PacketBase
{
    static const unsigned int sc_max_score_add_type = 8;
    enum 
    {
        score_add_type_mvp_rank = 1,
        score_add_type_level_diff,
        score_add_type_consecutive_win,
        score_add_type_3v3_rank,
        score_add_type_2v2_rank,
        score_add_type_3v3_base,
        score_add_type_2v2_base,
    };
    enum
    {
        mark_in_racetime = 1 << 0,
        mark_baiyin3_no_score = 1 << 1,
        mark_black_protect = 1 << 2,      // 开黑前几局不掉星
        mark_division_protect = 1 << 3,   // 低段位保护不掉星
        mark_cp_protect = 1 << 4,         // 使用cp武将不掉星
    };
    struct SeatResult
    {
        unsigned char seat_id;

        unsigned short score;
        unsigned short morale;
        unsigned int   division;
        unsigned short max_morale;
        unsigned short max_score;

        unsigned short old_score;
        unsigned short old_morale;
        unsigned int   old_division;
        unsigned short old_max_morale;
        unsigned short old_max_score;

        unsigned short consecutive_win;
        unsigned char team_interal_rank;
        unsigned char upgrade_score_by_morale;
        unsigned char score_adds[sc_max_score_add_type];
    };

    struct BlackProtect
    {
        unsigned char black_protect_cnt;      // 当天已使用的保护次数
        unsigned char max_black_protect_cnt;  // 每天总的保护次数
    };

    unsigned char player_count;
    SeatResult result[MAX_TABLE_SEAT];
    bool useProtectCard[MAX_TABLE_SEAT];
    unsigned int flag[MAX_TABLE_SEAT];
    BlackProtect blackProtect[MAX_TABLE_SEAT];

    ClientMsgSyncArenaGameResult() : PacketBase(GS_CLIENT_ARENA_GAME_RESULT_NTF, sizeof(ClientMsgSyncArenaGameResult))
    {
        PRO_ZERO_MEMORY(this, sizeof(ClientMsgSyncArenaGameResult));
    }
};

说明

  • flag添加了新段位保护类型mark_black_protect/mark_division_protect/mark_cp_protect,客户端可根据这个进行相应的提示;
  • 新增了blackProtect(内容拼接在最后面),在flag置位了mark_black_protect时有效,客户端可根据这个进行相应的提示;

分发武将通知

交互协议 [修改]

MSG_GAME_DEAL_CHARACTER = 21224,

struct MsgDealCharacters : public PacketBase
{
    enum EmType
    {
        TYPE_INVALID = 0,
        TYPE_SEL,        // 选择
        TYPE_WAIT,        // 等待选择
        TYPE_CHANGE,    // 替换(timeOut无效)
        TYPE_RECOMMEND, // 选择推荐武将(智能点将卡)
        TYPE_PRACTICE,    //人机练习 选将
        TYPE_NEW_1V1,    //新1V1发的可以使用的武将
        TYPE_DOUDIZHU,    //斗地主发的可以使用的武将
        TYPE_ARENA_TEAM, // 竞技场 组队共用选将池
        TYPE_CMEG_FORBID, // CMEG对手禁将
        TYPE_END,
    };
    enum
    {
        char_cannot_use = 0,
        char_can_use = 1,
        char_ban = 2,
        char_trial = 3,//试用卡
        char_try = 4,  //试用
        char_friend = 5,
        char_new_trial = 6,
        char_share = 7,//共享
    };

    struct TDealCharacter
    {
        uint16 uCharacterId;
        BYTE   bMeetAssignCondition;//分配的时候是否满足分配规则的
        TDealCharacter()
        {
            uCharacterId = 0;
            bMeetAssignCondition = 0;
        }
    };

    uint8 type;
    uint32 timeOut;     //时间条
    uint16 vip_card_cnt;
    TDealCharacter dealCharacter[MAX_SEL_CHARACTER];
    MsgDealCharacters() : PacketBase(MSG_GAME_DEAL_CHARACTER, sizeof(MsgDealCharacters))
    {
        PRO_ZERO_MEMORY(this, sizeof(MsgDealCharacters));
        type = TYPE_SEL;
        timeOut = 15;
    }
};

说明

  • bMeetAssignCondition添加了新类型char_share,客户端根据这个显示对应的武将角标;

CP武将通知

交互协议 [新增]

GS_CLIENT_CP_CHARACTER_NTF = 21367,

struct GsClientCPCharacterNtf : public PacketBase
{
    unsigned int cnt;
    unsigned short characters[100];
    unsigned int GetLen(){ return sizeof(GsClientCPCharacterNtf) - sizeof(characters) + cnt*sizeof(characters[0]); }
    GsClientCPCharacterNtf() :PacketBase(GS_CLIENT_CP_CHARACTER_NTF, sizeof(GsClientCPCharacterNtf))
    {
        PRO_ZERO_MEMORY(this, sizeof(GsClientCPCharacterNtf));
    }
};