Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Metin2 > Metin2 Private Server
You last visited: Today at 15:57

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



WTF ?? Metin2 coding style?

Discussion on WTF ?? Metin2 coding style? within the Metin2 Private Server forum part of the Metin2 category.

Reply
 
Old   #1
 
fcsk_aim's Avatar
 
elite*gold: 100
Join Date: Dec 2014
Posts: 93
Received Thanks: 51
WTF ?? Metin2 coding style?

Hy, guys i just started to develop metin2Source.
Who the **** 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. ******* 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 ******* 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?

fcsk_aim is offline  
Old 11/03/2015, 17:21   #2
 
elite*gold: 0
Join Date: Jan 2014
Posts: 268
Received Thanks: 373
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
Lefloyd is offline  
Thanks
5 Users
Old 11/03/2015, 18:16   #3
wild wild son




 
Nick's Avatar
 
elite*gold: 220
Join Date: Feb 2011
Posts: 5,857
Received Thanks: 3,371
Where's your message? It isn't a hidden secret that the game itself was made on the cheap. Feel free to improve it.
Nick is offline  
Thanks
1 User
Old 11/03/2015, 20:39   #4
 
Mi4uric3's Avatar
 
elite*gold: 405
Join Date: Dec 2007
Posts: 6,615
Received Thanks: 6,356
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.
Mi4uric3 is offline  
Thanks
9 Users
Old 11/04/2015, 00:57   #5

 
elite*gold: 0
Join Date: Jul 2009
Posts: 2,471
Received Thanks: 5,622
He actually already did as far as I can see
.Alpha. is offline  
Old 11/04/2015, 02:27   #6
 
fcsk_aim's Avatar
 
elite*gold: 100
Join Date: Dec 2014
Posts: 93
Received Thanks: 51
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...
fcsk_aim is offline  
Old 11/04/2015, 10:13   #7
 
Mi4uric3's Avatar
 
elite*gold: 405
Join Date: Dec 2007
Posts: 6,615
Received Thanks: 6,356
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 :)
Mi4uric3 is offline  
Old 11/04/2015, 14:09   #8
 
fcsk_aim's Avatar
 
elite*gold: 100
Join Date: Dec 2014
Posts: 93
Received Thanks: 51
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. 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)
fcsk_aim is offline  
Old 11/05/2015, 17:33   #9



 
.aNNdii#'s Avatar
 
elite*gold: 1
Join Date: Aug 2008
Posts: 7,744
Received Thanks: 3,606
Arrow Metin2 PServer Guides & Strategies -> Metin2 PServer - …

#moved
.aNNdii# is offline  
Reply

Tags
async


Similar Threads Similar Threads
[WTB] HL Account with either Long Tail, Officer Line, Delicate style or Bandana style
02/07/2014 - S4 League Trading - 8 Replies
Hi, I'm looking for an account which has either Long Tail, Officer Line, Delicate style or Bandana style, and which is lvl 60 minimum. I can pay up to 50€ with paypal or psc, if the account has two/three of the items i'm looking after. I'm also interested in accounts that have both Halloween Vampire Pants and Sixpack ABS. Ideal account should be something like : http://image.noelshack.com/fichiers/2014/05/13912 88551-s4-3.jpg or http://image.noelshack.com/fichiers/2014/05/13912 88551-s4-1.jpg



All times are GMT +2. The time now is 15:57.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.