添加匹配准备流程(接口协议)

添加匹配准备流程

流程说明

准备阶段超时或离开处理

  1. 【配置一】:结束游戏
  2. 【配置二】:踢出未准备玩家,使用机器人代替被踢出或离开玩家

匹配阶段

  1. 客户端点击开战或者组队开始匹配后,玩家和队伍中的其他玩家进入匹配阶段,回到大厅并显示在匹配中,不可再进入其他模式;
  2. 客户端在匹配阶段,可以中止匹配,中止后其所在队伍的其他玩家也会退出匹配并解散队伍;
  3. 匹配成功后,服务端通知客户端匹配成功,客户端需要进入游戏场景,显示玩家信息;

准备预处理阶段

  1. 客户端收到匹配成功通知,未收到准备选择通知的这段时间为准备预处理阶段;
  2. 该阶段有玩家离开,则惩罚该玩家,【配置一】则直接结束游戏,【配置二】则使用机器人代替进入;

准备等待确认阶段

  1. 服务端通知玩家进行准备确认,房主默认自动准备;
  2. 玩家确认准备则广播其他玩家,全部准备则开始游戏;

准备超时

  1. 在规定时间内有玩家未准备,则进入超时处理;
  2. 【配置一】则直接结束游戏,并惩罚未准备玩家;【配置二】则使用机器人代替未准备的和离开的玩家,踢出未准备玩家,惩罚被踢出的和离开的玩家,之后游戏开始;

交互协议

匹配成功

  • 新增协议

    协议号

    ABROAD_TEAM_MATCH_OK_NTF = 48407,                // 匹配成功
    

    协议内容

    struct MsgGameMatchOKNtf : public PacketBase
    {
      MsgGameMatchOKNtf() : PacketBase(ABROAD_TEAM_MATCH_OK_NTF, sizeof(MsgGameMatchOKNtf))
      {
          PRO_ZERO_MEMORY(this, sizeof(MsgGameMatchOKNtf));
      }
    };
    

进入准备确认阶段

  • 新增协议

    协议号

    ABROAD_GS_ENTER_READY_NTF = 48404,                // 匹配场进入准备阶段通知,通知客户端选择准备
    

    协议内容

    struct MsgGameEnterReadyNtf : public PacketBase
    {
      enum 
      {
          wait_other_ready = 0,    //等待其他玩家准备,房主
          wait_ready_sure,         //等待准备确认,非房主
      };
    
      unsigned int   readytype;                   //准备类型 
      unsigned int   waittime;                    //准备等待时间,对非房主有用
      bool           bLeavePunish;                //准备阶段离开是否惩罚(超时被踢或断线离开)
      bool           bOutOver;                    //超时后,游戏是否结束
    
      MsgGameEnterReadyNtf() : PacketBase(ABROAD_GS_ENTER_READY_NTF, sizeof(MsgGameEnterReadyNtf))
      {
          PRO_ZERO_MEMORY(this, sizeof(MsgGameEnterReadyNtf));
      }
    };
    

客户端请求准备

  • 看客户端是否已有这个处理,没有则新加
  • 非房主点击准备按钮向服务端发送的通知

    协议号

    C_GS_READY_REQ = 21203,                    //client请求准备
    

    协议内容

    struct ClientMsg_ReadyGameReq : public PacketBase
    {
      bool isprepare;
      ClientMsg_ReadyGameReq():PacketBase( C_GS_READY_REQ, sizeof(ClientMsg_ReadyGameReq))
      {
          isprepare = true;
      }
    };
    

