Call a code automatically

02/14/2019 04:02 tedfailon#1
I'd like to ask if there's a way to set a time to call a certain code like for example

I wanna set a call for "/announce"
This way its easier to start a cetrtain feature that we've added.

I hope someone would understand what im trying to say.
02/14/2019 19:56 Crimal#2
Take a look at the Function SetTimer.
For example if you just want to send packets to all connected players you could declare an ID for your new Timer in CoreServer.cpp and call SetTimer with your new ID in "InitInstance(HINSTANCE hInstance, int nCmdShow)".
Keep in mind that you have to kill that Timer when closing the Core Server (e.g. WM_Destroy ind WndProc).
In the function "OnTimer" you just simply add your new entry and call the corresponding code.
I hope i could help you with that.
I'm not really experienced with the Flyff Source and still learning :)
02/14/2019 20:00 netHoxInc#3
Another option would be to create a new thread running your codes as you wish them to.

The options to achieve ur goal are limitless probably. Google your way arround timer's and threads, or take Crimal's solution, but im not familar to the Source in that way so i cannot confirm if he/she is correct. But it sounds well to me xD

Anyways, a thread will allways do the job. Maybe do a for-loop which reset's after x count's and use a sleep to determine the length of each count.

Hope i could give you some creative ideas.

Cheers, net