Ghmattibanking 1.1.2

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;

Screenshot_20181002-104732-ConvertImage

Btw, thanks for your release @zr0iq, you always make good and powerful things :slight_smile:

2 Likes

Very nice release mate, also good job on the UI.

Maybe because he is using a linux server? (He is)

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 :man_shrugging:

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.

Removed all offtopic posts, please keep it on topic from now on, this is about the actual release.

2 Likes

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.

You did not configure the connection correctly. Whatever you set in your config.server.json cannot connect with the database.

because there are no internal timeouts in the mysql for query stuff I am using. ETIMEDOUT is instead a connection error.

I’m not too sure as it has added the tables from a fresh database wipe yet it also throws that error.

I am pretty sure there is an issue with the connection. Maybe create another user? And maybe let it run on a different database to check?

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.

You do not have to touch the DB at all.

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.

And so on.

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!

this is what i did

in ghmattibanking > __resource.lua

client_script 'client.js'
server_scripts {
  'server.js',
  'server.lua'
}

ui_page 'ui/index.html'

server_export 'signIn'
server_export 'reward'

then created a file named server.lua inside i added my trigger for signIn and Reward for simplistics

this is not needed. When the script gets loaded. signIn is automatically exported… from the js :man_facepalming:

Read my post.

When a player has loaded in (i.e. on the event hardcap:playerActivated) or whenever you want really

for some reason i would get a error saying that there is no export with the name wouldn’t work till i added it in resource