客户端准备请求的回复

  • 看客户端是否已有这个处理,没有则新加

    协议号

    GS_C_READY_RESP = 21204,                    //准备结果
    

    协议内容

    struct GsMsg_ReadyGameRep : public PacketBase
    {
      enum emresult
      {
          result_ok = 1,
          result_gs_user_notexist,
          result_gs_user_notbl,
          result_gs_user_notseatintbl,
          result_gs_master_notprepare,  //你是房主,不应该发送这样的消息
          result_gs_master_notfind,     //没有发现房主
          result_gs_goeasy,                // 客户端操作太快,得慢慢来
          result_gs_quickstartonly,
          result_gs_civiscore_limit = 9,            //文明分不够或禁赛限制
      };
      emresult  result;
      GsMsg_ReadyGameRep():PacketBase( GS_C_READY_RESP, sizeof(GsMsg_ReadyGameRep))
      {
          result = result_ok;
      }
    };
    

玩家准备通知

  • 看客户端是否已有这个处理,没有则新加
  • 一个玩家准备后,通知其他玩家

    协议号

    GS_C_USERPREAPRE_NTF = 21205,            //通知别人
    

    协议内容

    struct ClientMsgUserPrepareNtf : public PacketBase
    {
      struct TSeatInfo
      {
          unsigned char seat_id;
          unsigned char is_prepare; //=1 表示准备; =0 表示没有准备
      };
      static const unsigned int sc_maxinfo_count = 8;
      unsigned  short            ref_count;                    //使用的数目
      TSeatInfo                info[sc_maxinfo_count];
      ClientMsgUserPrepareNtf():PacketBase( GS_C_USERPREAPRE_NTF, sizeof(ClientMsgUserPrepareNtf))
      {
          ref_count = 0;
      }
    };
    

准备超时或离开惩罚

  • 新增协议
  • 玩家在准备阶段离开或被踢,根据配置可能会惩罚该玩家玩家,该惩罚统称为准备阶段离开惩罚
  • 玩家可主动请求指定模式的准备阶段离开的惩罚数据;
  • 玩家被惩罚时会通知该玩家,玩家应该这个原因不能进行游戏是也会通知玩家

    协议号

    ABROAD_READY_OFFLINE_PUNISH_REQ = 48405,        // 匹配场准备超时惩罚数据请求
    ABROAD_READY_OFFLINE_PUNISH_REP = 48406,        // 匹配场准备超时惩罚数据回复或通知
    

    协议内容

    struct ReadyOfflinePunishReq : public PacketBase
    {
      unsigned int model;
      unsigned int section;
      ReadyOfflinePunishReq() : PacketBase(ABROAD_READY_OFFLINE_PUNISH_REQ, sizeof(ReadyOfflinePunishReq))
      {
          PRO_ZERO_MEMORY(this, sizeof(ReadyOfflinePunishReq));
      }
    };
    struct ReadyOfflinePunishRep : public PacketBase
    {
      unsigned int model;
      unsigned int section;
      unsigned int left_forbidtm;
    
      ReadyOfflinePunishRep() : PacketBase(ABROAD_READY_OFFLINE_PUNISH_REP, sizeof(ReadyOfflinePunishRep))
      {
          PRO_ZERO_MEMORY(this, sizeof(ReadyOfflinePunishRep));
      }
    };
    

离开匹配队列

  • 新增协议
  • 队伍正在匹配中,一个玩家离开,则队伍退出匹配队列并解散,其他玩家也会收到ABROAD_CLIENT_LEAVE_MATCHQUEUE_REP

    协议号

    ABROAD_CLIENT_LEAVE_MATCHQUEUE_REQ = 48409,        //[client] 请求离开匹配队列
    ABROAD_CLIENT_LEAVE_MATCHQUEUE_REP = 48410,
    

    协议内容

    struct ClientMsgLeaveMatchQueueReq : public PacketBase
    {
      ClientMsgLeaveMatchQueueReq() :PacketBase(ABROAD_CLIENT_LEAVE_MATCHQUEUE_REQ, sizeof(ClientMsgLeaveMatchQueueReq))
      {
      }
    };
    struct ClientMsgLeaveMatchQueueRep : public PacketBase
    {
      enum emResult
      {
          ok_rep = 0,
          ok_ntf = 1,
          fail = 2,
          fail_team_notexist = 3,    // 队伍不存在
          fail_not_in_team = 4,    // 你不在队伍中
      };
    
      unsigned short result;
      char           szNickname[sc_max_nickname_len];
      unsigned int   teamid;
      ClientMsgLeaveMatchQueueRep() :PacketBase(ABROAD_CLIENT_LEAVE_MATCHQUEUE_REP, sizeof(ClientMsgLeaveMatchQueueRep))
      {
          result = 0;
      }
    };
    

