Page 2 of 2

Re: Restart the round

Posted: Thu Sep 22, 2016 3:37 am
by satoon101
You do realize that that entity gets removed when the round resets, right? So, it's only on the server for around 5 seconds. It's not like creating 1 entity is going to hurt the server in any way. The only possible issue is hitting the entity limit. But, if you're that concerned about doing that, you should avoid "ever" creating any entities for any reason in any of your plugins. I would much rather not worry about that, avoid removing a cheat flag, and ending the round in the much more proper way.

Re: Restart the round

Posted: Thu Sep 22, 2016 3:38 am
by iPlayer
L'In20Cible wrote:
iPlayer wrote:However, I just pointed out that there was better (in my opinion) alternatives but you really seems to be on the defensive and sticky on that method so next time I will just avoid proposing them. :wink:

You do realize that this statement may make somebody (e.g. iPlayer in this discussion) feel kinda like an offensive, arrogant person instead of just feeling like there was a fine discussion?

Don't be like that.

Also, nobody explained why the original code stopped working (with server_execute). If it literally means this:
1. Strip CHEAT flag
2. Add endround to the queue
3. Execute the queue
4. Apply CHEAT flag
This seems like a flawless code to me, so the reason I stood on the side of endround is that because I wanted somebody to come up and explain why the code wouldn't work now. Instead I was told to use another approach and now I feel like I've lost further technical support from Invincible's side.

Re: Restart the round

Posted: Thu Sep 22, 2016 3:44 am
by satoon101
Literally nothing in the code around that has changed. So, why it no longer works doesn't make sense to me if it did work a week ago (assuming you tested this code previously and had it working).

I honestly disagree with this statement:
iPlayer wrote:This seems like a flawless code to me

I will personally never agree that any code involving removing cheat flags or setting sv_cheats is "flawless".

However, the fact that the server_execute doesn't seem to be flushing commands in a timely manner is an issue that does need addressed outside of the rest of this discussion.

Re: Restart the round

Posted: Thu Sep 22, 2016 3:47 am
by iPlayer
satoon101 wrote:You do realize that that entity gets removed when the round resets, right? So, it's only on the server for around 5 seconds. It's not like creating 1 entity is going to hurt the server in any way. The only possible issue is hitting the entity limit. But, if you're that concerned about doing that, you should avoid "ever" creating any entities for any reason in any of your plugins. I would much rather not worry about that, avoid removing a cheat flag, and ending the round in the much more proper way.

Makes sense. So it's basically "messing cvar flags on server cvar" vs "hitting the entity limit (which I agree is a non-existant problem)".

I will go with info_map_parameters in my plugin. But if somebody explained more cons of stripping/setting CHEAT flag (besides messing cvar flags up, which can be avoided with a simple check), that'd be really nice.

assuming you tested this code previously and had it working

I can assure you, it did work. But that was even before find_command_base was removed and split into multiple methods.

I honestly disagree with this statement:

I meant "flawless" in a way that there's no possible logic errors in the simpliest 4 steps.

Re: Restart the round

Posted: Thu Sep 22, 2016 3:50 am
by satoon101
Oh, for some reason I missed the fact that this thread was started almost a year ago, and that was when the code was posted. We will look into this, but it will likely be fixed when these changes are made.

Re: Restart the round

Posted: Thu Sep 22, 2016 4:11 am
by L'In20Cible
iPlayer wrote:
L'In20Cible wrote:
iPlayer wrote:However, I just pointed out that there was better (in my opinion) alternatives but you really seems to be on the defensive and sticky on that method so next time I will just avoid proposing them. :wink:

You do realize that this statement may make somebody (e.g. iPlayer in this discussion) feel kinda like an offensive, arrogant person instead of just feeling like there was a fine discussion?

Don't be like that.

I'm sorry, that was not my intention. What I meant by that is that I was not going to argue more on that topic since you seemed to absolutely want to use the former over the proposed alternative. But there is no anger/grudge, no worries. :)

Re: Restart the round

Posted: Thu Sep 22, 2016 4:21 am
by iPlayer
Okay, there must have been a misunderstanding then, thanks for clarifying :)

Re: Restart the round

Posted: Fri Dec 02, 2016 8:42 pm
by sl0
any ideas why now `execute_server_command('mp_restartgame', 1)` failed with `ValueError: Unable to find command 'mp_restartgame'.` ?

Re: Restart the round

Posted: Fri Dec 02, 2016 9:28 pm
by iPlayer
I guess that's a console variable, not a command. So you need to find it and set it to 1.
There must be some Source handler attached to that variable.

Re: Restart the round

Posted: Fri Dec 02, 2016 10:08 pm
by Ayuto
Yep, it's a console variable, so you need to use one of these 3 possibilities:

Syntax: Select all

# No. 1
mp_restartgame = ConVar('mp_restartgame')
mp_restartgame.set_int(1)

# No. 2
queue_command_string('mp_restartgame 1')

# No. 3
mp_restartgame = cvar.find_var('mp_restartgame')
mp_restartgame.set_int(1)

Re: Restart the round

Posted: Fri Dec 02, 2016 10:11 pm
by sl0
tnx, guys