Register for your free account! | Forgot your password?

You last visited: Today at 23:31

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

 

Serious Help

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Aug 2007
Posts: 1,524
Received Thanks: 230
Serious Help

Well I Wanna Code :-

1 - Flower Ranking

2 - Guild Donation Ranking

3 - Pk Exploit

ill save them with Database And load them Either when Source Start or When Player Join Game but this isnt the issue the Main issue that i feel its going to Make Server Slower or make it less efficient as its going to Load 3 Tables that conatins alot of Data so this Kind Affect badly on Server.... Right ? or iam Wrong About that



shadowman123 is offline  
Old   #2
 
elite*gold: 0
Join Date: May 2008
Posts: 1,769
Received Thanks: 1,139
What do you mean make it slower? The actual data amount on those tables wouldn't take a lot of memory if you do the class/struct that holds the data correctly and don't duplicate the data. I had my rankings/top guilds/top players/etc tables in the server for easy updating, and it never even took up more than 1MB of memory.


Zeroxelli is offline  
Thanks
1 User
Old   #3
 
elite*gold: 0
Join Date: Aug 2007
Posts: 1,524
Received Thanks: 230
Well for Pk Exploits :-

1 - Lets Assume that i have 300 Player in Server and each player's total killing is 30 so thats 300 x 30 = 9000 Line in Database and thats very low killing rate..1 Player can kill for example 40 Player in one Day so thats Huge load on database ..So i need to understand how it works ? Surely TQ didnt Make smthing like that ..weird
shadowman123 is offline  
Old   #4
 
elite*gold: 0
Join Date: May 2008
Posts: 1,769
Received Thanks: 1,139
Quote:
Originally Posted by shadowman123 View Post
Well for Pk Exploits :-

1 - Lets Assume that i have 300 Player in Server and each player's total killing is 30 so thats 300 x 30 = 9000 Line in Database and thats very low killing rate..1 Player can kill for example 40 Player in one Day so thats Huge load on database ..So i need to understand how it works ? Surely TQ didnt Make smthing like that ..weird

Well for Pk Exploits :-

1 - Lets Assume that i have 300 Player in Server and each player's total killing is 30 so thats 300 x 30 = 9000 Line in Database and thats very low killing rate..1 Player can kill for example 40 Player in one Day so thats Huge load on database ..So i need to understand how it works ? Surely TQ didnt Make smthing like that ..weird
Actually, you might only have to send one page at a time, so it wouldn't be that high a load anyway. And if you're worried about them killing 9000 different people, just limit the amount you can save. Or, when you send it when they log on, add
Code:
LIMIT 100
to the end of your SQL query, so only 100 are loaded. You may want to also use the SORT clause in your SQL query to make sure you only get the highest killcounts.


Zeroxelli is offline  
Thanks
1 User
Old   #5
 
elite*gold: 0
Join Date: Aug 2007
Posts: 1,524
Received Thanks: 230
Quote:
Originally Posted by Zeroxelli View Post
Actually, you might only have to send one page at a time, so it wouldn't be that high a load anyway. And if you're worried about them killing 9000 different people, just limit the amount you can save. Or, when you send it when they log on, add
Code:
LIMIT 100
to the end of your SQL query, so only 100 are loaded. You may want to also use the SORT clause in your SQL query to make sure you only get the highest killcounts.
what do u mean by limit the Amount i Should save .. u mean i make just only 100 ROws in Database if Yes that would be USeless cuz once The Table is completed with 100 it would Stop Saving ..
shadowman123 is offline  
Old   #6
 
elite*gold: 0
Join Date: May 2008
Posts: 1,769
Received Thanks: 1,139
Quote:
Originally Posted by shadowman123 View Post
what do u mean by limit the Amount i Should save .. u mean i make just only 100 ROws in Database if Yes that would be USeless cuz once The Table is completed with 100 it would Stop Saving ..
No, the LIMIT 100 was for how many you load.. As for limiting the amount you save, just keep the table inside the server. Make a class or struct for each table entry, and keep them in a ConcurrentDictionary or something.
Zeroxelli is offline  
Thanks
1 User
Old   #7
 
elite*gold: 0
Join Date: Aug 2007
Posts: 1,524
Received Thanks: 230
Quote:
Originally Posted by Zeroxelli View Post
No, the LIMIT 100 was for how many you load.. As for limiting the amount you save, just keep the table inside the server. Make a class or struct for each table entry, and keep them in a ConcurrentDictionary or something.
well i can do Dictionery of the Class or Struct that contains the variables but whats the use of Dictionery ? i never Used it b4 and i Fail at using it seriously which make me kinda disappointed
shadowman123 is offline  
Old   #8
 
elite*gold: 0
Join Date: May 2008
Posts: 1,769
Received Thanks: 1,139
Quote:
Originally Posted by shadowman123 View Post
well i can do Dictionery of the Class or Struct that contains the variables but whats the use of Dictionery ? i never Used it b4 and i Fail at using it seriously which make me kinda disappointed
Example, we don't need a dictionary for now.
Code:
public static List<PkExploit> pkeDatabase = new List<PkExploit>();
Put that somewhere in your main file, probably Program.cs.

Code:
public class PkExploit
{
    public int KillerUID = 0; // The killer's UniqueID / Identity
    public int KilledUID = 0; // The victim's UniqueID / Identity
    public ulong TimeStamp = 0; // Timestamp of when they were killed
    public ushort KillCount = 0; // How many times Killer has PKed Killed
}
That's a sample class for a PkExploit.

Code:
PkExploit PKE = new PkExploit();
PKE.KilledUID = Target.Char.UniqueID;
PKE.KillerUID = Client.Char.UniqueID;
PKE.TimeStamp = Program.Microtime(); // I'll give you this function if you don't already have one of your own.
PKE.KillCount = 1; // Or, check if they're already in the table, and just increment it.

Program.pkeDatabase.Add(PKE);
There's a sample of creating one.

Microtime function:

Note, first you need the Unix Epoch date.

Code:
public static readonly DateTime Epoch = new DateTime(1970, 1, 1);
Code:
public static long Microtime()
{
    return Convert.ToInt64((DateTime.UtcNow - Epoch).TotalMilliseconds);
}
If you need these for later:

Code:
public static long MilliSecondsSince(long UTS)
{
    return (Microtime() - UTS);
}

public static long SecondsSince(long UTS)
{
    return ((Microtime() - UTS) / 1000);
}
Anyway, surely you can understand the rest.
Zeroxelli is offline  
Thanks
2 Users
Old   #9
 
elite*gold: 0
Join Date: Jun 2010
Posts: 2,188
Received Thanks: 846
serious help? Give me a ******* break you make a thread almost daily.
_DreadNought_ is offline  
Old   #10
 
elite*gold: 0
Join Date: Aug 2007
Posts: 1,524
Received Thanks: 230
Quote:
Originally Posted by _DreadNought_ View Post
serious help? Give me a ******* break you make a thread almost daily.
Nah thats untrue i dont make daily maybe each 3 - 4 days and thats not Alawys too


shadowman123 is offline  
Reply



« Previous Thread | Next Thread »



All times are GMT +2. The time now is 23:31.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2018 elitepvpers All Rights Reserved.