Project 1999

Go Back   Project 1999 > Red Community > Red Server Chat

Closed Thread
 
Thread Tools Display Modes
  #1  
Old 05-17-2013, 09:33 AM
GODPARTICLE GODPARTICLE is offline
Banned


Join Date: Apr 2013
Posts: 85
Default

Code:
	char phrase[255];
	database.GetRandPvPSaying(phrase);
	
	worldserver.SendEmoteMessage(0,0,0,15,
		"%s (%u %s) <%s> %s %s (%u %s) <%s>  in %s!",
			this->GetName(),this->GetLevel(),classes[this->GetClass()],guild_mgr.GetGuildName(this->GuildID()),
			phrase,
			killer->GetName(),killer->GetLevel(),classes[killer->GetClass()],guild_mgr.GetGuildName(killer->GuildID()),
			zone->GetLongName()
	);
  #2  
Old 05-17-2013, 09:46 AM
Rogean Rogean is offline
¯\_(ツ)_/¯

Rogean's Avatar

Join Date: Oct 2009
Location: Massachusetts
Posts: 5,390
Default

Quote:
Originally Posted by GODPARTICLE [You must be logged in to view images. Log in or Register.]
Code:
	char phrase[255];
	database.GetRandPvPSaying(phrase);
	
	worldserver.SendEmoteMessage(0,0,0,15,
		"%s (%u %s) <%s> %s %s (%u %s) <%s>  in %s!",
			this->GetName(),this->GetLevel(),classes[this->GetClass()],guild_mgr.GetGuildName(this->GuildID()),
			phrase,
			killer->GetName(),killer->GetLevel(),classes[killer->GetClass()],guild_mgr.GetGuildName(killer->GuildID()),
			zone->GetLongName()
	);
database.GetRandPvPSaying(phrase); ? You're pulling an SQL Query every time you want to get a phrase? I almost didn't read past this horrible bit of inefficiency.

"%s (%u %s) <%s> %s %s (%u %s) <%s> in %s!"

Lack of guild causes unnecessary ") <> ". This is why I have %s%s%s, If there's no guild name, why add the extra support text around it. It looks cleaner.
You have an extra space before "in".

I did forget the zone name, I'll add that to mine.
__________________
Sean "Rogean" Norton
Project 1999 Co-Manager

Project 1999 Setup Guide
  #3  
Old 06-01-2013, 12:08 PM
Tomato King6 Tomato King6 is offline
Banned


Join Date: May 2013
Posts: 277
Default

desperate for attention
  #4  
Old 05-17-2013, 09:36 AM
GODPARTICLE GODPARTICLE is offline
Banned


Join Date: Apr 2013
Posts: 85
Default

btw what is that Rogean perl or something? What's the world coming to with ternary operations in a string format. Wonder if that's valid in C/C++
  #5  
Old 05-17-2013, 10:00 PM
GODPARTICLE GODPARTICLE is offline
Banned


Join Date: Apr 2013
Posts: 85
Default

Quote:
Originally Posted by GODPARTICLE [You must be logged in to view images. Log in or Register.]
btw what is that Rogean perl or something? What's the world coming to with ternary operations in a string format. Wonder if that's valid in C/C++
I thought it would be, my assumption is correct

Code:
#include <stdio.h>

int main()
{
    const int b = 1;
    printf("%s %s", b ? "cando" : "nutdo", !b ? "cando" : "nutdo");

    return 0;
}
output

Code:
cando nutdo
compiles with both c and c++
Last edited by GODPARTICLE; 05-17-2013 at 10:03 PM..
  #6  
Old 05-17-2013, 09:48 AM
GODPARTICLE GODPARTICLE is offline
Banned


Join Date: Apr 2013
Posts: 85
Default

its a myisam table. reads are virtually 0 overhead for how often a pvp slaying happens, especially compared to the trillions of database calls happening constantly. I did it so they could be added in realtime without recompiling and resetting the server, but it could be hardcoded array (mt_rand might have the same overhead realistically)

oh the original line with <> was a copypasta of null's code
Last edited by GODPARTICLE; 05-17-2013 at 09:52 AM..
  #7  
Old 05-17-2013, 09:53 AM
Rogean Rogean is offline
¯\_(ツ)_/¯

Rogean's Avatar

Join Date: Oct 2009
Location: Massachusetts
Posts: 5,390
Default

Quote:
Originally Posted by GODPARTICLE [You must be logged in to view images. Log in or Register.]
its a myisam table. reads are virtually 0 overhead
Are you forgetting all the overhead of actually running an SQL Query? The amount of code that then needs to be executed through the database functions, then the TCP code.. THEN we get to the actual mysql / myisam portion while the server process sits and twiddles it's thumbs (non asynchronous db call). Then repeat in reverse. I'll pass on that.


Quote:
Originally Posted by GODPARTICLE [You must be logged in to view images. Log in or Register.]
especially compared to the trillions of database calls happening constantly.
Not on my servers. There's a reason P99 holds more stability with hundreds of people online / in same zones compared to other servers. We moved away from on-demand sql queries a long time ago, preferring caches whenever possible.
__________________
Sean "Rogean" Norton
Project 1999 Co-Manager

Project 1999 Setup Guide
  #8  
Old 05-17-2013, 10:31 AM
Smedy Smedy is offline
Planar Protector

Smedy's Avatar

Join Date: Mar 2011
Posts: 4,578
Default

Quote:
Originally Posted by Rogean [You must be logged in to view images. Log in or Register.]
Are you forgetting all the overhead of actually running an SQL Query? The amount of code that then needs to be executed through the database functions, then the TCP code.. THEN we get to the actual mysql / myisam portion while the server process sits and twiddles it's thumbs (non asynchronous db call). Then repeat in reverse. I'll pass on that.




Not on my servers. There's a reason P99 holds more stability with hundreds of people online / in same zones compared to other servers. We moved away from on-demand sql queries a long time ago, preferring caches whenever possible.
rogean just took a shit on this self proclaimed genius godparticle sons, put some ones and zeros into red99 so we can get some shit done now
__________________
Quote:
Originally Posted by Slathar View Post
you clean plaque off peoples teeth for a living and are only able to do that because your daddy hired you. your waist is also wider than your shoulders and you’re 5’2.
Videos
Wipe it clean.
  #9  
Old 05-17-2013, 10:35 AM
Inkanddagger Inkanddagger is offline
Large Rat

Inkanddagger's Avatar

Join Date: May 2013
Location: The Safehouse
Posts: 5
Default

Quote:
Originally Posted by Smedy [You must be logged in to view images. Log in or Register.]
rogean just took a shit on this self proclaimed genius godparticle sons, put some ones and zeros into red99 so we can get some shit done now
[You must be logged in to view images. Log in or Register.]
__________________

<Force>
  #10  
Old 05-17-2013, 09:50 AM
Feniggles Feniggles is offline
Banned


Join Date: Sep 2010
Posts: 492
Default

plz send updates to my icq = 7050258
Closed Thread


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:08 PM.


Everquest is a registered trademark of Daybreak Game Company LLC.
Project 1999 is not associated or affiliated in any way with Daybreak Game Company LLC.
Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.