HTTP on player connect
#1

This only occurs on linux. Code:
pawn Код:
public OnPlayerConnect(playerid)
{
    if(IsPlayerNPC(playerid)) return 1;
    new str[128];
    format(str,sizeof(str),"www.*******-mp3.org/api/itemInfo/?video_id=%s",g_StartRadio);
    HTTP(playerid,HTTP_GET,videostr,"","U2BInfo");
}

forward U2BInfo(playerid, response_code, data[]);
public U2BInfo(playerid, response_code, data[])
{
    if(response_code == 200)
    {
        new result[33], u2bstr[33]; new streamedurl[128];
        new crypted = strfind(data, "\"h\"", true, -1);
        strmid(result,data,crypted+7,crypted+39,strlen(data));
        format(u2bstr,sizeof(u2bstr), "%s", result);
        format(streamedurl, sizeof(streamedurl), "http://www.*******-mp3.org/get?video_id=%s&h=%s",g_StartRadio, u2bstr);
        PlayAudioStreamForPlayer(playerid, streamedurl);
        return 1;
    }
    /*else
    {
        SendInfoMessage(playerid,"Fail.");
    }*/

    return 1;
}
Result - crash.
This is nohup.out:
Quote:

samp03svr: amx/amxstring.c:296: compare: Assertion `c1!=0 && c2!=0' failed.
./autosamp.sh: line 13: 32402 Aborted ${samp} >> $log
samp03svr: amx/amxstring.c:296: compare: Assertion `c1!=0 && c2!=0' failed.
./autosamp.sh: line 13: 32461 Aborted ${samp} >> $log
samp03svr: amx/amxstring.c:296: compare: Assertion `c1!=0 && c2!=0' failed.
./autosamp.sh: line 13: 32533 Aborted ${samp} >> $log
samp03svr: amx/amxstring.c:296: compare: Assertion `c1!=0 && c2!=0' failed.
./autosamp.sh: line 13: 32586 Aborted ${samp} >> $log
samp03svr: amx/amxstring.c:296: compare: Assertion `c1!=0 && c2!=0' failed.

Same problem on 0.3d and 0.3d R2
Reply
#2

Cofirmed. What Linux Distro are you using?
Reply
#3

Debian 5.
Reply
#4

Quote:
Originally Posted by wups
Посмотреть сообщение
Debian 5.
it's Debian 6

Anyone can confirm on Ubuntu or other Linux Distros?
Reply
#5

Are you sure that 'data' is not empty? And why are you using -1 as search start in strfind? It should be >= 0.
Reply
#6

Quote:
Originally Posted by TopSecret
Посмотреть сообщение
Are you sure that 'data' is not empty? And why are you using -1 as search start in strfind? It should be >= 0.
I'm pretty sure. And that script isn't mine, I only use it for testing.
Reply
#7

bump?
Reply
#8

I have same problem. did anyone find a way?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)