hunkmegs fix, does it work?


(ailmanki) #1

[QUOTE=El Stupido;147795]

void forcehunk(void){
	char		server[MAX_CVAR_VALUE_STRING];
	char		hunk[MAX_CVAR_VALUE_STRING];
	char		base[MAX_CVAR_VALUE_STRING];
	char		game[MAX_CVAR_VALUE_STRING];
	char		*p;
	
	trap_Cvar_VariableStringBuffer("com_hunkMegs",hunk,sizeof(hunk));
	if(atoi(hunk)<128){
		trap_Cvar_VariableStringBuffer("cl_currentServerIP",server,sizeof(server));
		trap_Cvar_VariableStringBuffer("fs_basePath",base,sizeof(base));
		trap_Cvar_VariableStringBuffer("fs_game",game,sizeof(game));
		
#ifdef WIN32
		p=va("%s/et.exe",base);
#else
		p=va("%s/et",base);
#endif

		execl(p,p,"+set","fs_game",game,"+set","com_hunkmegs","128","+connect",server,NULL);

		trap_SendConsoleCommand("quit
");
	}
}

This goes to CG_Init below CG_ParseWolfinfo. It works fine besides on linux it seems to screw up sound on some installs . I think this is related to the new process starting before the old one terminates but i didnt have time to look into it yet.[/QUOTE]

Has anybody tested this? I wonder if this works…


(Scennative) #2

Yada has write these for long time ago.

He has maked a better Version.

He sayed, on Windows Xp works it. But on Vista and Windoof 7 not so good. The Problem is the admin controll things…


(system) #3

Sure it works, we use it since the very beginning of our mod.
Works on all Windows machines and Linux. (Dunno about Mac but if you are planning to use it you can add it i guess).

The code you found is damn old though.
If you are interested, i can ask Yada to handout the new code.


(ailmanki) #4

Thanks! I thought the code would be complicated, did not even read it correctly… lol

Having it read now, seems obvious what it does, starts et with new settings, and closes the current one.
Awesome!

Once i start coding I will come back on that offer dutchman, thanks!


(7Killer) #5

hey
i have try it like it s on my mod under windows 7 , that s seems works only if the runs as administrator check box has been checked before in the exe propriety thing…
If yada want share it that would be nice and i ll ad him to the credits of my mods


(Scennative) #6

you sayed it…

on windows 7 (and on vista) it works only with run as admin.
on windoof xp it works fine :slight_smile:


(7Killer) #7

i ll ask one of my friend which work under windows system developmenet if we can make a system call with admin right.
As i understood, a windows 7 players need to runs ET as admin, so the dll is somewhere call with the good right


(BlackEight) #8

Hello
Is that sth that can be put on server to improve it or it’s just strictly related to map making?

Eight


(Indloon) #9

[QUOTE=BlackEight;262764]Hello
Is that sth that can be put on server to improve it or it’s just strictly related to map making?

Eight[/QUOTE]

It´s for modding.


(7Killer) #10

my friend said it exists a runas cmd in cmd line windows vista/7 cmd system,
after some ( quick ) search i found that :
http://www.sevenforums.com/system-security/17528-command-line-argument-admin-rights.html

i try one my laptop :
runas /user: admin /savcred ET.exe on my laptop in a cmd line box and that have ask me a password in the box,
i ll make a shot compilation of a basis mod which just check the hunk thing, to see what that s done on my windows 7