Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #16  
Old 11-18-2014, 01:32 PM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
why don't you just keep track of high scores on a notepad. if internet goes down u have hard copy
Reply With Quote
  #17  
Old 11-18-2014, 02:22 PM
Inari Inari is offline
Registered User
Join Date: Sep 2014
Posts: 47
Inari is on a distinguished road
Quote:
Originally Posted by Cubical View Post
why don't you just keep track of high scores on a notepad. if internet goes down u have hard copy
Possible, but that isn't very dynamic, and doesn't make much sense.
It makes sense to store player-data in a central place where its easily accessible via a language made for accessing such entries
Reply With Quote
  #18  
Old 11-18-2014, 02:33 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by Cubical View Post
why don't you just keep track of high scores on a notepad. if internet goes down u have hard copy
i also backup all my data to offsite stone tablets.
__________________
Quote:
Reply With Quote
  #19  
Old 11-18-2014, 02:33 PM
Tim_Rocks Tim_Rocks is offline
a true gentlemen
Tim_Rocks's Avatar
Join Date: Aug 2008
Location: USA
Posts: 1,863
Tim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to behold
Quote:
Originally Posted by Cubical View Post
why don't you just keep track of high scores on a notepad. if internet goes down u have hard copy
Cubical brings up an excellent point here.
__________________
Reply With Quote
  #20  
Old 11-18-2014, 03:17 PM
Inari Inari is offline
Registered User
Join Date: Sep 2014
Posts: 47
Inari is on a distinguished road
Pros of SQL (some only apply if using a primarily SQL-based system, so probably not to all graal servers ):
  • Easy access to all data
  • Made to store and request data (and has proven itself)
  • Doesn't break from staff editing the attributes
  • Better relational data management
among others

(Of course storing all data in NPC-flags is also a way, but then you end up having to write more potentially slower and buggier script code)
Reply With Quote
  #21  
Old 11-18-2014, 03:26 PM
Tim_Rocks Tim_Rocks is offline
a true gentlemen
Tim_Rocks's Avatar
Join Date: Aug 2008
Location: USA
Posts: 1,863
Tim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to behold
Yea, but there's no need to create an SQL table for over a thousand players when all you really need is 25 of them.
__________________
Reply With Quote
  #22  
Old 11-18-2014, 03:38 PM
Inari Inari is offline
Registered User
Join Date: Sep 2014
Posts: 47
Inari is on a distinguished road
Quote:
Originally Posted by Tim_Rocks View Post
Yea, but there's no need to create an SQL table for over a thousand players when all you really need is 25 of them.
Well, no direct /need/, except if you use SQL to begin with Which maybe graal servers should consider doing... I guess its more of a point of "hey, if you put your structure more around SQL you can make such things much much easier"~
Reply With Quote
  #23  
Old 11-18-2014, 03:53 PM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
Quote:
Originally Posted by Inari View Post
Well, no direct /need/, except if you use SQL to begin with Which maybe graal servers should consider doing... I guess its more of a point of "hey, if you put your structure more around SQL you can make such things much much easier"~
Well, no direct /need/, except if you use SQL to begin with Which maybe graal servers should consider doing... I guess its more of a point of "hey, if you put your structure more around SQL you can make such things much much easier"~
Reply With Quote
  #24  
Old 11-18-2014, 03:57 PM
Inari Inari is offline
Registered User
Join Date: Sep 2014
Posts: 47
Inari is on a distinguished road
Quote:
Originally Posted by Cubical View Post
Well, no direct /need/, except if you use SQL to begin with Which maybe graal servers should consider doing... I guess its more of a point of "hey, if you put your structure more around SQL you can make such things much much easier"~
Well, no direct /need/, except if you use SQL to begin with Which maybe graal servers should consider doing... I guess its more of a point of "hey, if you put your structure more around SQL you can make such things much much easier"~
(am i missing something?)

Anyway, my original point still is valid I guess: If you use SQL you have a much cleaner code and the < 1 MB you use to store data doesn't bother anyone ever.
Reply With Quote
  #25  
