Anyone have an idea WHEN thefunction is called?CDboVirtualServer::Update
Every second? Or when??
Anyone have an idea WHEN thefunction is called?CDboVirtualServer::Update
Every second? Or when??
Update mean , it is called Every frame
every frame = ? I dont understand
so If I create now void CClientSession::Update()
then it will be auto. called every "frame"?
in game contents this is common used , need check Every frame , while u playin , and since its a reference here , check what update mean in ur code
thanks thanks.
ok I understand now a little more about the update/frame etc..
Anyone an idea how to create a loop for the game which will run the Update function?
a lot of servers/emulators use while true in the main function, but most of the functionality is in the main function as well.
Yea but
while ( what ) ?
I dont know how to do the while etc..
No use while(true) as in an infinite loop, but most of the logic is called every iteration in the update frame.
And the loop runs every second?
- - - Updated - - -
I dont get this... If I run loop on the client session then I cant log in anymore after relog or with other account.
And run loop on the main game doesnt work somehow because I need the client session..
From a programming standpoint this is where threads would come into play. If you were to thread your While(true) loop all the other things would continue, but then you would have to make thread pointers i believe to access anything in those other threads. While useful and more optimized it would take a while to do this.
You could just set a bool someplace in a function that runs every second or every frame to call update.
Make it go through your list of functions you want to call and then break out of the loop once it reaches the end of your function calls,