vbGore Free Online RPG Engine

Revolutionizing Visual Basic ORPG Development
It is currently Thu May 23, 2013 5:17 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Database hosted Friend List
PostPosted: Mon Jan 26, 2009 9:05 pm 
Bit Baby

Joined: Sun Jul 20, 2008 5:48 pm
Posts: 387
Location: Mercer Island , Washington
Seeing that many want a Friend List I think we should make one for the community (when finished I will make a wiki on it).
Since I am awfull at databases, I will need help.
Here is what I started with. In users table make a new field. Call it charid and set as int, No null, autoincrement.
make another field called friends,text,no null.

Now in the server under TPC add this:
Sub Add_friend (byval userindex as integer)
DB_RS.Open "SELECT * FROM usersWHERE `friend`='" & charid& "'", DB_Conn, adOpenStatic, adLockOptimistic

DB_RS.Close
Thats as far as I get. Anyone wanna add on

GOREMANIA WHERE ARE YOU :x ??? I learned so much from your additions.


Top
 Profile  
 
 Post subject: Re: Database hosted Friend List
PostPosted: Tue Jan 27, 2009 12:23 pm 
Slave to the BB

Joined: Tue Jul 31, 2007 8:45 am
Posts: 3273
Location: United Kingdom
Quote:
Seeing that many want a Friend List I think we should make one for the community (when finished I will make a wiki on it).


Don't bother, I'm putting up a tut for mine in the next for weeks. :p


Top
 Profile  
 
 Post subject: Re: Database hosted Friend List
PostPosted: Tue Jan 27, 2009 12:33 pm 
Slave to the BB

Joined: Sat May 12, 2007 6:20 am
Posts: 3842
Location: Behind you!
Code:
Sub Add_friend (byval UserIndex as integer, byval Target as string)
dim FriendList() as string
dim s as string

DB_RS.Open "SELECT * FROM users WHERE `friend`='" & charid & "'", DB_Conn, adOpenStatic, adLockOptimistic
If LenB(DB_RS!friend) = 0 Then
        DB_RS!friend = Target
   
    'Enter in a new friend into the list if its not already in there
Else
        FriendList() = Split(DB_RS!friend, vbNewLine)  'Create the friend list
        Count = UBound(FriendList)
        For LoopC = 0 To Count
            If FriendList(LoopC) = Target Then
                LoopC = 250
                Exit For    'friend already in list, abort!
            End If
        Next LoopC
        If LoopC < 250 Then 'Check if we have a unique value
            Count = Count + 1
            FriendsList(Count) = Target 'Add the new friend to the end of the list
            For LoopC = 0 To Count
                s = s & FriendList(LoopC)  'Add the friend onto the string
                If LoopC < Count Then s = s & vbNewLine 'If not the last entry, add the line break
            Next LoopC
            DB_RS!friend = s
            DB_RS.Update
        End If
    End If
    DB_RS.Close


Top
 Profile  
 
 Post subject: Re: Database hosted Friend List
PostPosted: Tue Jan 27, 2009 12:53 pm 
Bit Baby

Joined: Sun Jul 20, 2008 5:48 pm
Posts: 387
Location: Mercer Island , Washington
We are getting there. Ill post a GUI for this later tonight.


Top
 Profile  
 
 Post subject: Re: Database hosted Friend List
PostPosted: Tue Jan 27, 2009 1:16 pm 
Slave to the BB

Joined: Tue Jul 31, 2007 8:45 am
Posts: 3273
Location: United Kingdom
Seriously. I've already got one fully coded, with a blocklist too. I'm planning to post the code up when it's tested properly...


Top
 Profile  
 
 Post subject: Re: Database hosted Friend List
PostPosted: Tue Jan 27, 2009 1:41 pm 
Slave to the BB

Joined: Sat May 12, 2007 6:20 am
Posts: 3842
Location: Behind you!
Lol I was actually making that when you posted :/.