创建桌子回复

  • 添加失败原因 ctb_ret_cs_ready_offline_forbit,在准备阶段离开惩罚中

    协议号

    CLIENT_CREATETABLE_REP = 20502;
    

    协议内容

    struct ClientMsgCreateTableRep : public PacketBase
    {
      //创建桌子失败消息
      enum EmCreateTableResult
      {
          ctb_ret_success=1,
          ctb_ret_param_error,                //数据包的参数错误
          ctb_ret_param_extype_error,         //扩展包参数错误
          ctb_ret_tablename_exist,            //桌子名字存在 
          ctb_ret_not_unused_table,           //没有空桌子 
          ctb_ret_assignpage_fail,            //把桌子绑定到分页失败
          ctb_ret_gsclose,                    //gs已经关闭
          ctb_ret_cs_intable,                 //已经在桌子上了
          ctb_ret_cs_sendmsgtogs_fail,        //发送消息给gs失败
          ctb_ret_cs_fail_why_lookon,         //你正在旁观
    
          ctb_ret_gs_userexist,               //用户是不应该存在的,现在
          ctb_ret_gs_attch_gateway_fail,      //gs绑定到gt失败
          ctb_ret_gs_attch_dbs_fail,          //gs绑定到dbs失败
          ctb_ret_gs_attch_fs_fail,           //gs绑定到fs失败
          ctb_ret_gscrate_fail,               //gs上创建桌子失败
          ctb_ret_gs_adduser_fail,            //gs上内存分配失败
    
          ctb_ret_gs_param_error,             //gs数据包的参数错误
          ctb_ret_gs_getmasterfail,           //gs上得到房主信息失败
          ctb_ret_gs_fetchfail,
          ctb_ret_gs_get_tblconfiginfo_fail,     //gs上得到桌子配置信息失败
          ctb_ret_gs_emptymsg,                   // 
          ctb_ret_gs_userid_err,                 //gs上得到用户id失败
          ctb_ret_gs_tableid_err,                //gs上没有这个桌下
          ctb_ret_gs_table_errstate,             //gs上桌子状态错误
          ctb_ret_gs_seat_noempty,               //gs上桌子没有位置
          ctb_ret_gs_othererr,                   //gs上发生了不确定的错误
    
          //新添加的2010-11-22
          ctb_ret_gs_userexist_second,        //用户是不应该存在的,现
          ctb_ret_cs_user_leak_tongqian,      //用户铜钱不足
          ctb_ret_cs_limit_visit,             //禁止游客进入
          ctb_ret_cs_limit_enterpage,            //禁止进入该分页
    
          //2012-09-10
          ctb_ret_cs_no_permit,               //此模式不允许主动创建房间
    
          //2013-11-11
          ctb_ret_cs_escape_forbit,            // 逃跑被禁    
          //20140504
          ctb_ret_cs_kill_monster_no_value,    //杀boss模式没体力值
          //20150817
          ctb_ret_gs_get_chapter_err,            //新手获取章节信息失败
    
          ctb_ret_cs_quick_start_only,
          ctb_ret_in_mktbl_queue,
          ctb_ret_kingbattle_no_singup,        // 王战没报名
          ctb_ret_kingbattle_not_gametime,    // 王战不是游戏期间
          ctb_ret_kingbattle_not_match_model,    // 当前王战不是匹配模式
          ctb_ret_invite,
    
          ctb_ret_division_high,
          ctb_ret_cs_ready_offline_forbit,            // 匹配准备超时或掉线被禁    
      };
      unsigned short       result;
      unsigned int         tbl_id;
      unsigned char        seat_id_array[4];     //位置ID
      unsigned int         assign_gameserver_id; //客户端不需要使用
      char                 table_name[sc_max_tablename_len];
    
      unsigned char        label_model;
      unsigned char        label_section;
      //unsigned char        max_user_count;
      ClientMsgCreateTableRep():PacketBase(CLIENT_CREATETABLE_REP, sizeof(ClientMsgCreateTableRep))
      {
          tbl_id = sc_invalid_table_id;
          assign_gameserver_id = sc_invalid_server_id;
          result = ctb_ret_success;
    
          memset( seat_id_array,0,sizeof(seat_id_array));
          memset( table_name,0,sizeof(table_name));
          for( unsigned int t=0; t<(sizeof(seat_id_array)/sizeof(unsigned char)); ++t)
              seat_id_array[t] = sc_invalid_seat_id;
    
          label_model = label_model_no;
          label_section = section_kind_no;
          //max_user_count = 0;
      }
    };
    

