Ucitavanje

Započeo Shaw Salcedo
8. Avg. 2020.
439
pregleda
5
postova
Kriso_Anderson
5
Kingpin
8. Avg. 2020.
Problem(error/warning):
Deo skripte: Da li ovoliko treba vremena da se ucita jedan port, 77 sekundi?
https://prnt.sc/twb9n1
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log):
Alhemičar v2
4
Shot Caller
8. Avg. 2020.
Aj reci mi šta ti misliš da li bi iko koristio MySql da mu treba 77 sekundi da očita podatak iz 1 row-a?

Pošalji callback i query
Kriso_Anderson
5
Kingpin
8. Avg. 2020.
Tebra ako sam te lepo pitao lepo odgovori, ne moras biti drzak.
#define MAX_APORT 100


Ovo je ucitavanje
    new aportcount;
    for(new i = 0; i < sizeof(APORT); i++)
    {
    if(SQL::RowExists("aport", "RB", i))
    {
        UcitajAPORT(i);
            aportcount++;
        }
    }
    va_print(" * MYSQL INFO: Ucitani admin portovi %d (ms) - %d portova ucitano.", GetTickCount() - time, aportcount);

forward UcitajAPORT(id);
public UcitajAPORT(id)
{
new handle = SQL::Open(SQL::READ, "aport", "RB", id);
    SQL::ReadString(handle,"Ime", APORT, 32);
    SQL::ReadInt(handle,"Postavljen", APORT);
    SQL::ReadInt(handle,"Vrsta", APORT);
SQL::ReadFloat(handle,"X", APORT);
SQL::ReadFloat(handle,"Y", APORT);
SQL::ReadFloat(handle,"Z", APORT);
SQL::Close(handle);
    return 1;
}


Kreiranje nove table ako ne postoji
	if(!SQL::ExistsTable("aport"))
    {
    new handle = SQL::Open(SQL::CREATE, "aport");
SQL::AddTableColumn(handle,"RB", SQL_TYPE_INT, 11, false, true);
SQL::AddTableColumn(handle,"Ime", SQL_TYPE_VCHAR,32);
SQL::AddTableColumn(handle,"Postavljen", SQL_TYPE_INT);
SQL::AddTableColumn(handle,"Vrsta", SQL_TYPE_INT);
SQL::AddTableColumn(handle,"X", SQL_TYPE_FLOAT);
SQL::AddTableColumn(handle,"Y", SQL_TYPE_FLOAT);
SQL::AddTableColumn(handle,"Z", SQL_TYPE_FLOAT);
SQL::Close(handle);
}

Kreiranje reda /aportcreate
    new handle = SQL::Open(SQL::INSERT, "aport");
SQL::WriteInt(handle, "RB", id);
SQL::WriteString(handle, "Ime", APORT);
    SQL::WriteInt(handle, "Postavljen",APORT);
    SQL::WriteInt(handle, "Vrsta", APORT);
    SQL::WriteFloat(handle, "X", APORT);
    SQL::WriteFloat(handle, "Y",APORT);
    SQL::WriteFloat(handle, "Z",APORT);
    SQL::Close(handle);
Alhemičar v2
4
Shot Caller
8. Avg. 2020.
Shaw Salcedo wrote on August 8, 2020, 5:56 pm:
Tebra ako sam te lepo pitao lepo odgovori, ne moras biti drzak.
#define MAX_APORT 100


Ovo je ucitavanje
    new aportcount;
    for(new i = 0; i < sizeof(APORT); i++)
    {
    if(SQL::RowExists("aport", "RB", i))
    {
        UcitajAPORT(i);
            aportcount++;
        }
    }
    va_print(" * MYSQL INFO: Ucitani admin portovi %d (ms) - %d portova ucitano.", GetTickCount() - time, aportcount);

forward UcitajAPORT(id);
public UcitajAPORT(id)
{
new handle = SQL::Open(SQL::READ, "aport", "RB", id);
    SQL::ReadString(handle,"Ime", APORT, 32);
    SQL::ReadInt(handle,"Postavljen", APORT);
    SQL::ReadInt(handle,"Vrsta", APORT);
SQL::ReadFloat(handle,"X", APORT);
SQL::ReadFloat(handle,"Y", APORT);
SQL::ReadFloat(handle,"Z", APORT);
SQL::Close(handle);
    return 1;
}


Kreiranje nove table ako ne postoji
	if(!SQL::ExistsTable("aport"))
    {
    new handle = SQL::Open(SQL::CREATE, "aport");
SQL::AddTableColumn(handle,"RB", SQL_TYPE_INT, 11, false, true);
SQL::AddTableColumn(handle,"Ime", SQL_TYPE_VCHAR,32);
SQL::AddTableColumn(handle,"Postavljen", SQL_TYPE_INT);
SQL::AddTableColumn(handle,"Vrsta", SQL_TYPE_INT);
SQL::AddTableColumn(handle,"X", SQL_TYPE_FLOAT);
SQL::AddTableColumn(handle,"Y", SQL_TYPE_FLOAT);
SQL::AddTableColumn(handle,"Z", SQL_TYPE_FLOAT);
SQL::Close(handle);
}

Kreiranje reda /aportcreate
    new handle = SQL::Open(SQL::INSERT, "aport");
SQL::WriteInt(handle, "RB", id);
SQL::WriteString(handle, "Ime", APORT);
    SQL::WriteInt(handle, "Postavljen",APORT);
    SQL::WriteInt(handle, "Vrsta", APORT);
    SQL::WriteFloat(handle, "X", APORT);
    SQL::WriteFloat(handle, "Y",APORT);
    SQL::WriteFloat(handle, "Z",APORT);
    SQL::Close(handle);

Izvini, Lanmi je na forumu pa napeto ko u kafe aparatu

EDIT: Koji je ovo Sql?
Kriso_Anderson
5
Kingpin
8. Avg. 2020.
easy_mysql

https://github.com/ThreeKingz/easy-mysql

Sredjeno prevelik MAX_APORT je bio

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha