Comments (17)
I think is connected with this: https://github.com/Misiur/YSI-Includes/issues/45
the "response" stop works right?
from ysi-includes.
In my case the function is not being called correctly when I restart my server is orm_select_inline.
I made a simple debug to see where the problem was. When I turn on my server and I make the record all debugs are called, but when I restart the server, only (debug 1) is called.
See an example of the code.
enum E_PLAYER {
ORM:ormID,
name[MAX_PLAYER_NAME]
} new Player[MAX_PLAYERS][E_PLAYER];
LoadPlayer(playerid) {
new ORM:ormid = Player[playerid][ormID] = orm_create("exemple");
orm_addvar_string(ormid, Player[playerid][name], MAX_PLAYER_NAME, "name");
orm_setkey(ormid, "name");
print("debug 1 OK!");
inline InformationLoad(pid) {
switch(orm_errno(Player[pid][ormID])) {
// user does not exist
case ERROR_NO_DATA: {
print("debug 2 OK!");
}
// user exists
case ERROR_OK: {
print("debug 3 OK!");
}
}
}
// This function isn't called when the server is restarted
orm_select_inline(ormid, using inline InformationLoad, "d", playerid);
}
from ysi-includes.
I am experiencing this problem as well after GMX, inline functions doesn't respond right. Dialogs aqre shown but the dialogs aren't functioning properly.
''RetrievePlayerData(playerid)
{
new
SQLRow:rowid = yoursql_get_row(serverDB, TABLE_ACCOUNTS, ""COLUMN_NAME" = %s", PlayerName(playerid)), string[128];
if(rowid != SQL_INVALID_ROW)
{
inline dialogLogin(pid, dialogid, response, listitem, string:inputtext[])
{
#pragma unused pid, dialogid, response, listitem, inputtext
if(!response)
{
Kick(playerid);
return 1;
}
yoursql_get_field(serverDB, ""TABLE_ACCOUNTS"/"COLUMN_PASS"", rowid, playerData[playerid][pPassword], MAX_PASSWORD);
new password[MAX_PASSWORD];
SHA256_PassHash(inputtext, PASSWORD_HASH, password, sizeof(password));
if(!inputtext[0] || strcmp(password, playerData[playerid][pPassword]))
{
MsgTag(playerid, TYPE_ERROR, "The password doesn't match with the account's password.");
goto showRDIALOG;
return 1;
}
yoursql_multiget_fields(serverDB, TABLE_ACCOUNTS, rowid, "iiii",
COLUMN_ADM, playerData[playerid][pAdmin], COLUMN_CLASS, playerData[playerid][pJob], COLUMN_KILLS, playerData[playerid][pKills], COLUMN_DEATHS, playerData[playerid][pDeaths]);
rowid = yoursql_get_row(serverDB, TABLE_ITEMS, ""COLUMN_NAME" = %s", PlayerName(playerid));
#if defined ACCOUNT_DEBUG
printf("[LOADING %s's DATA] - TABLE: %s - ACC ID: %i, ", PlayerName(playerid), TABLE_ACCOUNTS, _:rowid);
printf("COLUMN_%s: %i - COLUMN_%s: %i", COLUMN_ADM, playerData[playerid][pAdmin], COLUMN_ADM, GetPlayerJob(playerid));
printf("COLUMN_%s: %i - COLUMN_%s: %i", COLUMN_KILLS, playerData[playerid][pKills], COLUMN_DEATHS, playerData[playerid][pDeaths]);
#endif
yoursql_multiget_fields(serverDB, TABLE_ITEMS, rowid, "iiiii",
COLUMN_WEED, playerItems[playerid][pWeed], COLUMN_CRACK, playerItems[playerid][pCrack], COLUMN_ROPE, playerItems[playerid][pRope], COLUMN_PICKLOCK, playerItems[playerid][pPickLock], COLUMN_SCISSORS, playerItems[playerid][pScissors]);
#if defined ACCOUNT_DEBUG
printf("[LOADING %s's DATA] - TABLE: %s - ACC ID: %i, ", PlayerName(playerid), TABLE_ITEMS, _:rowid);
printf("COLUMN_%s: %i - COLUMN_%s: %i", COLUMN_WEED, GetPlayerWeed(playerid), COLUMN_CRACK, GetPlayerCrack(playerid));
printf("COLUMN_%s: %i - COLUMN_%s: %i", COLUMN_ROPE, GetPlayerRope(playerid), COLUMN_PICKLOCK, GetPlayerPickLock(playerid));
printf("COLUMN_%s: %i", COLUMN_SCISSORS, GetPlayerScissors(playerid));
#endif
MessageBoxF(playerid, TYPE_MSGBOX, "~g~Welcome back!", "You have successfully logged in your account, enjoy playing!");
playerData[playerid][pLoggedIn] = true;
}
showRDIALOG:
format(string, sizeof(string), "Welcome back %p!\nPlease insert your password to continue:", playerid);
Dialog_ShowCallback(playerid, using inline dialogLogin, DIALOG_STYLE_PASSWORD, "User Account", string, "Login", "Cancel");
}
else
{
inline dialogRegister(pid, dialogid, response, listitem, string:inputtext[])
{
#pragma unused pid, dialogid, response, listitem, inputtext
if(!response)
{
Kick(playerid);
return 1;
}
if(!inputtext[0] || strlen(inputtext) < 4 || strlen(inputtext) > 50)
{
MsgTag(playerid, TYPE_ERROR, "Your password must be between 4 - 50 characters.");
goto showLDIALOG;
return 1;
}
yoursql_set_row(serverDB, TABLE_ACCOUNTS, ""COLUMN_NAME" = %s", PlayerName(playerid));
yoursql_set_row(serverDB, TABLE_ITEMS, ""COLUMN_NAME" = %s", PlayerName(playerid));
rowid = yoursql_get_row(serverDB, TABLE_ACCOUNTS, ""COLUMN_NAME" = %s", PlayerName(playerid));
new password[MAX_PASSWORD];
SHA256_PassHash(inputtext, PASSWORD_HASH, password, sizeof(password));
yoursql_set_field(serverDB, ""TABLE_ACCOUNTS"/"COLUMN_PASS"", rowid, password);
#if defined ACCOUNT_DEBUG
printf("Account Created. Account ID: %i - Account Name: %s", _:rowid, PlayerName(playerid));
#endif
MessageBoxF(playerid, TYPE_MSGBOX, "~g~Welcome!", "You have successfully registered your account in the server.");
playerData[playerid][pLoggedIn] = true;
}
showLDIALOG:
format(string, sizeof(string), "Welcome %p!\nYou are not recognized on our database, please insert a password to sing-in and continue:", playerid);
Dialog_ShowCallback(playerid, using inline dialogRegister, DIALOG_STYLE_PASSWORD, "User Account", string, "Register", "Cancel");
}
return 1;
}''
from ysi-includes.
You are getting malloc errors in the log right? After GMX?
from ysi-includes.
I am not getting any malloc errors after gmx. No errors at all, it just doesn't act right.
from ysi-includes.
Well, I get a bunch of y_malloc errors, then it doesn't work right.
Y_Less told me the errors shouldn't really affect me in my situation, but I think they are related to this because I did happen to notice this happening.
from ysi-includes.
I'm using the old version (YSI 3.1) and is working perfectly.
If you are having the same problem use this version (https://github.com/Misiur/YSI) until the bugs are fixed.
from ysi-includes.
YSI 4 is really different from YSI 3, there's much runtime AMX rewriting involved. It's much faster, but yeah, the problem after GMX is often sighted. I didn't have time to track down what exactly happens during mode restart adn why stuff doesn't work well
from ysi-includes.
Hello, I have the same problem, like PT-Player (https://github.com/Misiur/YSI-Includes/issues/45)
I use only normal dialogs, but I use lot of YSI functions/librairies (hooks, iterate, timers ..etc)
I looked and debug operation of y_dialogs.
line 301 : hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
dialogid is correct when debug is set.
But dialogid is overload dialogid = Dialog_Get(playerid);
and equals "-1".
So hook OnDialogResponse return false and stop processus about normal dialog.
It's works for the first normal dialog (logic compared to what is above) but not for others.
I'm not sure it will help you. I use a lot this library so if I can give information and help ..
from ysi-includes.
Add "const" to all "hook" parameters - that's much closer to what they really are.
from ysi-includes.
@Y-Less Have any idea of how can fix this bug?
from ysi-includes.
What bug? Given that that is your first time posting in a thread with multiple issues discussed at various points, as well as multiple versions of YSI mentioned. I can't just guess your specific problem.
from ysi-includes.
A bug about ShowPlayerDialog
and Dialog_ShowCallback
(combined with y_inline). There is a conflict.
from ysi-includes.
@Y-Less we are all talking about YSI 4.0 now..
from ysi-includes.
YSI 4.0
After restart my server(GMX) not work anymore
public OnPlayerConnect(playerid) {
test_bug_inline(playerid);
return 1;
}
stock test_bug_inline(playerid) {
inline testInline(pid, dialogid, response, listtiem, string:inputtext[]) {
#pragma unused dialogid, response, listtiem, inputtext
SendClientMessage(pid, -1, "CALLED, OK!");
}
Dialog_ShowCallback(playerid, using inline testInline, DIALOG_STYLE_MSGBOX, "Test", "Test One", "OK", "OK");
}
from ysi-includes.
UP
from ysi-includes.
Hopefully fixed by #101 when using YSI_NO_HEAP_MALLOC
as a compile-time setting. This reverts y_malloc to the old style of using a huge array instead of the heap, but will increase compile times and file sizes.
from ysi-includes.
Related Issues (20)
- I found a problem in y_inline_bcrypt. HOT 2
- YSI_Coding\y_timers\..\..\YSI_Core\y_core\y_scriptinit_impl.inc(434) : fatal error 111: user error: defined OnScriptInit HOT 1
- va_args stopped working after update HOT 6
- What does callbackfix.amx do? HOT 1
- (error) undefined symbol "Dialog_ShowPlayerNative HOT 2
- Error when using y_commands HOT 1
- Error when updating YSI HOT 2
- Long callback execution detected (hang or performance issue) or DDoS Attack HOT 1
- Issues with using y_iterator HOT 1
- y_inline_timers calling the timer function twice HOT 1
- AMX Size HOT 1
- Can't include y_races
- error complil HOT 1
- Y_Hooks not called with 3.10.11 Compiler and Open.MP HOT 2
- y_functional_funcs.inc(1154) : error 017: undefined symbol "j"
- bcrypt_delete File or function is not found since last YSI Update. HOT 4
- \pawno\include\YSI_Data\y_foreach\y_foreach_entry.inc(137) : fatal error 111: user error: Old <foreach.inc> found - delete it.
- Unable to compile with y_zonenames and y_races
- pawn.cc crashes when i use the last version of ysi includes
- helpp me YSI HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ysi-includes.