#emit crash
#3

On short: I'm trying to call format with variables from an array (and it's not working so I tried somthing smaller)

Long story:

Problem: Loading player's data from multiple DB tables across multiple files in my GM
Fix: Create a file named load with a single big query
Problem 2: There is quite a bit of data to load + this means I have to split my systems (load part will be ripped off)
Fix 2: A callback through all files. Each system send it's query to the DB (note that I need a counter to know when everything loaded).

This is the method I'm using right now and I want to change it. Why? Take a look at how it works https://pastebin.com/Pbzi2eWp

There is too much code I need to repeat every time + there are too many callbacks regarding the login system
(I have OnPlayerLoad which is called just to format the queries and then call other callback to load the data;
OnAccountLoad which is the callback from this query "SELECT * FROM users WHERE id=x";
OnUserFound which load basic things such as the player ID from 'names' table (yes, I have a names table),
the admin level in case the server is open just for admins and the ban status (don't load anything until I check those))
and I try to reduce this number.

Fix: Have a string which contains the model of all the queries (like this: "SELECT * FROM users WHERE id=%i; SELECT admin FROM admins WHERE id=%i; SELECT ..")
Each system calls a function which concatenate their query to the string (under OnGameModeInit). When the palyer's data can be loaded,
format the query and send it. Now I don't know how to format the query: https://pastebin.com/Q42Ra7qn
Reply


Messages In This Thread
#emit crash - by GaByM - 15.06.2018, 05:51
Re: #emit crash - by CodeStyle175 - 15.06.2018, 10:23
Re: #emit crash - by GaByM - 17.06.2018, 10:17
Re: #emit crash - by Calisthenics - 17.06.2018, 12:50

Forum Jump:


Users browsing this thread: 1 Guest(s)