1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
server::server(){
port = 0;
serverup = 0;
loaded = 0;
logfile = (char *) malloc(SERVER_PATHS_SIZE*sizeof(char)); //****************************
}
int server::load(int in_id, char *in_name, char *in_ip, int in_port,
char *in_rcon, char *in_logfile){
int err;
sprintf(name, "%s\x00", in_name);
sprintf(ip, "%s\x00", in_ip);
port = in_port;
sprintf(rcon, "%s\x00", in_rcon);
sprintf(logfile,"%s\x00", in_logfile); //**********************************
err = urt.set(ip, port, rcon);
if(err < 1){
printf("server::load(): error from urt.set()\n");
return 0;
}
printf("server::load(): server %d loaded!\n", id);
loaded = 1;
return 1;
}
|