Just_Fenix
11.05.2014, 21:15
Здравствуйте!
На сервере часто появляется краш. Появляется он после того как я начинаю следить за игроком. Если два раза подряд начать следить - то сервер выключается.
У меня слежка с панелью. Глобальные переменные
new PlayerSpec[MAX_PLAYERS];
new PlayerSpectateID[MAX_PLAYERS];
new Menu:reconmenu;
Колбэк OnPlayerCommandText
if(strcmp(cmd, "/re", true) == 0 || strcmp(cmd, "/recon", true) == 0)
{
if(pInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GRAD1, "Недостаточно прав для использования команды.");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD1, "/re(con) [playerid]");
para1 = ReturnUser(tmp);
if(para1 == playerid) return SendClientMessage(playerid, COLOR_GRAD1, "Вы не можете следить за самим собой.");
if(!IsPlayerConnected(para1)) return SendClientMessage(playerid, COLOR_GRAD1, "Игрока нет на сервере.");
if(GetPlayerState(para1) == PLAYER_STATE_SPECTATING) return SendClientMessage(playerid, COLOR_GRAD1, "Этот игрок не вступил в игру.");
SetPlayerInterior(playerid, GetPlayerInterior(para1));
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(para1));
TogglePlayerSpectating(playerid, true);
if(GetPlayerVehicleID(para1)) PlayerSpectateVehicle(playerid, GetPlayerVehicleID(para1));
else PlayerSpectatePlayer(playerid, para1);
ShowMenuForPlayer(reconmenu,playerid);
PlayerSpectateID[playerid] = para1;
PlayerSpec[para1] = playerid;
return true;
}
Колбэк OnGameModeInit
reconmenu = CreateMenu("Panel", 1, 510.0, 120.0, 75.0);
AddMenuItem(reconmenu,0,"Update");
AddMenuItem(reconmenu,0,"Exit");
public OnPlayerSelectedMenuRow(playerid, row)
{
if(GetPlayerMenu(playerid) == reconmenu)
{
switch(row)
{
case 0:
{
new vehicle = GetPlayerVehicleID(PlayerSpec[PlayerSpectateID[playerid]]);
if(vehicle) PlayerSpectateVehicle(playerid, vehicle);
else PlayerSpectatePlayer(playerid, PlayerSpec[PlayerSpectateID[playerid]]);
ShowMenuForPlayer(reconmenu,playerid);
SendClientMessageToAll(COLOR_GREEN, "Слежка обновлена");
}
case 1:
{
TogglePlayerSpectating(playerid, false);
SetCameraBehindPlayer(playerid);
SendClientMessage(playerid, COLOR_YELLOW, "Наблюдение закончено.");
PlayerSpec[PlayerSpectateID[playerid]] = -1;
PlayerSpectateID[playerid] = -1;
DestroyMenu(reconmenu);
}
}
}
return 1;
}
Ну и если игрок нажал ENTER во время слежки, то отключаем его.
В колбэк OnPlayerKeyStateChange
if(newkeys & 16 && GetPlayerState(playerid) == PLAYER_STATE_SPECTATING)
{
TogglePlayerSpectating(playerid, false);
SetCameraBehindPlayer(playerid);
SendClientMessage(playerid, COLOR_YELLOW, "Наблюдение закончено.");
PlayerSpec[PlayerSpectateID[playerid]] = -1;
PlayerSpectateID[playerid] = -1;
DestroyMenu(reconmenu);
return 1;
}
PlayerSpec[PlayerSpectateID[playerid]] = -1;
PlayerSpectateID[playerid] = -1; - эти переменные у меня обнуляются при входе/выходе.
Также заметил в самом краше, что как-то не правильно работает стример. Версия стримера у меня 2.6.1 (( 2.7 багнутый )).
Краш:
--------------------------
SA-MP Server: 0.3z
Exception At Address: 0x00487CE0 Module: (samp-server.exe)
Registers:
EAX: 0x00000000 EBX: 0x00000001 ECX: 0x00000000 EDX: 0x00000001
ESI: 0x00000000 EDI: 0x00470000 EBP: 0x0367F45C ESP: 0x0018F74C
EFLAGS: 0x00010297
Stack:
+0000: 0x0200F808 0x03861F80 0x01FAC538 0x0369AB00
+0010: 0x00000000 0x0369AB01 0x00000001 0x00000018
+0020: 0x00000800 0x00000000 0x0018F779 0x01000101
+0030: 0x00000100 0x0018F7AC 0x76FB6A16 0x00000000
+0040: 0x00000000 0x0018F836 0x00000001 0x0018F834
+0050: 0x00000001 0x00000000 0x00000000 0x0018F834
+0060: 0x0018F7E4 0x76FAEAE2 0x00000000 0x00000100
+0070: 0x0018F834 0x00000001 0x0018F834 0x00000001
+0080: 0x76FC124C 0x00000000 0x00000000 0x00000065
+0090: 0x00000001 0x00000001 0x0018F810 0x76FA2E8A
+00A0: 0x00000000 0x00000100 0x0018F834 0x00000001
+00B0: 0x0018F834 0x00000001 0x00000010 0x00000065
+00C0: 0x00000001 0x00000001 0x0018F838 0x750A3EE5
+00D0: 0x0018F840 0x01FAC538 0x03676760 0x00499CD9
+00E0: 0x00000000 0x0018F855 0x00000000 0x00493D1A
+00F0: 0x00406BA8 0x00000000 0x01FAC538 0x0369AB00
+0100: 0x001C7898 0x00000001 0x00000031 0x0367EF38
+0110: 0x004065C5 0x03862798 0x03852960 0x00000003
+0120: 0x0018FB54 0x004A5DCB 0xFFFFFFFF 0x00473E7B
+0130: 0x00470000 0x01FAC538 0x0369AB00 0x00402BD0
--------------------------
Loaded Modules:
samp-server.exe A: 0x00400000 - 0x004F5000 (C:\Users\user\Desktop\Project\samp-server.exe)
ntdll.dll A: 0x773D0000 - 0x77550000 (C:\Windows\SysWOW64\ntdll.dll)
kernel32.dll A: 0x754D0000 - 0x755E0000 (C:\Windows\syswow64\kernel32.dll)
KERNELBASE.dll A: 0x76F80000 - 0x76FC7000 (C:\Windows\syswow64\KERNELBASE.dll)
SHELL32.dll A: 0x75A50000 - 0x7669A000 (C:\Windows\syswow64\SHELL32.dll)
msvcrt.dll A: 0x74EF0000 - 0x74F9C000 (C:\Windows\syswow64\msvcrt.dll)
SHLWAPI.dll A: 0x752B0000 - 0x75307000 (C:\Windows\syswow64\SHLWAPI.dll)
GDI32.dll A: 0x759C0000 - 0x75A50000 (C:\Windows\syswow64\GDI32.dll)
USER32.dll A: 0x75080000 - 0x75180000 (C:\Windows\syswow64\USER32.dll)
ADVAPI32.dll A: 0x758F0000 - 0x75990000 (C:\Windows\syswow64\ADVAPI32.dll)
sechost.dll A: 0x766C0000 - 0x766D9000 (C:\Windows\SysWOW64\sechost.dll)
RPCRT4.dll A: 0x75770000 - 0x75860000 (C:\Windows\syswow64\RPCRT4.dll)
SspiCli.dll A: 0x74E00000 - 0x74E60000 (C:\Windows\syswow64\SspiCli.dll)
CRYPTBASE.dll A: 0x74DF0000 - 0x74DFC000 (C:\Windows\syswow64\CRYPTBASE.dll)
LPK.dll A: 0x766B0000 - 0x766BA000 (C:\Windows\syswow64\LPK.dll)
USP10.dll A: 0x74FD0000 - 0x7506D000 (C:\Windows\syswow64\USP10.dll)
WSOCK32.dll A: 0x712F0000 - 0x712F7000 (C:\Windows\system32\WSOCK32.dll)
WS2_32.dll A: 0x76900000 - 0x76935000 (C:\Windows\syswow64\WS2_32.dll)
NSI.dll A: 0x75750000 - 0x75756000 (C:\Windows\syswow64\NSI.dll)
WINMM.dll A: 0x73E40000 - 0x73E72000 (C:\Windows\system32\WINMM.dll)
IMM32.DLL A: 0x769F0000 - 0x76A50000 (C:\Windows\system32\IMM32.DLL)
MSCTF.dll A: 0x766E0000 - 0x767AC000 (C:\Windows\syswow64\MSCTF.dll)
streamer.DLL A: 0x6CA60000 - 0x6CA9E000 (C:\Users\user\Desktop\Project\plugins\streamer.DLL)
MSVCP100.dll A: 0x6A4C0000 - 0x6A529000 (C:\Windows\system32\MSVCP100.dll)
MSVCR100.dll A: 0x652C0000 - 0x6537F000 (C:\Windows\system32\MSVCR100.dll)
mswsock.dll A: 0x72D80000 - 0x72DBC000 (C:\Windows\system32\mswsock.dll)
wshtcpip.dll A: 0x73040000 - 0x73045000 (C:\Windows\System32\wshtcpip.dll)
NLAapi.dll A: 0x73920000 - 0x73930000 (C:\Windows\system32\NLAapi.dll)
napinsp.dll A: 0x73680000 - 0x73690000 (C:\Windows\system32\napinsp.dll)
pnrpnsp.dll A: 0x73660000 - 0x73672000 (C:\Windows\system32\pnrpnsp.dll)
DNSAPI.dll A: 0x71E60000 - 0x71EA4000 (C:\Windows\system32\DNSAPI.dll)
winrnr.dll A: 0x734B0000 - 0x734B8000 (C:\Windows\System32\winrnr.dll)
WLIDNSP.DLL A: 0x73010000 - 0x73037000 (C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live\WLIDNSP.DLL)
PSAPI.DLL A: 0x769E0000 - 0x769E5000 (C:\Windows\syswow64\PSAPI.DLL)
IPHLPAPI.DLL A: 0x72770000 - 0x7278C000 (C:\Windows\system32\IPHLPAPI.DLL)
WINNSI.DLL A: 0x72760000 - 0x72767000 (C:\Windows\system32\WINNSI.DLL)
rasadhlp.dll A: 0x72D00000 - 0x72D06000 (C:\Windows\system32\rasadhlp.dll)
На сервере часто появляется краш. Появляется он после того как я начинаю следить за игроком. Если два раза подряд начать следить - то сервер выключается.
У меня слежка с панелью. Глобальные переменные
new PlayerSpec[MAX_PLAYERS];
new PlayerSpectateID[MAX_PLAYERS];
new Menu:reconmenu;
Колбэк OnPlayerCommandText
if(strcmp(cmd, "/re", true) == 0 || strcmp(cmd, "/recon", true) == 0)
{
if(pInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GRAD1, "Недостаточно прав для использования команды.");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD1, "/re(con) [playerid]");
para1 = ReturnUser(tmp);
if(para1 == playerid) return SendClientMessage(playerid, COLOR_GRAD1, "Вы не можете следить за самим собой.");
if(!IsPlayerConnected(para1)) return SendClientMessage(playerid, COLOR_GRAD1, "Игрока нет на сервере.");
if(GetPlayerState(para1) == PLAYER_STATE_SPECTATING) return SendClientMessage(playerid, COLOR_GRAD1, "Этот игрок не вступил в игру.");
SetPlayerInterior(playerid, GetPlayerInterior(para1));
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(para1));
TogglePlayerSpectating(playerid, true);
if(GetPlayerVehicleID(para1)) PlayerSpectateVehicle(playerid, GetPlayerVehicleID(para1));
else PlayerSpectatePlayer(playerid, para1);
ShowMenuForPlayer(reconmenu,playerid);
PlayerSpectateID[playerid] = para1;
PlayerSpec[para1] = playerid;
return true;
}
Колбэк OnGameModeInit
reconmenu = CreateMenu("Panel", 1, 510.0, 120.0, 75.0);
AddMenuItem(reconmenu,0,"Update");
AddMenuItem(reconmenu,0,"Exit");
public OnPlayerSelectedMenuRow(playerid, row)
{
if(GetPlayerMenu(playerid) == reconmenu)
{
switch(row)
{
case 0:
{
new vehicle = GetPlayerVehicleID(PlayerSpec[PlayerSpectateID[playerid]]);
if(vehicle) PlayerSpectateVehicle(playerid, vehicle);
else PlayerSpectatePlayer(playerid, PlayerSpec[PlayerSpectateID[playerid]]);
ShowMenuForPlayer(reconmenu,playerid);
SendClientMessageToAll(COLOR_GREEN, "Слежка обновлена");
}
case 1:
{
TogglePlayerSpectating(playerid, false);
SetCameraBehindPlayer(playerid);
SendClientMessage(playerid, COLOR_YELLOW, "Наблюдение закончено.");
PlayerSpec[PlayerSpectateID[playerid]] = -1;
PlayerSpectateID[playerid] = -1;
DestroyMenu(reconmenu);
}
}
}
return 1;
}
Ну и если игрок нажал ENTER во время слежки, то отключаем его.
В колбэк OnPlayerKeyStateChange
if(newkeys & 16 && GetPlayerState(playerid) == PLAYER_STATE_SPECTATING)
{
TogglePlayerSpectating(playerid, false);
SetCameraBehindPlayer(playerid);
SendClientMessage(playerid, COLOR_YELLOW, "Наблюдение закончено.");
PlayerSpec[PlayerSpectateID[playerid]] = -1;
PlayerSpectateID[playerid] = -1;
DestroyMenu(reconmenu);
return 1;
}
PlayerSpec[PlayerSpectateID[playerid]] = -1;
PlayerSpectateID[playerid] = -1; - эти переменные у меня обнуляются при входе/выходе.
Также заметил в самом краше, что как-то не правильно работает стример. Версия стримера у меня 2.6.1 (( 2.7 багнутый )).
Краш:
--------------------------
SA-MP Server: 0.3z
Exception At Address: 0x00487CE0 Module: (samp-server.exe)
Registers:
EAX: 0x00000000 EBX: 0x00000001 ECX: 0x00000000 EDX: 0x00000001
ESI: 0x00000000 EDI: 0x00470000 EBP: 0x0367F45C ESP: 0x0018F74C
EFLAGS: 0x00010297
Stack:
+0000: 0x0200F808 0x03861F80 0x01FAC538 0x0369AB00
+0010: 0x00000000 0x0369AB01 0x00000001 0x00000018
+0020: 0x00000800 0x00000000 0x0018F779 0x01000101
+0030: 0x00000100 0x0018F7AC 0x76FB6A16 0x00000000
+0040: 0x00000000 0x0018F836 0x00000001 0x0018F834
+0050: 0x00000001 0x00000000 0x00000000 0x0018F834
+0060: 0x0018F7E4 0x76FAEAE2 0x00000000 0x00000100
+0070: 0x0018F834 0x00000001 0x0018F834 0x00000001
+0080: 0x76FC124C 0x00000000 0x00000000 0x00000065
+0090: 0x00000001 0x00000001 0x0018F810 0x76FA2E8A
+00A0: 0x00000000 0x00000100 0x0018F834 0x00000001
+00B0: 0x0018F834 0x00000001 0x00000010 0x00000065
+00C0: 0x00000001 0x00000001 0x0018F838 0x750A3EE5
+00D0: 0x0018F840 0x01FAC538 0x03676760 0x00499CD9
+00E0: 0x00000000 0x0018F855 0x00000000 0x00493D1A
+00F0: 0x00406BA8 0x00000000 0x01FAC538 0x0369AB00
+0100: 0x001C7898 0x00000001 0x00000031 0x0367EF38
+0110: 0x004065C5 0x03862798 0x03852960 0x00000003
+0120: 0x0018FB54 0x004A5DCB 0xFFFFFFFF 0x00473E7B
+0130: 0x00470000 0x01FAC538 0x0369AB00 0x00402BD0
--------------------------
Loaded Modules:
samp-server.exe A: 0x00400000 - 0x004F5000 (C:\Users\user\Desktop\Project\samp-server.exe)
ntdll.dll A: 0x773D0000 - 0x77550000 (C:\Windows\SysWOW64\ntdll.dll)
kernel32.dll A: 0x754D0000 - 0x755E0000 (C:\Windows\syswow64\kernel32.dll)
KERNELBASE.dll A: 0x76F80000 - 0x76FC7000 (C:\Windows\syswow64\KERNELBASE.dll)
SHELL32.dll A: 0x75A50000 - 0x7669A000 (C:\Windows\syswow64\SHELL32.dll)
msvcrt.dll A: 0x74EF0000 - 0x74F9C000 (C:\Windows\syswow64\msvcrt.dll)
SHLWAPI.dll A: 0x752B0000 - 0x75307000 (C:\Windows\syswow64\SHLWAPI.dll)
GDI32.dll A: 0x759C0000 - 0x75A50000 (C:\Windows\syswow64\GDI32.dll)
USER32.dll A: 0x75080000 - 0x75180000 (C:\Windows\syswow64\USER32.dll)
ADVAPI32.dll A: 0x758F0000 - 0x75990000 (C:\Windows\syswow64\ADVAPI32.dll)
sechost.dll A: 0x766C0000 - 0x766D9000 (C:\Windows\SysWOW64\sechost.dll)
RPCRT4.dll A: 0x75770000 - 0x75860000 (C:\Windows\syswow64\RPCRT4.dll)
SspiCli.dll A: 0x74E00000 - 0x74E60000 (C:\Windows\syswow64\SspiCli.dll)
CRYPTBASE.dll A: 0x74DF0000 - 0x74DFC000 (C:\Windows\syswow64\CRYPTBASE.dll)
LPK.dll A: 0x766B0000 - 0x766BA000 (C:\Windows\syswow64\LPK.dll)
USP10.dll A: 0x74FD0000 - 0x7506D000 (C:\Windows\syswow64\USP10.dll)
WSOCK32.dll A: 0x712F0000 - 0x712F7000 (C:\Windows\system32\WSOCK32.dll)
WS2_32.dll A: 0x76900000 - 0x76935000 (C:\Windows\syswow64\WS2_32.dll)
NSI.dll A: 0x75750000 - 0x75756000 (C:\Windows\syswow64\NSI.dll)
WINMM.dll A: 0x73E40000 - 0x73E72000 (C:\Windows\system32\WINMM.dll)
IMM32.DLL A: 0x769F0000 - 0x76A50000 (C:\Windows\system32\IMM32.DLL)
MSCTF.dll A: 0x766E0000 - 0x767AC000 (C:\Windows\syswow64\MSCTF.dll)
streamer.DLL A: 0x6CA60000 - 0x6CA9E000 (C:\Users\user\Desktop\Project\plugins\streamer.DLL)
MSVCP100.dll A: 0x6A4C0000 - 0x6A529000 (C:\Windows\system32\MSVCP100.dll)
MSVCR100.dll A: 0x652C0000 - 0x6537F000 (C:\Windows\system32\MSVCR100.dll)
mswsock.dll A: 0x72D80000 - 0x72DBC000 (C:\Windows\system32\mswsock.dll)
wshtcpip.dll A: 0x73040000 - 0x73045000 (C:\Windows\System32\wshtcpip.dll)
NLAapi.dll A: 0x73920000 - 0x73930000 (C:\Windows\system32\NLAapi.dll)
napinsp.dll A: 0x73680000 - 0x73690000 (C:\Windows\system32\napinsp.dll)
pnrpnsp.dll A: 0x73660000 - 0x73672000 (C:\Windows\system32\pnrpnsp.dll)
DNSAPI.dll A: 0x71E60000 - 0x71EA4000 (C:\Windows\system32\DNSAPI.dll)
winrnr.dll A: 0x734B0000 - 0x734B8000 (C:\Windows\System32\winrnr.dll)
WLIDNSP.DLL A: 0x73010000 - 0x73037000 (C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live\WLIDNSP.DLL)
PSAPI.DLL A: 0x769E0000 - 0x769E5000 (C:\Windows\syswow64\PSAPI.DLL)
IPHLPAPI.DLL A: 0x72770000 - 0x7278C000 (C:\Windows\system32\IPHLPAPI.DLL)
WINNSI.DLL A: 0x72760000 - 0x72767000 (C:\Windows\system32\WINNSI.DLL)
rasadhlp.dll A: 0x72D00000 - 0x72D06000 (C:\Windows\system32\rasadhlp.dll)