游戏开始

  • 添加失败原因 result_gs_match_ready_failed,匹配准备超时处理失败

    协议号

    GS_C_START_GAME_REP = 21207,            //开始游戏结果
    

    协议内容

    //开始游戏结果
    struct GsMsg_StartGameRep : public PacketBase
    {
      enum emresult
      {
          result_ok = 1,
          result_gs_user_notexist = 2,
          result_gs_user_notbl = 3,
          result_gs_initgamefail = 4,
          result_gs_little_role = 5,            //玩家数目太少
          result_gs_someone_notprepare = 6,
          result_gs_hasbegin = 7,                //游戏已经开始
          result_gs_younot_master = 8,        //你不是房主
          result_gs_user_leak_tongqian = 9,    //铜钱不足  param1为铜钱不足的人的userid
          result_gs_boss1v3_no_boss = 10,        //打年兽模式 坐最后的不是年兽
          result_gs_reconnect = 11,            //断线重连
          result_gs_civiscore_limit = 12,            //文明分不够或禁赛限制
          result_gs_match_ready_failed = 13,    //匹配准备超时处理失败
      };
      emresult        result;
      unsigned int    param1;     //备用参数result==result_ok 时,表示table_id
      unsigned int    param2;        //备用参数result==result_ok 时,表示inning
      GsMsg_StartGameRep():PacketBase( GS_C_START_GAME_REP, sizeof(GsMsg_StartGameRep))
      {
          result = result_ok;
          param1 = 0;
          param2 = 0;
      }
    };
    

玩家离开通知

  • 添加离开原因 why_kickedout_in_matchready,匹配准备阶段被踢出(超时或下线)

    协议号

    CLIENT_OTHERUSER_LEAVETABLE_NTF = 20509,        //[client] 通知别的玩家,有人离开桌子
    

    协议内容

    struct ClientOtherUserLeaveTableNtf : public PacketBase
    {
      enum em_leave_why
      {
          why_self_leave    =1,    //自己主动离开
          why_net_disconnect,      //网络断开,有可能是异常
          why_kickedout_seat,      //被踢出
          why_kickedout_timeout,     //超过10s被踢出
          why_kickedout_in_matchready, //匹配准备阶段被踢出(超时或下线)
      };
      em_leave_why    leave_why;           //离开的原因  
      unsigned int    leaveuser_temp_id;   //用来效验
      unsigned char    leaveuser_seatpos;   //那个位置的玩家离开了
      unsigned int    reqkickuserid;         //请求踢人的userid
      ClientOtherUserLeaveTableNtf():PacketBase(CLIENT_OTHERUSER_LEAVETABLE_NTF, sizeof(ClientOtherUserLeaveTableNtf))
      {
          leaveuser_temp_id = sc_invalid_user_temp_id;
          leaveuser_seatpos = 0XFF;
          reqkickuserid      = sc_invalid_user_temp_id;
      }
    };
    

