Another MySQL question
#1

Well, I have a question

I'm using MySQL for the accounts on my gamemode, and I thread all of them. Can I run 2 queries at the SAME TIME using the same thread? I mean, let's suppose that the login query is threaded as MYSQL_THREAD_LOGIN, and then two players log in exactly at the same time, would it crash the server? Or would the plugin wait till the first query is executed?

Thanks
Reply
#2

It will wait when the first query is finished. So you can't get any crashes and lag.
Reply
#3

Oh, okay. Now here's another example

My OnPlayerUpdateEx query is EXTREMELY BIG and it's called every 10 seconds. I divided it into 3 update queries. The main thread define (MYSQLT_UPDATEPLAYER) is defined as 12. Then I defined the first query as MYSQLT_UPDATEPLAYER + playerid + 500 (so every player will have it's own query, and the 500 is set so this query will not interfere with the other two), the second as MYSQLT_UPDATEPLAYER + playerid + 1000 and the third as MYSQLT_UPDATEPLAYER + playerid + 1500. Can I use just MYSQLT_UPDATEPLAYER for the three queries? Would it take more time to update? Am I doing something wrong? Thanks!

EDIT: I think it's better doing one thread for each player, because it crashed when 3 players logged in here, all being updated with query thread 12.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)