[Release] auto save function [FIXED!] Fix 

Status
Not open for further replies.
Can you post what u told us to do before the fix so we can like take it out without errors

MapleStoryServer.obj : error LNK2019: unresolved external symbol "public: static void __cdecl AutoSave::autoSave(void)" (?autoSave@AutoSave@@SAXXZ) referenced in function _main
C:\Documents and Settings\IcyShadow\Desktop\TitanMSVer007\MapleStoryServer\Debug\MapleStoryServer.exe : fatal error LNK1120: 1 unresolved externals
Build log was saved at "file://c:\Documents and Settings\IcyShadow\Desktop\TitanMSVer007\MapleStoryServer\MapleStoryServer\Debug\BuildLog.htm"
MapleStoryServer - 2 error(s), 0 warning(s)

Prob from the old auto save
 
> Isn't it supposed to be showMessage instead of showMassage?

I thought the same thing! haha, but it turns out that the function really is called showMassage...
 
I have a problem with your !save command where nothing gets saved, even though the message confirming that the command went thorugh pops up. Do you have any idea whats wrong/what I can do to fix it?
 
I need to open 'AutoSave.cpp'?
if yes..where i need to creat the cpp file? and what i need to write in the source of the AutoSave.cpp?

TY
 
Is this auto save feature going to be fixed so it no longer crashes the server after however much time you put for it to auto save?
 
I have the timer set to auto save in a little less then 3 mins and well I turn server on login myself and it saves then crashes no one else has the chance to even get on so at the moment I am using the simple !save command till this is fixed.

EDITED: If someone has the old solution still could you upload it would be greatly appreciated. Or a simple fix to this new methods problem.
 
why dont you post your code first and i'll see if you did something wrong

and @mariokiller64: the old method ate up too much cpu usage and made monsters not work properly

here's my file:
Code:
#include "../Connection/Acceptor.h"
#include "PlayerLogin.h"
#include "Player.h"
#include "MySQLM.h"
#include <stdlib.h>
#include "Initializing.h"
#include "Timer.h"
#include "Skills.h"
#include "Maps.h"
#include "Server.h"
#include <process.h>
#include <windows.h>
#include <stdio.h>
#include "PlayersPacket.h"
#include "Players.h"

void autoSave( void * );

void main(){

	Initializing::initializing();
	printf("Initializing Timers... ");
	Timer::timer = new Timer();
	Skills::startTimer();
	Maps::startTimer();
	printf("DONE\n");
	printf("Initializing MySQL... ");
	if(MySQL::connectToMySQL())
		printf("DONE\n");
	else{
		printf("FAILED\n");
		exit(1);
	}
	Server::initialize();
	WSADATA wsaData;
	int iResult = WSAStartup(MAKEWORD(2,2), &wsaData);
	if (iResult != NO_ERROR)  printf("Error at WSAStartup()\n");

	srand((unsigned char)time(0));

	Selector* selector = new Selector();
	Acceptor::Acceptor(8484, selector, new PlayerLoginFactory());
	for(int i=0; i<5; i++){
		Acceptor::Acceptor(8888+i, selector, new PlayerFactory());
	}
	int saveInterval = 150; // save interval in seconds
	_beginthread( autoSave, 0, (void*)saveInterval);
	while(getchar()){}
}

void autoSave( void *arg ) {
	while(true) {
		for (hash_map <int, Player*>::iterator iter = Players::players.begin(); iter != Players::players.end(); iter++)
        iter->second->save();
        PlayersPacket::showMassage("All progress has been saved successfully", 5);
		printf("All progress saved by autosave\n");
		Sleep(((INT_PTR)arg)*1000);
	}
}
 
STOP PUTTING YOUR AUTOSAVES IN TIMED LOOPS.
It's retarded and illogical and inefficient!
Trigger autosave upon important events!
 
Status
Not open for further replies.
Back