18.03.2015, 12:54
Hi there!
I had some free time and decided to script a friend list feature (using MySQL to store/extract data).
Once someone enters a name (or ID if online), it will be compared with the `Username` column in the accounts database.
The DBID will be extracted and added to a new database, along with the player's DBID.
A .zip package can be found in the attachments. And here is a mirror:
Download Here
Make sure to change all MySQL name values to your own database's.
Default is:
Player accounts DB: `accounts`
Friend DB: `friendsdb`
Account ID in accounts DB: `id`
Username in accounts DB: `Username`
Commands:
/addfriend [NAME / ID] - Adds a friend to your friendlist.
/friends - Displays a list of all the players you are befriended with.
How it works:
5 = "Farva"
5014 = "Benny_McCabe"
12340 = "Eddie_Murphy"
55100 = "Sam_Jingles"
"Sam_Jingles" (55100) enters the command:
"/addfriend eddie_murphy" (or when "Eddie_Murphy" is online, he can simply enter "/addfriend [ID]" or "/addfriend Eddie)
"Eddie_Murphy"'s DBID will be copied into a new entry in the `friendsdb` database, linking it to "Sam_Jingles".
After a while, Sam_Jingles has made some friends. The database will look like this:
Once "Sam_Jingles" enters the command: "/friends", he will get a friendlist that links the `FriendID` in the `friendsdb` database back to the usernames in the original accounts database.
"Sam_Jingles" is befriended with: "Farva", "Benny_McCabe", "Eddie_Murphy".
"Farva" is befriended with: "Benny_McCabe"
"Eddie_Murphy" is befriended with: "Sam_Jingles", "Farva".
And after a year or so, you'll be able to export the database and generate a map and see a sociographic representation of the social groups/relationships between NGG players :P.
Enjoy!
Jingles
I had some free time and decided to script a friend list feature (using MySQL to store/extract data).
Once someone enters a name (or ID if online), it will be compared with the `Username` column in the accounts database.
The DBID will be extracted and added to a new database, along with the player's DBID.
A .zip package can be found in the attachments. And here is a mirror:
Download Here
Make sure to change all MySQL name values to your own database's.
Default is:
Player accounts DB: `accounts`
Friend DB: `friendsdb`
Account ID in accounts DB: `id`
Username in accounts DB: `Username`
Commands:
/addfriend [NAME / ID] - Adds a friend to your friendlist.
/friends - Displays a list of all the players you are befriended with.
How it works:
5 = "Farva"
5014 = "Benny_McCabe"
12340 = "Eddie_Murphy"
55100 = "Sam_Jingles"
"Sam_Jingles" (55100) enters the command:
"/addfriend eddie_murphy" (or when "Eddie_Murphy" is online, he can simply enter "/addfriend [ID]" or "/addfriend Eddie)
"Eddie_Murphy"'s DBID will be copied into a new entry in the `friendsdb` database, linking it to "Sam_Jingles".
After a while, Sam_Jingles has made some friends. The database will look like this:
Once "Sam_Jingles" enters the command: "/friends", he will get a friendlist that links the `FriendID` in the `friendsdb` database back to the usernames in the original accounts database.
"Sam_Jingles" is befriended with: "Farva", "Benny_McCabe", "Eddie_Murphy".
"Farva" is befriended with: "Benny_McCabe"
"Eddie_Murphy" is befriended with: "Sam_Jingles", "Farva".
And after a year or so, you'll be able to export the database and generate a map and see a sociographic representation of the social groups/relationships between NGG players :P.
Enjoy!
Jingles