示例#1
0
    public override byte[] toBinary()
    {
        writer = new st.net.NetBase.ByteWriter();
        writer.write_int(rank);
        writer.write_int(surplus_time);
        writer.write_int(challenge_num);
        writer.write_int(reward_countdown);
        writer.write_int(state);
        ushort lenrobot_list = (ushort)robot_list.Count;

        writer.write_short(lenrobot_list);
        for (int i_robot_list = 0; i_robot_list < lenrobot_list; i_robot_list++)
        {
            st.net.NetBase.robot_list listData = robot_list[i_robot_list];
            listData.toBinary(writer);
        }
        ushort lenlog_list = (ushort)log_list.Count;

        writer.write_short(lenlog_list);
        for (int i_log_list = 0; i_log_list < lenlog_list; i_log_list++)
        {
            st.net.NetBase.log_list listData = log_list[i_log_list];
            listData.toBinary(writer);
        }
        writer.write_int(buy_challenge_times);
        writer.write_int(reward_rank);
        return(writer.data);
    }
示例#2
0
    public override void fromBinary(byte[] binary)
    {
        reader           = new st.net.NetBase.ByteReader(binary);
        rank             = reader.Read_int();
        surplus_time     = reader.Read_int();
        challenge_num    = reader.Read_int();
        reward_countdown = reader.Read_int();
        state            = reader.Read_int();
        ushort lenrobot_list = reader.Read_ushort();

        robot_list = new List <st.net.NetBase.robot_list>();
        for (int i_robot_list = 0; i_robot_list < lenrobot_list; i_robot_list++)
        {
            st.net.NetBase.robot_list listData = new st.net.NetBase.robot_list();
            listData.fromBinary(reader);
            robot_list.Add(listData);
        }
        ushort lenlog_list = reader.Read_ushort();

        log_list = new List <st.net.NetBase.log_list>();
        for (int i_log_list = 0; i_log_list < lenlog_list; i_log_list++)
        {
            st.net.NetBase.log_list listData = new st.net.NetBase.log_list();
            listData.fromBinary(reader);
            log_list.Add(listData);
        }
        buy_challenge_times = reader.Read_int();
        reward_rank         = reader.Read_int();
    }
示例#3
0
 /// <summary>
 /// 排行信息
 /// </summary>
 public string GetPlayerRank(int uid)
 {
     for (int i = 0; i < robot_list.Count; i++)
     {
         st.net.NetBase.robot_list data = robot_list[i];
         if (data.uid == uid)
         {
             return(data.rank.ToString());
         }
     }
     return(string.Empty);
 }
示例#4
0
    /// <summary>
    /// 获取玩家
    /// </summary>
    public List <OtherPlayerInfo> GetPlayer()
    {
        List <OtherPlayerInfo> strs   = new List <OtherPlayerInfo>();
        OtherPlayerData        player = null;

        for (int i = 0; i < robot_list.Count; i++)
        {
            st.net.NetBase.robot_list data = robot_list[i];
            player = new OtherPlayerData();
            player.serverInstanceID = (int)data.uid;
            player.name             = data.name;
            player.baseValueDic[ActorBaseTag.FightValue] = data.battle;
            player.prof = (int)data.prof;
            strs.Add(new OtherPlayerInfo(player));
        }
        return(strs);
    }