Random Crash worldServer

12/10/2020 05:43 marcdave#1
2020/10/29 19:53:25:439
ROL//CALLED
2020/10/29 19:53:25:447
ROL//NOT FIXED//5, 1508
2020/10/29 19:53:25:456
RemoveObjArray pObj->m_dwObjAryIdx == 0xffffffff
2020/10/29 19:53:25:505

any fix this in source? need help plsssss
12/12/2020 04:23 UrsulaT#2
debug...
12/12/2020 07:20 marcdave#3
this sir debug
[Only registered and activated users can see links. Click Here To Register...]
02/17/2021 15:45 redoch77#4
bonjour je cherche un hack pour les site cbet et roobet svp pour les jeux de hasard comme jetx et crash merci
02/17/2021 19:34 Wanetrain#5
Replace the function with:

Code:
auto CWorld::_process() -> void
{
	for( auto i = 0; i < std::extent<decltype(m_apObject)>::value; i++ )
	{
		const auto& pObj = m_apObject[ i ];
		FLASSERT(pObj);
		if( pObj && !pObj->IsDelete() && pObj->m_dwObjAryIdx != 0xffffffff )
		{
			pObj->Process();
		}
	}
}
You don't need m_dwObjNum.

If you have more Problems --> Pn.
02/18/2021 07:46 Naltalah#6
Quote:
Originally Posted by Wanetrain View Post
Replace the function with:

Code:
auto CWorld::_process() -> void
{
	for( auto i = 0; i < std::extent<decltype(m_apObject)>::value; i++ )
	{
		const auto& pObj = m_apObject[ i ];
		FLASSERT(pObj);
		if( pObj && !pObj->IsDelete() && pObj->m_dwObjAryIdx != 0xffffffff )
		{
			pObj->Process();
		}
	}
}
You don't need m_dwObjNum.

If you have more Problems --> Pn.
I have several questions about that function.

1: Why auto return type if you specify -> void anyway?
2: Why increase the loop to iterate over the entire array every game loop? It increases CPU usage by a fuckton.
3: Why FLAssert(pObj) on objects that are then expected to be empty when nothing happens? Debug must go wild for you then.
4: Why use fancy std::extent and decltype when the array size is handled by a define you could just use there?

To me this looks like it doesnt do anything different than trigger asserts more and increase CPU usage on empty objects.

You might as well refactor a fixed size array to a vector implementation and iterate over that instead of iterating over 80k empty objects every time.
02/18/2021 18:49 Wanetrain#7
Hell no..

1.: New Code style, just Formated the whole code with Clang Tidy.

2.: That "Game Loop" is just shit. So CPU Usage don't matters. Anyway, the cap is 81920. If only like 20k are used, CPU just gives a F* about that.

3.: FLAssert was just for my own testing, nvm that this is still in there. :D

The reason why this? it is an understandable fix for everyone. Yea i can also give everyone my refactored shit (Simple map) they need to change more then just one function.

You need to unterstand that the most user's just want to have some fun with the code. ;)
02/19/2021 08:49 Naltalah#8
I get that you just want to have fun. But what you posted literally has an impact on CPU, I benchmarked it.
It doesn't even depent on optimization level, my CPU usage goes up if I iterate over everything.

I'm not saying you shouldn't try to refactor to more modern code style, but in this case I was just trying to point out a potential performance downgrade.