s1lentq / reapi

AMX Mod X module, using API regamedll & rehlds
GNU General Public License v3.0
160 stars 103 forks source link

Add natives about pause #324

Open jonathan-up opened 2 months ago

jonathan-up commented 2 months ago

In this way, you do not need to set pausable to 1 and then make client sends pause command and finally set pausable to 0

ShadowsAdi commented 2 months ago

The only problems are with your implementation because the IsPaused() and SetPaused() are pure virtual functions declared in the abstracted class, RehldsServerData. You can read more about that on this site.

To fix your code you need to declare even the missing virtual functions before IsPaused() and SetPaused() as declared in the rehlds_interfaces.h.

jonathan-up commented 2 months ago

@ShadowsAdi Thank you for your explanation, but i saw rehlds_interfaces_impl.cpp. Is implementation in the file?

StevenKal commented 1 month ago

The "rehlds_interfaces.h" of this module must matches to the one of the ReHLDS's engine ShadowsAdi linked:

To fix your code you need to declare even the missing virtual functions before IsPaused() and SetPaused() as declared in the rehlds_interfaces.h.

jonathan-up commented 1 month ago

@StevenKal i know it, but rehlds/rehlds/rehlds_interfaces_impl.cpp must be the implementation of the virtual function, isn't it?

the one of the ReHLDS's engine

jonathan-up commented 1 month ago

@s1lentq It's all working now, but I think rh_set_pause function is a bit weird., any suggestions?

rtxa commented 1 week ago

Hi @jonathan-up, I don't get what the host parameter does in rh_set_pause(), in what situation would be useful to use that parameter? I don't get what this comment means:

It's best not to use rh_set_paused(false, false), bad things will happen

What is the bad thing that can happen? Why such behaviour is allowed?

jonathan-up commented 2 days ago

@rtxa you can try paused as host true, and unpaused as host false