Top
 Profile  
 
 Post subject: Re: Database hosted Friend List
PostPosted: Sat Jan 31, 2009 12:35 pm 
Bit Baby

Joined: Sun Jul 20, 2008 5:48 pm
Posts: 387
Location: Mercer Island , Washington
Checked out SVO's newest version 0.4.5 (and .4.5.1) and that friend list is great! You should also add to the wiki the whole friend list system in general (with the clan list to)


Top
 Profile  
 
 Post subject: Re: Database hosted Friend List
PostPosted: Sat Jan 31, 2009 1:10 pm 
=^.^= Kitty =^.^=

Joined: Wed Mar 21, 2007 6:50 am
Posts: 1002
Location: Belgium
Clans are really screwy at the moment though. The friendlist / blocklist didn't bring any problems (so far).


Top
 Profile  
 
 Post subject: Re: Database hosted Friend List
PostPosted: Sat Jan 31, 2009 1:26 pm 
Slave to the BB

Joined: Sat May 12, 2007 6:20 am
Posts: 3842
Location: Behind you!
geolej wrote:
Checked out SVO's newest version 0.4.5 (and .4.5.1) and that friend list is great! You should also add to the wiki the whole friend list system in general (with the clan list to)

You know its not really nice to ask people for their code you could request something like it which would be more acceptable and see if they reply :P.


Top
 Profile  
 
 Post subject: Re: Database hosted Friend List
PostPosted: Sat Jan 31, 2009 2:08 pm 
baka

Joined: Tue Jul 08, 2008 12:17 am
Posts: 2304
Location: England, UK
notexistant wrote:
geolej wrote:
Checked out SVO's newest version 0.4.5 (and .4.5.1) and that friend list is great! You should also add to the wiki the whole friend list system in general (with the clan list to)

You know its not really nice to ask people for their code you could request something like it which would be more acceptable and see if they reply :P.

Nothing wrong with asking :)

Although I wouldn't expect people to just post everything they make up on the wiki, if you post up all of your code you won't have any unique features! :P


Top
 Profile  
 
 Post subject: Re: Database hosted Friend List
PostPosted: Sat Jan 31, 2009 3:09 pm 
=^.^= Kitty =^.^=

Joined: Wed Mar 21, 2007 6:50 am
Posts: 1002
Location: Belgium
Well, friendlists aren't really unique, nor are clans so shouldn't be a problem :p


Top
 Profile  
 
 Post subject: Re: Database hosted Friend List
PostPosted: Sat Jan 31, 2009 3:29 pm 
baka

Joined: Tue Jul 08, 2008 12:17 am
Posts: 2304
Location: England, UK
I wasn't referring to anything specific like the friend-list, just playing devil's advocate to my "There's nothing wrong with asking". :)


Top
 Profile  
 
 Post subject: Re: Database hosted Friend List
PostPosted: Sat Jan 31, 2009 4:33 pm 
Bit Baby

Joined: Sun Jul 20, 2008 5:48 pm
Posts: 387
Location: Mercer Island , Washington
Darkfrost wrote:
Seriously. I've already got one fully coded, with a blocklist too. I'm planning to post the code up when it's tested properly...

Uhm...I win.


Top
 Profile  
 
 Post subject: Re: Database hosted Friend List
PostPosted: Sat Jan 31, 2009 5:26 pm 
Slave to the BB

Joined: Sat May 12, 2007 6:20 am
Posts: 3842
Location: Behind you!
geolej wrote:
(with the clan list to)

You lose :P


Top
 Profile  
 
 Post subject: Re: Database hosted Friend List
PostPosted: Sat Jan 31, 2009 7:11 pm 
Bit Baby

Joined: Sun Jul 20, 2008 5:48 pm
Posts: 387
Location: Mercer Island , Washington
Uhm, i said clan is optional.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next

All times are UTC - 8 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group