Print Page | Close Window

SavePlayers faster

Printed From: Mirage Source
Category: Tutorials
Forum Name: Approved Tutorials
Forum Discription: All tutorials shown to actually work with MSE are moved here.
URL: http://ms.shannaracorp.com/backup-forums/forum_posts.asp?TID=41
Printed Date: 20 December 2006 at 6:01pm
Software Version: Web Wiz Forums 8.01 - http://www.webwizforums.com


Topic: SavePlayers faster
Posted By: Sync
Subject: SavePlayers faster
Date Posted: 07 February 2006 at 6:02pm
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:
    For I = 1 To MAX_CHARS

with:
    For I = 1 To MAX_CHARS
        If Player(Index).CharNum = I Then


and replace:
Next I

with:
        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.



Replies:
Posted By: Sync
Date Posted: 07 February 2006 at 6:02pm
Approved



Posted By: Lord Dekon
Date Posted: 07 February 2006 at 6:03pm
Nice, I think most people could use it because its pretty cool!!! congrats


Posted By: robputt796
Date Posted: 11 February 2006 at 10:54am
WOW just tested this, it really speeds accound creation! Me likey very much.


Posted By: Sonire
Date Posted: 12 February 2006 at 10:08am
I've got a question

Doesn't this:
Code:
For I = 1 To MAX_CHARS


Need to be
Code:
For I = 0 To MAX_CHARS


Doesn't your character list start at 0 and end at 2? Thus, it wont save if it's your first character in the list?


-------------
I grant permission for anyone to alter a tutorial previously posted by me for use in a tutorial submission for MSE, so long as "Originally Coded By Sonire" is credited at the top of the tutorial.


Posted By: Dragoons Master
Date Posted: 12 February 2006 at 1:25pm
No. Actualy is realy from 1 to maxchars. The array is 1 to maxchars.


Posted By: xheadhunter
Date Posted: 22 February 2006 at 10:15pm
You could just make a new char assuming that the 1st is 0 then there will be no problems. even if it starts at 1 well 1 char slot less isnt gonna do much.


Posted By: Belier13
Date Posted: 04 March 2006 at 10:41am

You need to change some part in sub ErasePlayer, by making Player(index).charnum = Char# to delete

 else it will try to save Char = 0 ( aka none logged ) and wont delete it




Print Page | Close Window

Bulletin Board Software by Web Wiz Forums version 8.01 - http://www.webwizforums.com
Copyright ©2001-2006 Web Wiz Guide - http://www.webwizguide.info