Thank you for the feedback, but how do I fix stuff that does not break for me?
Can you provide me with some more information? “I got an issue” does not magically help to solve anything. You need to tell me about your setup, otherwise there might be little to no change until someone does.
It should error in a really verbose way at the moment on transaction errors. which is intended and happens on e.g. if you withdraw $600 while only having $500. But nothing breaks.
pay and reward directly to bank do currently not really work for mysql 5.7 / (8.x?) / mariadb below 10.3.1;
Or maybe because he is using mysql-async 2.x, which might cause issues. That is why I am experimenting at the moment to move to MongoDB + graphql with this.
The queries are kind of complex (hence graphql), which might be blocking mysql-async a bit more. But for timeouts I have to say, nothing in there can even timeout, neither in mysql-async 3.x; that is why I am very confused.
edit: But I got no idea if it actually causes any issues
That would be actually nice, if everyone could arrange themselves for a common API.
I do not like the current display bindings of this resource at the moment. but it is low effort. The permanent one stays like it is (plus gets a temporary show binding if no parameter is set), but the one that ticks every time the event is triggered will likely be changed to not trigger the display event that often, and only on cash change.
I’m currently running MariaDB 10.3.8 IIRC as I am also running Pterodactyl.
I get this error on resource start. Since I’m using Pterodactyl it’s running in a docker container and I am connecting via external IP.
Started resource ghmattibanking
hitch warning: frame time of 679 milliseconds
(node:19) UnhandledPromiseRejectionWarning: Error: connect ETIMEDOUT
at PoolConnection.Connection._handleTimeoutError (server.js:1:48225)
at ontimeout (timers.js:482:11)
at tryOnTimeout (timers.js:317:5)
at Timer.listOnTimeout (timers.js:277:5)
(node:19) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:19) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:19) UnhandledPromiseRejectionWarning: Error: connect ETIMEDOUT
at PoolConnection.Connection._handleTimeoutError (server.js:1:48225)
at ontimeout (timers.js:482:11)
at tryOnTimeout (timers.js:317:5)
at Timer.listOnTimeout (timers.js:277:5)
(node:19) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:19) UnhandledPromiseRejectionWarning: Error: connect ETIMEDOUT
at PoolConnection.Connection._handleTimeoutError (server.js:1:48225)
at ontimeout (timers.js:482:11)
at tryOnTimeout (timers.js:317:5)
at Timer.listOnTimeout (timers.js:277:5)
(node:19) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .cat
Note: It is connecting from what I can see on the database side.
I’ve read everything and this seems a bit unclear for me. I have it installed and as far as I know it’s working correctly. I see where you said something about adding users, is this something to make it recognize a user in the server. Also how to you go about adding the users? If I understand this correctly I need to add them manually in my database. If that’s the case which table do I need to add the users in? I imagine it’s ghmb_access, account would be the name of your user or RP name, and user is the preferred identifier. Please tell me if I’m right, sorry if it’s an inconvenience to you I just don’t want to screw up the resource before I even get it completely working. One more thing, if that’s the correct way, does it matter what identifier I use? IP address, steam, ect.
Thanks, Have A Great Day!
You don’t need to add the manually. You use the signIn export to tell ghmattibanking who is who.
It takes the provided source and the username to either create a new id or match him with a present one. It takes the identifiers automatically from the source so you need to do nothing.
Also you take the rp name – it supports multiple characters per user.
Ohhh, I see, I think. lol. So I put that signin code in? Or is it already setup? Again, sorry for my tardism. I don’t know how to code or anything so it’s all different. I mean I tried to type /signin in my server chat, or is that completely wrong too? lol.
Add the signin export when the player has loaded in (and use the GetPlayerName as the name) or if you use some sort of character system, when the character loads in (with the name of the character).
It will automatically then check if that person has a profile. if they don’t, it will be automatically created. Then when you go to the bank you can create an account.
Also just replace any place where you give out money with the reward export. If you pass the optional parameters it will send it to the bank, otherwise cash.
My server doesn’t have any frameworks or anything. Where exactly would I put add the export. I read on fivems documentation that it goes in the __resource.lua, but I want to be sure before I mess something up.
Again, Thanks for the help!