离开桌子回复或通知

  • 添加离开原因 why_leavetbl_match_ready_timeout,匹配准备超时被踢

    协议号

    CLIENT_LEAVETABLE_REP = 20506
    

    协议内容

    struct ClientMsgLeaveTableRep : public PacketBase
    {
      enum emResult
      {
          leavetbl_not_known         = 0,
          leavetbl_ret_ok            = 1,
          leavetbl_ret_user_notexist,
          leavetbl_ret_user_not_tbl,     //这个用户没有有效的桌子信息
          leavetbl_ret_gs_noerror,
          leavetbl_ret_yougaming,        //你正在游戏中,
          leavetbl_ret_waitstart,           //游戏倒计时开始中,禁止离开
      };
      enum emWhyLeave
      {
          why_leavetbl_not_known    = 0,
          why_leavetbl_userself_req = 1, //自己主动离开
          why_leavetbl_netdisconnect,    //网络断开
          why_leavetbl_cskickuser,       //系统踢出去 
          why_leavetbl_master_kickuser,  //房主踢用户
    
          //新添加的类型
          why_leavetbl_userself_req_gamenotbeing,    //自己离开,游戏还没有开始
          why_leavetbl_userself_req_gaming,          //自己离开,游戏没有结束,自己没有死亡,逃跑
          why_leavetbl_userself_req_selfdeath,       //自己离开,游戏没有结束,自己死亡
          why_leavetbl_match_over,                   //比赛使用,游戏结束,
          why_gsbegin_match_userleavetbl,            //当gs开始比赛的时候发现有人离开了桌子
          why_leavetbl_goods_expirydate,             //因为物品过期而被踢出桌子  
          why_leavetbl_cs_gs_sync,                   //cs,gs上的数据不同步,gs的桌子上有你,然cs上的桌子上没有
          why_leavetbl_gs_force_tbl,                 //gs强制解散了比赛的桌子
          why_leavetbl_gs_force_deathtbl,            //gs强制解散了死桌子
          why_leavetbl_cs_force_tbl,                 //cs强制要求解散桌子
          why_leavetbl_gs_force_setmaster,           //gs强制解散了设置房主失败的桌子
          why_leavetbl_gs_inning_gameover,           //gs强制解散了,一局结束后,逻辑需要
          why_leavetbl_gs_force_robotsitfail,        //gs上创建机器人失败
          why_leavetbl_gs_memerror,                  //gs发现内存无效
          why_leavetbl_gs_createtblfail,             //gs上创建桌子失败
          why_leavetbl_gs_selfkickuseroffline,       //gs自己踢用户下线
          why_leavetbl_gs_cssystemkickuser,          //系统批量踢用户下线
          why_leavetbl_gs_check_deathuser,           //gs检查到是个死用户
          why_leavetbl_gs_hearttimeout,              //gs上心跳超时
          why_leavetbl_gs_masterkickuser,            //gs上房主踢人
          why_leavetbl_gs_kickmaster,                //gs上都准备了,房主没有开始,系统踢房主
          why_leavetbl_gs_creatematchtblfail,        //gs上创建比赛桌子失败
          why_leavetbl_gs_cs_kickuseroffline,        //gs上收到cs踢用户下线的消息
          why_leavetbl_gs_gameover_kickuseroffline,  //gs上游戏结束,踢断线的滚蛋
          why_leavetbl_gs_youaccept_invite,          //你接收了别人的邀请,把你从自己的桌子上踢下去
          why_leavetbl_gs_synccs_check_aa,           //不知道什么具体的原因
          why_leavetbl_gs_synccs_check_ab,           //和cs进行同步验证
          why_leavetbl_gs_all_robots,                //桌子里都是机器人
          why_leavetbl_gs_training_gameover,         //练习桌子游戏结束解散
          why_leavetbl_gs_createttranktblfail,       //gs上创建天梯桌子失败
          why_gsbegin_ttrank_userleavetbl,           //当gs开始天梯游戏的时候发现有人离开了桌子
          why_leavetbl_ttrank_over,                  //天梯使用,游戏结束,
          why_leavetbl_gs_ai_gameover,                //AI场结束
          why_leavetbl_lookonleave,                    // 旁观离开
          why_leavetbl_no_fight_value,                //没有体力值了
          why_leavetbl_gs_createcmktbltblfail,       //gs上创建匹配模式桌子失败
          why_gsbegin_cmktbl_userleavetbl,           //当gs开始匹配模式游戏的时候发现有人离开了桌子
          why_leavetbl_wcafinal_over,                    //wcafinal比赛结束
          why_leavetbl_gs_close,
          why_arena_tuoguan_overtime,
          why_brawl_replace_by_robot,
          why_leavetbl_report_passive_player,            //举报消极游戏
          why_leavetbl_match_ready_timeout,           //匹配准备超时被踢
      };
    
      unsigned short result;
      unsigned short whyleave; //为什么离开,可以不填,只是为了追踪
      unsigned int   tbl_id;   //如果在cs上用户不在了,也要在桌子上清除用户
      ClientMsgLeaveTableRep():PacketBase(CLIENT_LEAVETABLE_REP, sizeof(ClientMsgLeaveTableRep))
      {
          tbl_id        = sc_invalid_table_id;
          result        = 0;
          whyleave    = 0;
      }
    };
    

