Hajas

[BUG?] Did you changed the Multithread behavior in last updates?

Recommended Posts

Posted (edited)

Hello, since 1.8 our severs are getting some weird behaviors sometimes... like ALL functions are now in different threads instead of sequencial as supposed to be.

For exemple, I read a config file to write the bots waypoints, and next I use this dvars to make the paths...

Before was working perfect until the 1.8, even in COD4 was working great for years, now I need to put a wait 1.5 line between to be able to read those dvars. But of course, it's not supposed to be a thread.

I'm getting other weird behaviors in my code because of that too.

I understand that someone thinks this could evolve in performance, but we need also sequential logic, that's why we have the "thread" command to use when we want it as a thread right?

Dunno if this was intensional or is just a new bug, hope to get fixed ASAP.

Thanks

Edited by Hajas

Share this post


Link to post
Share on other sites

Script VM is completely serial, there is no multithreading involved. "Thread" doesn't start a new thread.

Share this post


Link to post
Share on other sites

How are you reading a config? I believe it is something you can not do in cod4 1.7

Share this post


Link to post
Share on other sites
Posted (edited)

I'm executing a cfg file with dvars, then I can't get the new values after a few seconds now.

Exemple:

comando = "exec wp/" + mapname + "_waypoints";
exec(comando);

if ( getDvar( "flwp_0" ) == "" )
	logPrint("[FRONTLINES BOT ERROR] - Map " + mapname + " does not have waypoints loaded" + "\n");

Of course the dvar exist and was set with the cfg file. If I test again will work. Is taking time to update the dvars, they all are set right, but with delay now.

I need to add a wait between now, since many of my controls are working that way, many are not working well sometimes.

Yes, it's was working great before the 18 update in Frontlines and Rio, now both have the same problem.

and Yes, was working with regular COD4 for years using the ExecClientCommand trick.

Now this always returns "" as was never set if I don't add the wait line.

Cheers

Edited by Hajas

Share this post


Link to post
Share on other sites

Looks like the command gets executed next server frame so .05 wait time should be enough. Why do you even use such weird method of waypoiting?

Share this post


Link to post
Share on other sites

What is the "ExecClientCommand" trick? I don't know about it. Only such stuff I have seen is sharing rcon passwords with clients.

Well I assume exec() sends the input to Cbuf_AddText() - everything else would be too risky. And that command text gets executed when server calls next time Cbuf_Execute(), which is after Virtual machine is done with current frame and before next frame Virtual Machine gets called. Should be obvious it does not work as you expect. waittill endframe is inevitable.

Share this post


Link to post
Share on other sites
1 hour ago, Fraggy said:

What is the "ExecClientCommand" trick? I don't know about it. Only such stuff I have seen is sharing rcon passwords with clients.

Well I assume exec() sends the input to Cbuf_AddText() - everything else would be too risky. And that command text gets executed when server calls next time Cbuf_Execute(), which is after Virtual machine is done with current frame and before next frame Virtual Machine gets called. Should be obvious it does not work as you expect. waittill endframe is inevitable.

But like I said, was working until last 18 update. Why are not working anymore?

Share this post


Link to post
Share on other sites
10 hours ago, leiizko said:

Looks like the command gets executed next server frame so .05 wait time should be enough. Why do you even use such weird method of waypoiting?

Unlimited waypoints/maps/random objectives/etc... cfg file carry all the data needed.

Share this post


Link to post
Share on other sites
Posted (edited)

Found another bug, nothing is executed after [[level.onStartGameType]](); at Callback_StartGameType()

Again, was working fine before the update, also in original COD4... now I found out why my controls are not working anymore, they are not beeing updated. :/

Everything after [[level.onStartGameType]](); is ignored. 

Something is very wrong in the last update.

EDIT UPDATE: if I just move everything up all comes back to normal. Aside was easy to fix, still is a serious bug. Maybe could have more outhere. I just don't found out yet. I'm having weird errors that NEVER happened before in Frontlines, and nothing was touched in the code. Hope with this will fix, but if something similar is happening with other functions, will cause errors too. Something was touched in the last update that shouldn't.

Edited by Hajas

Share this post


Link to post
Share on other sites
47 minutes ago, Hajas said:

Unlimited

Nope.

 

44 minutes ago, Hajas said:

nothing is executed after [[level.onStartGameType]]()

Then you obviously never return from this function.

 

And as noone has any script problems you can safely assume problem is on your end.

Share this post


Link to post
Share on other sites
18 minutes ago, leiizko said:

Nope.

And as noone has any script problems you can safely assume problem is on your end.

Yes unlimited. And simple because no one reached so far than myself, that's why... something is wrong with COD4X 18, was working without ANY problem before the update, and now the problem is with Frontlines after over 10 years? really?

Quote

Then you obviously never return from this function.

Seams a good start to look for the error, since we don't have access to this function in mod...

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.