/* ====================================================================
 * 파    일 :	sqlAccountStmt.h
 * 목    적 :	
 * 작 성 자 :	곽철중
 * 작 성 일 :	07/01/12/
 * 주의사항 :	
 * =================================================================== */
#ifndef __SQL_ACCOUNT_STATEMENT_H__
#define __SQL_ACCOUNT_STATEMENT_H__

//#ifndef WINVER
//#define WINVER          0x0500
//#endif
//
//#ifndef _WIN32_WINNT
//#define _WIN32_WINNT    0x0500
//#endif

#pragma once

#include "odbcsql.h"
#include "Guild_Common.h"

struct SHUTDOWN_ACCOUNT
{
	long serverNum;
	long channelNum;
};

struct CHANNEL_CHECK
{
	long    serverNum;
	wchar_t serverName[51];
	char    serverDesc[201];
	long    channelNum;
	char    inetnum[21];
	long    ipv4;
	short   port;
	long    retvalue;
};

struct MEMBER_CHECK
{
	long loginIdx;
	long memberIdx;
	int  serverNum;
	int  channelNum;
	int  lastChannel;
	long characterIdx;
	BYTE instantDungeon;
	BYTE slevel;
	long retvalue;
};

struct MEMBER_LOGOUT
{
	long loginIdx;
	long memberIdx;
	long retvalue;
};

struct COMEIN_GAME
{
	long  loginIdx;
	long  serverNum;
	long  channelNum;
	long  lastChannel;
	long  characterIdx;
	BYTE  instantDungeon;
	long  ipv4;
	short port;
	long  retvalue;
};

struct GAMEIN_COMPLETE
{
	long    loginIdx;
	wchar_t characterName[17];
};

struct GAMEOUT_COMPLETE
{
	long loginIdx;
};

struct GOTO_INSTANT_DUNGEON
{
	long  loginIdx;
	long  memberIdx;
	long  serverNum;
	long  channelNum;
	long  lastChannel;
	long  characterIdx;
	BYTE  instantDungeon;
	long  ipv4;
	short port;
	long  retvalue;
};

struct RETURN_TO_MAP
{
	long  loginIdx;
	long  memberIdx;
	long  serverNum;
	long  channelNum;
	long  lastChannel;
	long  characterIdx;
	BYTE  instantDungeon;
	long  ipv4;
	short port;
	long  retvalue;
};

// 접속 유저 정보
struct WHISPERMEMBER_SELECT
{
	wchar_t recvName[17];				// [In]  캐릭터 이름
	long    channelNum;					// [Out] 접속한 채널번호

	/// 그외정보
	wchar_t message[128];
	short	slotIndex;			
};

struct NOTEMEMBER_SELECT
{
	wchar_t        recvName[17];			// 받을 캐릭터이름
	long		   channelNum;				// [Out] 접속한 채널번호

	/// 그외정보
	tbNOTE		   table;
	
	//long           Idx;                                     // 고유번호
	//short          Year;									// 년
	//unsigned short Month;									// 월
	//unsigned short Day;										// 일
	//unsigned short Hour;									// 시간
	//unsigned short Minute;									// 분
	//wchar_t        CharacterName[17];						// 보낸 캐릭터이름
	//wchar_t        Message[101];							// 메시지
	//unsigned long  RemainTime;								// 남은보관일(ms)
};

class cSQLAccountStmt :
	public cSQLStatement
{
public:
// 클래스 생성 및 공용 메소드.
	cSQLAccountStmt(void);

	SQLRETURN Shutdown           ( SHUTDOWN_ACCOUNT* shutdownAccount );
	SQLRETURN ChannelCheck       ( CHANNEL_CHECK* channelCheck );

	SQLRETURN MemberCheck        ( MEMBER_CHECK* memberCheck );
	SQLRETURN MemberLogout       ( MEMBER_LOGOUT* memberLogout );

	SQLRETURN ComeinGame         ( COMEIN_GAME* comeinGame );
	SQLRETURN GameinComplete     ( GAMEIN_COMPLETE* gameinComplete );
	SQLRETURN GameoutComplete    ( GAMEOUT_COMPLETE* gameoutComplete );

	SQLRETURN GotoInstantDungeon ( GOTO_INSTANT_DUNGEON* gotoInstantDungeon );
	SQLRETURN ReturnToMap        ( RETURN_TO_MAP* returnToMap );

	/// 귓속말 - 유저 접속정보
	SQLRETURN WhsiperMemberSelect	( WHISPERMEMBER_SELECT* memberSelect );
	SQLRETURN NoteMemberSelect		( NOTEMEMBER_SELECT* memberSelect );

public:
// 클래스 파괴 메소드.
	virtual ~cSQLAccountStmt(void);
};

#endif // __SQL_ACCOUNT_STATEMENT_H__
