mirror of https://git.48k.eu/ogserver
dbi: add server_id to og_computer struct
Extend og_dbi_get_computer_info to fetch "identorno" column from "ordenadores". "identorno" holds the row id value from the "entornos" table (valid ogserver addresses). Extend og_computer struct with a new field: "server_id" that will store the value of "identorno" column fetched from the database.master
parent
44745a3f22
commit
4cc2ca61fd
|
@ -77,6 +77,7 @@ int og_dbi_get_computer_info(struct og_dbi *dbi, struct og_computer *computer,
|
||||||
" ordenadores.oglivedir,"
|
" ordenadores.oglivedir,"
|
||||||
" ordenadores.inremotepc,"
|
" ordenadores.inremotepc,"
|
||||||
" ordenadores.maintenance,"
|
" ordenadores.maintenance,"
|
||||||
|
" ordenadores.identorno,"
|
||||||
" centros.idcentro "
|
" centros.idcentro "
|
||||||
"FROM ordenadores "
|
"FROM ordenadores "
|
||||||
"INNER JOIN aulas ON aulas.idaula=ordenadores.idaula "
|
"INNER JOIN aulas ON aulas.idaula=ordenadores.idaula "
|
||||||
|
@ -104,6 +105,7 @@ int og_dbi_get_computer_info(struct og_dbi *dbi, struct og_computer *computer,
|
||||||
dbi_result_get_string(result, "ip"));
|
dbi_result_get_string(result, "ip"));
|
||||||
snprintf(computer->mac, sizeof(computer->mac), "%s",
|
snprintf(computer->mac, sizeof(computer->mac), "%s",
|
||||||
dbi_result_get_string(result, "mac"));
|
dbi_result_get_string(result, "mac"));
|
||||||
|
computer->server_id = dbi_result_get_uint(result, "identorno");
|
||||||
computer->room = dbi_result_get_uint(result, "idaula");
|
computer->room = dbi_result_get_uint(result, "idaula");
|
||||||
computer->center = dbi_result_get_uint(result, "idcentro");
|
computer->center = dbi_result_get_uint(result, "idcentro");
|
||||||
computer->hardware_id = dbi_result_get_uint(result, "idperfilhard");
|
computer->hardware_id = dbi_result_get_uint(result, "idperfilhard");
|
||||||
|
|
|
@ -74,6 +74,7 @@ struct og_legacy_partition {
|
||||||
struct og_computer {
|
struct og_computer {
|
||||||
unsigned int procedure_id;
|
unsigned int procedure_id;
|
||||||
unsigned int hardware_id;
|
unsigned int hardware_id;
|
||||||
|
unsigned int server_id;
|
||||||
unsigned int repo_id;
|
unsigned int repo_id;
|
||||||
unsigned int center;
|
unsigned int center;
|
||||||
unsigned int room;
|
unsigned int room;
|
||||||
|
|
Loading…
Reference in New Issue