请求坐下回复

  • 添加失败原因 ret_cs_ready_offline_forbit,准备阶段离开惩罚中

    协议号

    CLIENT_SITDOWN_REP = 20504
    

    协议内容

    //请求坐到游戏桌子上结果
    struct TResult_SitDownReq
    {
      enum em_user_sitdowntblreq_result
      {
          //**** 原有原因不具体列出
          ret_cs_ready_offline_forbit = 600,                // 匹配准备超时或掉线,禁止游戏
      };
    };
    struct ClientMsgSitDownRep : public PacketBase
    {
      //**** 原有协议内容不具体列出
      ClientMsgSitDownRep():PacketBase(CLIENT_SITDOWN_REP, sizeof(ClientMsgSitDownRep))
      {
          PRO_ZERO_MEMORY(this, sizeof(ClientMsgSitDownRep));
          assign_gameserver_id = sc_invalid_server_id;
          result    = TResult_SitDownReq::ret_sitdowntbl_ok;
          for( unsigned int t=0; t<(sizeof(seat_id_array)/sizeof(unsigned char)); ++t)
              seat_id_array[t] = sc_invalid_seat_id;
          //max_user_count = 0;
      }
    };
    

组队邀请回复

  • 添加失败原因 fail_readyoffline_punish,准备阶段离开惩罚中

    协议号

    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,        // 准备阶段离开(超时或掉线等)惩罚中
      };
      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_readyoffline_punish,准备阶段离开惩罚中

    协议号

    CLIENT_SS_CREATE_TEAM_REP = 23647
    

    协议内容

    struct ClientMsgCreateTeamRep : PacketBase
    {
      enum
      {
          ok = 0,
          fail = 1,
          fail_in_other_team = 2, // 在其他队伍里
          fail_target_check = 3,    // 在其他桌子或者队列里
          fail_param = 4,            // model section 参数错误
          fail_locked = 5,
          fail_enterpage = 6,
          fail_escape_punish = 7,
          fail_not_open = 8,
    
          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_no_corps = 16,
          fail_no_corps_leader = 17,
          fail_corps_member_limit = 18,
          fail_not_game_time = 19,
          fail_civi_score_limit = 20,
          fail_civi_score_forbidden = 21,
    
          fail_no_enough_money = 22,    //钱不够,一般是有门票要求的模式,如果斗地主的欢乐豆
          fail_readyoffline_punish = 23,    //准备离线惩罚中
      };
    
      unsigned char result;
      unsigned int teamid;
      unsigned int model;
      unsigned int section;
      unsigned char max_team_member;
      unsigned int matchid;
      ClientMsgCreateTeamRep() : PacketBase(CLIENT_SS_CREATE_TEAM_REP, sizeof(ClientMsgCreateTeamRep))
      {
          PRO_ZERO_MEMORY(this, sizeof(ClientMsgCreateTeamRep));
      }
    };
    

