Example #1
0
        private string get_arg_string(Field_Info info, Bit_Buffer buffer, bool from_vector = false)
        {
            string ret = "";

            if (!from_vector)
            {
                ret = (info.field_name + ":");
            }

            if (info.field_type == "int")
            {
                int val = buffer.read_int(info.field_bit);
                ret += val.ToString();
            }
            else if (info.field_type == "uint")
            {
                uint val = buffer.read_uint(info.field_bit);
                ret += val.ToString();
            }
            else if (info.field_type == "int64")
            {
                long val = buffer.read_int64();
                ret += val.ToString();
            }
            else if (info.field_type == "uint64")
            {
                ulong val = buffer.read_uint64();
                ret += val.ToString();
            }
            else if (info.field_type == "float")
            {
                float val = buffer.read_decimal(32);
                ret += val.ToString();
            }
            else if (info.field_type == "bool")
            {
                bool val = buffer.read_bool();
                ret += val.ToString();
            }
            else if (info.field_type == "string")
            {
                string val = buffer.read_string();
                ret += "\"" + val + "\"";
            }
            return(ret + ", ");
        }
Example #2
0
 /// <summary>
 /// 服务器返回消息
 /// </summary>
 public int res_heartbeat(Bit_Buffer buffer)
 {
     server_tick_ = buffer.read_int(32);
     player_log("服务器心跳时间:" + server_tick_.ToString());
     return(0);
 }