Skip to content

Commit

Permalink
Update jse_jumpbot_repo.sp
Browse files Browse the repository at this point in the history
translate debug messages
  • Loading branch information
LapplandBro committed Sep 4, 2023
1 parent 4f68339 commit 0594c85
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions scripting/jse_jumpbot_repo.sp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public int OnSocketConnected(Handle hSocket, any aArg) {
hFileInfo.GetString(FileInfo_sPage, sPage, sizeof(sPage));

if (g_hDebug.BoolValue) {
CPrintToChatAll("{green}[{lightgreen}jb{green}] {white}Establishing connection to: %s", sPage);
CPrintToChatAll("{green}[{lightgreen}jb{green}] {white}Установка соединения с: %s", sPage);
}

FormatEx(sRequest, sizeof(sRequest), "GET %s HTTP/1.0\r\nHost: %s\r\nConnection: close\r\nCache-Control: no-cache, no-store, must-revalidate\r\nPragma: no-cache\r\nExpires: 0\r\n\r\n", sPage, API_HOST);
Expand All @@ -207,7 +207,7 @@ public int OnSocketReceive(Handle hSocket, char[] sData, const int iSize, any aA
if (!hFileInfo.Get(FileInfo_bConcat)) {
if (strncmp(sData, "HTTP/", 5) == 0 && strncmp(sData[9], "200", 3) == 0) {
if (g_hDebug.BoolValue) {
CPrintToChatAll("{green}[{lightgreen}jb{green}] {white}Received HTTP OK header");
CPrintToChatAll("{green}[{lightgreen}jb{green}] {white}Получен HTTP OK заголовок.");
}

hFileInfo.Set(FileInfo_bConcat, true);
Expand All @@ -224,8 +224,8 @@ public int OnSocketReceive(Handle hSocket, char[] sData, const int iSize, any aA
iRecording.FileSize = StringToInt(sFileSize);

if (g_hDebug.BoolValue) {
CPrintToChatAll("{green}[{lightgreen}jb{green}] {white}Content-Length: %s bytes", sFileSize);
CPrintToChatAll("{green}[{lightgreen}jb{green}] {white}Initial packet size: %d bytes", iSize-(StrContains(sData[16], "\r\n\r\n")+16+4));
CPrintToChatAll("{green}[{lightgreen}jb{green}] {white}Content-Length: %s байт", sFileSize);
CPrintToChatAll("{green}[{lightgreen}jb{green}] {white}Начальный размер пакета: %d байт", iSize-(StrContains(sData[16], "\r\n\r\n")+16+4));
}
}
}
Expand All @@ -242,7 +242,7 @@ public int OnSocketReceive(Handle hSocket, char[] sData, const int iSize, any aA
}
} else {
if (g_hDebug.BoolValue) {
CPrintToChatAll("{green}[{lightgreen}jb{green}] {white}Received packet: %d bytes", iSize);
CPrintToChatAll("{green}[{lightgreen}jb{green}] {white}Получен пакет: %d байт", iSize);
}

for (int i=0; i<iSize; i++) {
Expand All @@ -259,7 +259,7 @@ public int OnSocketDisconnected(Handle hSocket, any aArg) {
FlushFile(hFile);

if (g_hDebug.BoolValue) {
CPrintToChatAll("{green}[{lightgreen}jb{green}] {white}Connection closed");
CPrintToChatAll("{green}[{lightgreen}jb{green}] {white}Соединение закрыто");
}

switch (hFileInfo.Get(FileInfo_iType)) {
Expand All @@ -278,7 +278,7 @@ public int OnSocketDisconnected(Handle hSocket, any aArg) {
delete hFile;

if (g_hDebug.BoolValue) {
CPrintToChatAll("{green}[{lightgreen}jb{green}] {white}Downloaded %d/%d bytes", FileSize(sFilePath), iRecording.FileSize);
CPrintToChatAll("{green}[{lightgreen}jb{green}] {white}Загружено %d/%d байт", FileSize(sFilePath), iRecording.FileSize);
}

if (FileSize(sFilePath) == iRecording.FileSize) {
Expand All @@ -300,7 +300,7 @@ public int OnSocketDisconnected(Handle hSocket, any aArg) {
delete hFile;

if (g_hDebug.BoolValue) {
CPrintToChatAll("{green}[{lightgreen}jb{green}] {white}Downloaded %d/%d bytes", FileSize(sFilePath), iRecording.FileSize);
CPrintToChatAll("{green}[{lightgreen}jb{green}] {white}Загружено %d/%d байт", FileSize(sFilePath), iRecording.FileSize);
}

if (FileSize(sFilePath) == iRecording.FileSize) {
Expand Down

0 comments on commit 0594c85

Please sign in to comment.