Old 11-18-2014, 04:06 PM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
Quote:
Originally Posted by Inari View Post
Well, no direct /need/, except if you use SQL to begin with Which maybe graal servers should consider doing... I guess its more of a point of "hey, if you put your structure more around SQL you can make such things much much easier"~
(am i missing something?)

Anyway, my original point still is valid I guess: If you use SQL you have a much cleaner code and the < 1 MB you use to store data doesn't bother anyone ever.
Well, no direct /need/, except if you use SQL to begin with Which maybe graal servers should consider doing... I guess its more of a point of "hey, if you put your structure more around SQL you can make such things much much easier"~
(am i missing something?)

Anyway, my original point still is valid I guess: If you use SQL you have a much cleaner code and the < 1 MB you use to store data doesn't bother anyone ever.
Reply With Quote
  #26  
Old 11-18-2014, 04:55 PM
Tim_Rocks Tim_Rocks is offline
a true gentlemen
Tim_Rocks's Avatar
Join Date: Aug 2008
Location: USA
Posts: 1,863
Tim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to behold
I use SQL for most systems on Era. Works nicely.
__________________
Reply With Quote
  #27  
Old 12-03-2014, 09:05 PM
Carlito Carlito is offline
Playerworld Admin
Join Date: Nov 2014
Posts: 2
Carlito is on a distinguished road
SQL is great i use it mostly but at the same time it can easily be abused and bloat your db. If Snk only wanted the top 20 players why would he store and update over 3000 accounts. I feel for this reason his method is best, it is only maintaining the top 25 oppose of all 3000+ players. DB npcs are great for temp storage especially on situations like this.
Reply With Quote
  #28  
Old 12-11-2014, 11:02 PM
prozacboy666 prozacboy666 is offline
Registered User
Join Date: Mar 2002
Posts: 130
prozacboy666 will become famous soon enough
Use SQL. Here is how I would do it.
When a new score comes in do a select on the database for the minimum score to get into the top20.
PHP Code:
SELECT MIN(scoreFROM myTable
If new score > min, insert new score into the database and delete the min score.
The only thing is you would have to do two queries to delete the min score from the database something like
PHP Code:
minId SELECT id FROM myTable WHERE score = (SELECT min(scoreFROM myTable)
DELETE FROM top20 WHERE id minId 
Then all you have to do is selects on that table if you are looking for the top20
PHP Code:
SELECT FROM top20 ORDER BY score DESC 
You probably could get the ID and delete it from the database all in one query but this should be fast enough.
Reply With Quote
  #29  
Old 12-12-2014, 01:12 AM
Elk Elk is offline
Sr Marketing Strategist
Elk's Avatar
Join Date: Nov 2005
Location: Deerland
Posts: 3,829
Elk has a brilliant futureElk has a brilliant futureElk has a brilliant futureElk has a brilliant futureElk has a brilliant futureElk has a brilliant futureElk has a brilliant future
Send a message via ICQ to Elk Send a message via AIM to Elk Send a message via MSN to Elk Send a message via Yahoo to Elk
Quote:
Originally Posted by fowlplay4 View Post
i also backup all my data to offsite stone tablets.
cuneiform <3
__________________
iEra IGN: *Elk (Darkshire)
iCla. IGN: *Elk (Darkshire)
iZone IGN: *Elk (Darkshire)




Reply With Quote
  #30  
Old 12-12-2014, 08:48 AM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Quote:
Originally Posted by prozacboy666 View Post
Use SQL. Here is how I would do it.
When a new score comes in do a select on the database for the minimum score to get into the top20.
PHP Code:
SELECT MIN(scoreFROM myTable
If new score > min, insert new score into the database and delete the min score.
The only thing is you would have to do two queries to delete the min score from the database something like
PHP Code:
minId SELECT id FROM myTable WHERE score = (SELECT min(scoreFROM myTable)
DELETE FROM top20 WHERE id minId 
Then all you have to do is selects on that table if you are looking for the top20
PHP Code:
SELECT FROM top20 ORDER BY score DESC 
You probably could get the ID and delete it from the database all in one query but this should be fast enough.
You'd need three queries.
1,) Find the minimum score
2,) Add the score
3,) Delete old score


I guess it's what you want to store.
__________________
Reply With Quote
Reply


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 +2. The time now is 02:45 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.