组队自动邀请回复

  • 添加失败原因 fail_readyoffline_punish,准备阶段离开惩罚中

    协议号

    ClientAutoInviteRep = 23696
    

    协议内容

    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,        // 准备阶段离开(超时或掉线等)惩罚中
      };
    
      unsigned int result;
    
      ClientAutoInviteRep() : PacketBase(CLIENT_AUTO_INVITE_REP, sizeof(ClientAutoInviteRep))
      {
          PRO_ZERO_MEMORY(this, sizeof(ClientAutoInviteRep));
      }
    };
    

进入教训模式回复

  • 添加失败原因 fail_in_mtach_queue,正在匹配队列中

    协议号

    CLIENT_JIAOXUN_REP = 21685
    

    协议内容

    struct ClientJiaoxunRep : public PacketBase
    {
      enum
      {
          ok = 0,
          fail,
          fail_dbs,
          fail_me_not_loadcomplete,
          fail_dest_not_loadcomplete,
          fail_dataformat,
          fail_today_count_limit_dest,
          fail_today_count_limit_me,
          fail_createtable,
          fail_in_mtach_queue,
      };
    
      BYTE entrance;        // 教训,切磋
      BYTE reason;        // 邮件、面板等等
      BYTE result;
      char destnickname[sc_max_nickname_len];
    
      ClientJiaoxunRep() : PacketBase(CLIENT_JIAOXUN_REP, sizeof(ClientJiaoxunRep))
      {
          PRO_ZERO_MEMORY(this, sizeof(ClientJiaoxunRep));
      }
    };
    

队伍信息查询回复或通知

  • 添加离开标记 other_leave_dismiss、other_leave_continue

    协议号

    CLIENT_SS_TEAM_INFO_REP = 23660
    

    协议内容

    struct ClientMsgTeamInfoRep : PacketBase
    {
      static const unsigned int sc_max_membercnt = 8;
    
      enum eFlag
      {
          user_req = 0,
          other_enter = 1,
          other_leave = 2,   //玩家离开,终止匹配,保留队伍
          other_swap = 3,
          other_prepare = 4,
          other_updateinfo = 5,
          other_leave_dismiss = 6,   //玩家离开,终止匹配,解散队伍
          other_leave_continue = 7, //玩家离开,保留队伍,继续匹配
      };
    
      struct TBaseInfo
      {
          unsigned int user_id;
          char nickname[sc_max_nickname_len];
          unsigned int head;
          unsigned char sex;
          unsigned char pos;
          unsigned char level;
          unsigned char vip;
          unsigned int  arena_score;
          unsigned int  arena_division;
          unsigned char officiallevel;
          unsigned char officialrank;
          bool prepare;
          unsigned short win_rate;
          unsigned char is_vip;
          unsigned char is_dynamic;
          char backup[14];
      };
    
      BYTE flag;
      unsigned int teamid;
      unsigned int model;
      unsigned int section;
      unsigned int master_userid;
      unsigned char max_usercnt;
      unsigned char usercnt;
      TBaseInfo members[sc_max_membercnt];
    
      unsigned int GetLen() { return sizeof(ClientMsgTeamInfoRep) - sizeof(members) + sizeof(TBaseInfo) * usercnt; }
    
      ClientMsgTeamInfoRep() : PacketBase(CLIENT_SS_TEAM_INFO_REP, sizeof(ClientMsgTeamInfoRep))
      {
          PRO_ZERO_MEMORY(this, sizeof(ClientMsgTeamInfoRep));
      }
    };