![]() |
Working with .INI files.... - Printable Version +- Mirage Source (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: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17) +---- Thread: Working with .INI files.... (/showthread.php?tid=1345) |
Working with .INI files.... - Sh4d0ws - 15-10-2007 Currently, I am working with some code that hopefully when finished will accomplish the fallowing task. What I want is so that every time there is a player killer event, it increases your score based on the level difference (Less then, Equal, or greater then). However, I don't know how to use MySQL and I have no intention of learning it currently, so this left me with only one option... .ini files, which I have never used before. I was getting some help from someone on the basics (get var/putvar) but unfortinatly I need some more assistance. For anyone interested, I'll give you as much information as possible on what I want, and what I already have done... - Upon Char creation it creates a new line in the .ini file ( CharName = 0 ) - Upon char deletion, it deletes that character in the .ini file - Every time someone kills someone else, it increses the killers score in the .ini file - Based on a timer on the client (or another good idea if anyone has one), it sends a packet to the server and requests the information from it. ---------------- Here are the segments of code that I have currently... ::Server Side:: - The packet (unfinished) Code: ' ::::::::::::::::::::::::::::: - In the AddChar sub, near the bottom before it saves, I added this to create a new char on the ini file Code: ' Saves the chars name to 0 on the player leaderboards - In modGameLogic, under "Has been deemed a player killer!" I placed this, and two others simler to it to act out different senerios for killing... Code: Dim PKLAmount As Integer, PKTotal As Integer ::Client Sided:: - Packet Information Code: Sub PKLPacket(ByVal First As Integer, second As Integer, third As Integer) This is basically all I have currently. If you can give me some segments of code or an idea on how to delete the line for the "DelChar" sub, that would be a good start for me. I also need help with displaying the information onto the frmMirage once I get the packet sending the information back and fourth. Pleas and thank you! Re: Working with .INI files.... - Robin - 15-10-2007 Actually, you can use binary. DelChar actually just sets everything to 0 and saves it, so have a look around. Re: Working with .INI files.... - Sh4d0ws - 15-10-2007 Well yes, but to the player, you are deleting your char and cannot use it anymore (its name disappears from the list so to speak), And when that happens to them, then I want it to disappear from the .ini file for the leaderboard. The best I can see currently is setting it to zero, then perhaps I could add some more code in the client so that when the packet comes back, if the name is equal to 0 then it just dose not display.... That might actually work now that I think about it... Re: Working with .INI files.... - Dr. Spoon - 15-10-2007 you could also load in the entire PKlist removing any player names that = 0 I would recommend not adding the player to the list until they have their first kill Re: Working with .INI files.... - Sh4d0ws - 15-10-2007 Thats a possibility, and would incorperate a sort of, "This is the highest killer ever..." kind of thing.. Not sure were I would place this though. Re: Working with .INI files.... - Sh4d0ws - 16-10-2007 So you suggest placing it on the Server? That wouldn't be much more trouble... Every couple mins it sends a packet to update the leaderboard... Re: Working with .INI files.... - Matt - 16-10-2007 Why not update the leaderboard when the player accesses it? Re: Working with .INI files.... - Rezeyu - 16-10-2007 Just export it to the website at a timed interval, the more kills and players there are, the more strain it's going to cause to create the list. Re: Working with .INI files.... - Robin - 16-10-2007 Don't export anything on a timer. Just export it when it's changed. Re: Working with .INI files.... - Rezeyu - 16-10-2007 But if people are PKing often, wont that rape with lag? Especially with INI files. Re: Working with .INI files.... - Robin - 16-10-2007 Robin Wrote:use binary. Re: Working with .INI files.... - Spodi - 16-10-2007 Rezeyu Wrote:But if people are PKing often, wont that rape with lag? Combination of both, then. Code: If StatusChanged Then Not like you'd need to update more than every hour or so, though. Re: Working with .INI files.... - Matt - 16-10-2007 Why not use a separate program to do what Rez said? Make the list, export it to a website, to be included in an html or php page..? Just have it read directly from the account files and what not. Wouldn't cause any lag, would it? Re: Working with .INI files.... - Matt - 16-10-2007 Dave Wrote:No, probably not. There are ways around that. Re: Working with .INI files.... - Sh4d0ws - 17-10-2007 What I am going to do, every time there is a change to the .ini file, then it will send that value to the clients. I have absoultly no idea how to do this. Any ideas people? Re: Working with .INI files.... - Sh4d0ws - 18-10-2007 Apart from my way of comparing levels is not yet completed (more or less, what I thought would work dose not), I have just one more task because I can set up the packet. I am not sure how to get all of the information on the text file stored in an array... Like, I can get an individual one, with a specific name in mind, but not all of them into an array at once. Any ideas? Re: Working with .INI files.... - Sh4d0ws - 19-10-2007 Its late at night and my mind is just not functioning... If that is it, wonderful, I'll try it... If not, this is basically what I need... Array(0) = FirstCharNameValue (Which will be like, Sh4d0ws = 0) Array(1) = SecondCharName (etc...) |