Mirage Engine
Friend List - Printable Version

+- Mirage Engine (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: Resources (https://mirage-engine.uk/forums/forumdisplay.php?fid=49)
+---- Thread: Friend List (/showthread.php?tid=121)



Friend List - Leighland - 14-06-2006

Was wondering if someone can throw together a tutorial for some type of friends list or buddy system. I had it to the point where I could load a picbox which displayed the list of online users, then you could select the user and add them to the friends list. I used an array and saved it with the character file, something like so:

Code:
For n= 1 to MAX_FRIENDS
     Call PutVar(FileName, "CHAR" & i, "Friend" & n, STR(Player(index).Char(i).FriendName(n)))
Next n

The problem I ran into was sending the list back to the client when the player logged back in. I know it's easy I'm just having one of my usual bran malfunctions lol..

I want to be able to add friends to a friends list using the whoonline list, which i know how to do. Then later load the back into the client from the server, and display them in a list so the character can PM them etc.

Any help is appreciated Smile *trods off to bed*


- Obsidian - 14-06-2006

well if you're using ini (a good place to start... although it's a bit slow...), on the player login just do

for i =1 to max friends
Call getvar(FileName, "CHAR" & i, "Friend" & n)
next i


- Leighland - 15-06-2006

Just realized how stupid I am lol... Help to sleep on it sometimes I guess. I was sendinf the friends list to the server and trying to read it back, meanwhile I can just do the code for writing INI files on the client and save/load the lists from the client folder lmao...


- Kenko - 15-06-2006

Or you could just save it to the server, and load it from the server and send it to the client. That way, even if you switched PCs, your friend list would stay intact and it'd save client space (even if by a bit)


- Dragoons Master - 19-06-2006

If I remember well, Dave asked me this a while ago and I posted on the forums, but it was a long time ago, I think 2 forums ago. I'll try to find some txt file here w/ that TUT, I always backup my TUTs into txt files on my computer.