cmdoffline.cpp
上传用户:garry_shen
上传日期:2015-04-15
资源大小:45647k
文件大小:15k
- #include "stdafx.h"
- #include "XmudOS.h"
- #include "MainWnd.h"
- #include "CmdPlayerLogon.h"
- #include "CommandCheck.h"
- #include "mapMapInfo.h"
- #include "skillskillSkill.h"
- #include "wgscommon.h"
- // Nuke +1
- #include "hash.h"
- // Spock start
- #include "Fight.h"
- extern CList <CFight*,CFight*>fightlist;
- extern CList <CFight*,CFight*>killlist;
- // Spock end
- extern char g_tszPathName[256];
- extern rmfullglobals myglobs;
- extern CList <CBaseMap*,CBaseMap*>maplist;
- extern CList <TChatChannel*,TChatChannel*>chatchannellist;
- extern CList <TDataUser*,TDataUser*>userlist;
- extern int g_iActiveClientNum;
- // Spock start
- int CCmdPlayerLogon::SavePlayerData(CPlayerInfo *lpPlayerInfo)
- {
- CString strtmp, sResultMsg, szTemp;
- char szPath[256], szFileName[256];
- int i,j,rn;
- TObjectSkill* lpPlayerSkill;
- CGoods* lpPlayerEquip;
- BOOL bFindHead = FALSE;
- char itmpString[20];
- CString sign = CString(""");
- CString parm = CString(" ");
- //POSITION pos;
- // Check start
- if (lpPlayerInfo == NULL) {
- AddRecordMsg("NULL player data in SavePlayerData");
- return -4000;
- }
- if (strcmp(lpPlayerInfo->szCheck, SZAOBJCHECK)) {
- AddRecordMsg("Bad player data in SavePlayerData");
- return -5000;
- }
- // Check end
- //ANDY_ADD REPUT ITEM
- POSITION pos,RunPos,lastpos;
- CGoods *lpCheckGoods = NULL;
- CGoods *lpReGoods = NULL;
- //lpPlayerInfo = (CPlayerInfo*)lpClientConData->pvPlayer;
- pos = lpPlayerInfo->listequip.GetHeadPosition();
- RunPos = pos;
- while( RunPos != NULL) {
- lpReGoods = lpPlayerInfo->listequip.GetNext( RunPos);
- pos = RunPos;
- while( pos != NULL) {
- lastpos = pos;
- lpCheckGoods = lpPlayerInfo->listequip.GetNext( pos);
- if( !strcmp(lpCheckGoods->lpGoods->szEName, lpReGoods->lpGoods->szEName)) {
- lpReGoods->nCount += lpCheckGoods->nCount;
- lpPlayerInfo->listequip.RemoveAt( lastpos);
- pos = lpPlayerInfo->listequip.GetHeadPosition();
- RunPos = pos;
- break;
- }
- }
- }
- //END
- //纗