Forum > Serverside Modding

[C++]  StockExchange NPC Script

<< < (2/2)

Rochet2:
PR would be a github pull request.

Did you fix the crash? Did you get the debugging and or crash logging working?

I was just noting about the investment. I ignored what the purpose of the code was and simply analyzed the code. Seemed the code said only use 1.2.3.4. etc and nothing about using higher values.

If you keep the stock data in RAM and when you update it, update it to both to RAM and to DB.
That way the info in both places is uptodate and you can get the correct data in code at any time with simply using the stored data. Like I mentioned earlier, using Exeute to update the database should be less heavy than using Query.
Though its a bit hard for me to see how this ratio thing works .. I feel like storing a float ratio is a bad thing since rounding could make it screw up so that its over or under allowed. Not that I checked if that is possible in the code.

You seem to be using Query/PQuery for all your database actions. What is wrong with using Execute?
You should change all SQL statements where you do not actually fetch any data into Execute, PExecute or DirectExecute or PDirectExecute.

Roarl:
I see. :)

I compiled in debug mode but I couldn't make the crash happen again... I have no idea why it crashed in the first place but if it ever happens again at least I know how to debug it thanks to you.

Yeah, I don't think it needs a limit but once more I might be wrong.

I updated the code and changed every instance of PQuery used only to fetch data from DB into an Execute as recommended!

I'll start working on an English translation next week, time for me to test it and improve it a little bit more.

As far as ratios are concerned, I have to say it's the best way I figured to take into account exchange rates variations. That doesn't mean there ain't another way for it, but rather that's the one I preferred. Do you think I ought to use double instead of float? Or straight out change this ratio system?

Thank you. :)

Navigation

[0] Message Index

[*] Previous page

Go to full version