Mirage Source http://web.miragesource.net/forums/ |
|
SavePlayer Faster http://web.miragesource.net/forums/viewtopic.php?f=210&t=60 |
Page 1 of 2 |
Author: | grimsk8ter11 [ Thu Jun 01, 2006 9:44 pm ] |
Post subject: | SavePlayer Faster |
Originally posted by Dragoons Master Very simple tutorial. I was testing my server on a P2(455Mhz) and it was veery lagued, but thats not the point. When I tried to create an account from my website account creation, it taked sooo long creating it, so I maded a veeery simple modification, and now it creates the account praticly instantly. It just saves the player you are using(PlayerNum), so do this: ONLY SERVER SIDE modDatabase: Sub SavePlayer: Replace: Code: For I = 1 To MAX_CHARS with: Code: For I = 1 To MAX_CHARS If Player(Index).CharNum = I Then and replace: Code: Next I with: Code: End If
Next I This will make the server saves only the char you had played, and on the account creation, it will save only the account information(3 or 4 lines) xD Simple and usefull. |
Author: | Coke [ Mon Jul 02, 2007 1:10 pm ] |
Post subject: | Re: SavePlayer Faster |
Any side affects to this? |
Author: | William [ Mon Jul 02, 2007 1:32 pm ] |
Post subject: | Re: SavePlayer Faster |
Without it, it will save all your characters although you are only online with one. |
Author: | Coke [ Mon Jul 02, 2007 3:03 pm ] |
Post subject: | Re: SavePlayer Faster |
ooh, simple but meaningful fix - thankies |
Author: | Robin [ Mon Jul 02, 2007 4:10 pm ] |
Post subject: | Re: SavePlayer Faster |
Link it in with HighIndex and you'll only have to save 5 players a time |
Author: | Rezeyu [ Tue Jul 03, 2007 8:48 am ] |
Post subject: | Re: SavePlayer Faster |
Note, this makes you unable to delete chars. |
Author: | Lea [ Tue Jul 03, 2007 10:32 am ] |
Post subject: | Re: SavePlayer Faster |
I don't see why it would... Maybe it does, but that's fixable with a check or two im sure. |
Author: | William [ Tue Jul 03, 2007 10:36 am ] |
Post subject: | Re: SavePlayer Faster |
I can still delete my chars, maybe I did something to fix it dunno. |
Author: | Matt [ Tue Jul 03, 2007 11:35 am ] |
Post subject: | Re: SavePlayer Faster |
I can still delete my characters too. I THINK there may have been an issue with it, but I added this so long ago, I'm not really sure. |
Author: | Robin [ Tue Jul 03, 2007 4:37 pm ] |
Post subject: | Re: SavePlayer Faster |
I thought there was a problem with deleting characters anyway... |
Author: | Rezeyu [ Tue Jul 03, 2007 8:33 pm ] |
Post subject: | Re: SavePlayer Faster |
When you delete a char, it clears the char, setting everythingk.. blank. Then it calls save player. So that it saves the blank data over the old data. But with this, I was unable to do that, because it checks if the char is being used. And in a menu, it's not being used. So it says that you have no currently playing chars, and skips the whole save. Me and SMChronos had the error. |
Author: | Coke [ Tue Jul 03, 2007 8:59 pm ] |
Post subject: | Re: SavePlayer Faster |
Fix? |
Author: | Cruzn [ Tue Jul 03, 2007 9:04 pm ] |
Post subject: | Re: SavePlayer Faster |
Fox wrote: Fix? I use this: Code: Sub SavePlayer(ByVal Index As Long, ByVal cNum as Byte) Dim FileName As String Dim n As Long cNum = int(cNum) FileName = App.Path & "\accounts\" & Trim(Player(Index).Login) & ".ini" Call PutVar(FileName, "CHAR" & cNum, "Name", Trim(Player(Index).Char(cNum).Name)) Call PutVar(FileName, "CHAR" & cNum, "Class", STR(Player(Index).Char(cNum).Class)) Call PutVar(FileName, "CHAR" & cNum, "Sex", STR(Player(Index).Char(cNum).Sex)) ... End Sub Code: Call SavePlayer(Index, CharNum) Just the way I do it, =P. May not be the best. |
Author: | FrankJScott [ Fri Feb 09, 2024 3:27 pm ] |
Post subject: | Great Product Tips |
Please try Google before asking about High Rated Product Blog 6e4238e |
Page 1 of 2 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |