WTF ?? Metin2 coding style?

11/03/2015 17:02 fcsk_aim#1
Hy, guys i just started to develop metin2Source.
Who the fuck writen LibSql.a ?

AsyncSQL.H

dunno. The formatting certainly isn't. Also, abusing stdafx out-of-tree. Ugh. And OS-specific synch. Reserved identifiers. C-style structs. Mixing tabs and spaces. DWORD. Fucking m_sem not even used. Copying full async resultset into a container eagerly? Oh. And using mySql
Storing SQLResult* in a vector, not honouring Rule Of Three. The fucking type not even polymorphic, so use vector, or stable_vector if you must. Not typedeffing the container or using auto for the iterators. Using strange names for iterators (past?). Nohting ever initializes m_pkSQL. So that's encapsulation disavowed then.
What happened to smart pointers... uiResultsPos in the database layer?!?!##!@# Not using prepared statements and bound arguments. C-style error handling through multiple non-encapsulated field. Read: missing errorhandling. CAsyncSQL2 - naming fail.
CAsyncSQL looks somewhat saner. Possibly because it was nicked from somewhere?

[Only registered and activated users can see links. Click Here To Register...]
11/03/2015 17:21 Lefloyd#2
You just open this thread to tell us something that we all know and won't help anyone who wouldn't know? That's indeed wtf. It's a completely useless thread.

Kind Regards
11/03/2015 18:16 Nick#3
Where's your message? It isn't a hidden secret that the game itself was made on the cheap. Feel free to improve it.
11/03/2015 20:39 Mi4uric3#4
The code was written by asian programmers over 10 years ago who probably got paid 2 cents per hour. Feel free to rework and share it with the community.
11/04/2015 00:57 .Alpha.#5
He actually already did as far as I can see
11/04/2015 02:27 fcsk_aim#6
At the request of a friend I started to develop the system of scarves.

I already updated my binary to directx12 and i use D3DXMatrixScaling for scale.
There days i wil share with community all library rewrited , clang , c+17 :
Loop coverted,nullptr, auto for itearators , etc.. c++17 style.

Quote:
Originally Posted by Mi4uric3 View Post
The code was written by asian programmers over 10 years ago who probably got paid 2 cents per hour. Feel free to rework and share it with the community.
That explains everything, I was stupid when I saw how many problems...
11/04/2015 10:13 Mi4uric3#7
Quote:
Originally Posted by fcsk_aim View Post
At the request of a friend I started to develop the system of scarves.

I already updated my binary to directx12 and i use D3DXMatrixScaling for scale.
There days i wil share with community all library rewrited , clang , c+17 :
Loop coverted,nullptr, auto for itearators , etc.. c++17 style.
Nice, if you use smart pointers (1st post) this could solve many memory leak and performance problems :)
11/04/2015 14:09 fcsk_aim#8
Quote:
Originally Posted by Mi4uric3 View Post
Nice, if you use smart pointers (1st post) this could solve many memory leak and performance problems :)
Now it's easy to transform an existing program #includeing header files to consume modules
Code:
import std.vector; // #include <vector>
import std.string;//
import struct_x #include an specific struct from default library
This new features increase performance and reduce compile speed.

You allocate memory on the heap, regardless of the fact you do it with new, new[], or the c memory allocation functions like malloc, you are responsible for cleaning it up by calling the appropriate delete or free.

Since that programmers mixing c and c++ codes. YES , memory LEAKED.

All kinds of smart pointers, enforce the different ownership models, they all reside in the memory header///==/=/=/=//.-.-.-.-='

-_-

I already solved problems with memory leak. :D uuh

LOVE C++1z

And i already remover free from libthecore.

Here's an example for memory leak.

Code:
static void buffer_pool_free()
{
	for (int i = 31; i >= 0; i--)
		{
			if (normalized_buffer_pool[i] != NULL)
				{
					LPBUFFER next;
					for (LPBUFFER p = normalized_buffer_pool[i]; p != NULL; p = next)
						{
							next = p->next;
							free(p->mem_data);
							free(p);
						}
					normalized_buffer_pool[i] = NULL;
				}
		}
}
See? Free(p)
11/05/2015 17:33 .aNNdii##9
#moved