Originally Posted by
voron00
Also maybe put:
PHP Code:
printf("Last weapon used: %s\n", *(char**)(v3 + 0));
To see which weapon has crashed the server (this would be the last message before the crash then). Have you tried reproducing it somehow? How does it happens anyway?
Sorry as I was writting my last post there wasn't your second post.
PHP Code:
int hook_BG_IsWeaponValid(int a1, int a2) {
printf("hook_BG_IsWeaponValid -- Starting \n");
printf("hook_BG_IsWeaponValid -- a1 == %i a2 == %i \n", a1, a2);
int v3;
char v4;
signed int (*sub_80E9758)(int a1);
*(int *)&sub_80E9758 = 0x80E9758;
int (*sub_80D9E84)(int a1, signed int a2);
*(int *)&sub_80D9E84 = 0x80D9E84;
int (*sub_80E9270)(int a1);
*(int *)&sub_80E9270 = 0x80E9270;
v4 = 1;
if ( !(unsigned int8_t)sub_80E9758(a2) )
v4 = 0;
if ( !(unsigned int8_t)sub_80D9E84(a1 + 1348, a2) )
v4 = 0;
v3 = sub_80E9270(a2);
printf("hook_BG_IsWeaponValid -- sub_80E9270(a2) = v3 == %i \n", v3);
printf("hook_BG_IsWeaponValid -- Checking fi anything changed a1 == %i a2 == %i \n", a1, a2);
if ( !*(long *)(v3 + 132) && *(char *)(a1 + 1365) != a2 && *(char *)(a1 + 1366) != a2 && *(long *)(v3 + 876) != a2 )
v4 = 0;
printf("Finished hook_BG_IsWeaponValid \n");
return (unsigned int8_t)v4;
}
Should I place your printf("Last weapon used: %s\n", *(char**)(v3 + 0)); right after v3 = sub_80E9270(a2); ? Why is it even a char? Mine prints are bad then?
I wass trying to reproduce it by disconnecting the server with opened weapon menu, but no success. Seg fault is quite rare, about one per day, but I had none since 2 days now.
There is nothing special when it happens.
Code:
^9(GAME_AXIS)Lazlow B^7: QUICKMESSAGE_SORRY
^9(GAME_AXIS)Lazlow B^7: QUICKMESSAGE_SORRY
Client 50 connecting with 100 challenge ping from 41.227.135.167:11431
Going from CS_FREE to CS_CONNECTED for (num 0 guid 0)
^9(GAME_AXIS)Lazlow B^7: QUICKMESSAGE_SORRY
^9(GAME_DEAD)Ndrecke24^7: SORRY JB
^9(GAME_AXIS)Lazlow B^7: QUICKMESSAGE_SORRY
Segmentation fault (core dumped)
Code:
Client 11 connecting with 150 challenge ping from 39.32.79.134:28960
Going from CS_FREE to CS_CONNECTED for (num 2 guid 0)
0: EXE_DISCONNECTED
clientDownload: 2 : begining "whiskys.lair2/zzz_rifle_only.iwd"
clientDownload: 2 : file "whiskys.lair2/zzz_rifle_only.iwd" completed
clientDownload: 2 : begining "whiskys.lair2/zzz_modz.iwd"
clientDownload: 2 : file "whiskys.lair2/zzz_modz.iwd" completed
Client 12 connecting with 150 challenge ping from 41.111.108.187:15369
Going from CS_FREE to CS_CONNECTED for (num 0 guid 0)
Segmentation fault (core dumped)