ilk commit

This commit is contained in:
Levent FERRAH 2025-08-19 15:55:41 +03:00
parent 385548afa6
commit bcbb5db79f
629 changed files with 141341 additions and 0 deletions

188
server/AIServer/AIUser.cpp Normal file
View File

@ -0,0 +1,188 @@
#include "stdafx.h"
#include "User.h"
#include "Region.h"
#include "GameSocket.h"
#include "Npc.h"
#include "MAP.h"
#define MORAL_GOOD 0x01
#define MORAL_BAD 0x02
#define MORAL_NEUTRAL 0x03
static float surround_fx[8] = {0.0f, -0.7071f, -1.0f, -0.7083f, 0.0f, 0.7059f, 1.0000f, 0.7083f};
static float surround_fz[8] = {1.0f, 0.7071f, 0.0f, -0.7059f, -1.0f, -0.7083f, -0.0017f, 0.7059f};
CUser::CUser() : Unit(UnitPlayer) {}
CUser::~CUser() { }
void CUser::Initialize()
{
Unit::Initialize();
m_iUserId = -1;
m_bLive = AI_USER_DEAD;
m_sHP = m_sMP = 0;
m_sMaxHP = m_sMaxMP = 0;
m_state = 0;
m_sItemAc = 0;
m_byNowParty = 0;
m_sPartyTotalLevel = 0;
m_byPartyTotalMan = 0;
m_sPartyNumber = -1;
m_byIsOP = 0;
m_transformationType = TransformationNone;
m_bInvisibilityType = 0;
m_tLastRegeneTime = 0;
m_bMaxWeightAmount = 100;
m_FlashExpBonus = 0;
m_FlashDcBonus = 0;
m_FlashWarBonus = 0;
m_sExpGainAmount = m_bNPGainAmount = m_bNoahGainAmount = 100;
m_bPlayerAttackAmount = 100;
m_bSkillNPBonus = 0;
m_bAddWeaponDamage = 0;
m_sAddArmourAc = 0;
m_bPctArmourAc = 100;
m_bPremiumMerchant = false;
InitNpcAttack();
}
void CUser::OnDeath(Unit * pAttacker)
{
if (m_bLive == AI_USER_DEAD)
return;
m_sHP = 0;
m_bLive = AI_USER_DEAD;
InitNpcAttack();
MAP* pMap = GetMap();
if (pMap == nullptr)
return;
pMap->RegionUserRemove(m_sRegionX, m_sRegionZ, GetID());
}
void CUser::InitNpcAttack()
{
memset(&m_sSurroundNpcNumber, -1, sizeof(m_sSurroundNpcNumber));
}
int CUser::IsSurroundCheck(float fX, float fY, float fZ, int NpcID)
{
int nDir = 0;
__Vector3 vNpc, vUser, vDis;
vNpc.Set(fX, fY, fZ);
float fDX, fDZ;
float fDis = 0.0f, fCurDis=1000.0f;
bool bFlag = false;
for(int i=0; i<8; i++)
{
//if(m_sSurroundNpcNumber[i] != -1) continue;
if(m_sSurroundNpcNumber[i] == NpcID)
{
if (bFlag)
m_sSurroundNpcNumber[i] = -1;
else
{
m_sSurroundNpcNumber[i] = NpcID;
nDir = i+1;
bFlag = true;
}
//return nDir;
}
if(m_sSurroundNpcNumber[i] == -1 && bFlag==false)
{
fDX = GetX() + surround_fx[i];
fDZ = GetZ() + surround_fz[i];
vUser.Set(fDX, 0.0f, fDZ);
vDis = vUser - vNpc;
fDis = vDis.Magnitude();
if(fDis < fCurDis)
{
nDir = i+1;
fCurDis = fDis;
}
}
}
/* TRACE("User-Sur : [0=%d,1=%d,2=%d,3=%d,4=%d,5=%d,6=%d,7=%d]\n", m_sSurroundNpcNumber[0],
m_sSurroundNpcNumber[1], m_sSurroundNpcNumber[2], m_sSurroundNpcNumber[3], m_sSurroundNpcNumber[4],
m_sSurroundNpcNumber[5],m_sSurroundNpcNumber[6], m_sSurroundNpcNumber[7]);
*/
if(nDir != 0)
{
m_sSurroundNpcNumber[nDir-1] = NpcID;
}
return nDir;
}
void CUser::HealMagic()
{
int region_x = (int)(GetX() / VIEW_DIST);
int region_z = (int)(GetZ() / VIEW_DIST);
MAP* pMap = GetMap();
if (pMap == nullptr) return;
int min_x = region_x - 1; if(min_x < 0) min_x = 0;
int min_z = region_z - 1; if(min_z < 0) min_z = 0;
int max_x = region_x + 1; if(max_x > pMap->GetXRegionMax()) max_x = pMap->GetXRegionMax();
int max_z = region_z + 1; if(min_z > pMap->GetZRegionMax()) min_z = pMap->GetZRegionMax();
int search_x = max_x - min_x + 1;
int search_z = max_z - min_z + 1;
int i, j;
for(i = 0; i < search_x; i++)
{
for(j = 0; j < search_z; j++)
{
HealAreaCheck( min_x+i, min_z+j );
}
}
}
void CUser::HealAreaCheck(int rx, int rz)
{
MAP* pMap = GetMap();
if (pMap == nullptr) return;
if (rx < 0 || rz < 0 || rx > pMap->GetXRegionMax() || rz > pMap->GetZRegionMax())
{
//TRACE("#### CUser-HealAreaCheck() Fail : [nid=%d, name=%s], nRX=%d, nRZ=%d #####\n", GetID(), GetName().c_str(), rx, rz);
return;
}
static const float fRadius = 30.0f; // 30m
Guard lock(pMap->m_lock);
CRegion *pRegion = &pMap->m_ppRegion[rx][rz];
if (pRegion == nullptr || (pRegion && pRegion->m_RegionNpcArray.GetSize() <= 0))
return;
foreach_stlmap (itr, pRegion->m_RegionNpcArray)
{
CNpc * pNpc = g_pMain->GetNpcPtr(itr->first);
if (pNpc == nullptr)
continue;
if(pNpc->isDead() || !pNpc->isHostileTo(this))
continue;
if (pNpc->isInRangeSlow(this, fRadius))
{
pNpc->ChangeTarget(1004, this);
break;
}
}
}

View File

@ -0,0 +1,53 @@
f:\005server\aıserver\debug\vcpkg.applocal.log
f:\005server\aıserver\debug\server.pch
f:\005server\aıserver\debug\vc142.pdb
f:\005server\aıserver\debug\vc142.ıdb
f:\005server\aıserver\debug\stdafx.obj
f:\005server\aıserver\debug\magıcprocess.obj
f:\005server\aıserver\debug\unıt.obj
f:\005server\aıserver\debug\gamesocket.obj
f:\005server\aıserver\debug\maın.obj
f:\005server\aıserver\debug\map.obj
f:\005server\aıserver\debug\npc.obj
f:\005server\aıserver\debug\npcmagıcprocess.obj
f:\005server\aıserver\debug\npcthread.obj
f:\005server\aıserver\debug\party.obj
f:\005server\aıserver\debug\pathfınd.obj
f:\005server\aıserver\debug\roomevent.obj
f:\005server\aıserver\debug\aıuser.obj
f:\005server\aıserver\debug\serverdlg.obj
f:\005server\aıserver\debug\n3shapemgr.obj
f:\bın\debug\aıserver.ılk
f:\bın\debug\aıserver.exe
f:\005server\aıserver\debug\server.map
f:\bın\debug\aıserver.pdb
f:\005server\aıserver\debug\aıserver.res
f:\005server\server source\aıserver\debug\aıuser.obj
f:\005server\server source\aıserver\debug\gamesocket.obj
f:\005server\server source\aıserver\debug\magicprocess.obj
f:\005server\server source\aıserver\debug\main.obj
f:\005server\server source\aıserver\debug\map.obj
f:\005server\server source\aıserver\debug\n3shapemgr.obj
f:\005server\server source\aıserver\debug\npc.obj
f:\005server\server source\aıserver\debug\npcmagicprocess.obj
f:\005server\server source\aıserver\debug\npcthread.obj
f:\005server\server source\aıserver\debug\party.obj
f:\005server\server source\aıserver\debug\pathfind.obj
f:\005server\server source\aıserver\debug\roomevent.obj
f:\005server\server source\aıserver\debug\serverdlg.obj
f:\005server\server source\aıserver\debug\stdafx.obj
f:\005server\server source\aıserver\debug\unit.obj
f:\005server\server source\aıserver\debug\aıserver.res
f:\005server\server source\aıserver\debug\server.pch
f:\005server\server source\aıserver\debug\vc142.idb
f:\005server\server source\aıserver\debug\vc142.pdb
f:\005server\server source\aıserver\debug\aıserver.tlog\aıserver.write.1u.tlog
f:\005server\server source\aıserver\debug\aıserver.tlog\cl.command.1.tlog
f:\005server\server source\aıserver\debug\aıserver.tlog\cl.read.1.tlog
f:\005server\server source\aıserver\debug\aıserver.tlog\cl.write.1.tlog
f:\005server\server source\aıserver\debug\aıserver.tlog\link.command.1.tlog
f:\005server\server source\aıserver\debug\aıserver.tlog\link.read.1.tlog
f:\005server\server source\aıserver\debug\aıserver.tlog\link.write.1.tlog
f:\005server\server source\aıserver\debug\aıserver.tlog\rc.command.1.tlog
f:\005server\server source\aıserver\debug\aıserver.tlog\rc.read.1.tlog
f:\005server\server source\aıserver\debug\aıserver.tlog\rc.write.1.tlog

Binary file not shown.

View File

@ -0,0 +1,2 @@
#TargetFrameworkVersion=v4.0:PlatformToolSet=v142:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.17763.0
Debug|Win32|F:\005SERVER\server source\|

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,8 @@
 cl : Command line warning D9035 : option 'Gm' has been deprecated and will be removed in a future release
ServerDlg.cpp
F:\005SERVER\server source\AIServer\ServerDlg.cpp(344,45): warning C4267: '=': conversion from 'size_t' to 'short', possible loss of data
F:\005SERVER\server source\AIServer\ServerDlg.cpp(857,67): warning C4244: 'argument': conversion from 'float' to 'int32', possible loss of data
F:\005SERVER\server source\AIServer\ServerDlg.cpp(857,46): warning C4244: 'argument': conversion from 'float' to 'int32', possible loss of data
F:\005SERVER\server source\AIServer\ServerDlg.cpp(863,67): warning C4244: 'argument': conversion from 'float' to 'int32', possible loss of data
F:\005SERVER\server source\AIServer\ServerDlg.cpp(863,46): warning C4244: 'argument': conversion from 'float' to 'int32', possible loss of data
proj-AIServer.vcxproj -> F:\005SERVER\server source\..\bin\Debug\AIServer.exe

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@


105
server/AIServer/Define.h Normal file
View File

@ -0,0 +1,105 @@
#pragma once
//
// Defines About Communication
//
#define MAX_SOCKET 100
#define MAX_PATH_LINE 100
#define MAX_NPC_SIZE 30
#define MAX_WEAPON_NAME_SIZE 40
#define VIEW_DIST 48 // 가시거리
#define MAX_UPGRADE_WEAPON 12
//enum MOVE_SPEED {SPEED_SLOW=0, SPEED_NORMAL, SPEED_FAST};
//enum USER_TYPE {TYPE_USER=0, TYPE_MONSTER, TYPE_NPC, TYPE_DOOR, TYPE_GUARD};
// Npc InOut
#define NPC_IN 0X01
#define NPC_OUT 0X02
#define TILE_SIZE 4
#define CELL_SIZE 4
#define COMPARE(x,min,max) ((x>=min)&&(x<max))
struct _NpcPosition
{
typedef struct { long x; long y; } Point;
uint8 byType; // type
uint8 bySpeed; // speed
Point pPoint; // position
float fXPos;
float fZPos;
};
//
// About USER
//
#define AI_USER_DEAD 0X00
#define AI_USER_LIVE 0X01
//
// About NPC
//
#define NPC_NUM 20
#define MAX_DUNGEON_BOSS_MONSTER 20
#define NPC_PASSIVE 150
#define NPC_MAX_MOVE_RANGE 100
//
// About Map Object
//
#define USER_BAND 0 // Map 위에 유저가 있다.
#define NPC_BAND 10000 // Map 위에 NPC(몹포함)가 있다.
#define INVALID_BAND 30000 // 잘못된 ID BAND
//
// Item
//
#define TYPE_MONEY 0
#define TYPE_ITEM 1
////////////////////////////////////////////////////////////
// Durability Type
#define ATTACK 0x01
#define DEFENCE 0x02
////////////////////////////////////////////////////////////
#define GREAT_SUCCESS 0X01 // 대성공
#define SUCCESS 0X02 // 성공
#define NORMAL 0X03 // 보통
#define FAIL 0X04 // 실패
#define DIR_DOWN 0 // 각 보고있는 방향을 정의한다.
#define DIR_DOWNLEFT 1
#define DIR_LEFT 2
#define DIR_UPLEFT 3
#define DIR_UP 4
#define DIR_UPRIGHT 5
#define DIR_RIGHT 6
#define DIR_DOWNRIGHT 7
////////////////////////////////////////////////////////////
// Npc Type
// Monster는 0부터 시작 10까지의 타입
#define NPCTYPE_MONSTER 0 // monster
// Attack Type
#define DIRECT_ATTACK 0
#define LONG_ATTACK 1
#define MAGIC_ATTACK 2
#define DURATION_ATTACK 3
#define NORMAL_OBJECT 0
#define SPECIAL_OBJECT 1
// Battlezone Announcement
#define BATTLEZONE_OPEN 0x00
#define BATTLEZONE_CLOSE 0x01
#define DECLARE_WINNER 0x02
const int TYPE_MONEY_SID = 900000000;

55
server/AIServer/Extern.h Normal file
View File

@ -0,0 +1,55 @@
#pragma once
extern bool g_bNpcExit;
struct _MAKE_WEAPON
{
uint8 byIndex;
uint16 sClass[MAX_UPGRADE_WEAPON];
_MAKE_WEAPON() { memset(&sClass, 0, sizeof(sClass)); }
};
struct _MAKE_ITEM_GRADE_CODE
{
uint8 byItemIndex; // item grade
uint16 sGrade[9];
};
struct _MAKE_ITEM_LARE_CODE
{
uint8 byItemLevel;
uint16 sLareItem;
uint16 sMagicItem;
uint16 sGeneralItem;
};
struct _K_MONSTER_ITEM
{
uint16 sIndex;
uint32 iItem[5];
uint16 sPercent[5];
_K_MONSTER_ITEM()
{
memset(&iItem, 0, sizeof(iItem));
memset(&sPercent, 0, sizeof(sPercent));
}
};
struct _MAKE_ITEM_GROUP
{
uint32 iItemGroupNum;
std::vector<uint32> iItems;
};
struct _NPC_LIVE_TIME
{
uint16 nIndex;
int16 SocketID;
uint16 Nid;
uint16 Duration;
int32 SpawnedTime;
};
#include "../shared/database/structs.h"

View File

@ -0,0 +1,643 @@
#include "stdafx.h"
#include "GameSocket.h"
#include "User.h"
#include "MAP.h"
#include "Region.h"
#include "../shared/globals.h"
#include "../GameServer/MagicProcess.h"
#include "Npc.h"
CGameSocket::~CGameSocket() {}
void CGameSocket::OnConnect()
{
KOSocket::OnConnect();
Initialize();
}
void CGameSocket::Initialize()
{
m_Party.Initialize();
}
void CGameSocket::OnDisconnect()
{
TRACE("*** CloseProcess - socketID=%d ... server=%s *** \n", GetSocketID(), GetRemoteIP().c_str());
g_pMain->DeleteAllUserList(this);
}
bool CGameSocket::HandlePacket(Packet & pkt)
{
switch (pkt.GetOpcode())
{
case AI_SERVER_CONNECT:
RecvServerConnect(pkt);
break;
case AG_USER_INFO:
RecvUserInfo(pkt);
break;
case AG_USER_INOUT:
RecvUserInOut(pkt);
break;
case AG_USER_MOVE:
RecvUserMove(pkt);
break;
case AG_USER_LOG_OUT:
RecvUserLogOut(pkt);
break;
case AG_USER_REGENE:
RecvUserRegene(pkt);
break;
case AG_USER_SET_HP:
RecvUserSetHP(pkt);
break;
case AG_NPC_HP_CHANGE:
RecvNpcHpChange(pkt);
break;
case AG_USER_UPDATE:
RecvUserUpdate(pkt);
break;
case AG_ZONE_CHANGE:
RecvZoneChange(pkt);
break;
case AG_USER_PARTY:
m_Party.PartyProcess(pkt);
break;
case AG_USER_INFO_ALL:
RecvUserInfoAllData(pkt);
break;
case AG_PARTY_INFO_ALL:
RecvPartyInfoAllData(pkt);
break;
case AG_HEAL_MAGIC:
RecvHealMagic(pkt);
break;
case AG_TIME_WEATHER:
RecvTimeAndWeather(pkt);
break;
case AG_BATTLE_EVENT:
RecvBattleEvent(pkt);
break;
case AG_NPC_GATE_OPEN:
RecvGateOpen(pkt);
break;
case AG_USER_VISIBILITY:
RecvUserVisibility(pkt);
break;
case AG_NPC_SPAWN_REQ:
RecvNpcSpawnRequest(pkt);
break;
case AG_NPC_KILL_REQ:
RecvNpcKillRequest(pkt);
break;
case AG_MAGIC_ATTACK_REQ:
CMagicProcess::MagicPacket(pkt);
break;
case AG_NPC_UPDATE:
RecvNpcUpdate(pkt);
break;
case MOVE_RESULT:
RecvNpcMoveResult(pkt);
break;
case AG_USER_EVENTROOM:
uint16 uRoomEvent;
uint16 uid;
pkt >> uid >> uRoomEvent;
g_pMain->UserEventRoomUpdate(uid,uRoomEvent);
break;
case AG_CSW_OP_CL:
bool Status;
pkt >> Status;
g_pMain->CSWOpen = Status;
break;
case AG_USER_TRANS_CHANGE:
RecvUserTransform(pkt);
break;
case AG_CHAOS_CUBE:
uint16 nid;
pkt >> nid;
CNpc* pNpc = g_pMain->GetNpcPtr(nid);
if (pNpc != nullptr)
pNpc->ChaosCubeControl();
break;
}
return true;
}
void CGameSocket::RecvNpcMoveResult(Packet & pkt)
{
uint8 flag; // 01(INFO_MODIFY), 02(INFO_DELETE)
uint16 sNid;
float fX, fY, fZ, fSecForMetor;
pkt >> flag >> sNid >> fX >> fZ >> fY >> fSecForMetor;
CNpc * pNpc = g_pMain->GetNpcPtr(sNid);
if (pNpc == nullptr)
return;
pNpc->RegisterRegion(fX, fZ);
}
void CGameSocket::RecvServerConnect(Packet & pkt)
{
uint8 byReconnect = pkt.read<uint8>();
printf("Game Server connected - %s\n", GetRemoteIP().c_str());
Packet result(AI_SERVER_CONNECT, byReconnect);
Send(&result);
if (byReconnect == 1)
printf("**** ReConnect - server=%s, socket = %d ****\n ", GetRemoteIP().c_str(), GetSocketID());
else
printf("**** Connect - server=%s, socket = %d ****\n ", GetRemoteIP().c_str(), GetSocketID());
g_pMain->m_bFirstServerFlag = true;
g_pMain->AllNpcInfo();
}
void CGameSocket::RecvUserInfo(Packet & pkt)
{
CUser *pUser = new CUser();
pUser->Initialize();
pkt >> pUser->m_iUserId;
ReadUserInfo(pkt, pUser);
if (pUser->GetName().empty() || pUser->GetName().length() > MAX_ID_SIZE)
{
delete pUser;
return;
}
pUser->m_pMap = g_pMain->GetZoneByID(pUser->m_bZone);
pUser->m_bLive = AI_USER_LIVE;
TRACE("**** RecvUserInfo()---> uid = %d, name=%s ******\n",
pUser->GetID(), pUser->GetName().c_str());
if (!g_pMain->SetUserPtr(pUser->GetID(), pUser))
delete pUser;
}
void CGameSocket::ReadUserInfo(Packet & pkt, CUser * pUser)
{
uint32 equippedItems = 0;
pkt.SByte();
pkt >> pUser->m_strUserID >> pUser->m_bZone >> pUser->m_bNation
>> pUser->m_bLevel >> pUser->m_sHP >> pUser->m_sMP
>> pUser->m_sTotalHit >> pUser->m_bAttackAmount
>> pUser->m_sTotalAc >> pUser->m_sACAmount
>> pUser->m_fTotalHitrate >> pUser->m_fTotalEvasionrate
>> pUser->m_sItemAc
>> pUser->m_sPartyNumber
>> pUser->m_byIsOP >> pUser->m_bInvisibilityType
>> equippedItems;
if (pUser->m_sPartyNumber != -1)
pUser->m_byNowParty = 1;
Guard lock(pUser->_unitlock);
pUser->m_equippedItemBonuses.clear();
for (uint32 i = 0; i < equippedItems; i++)
{
uint8 bSlot; uint32 bonusCount;
Unit::ItemBonusMap bonusMap;
pkt >> bSlot >> bonusCount;
for (uint32 x = 0; x < bonusCount; x++)
{
uint8 bType; int16 sAmount;
pkt >> bType >> sAmount;
bonusMap.insert(std::make_pair(bType, sAmount));
}
pUser->m_equippedItemBonuses[bSlot] = bonusMap;
}
}
void CGameSocket::RecvUserInOut(Packet & pkt)
{
std::string strUserID;
uint8 bType;
uint16 uid;
float fX, fZ;
pkt.SByte();
pkt >> bType >> uid >> strUserID >> fX >> fZ;
if (fX < 0 || fZ < 0)
{
TRACE("Error:: RecvUserInOut(),, uid = %d, fX=%.2f, fZ=%.2f\n", uid, fX, fZ);
return;
}
int region_x = 0, region_z=0;
int x1 = (int)fX / TILE_SIZE;
int z1 = (int)fZ / TILE_SIZE;
region_x = (int)fX / VIEW_DIST;
region_z = (int)fZ / VIEW_DIST;
MAP* pMap = nullptr;
CUser* pUser = g_pMain->GetUserPtr(uid);
if (pUser == nullptr)
return;
pMap = pUser->GetMap();
if (pMap == nullptr)
{
TRACE("#### Fail : pMap == nullptr ####\n");
return;
}
if (x1 < 0 || z1 < 0 || x1 >= pMap->GetMapSize() || z1 >= pMap->GetMapSize())
{
TRACE("#### RecvUserInOut Fail : [name=%s], x1=%d, z1=%d #####\n", pUser->GetName().c_str(), region_x, region_z);
return;
}
//if (pMap->m_pMap[x1][z1].m_sEvent == 0) return;
if (region_x > pMap->GetXRegionMax() || region_z > pMap->GetZRegionMax())
{
TRACE("#### GameSocket-RecvUserInOut() Fail : [name=%s], nRX=%d, nRZ=%d #####\n", pUser->GetName().c_str(), region_x, region_z);
return;
}
pUser->m_curx = pUser->m_fWill_x = fX;
pUser->m_curz = pUser->m_fWill_z = fZ;
// leaving a region
if (bType == 2)
{
pMap->RegionUserRemove(region_x, region_z, uid);
}
// entering a region
else if (pUser->m_sRegionX != region_x || pUser->m_sRegionZ != region_z)
{
pUser->m_sRegionX = region_x;
pUser->m_sRegionZ = region_z;
pMap->RegionUserAdd(region_x, region_z, uid);
}
}
void CGameSocket::RecvUserMove(Packet & pkt)
{
uint16 uid, speed;
float fX, fZ, fY;
pkt >> uid >> fX >> fZ >> fY >> speed;
SetUid(fX, fZ, uid, speed);
}
bool CGameSocket::SetUid(float x, float z, int id, int speed)
{
int x1 = (int)x / TILE_SIZE;
int z1 = (int)z / TILE_SIZE;
int nRX = (int)x / VIEW_DIST;
int nRZ = (int)z / VIEW_DIST;
CUser* pUser = g_pMain->GetUserPtr(id);
if(pUser == nullptr)
{
TRACE("#### Userµî·Ï ½ÇÆÐ sid = %d ####\n", id);
return false;
}
MAP* pMap = pUser->GetMap();
if (pMap == nullptr)
{
TRACE("#### User not in valid zone, sid = %d ####\n", id);
return false;
}
if(x1 < 0 || z1 < 0 || x1 >= pMap->GetMapSize() || z1 >= pMap->GetMapSize())
{
TRACE("#### GameSocket ,, SetUid Fail : [nid=%d, name=%s], x1=%d, z1=%d #####\n", id, pUser->GetName().c_str(), x1, z1);
return false;
}
if(nRX > pMap->GetXRegionMax() || nRZ > pMap->GetZRegionMax())
{
TRACE("#### GameSocket , SetUid Fail : [nid=%d, name=%s], nRX=%d, nRZ=%d #####\n", id, pUser->GetName().c_str(), nRX, nRZ);
return false;
}
// if(pMap->m_pMap[x1][z1].m_sEvent == 0) return false;
if (pUser != nullptr)
{
if (pUser->isDead())
return false;
///// attack ~
if( speed != 0 ) {
pUser->m_curx = pUser->m_fWill_x;
pUser->m_curz = pUser->m_fWill_z;
pUser->m_fWill_x = x;
pUser->m_fWill_z = z;
}
else {
pUser->m_curx = pUser->m_fWill_x = x;
pUser->m_curz = pUser->m_fWill_z = z;
}
/////~ attack
if(pUser->m_sRegionX != nRX || pUser->m_sRegionZ != nRZ)
{
pMap->RegionUserRemove(pUser->m_sRegionX, pUser->m_sRegionZ, id);
pUser->m_sRegionX = nRX; pUser->m_sRegionZ = nRZ;
pMap->RegionUserAdd(pUser->m_sRegionX, pUser->m_sRegionZ, id);
}
}
// dungeon work
int room = pMap->IsRoomCheck( x, z );
return true;
}
void CGameSocket::RecvUserLogOut(Packet & pkt)
{
uint16 sessionId;
std::string strUserID;
pkt >> sessionId >> strUserID; // double byte string for once
g_pMain->DeleteUserPtr(sessionId);
//TRACE("**** User LogOut -- uid = %d, name = %s\n", sessionId, strUserID.c_str());
}
void CGameSocket::RecvUserRegene(Packet & pkt)
{
uint16 uid, sHP;
pkt >> uid >> sHP;
CUser* pUser = g_pMain->GetUserPtr(uid);
if(pUser == nullptr)
return;
pUser->m_bLive = AI_USER_LIVE;
pUser->m_sHP = sHP;
TRACE("**** RecvUserRegene -- uid = (%s,%d), HP = %d\n", pUser->GetName().c_str(), pUser->GetID(), pUser->m_sHP);
}
void CGameSocket::RecvUserSetHP(Packet & pkt)
{
uint16 sid, sHP, tid;
pkt >> sid >> sHP >> tid;
CUser* pUser = g_pMain->GetUserPtr(sid);
Unit * pAttacker = g_pMain->GetUnitPtr(tid);
if (pUser == nullptr
|| pUser->m_sHP == sHP)
return;
pUser->m_sHP = sHP;
if (sHP == 0)
pUser->OnDeath(pAttacker);
}
void CGameSocket::RecvNpcHpChange(Packet & pkt)
{
int16 nid, sAttackerID;
int32 nHP, nAmount;
uint8 attributeType = AttributeNone;
pkt >> nid >> sAttackerID >> nHP >> nAmount >> attributeType;
CNpc * pNpc = g_pMain->GetNpcPtr(nid);
if (pNpc == nullptr)
return;
if (nAmount < 0)
{
pNpc->RecvAttackReq(-nAmount, sAttackerID, (AttributeType) attributeType);
return;
}
else
{
pNpc->m_iHP += nAmount;
if (pNpc->m_iHP > pNpc->m_iMaxHP)
pNpc->m_iHP = pNpc->m_iMaxHP;
}
}
void CGameSocket::RecvUserUpdate(Packet & pkt)
{
CUser* pUser = g_pMain->GetUserPtr(pkt.read<uint16>());
if (pUser == nullptr)
return;
ReadUserInfo(pkt, pUser);
}
void CGameSocket::RecvZoneChange(Packet & pkt)
{
uint16 uid = pkt.read<uint16>();
uint8 byZoneNumber = pkt.read<uint8>();
CUser* pUser = g_pMain->GetUserPtr(uid);
if (pUser == nullptr)
return;
pUser->m_pMap = g_pMain->GetZoneByID(byZoneNumber);
pUser->m_bZone = byZoneNumber;
TRACE("**** RecvZoneChange -- user(%s, %d), cur_zone = %d\n", pUser->GetName().c_str(), pUser->GetID(), byZoneNumber);
}
void CGameSocket::RecvUserInfoAllData(Packet & pkt)
{
uint8 byCount = pkt.read<uint8>();
for (int i = 0; i < byCount; i++)
RecvUserInfo(pkt);
}
void CGameSocket::RecvGateOpen(Packet & pkt)
{
uint16 nid;
bool byGateOpen;
pkt >> nid >> byGateOpen;
if (nid < NPC_BAND)
{
TRACE("#### RecvGateOpen() nid Fail --> nid = %d ####\n", nid);
return;
}
CNpc* pNpc = g_pMain->GetNpcPtr(nid);
if (pNpc == nullptr)
return;
if (!pNpc->isGate())
{
TRACE("#### RecvGateOpen() NpcType Fail --> type = %d ####\n", pNpc->GetType());
return;
}
pNpc->m_byGateOpen = byGateOpen;
TRACE("**** RecvGateOpen()---> nid = %d, byGateOpen = %d ******\n", nid, byGateOpen);
}
void CGameSocket::RecvUserVisibility(Packet & pkt)
{
uint16 sid;
uint8 bIsInvisible;
pkt >> sid >> bIsInvisible;
CUser *pUser = g_pMain->GetUserPtr(sid);
if (pUser == nullptr)
return;
pUser->m_bInvisibilityType = bIsInvisible;
}
void CGameSocket::RecvUserTransform(Packet & pkt)
{
uint16 sid;
uint8 type;
pkt >> sid >> type;
CUser *pUser = g_pMain->GetUserPtr(sid);
if (pUser == nullptr)
return;
pUser->m_transformationType = TransformationType(type);
}
void CGameSocket::RecvPartyInfoAllData(Packet & pkt)
{
uint16 sPartyIndex = pkt.read<uint16>();
if (sPartyIndex >= SHRT_MAX)
{
TRACE("#### RecvPartyInfoAllData Index Fail - index = %d ####\n", sPartyIndex);
return;
}
_PARTY_GROUP *pParty = new _PARTY_GROUP;
pParty->wIndex = sPartyIndex;
for (int i = 0; i < MAX_PARTY_USERS; i++)
pParty->uid[i] = pkt.read<uint16>();
if (g_pMain->m_arParty.PutData(pParty->wIndex, pParty))
TRACE("**** RecvPartyInfoAllData()---> PartyIndex = %d ******\n", sPartyIndex);
}
void CGameSocket::RecvHealMagic(Packet & pkt)
{
uint16 sid = pkt.read<uint16>();
CUser* pUser = g_pMain->GetUserPtr(sid);
if (pUser == nullptr
|| pUser->isDead())
return;
pUser->HealMagic();
}
void CGameSocket::RecvTimeAndWeather(Packet & pkt)
{
pkt >> g_pMain->m_iYear >> g_pMain->m_iMonth >> g_pMain->m_iDate
>> g_pMain->m_iHour >> g_pMain->m_iMin
>> g_pMain->m_iWeather >> g_pMain->m_iAmount;
// We'll class day time as 6am to 9pm.
g_pMain->m_bIsNight = (g_pMain->m_iHour <= 5 || g_pMain->m_iHour >= 21);
}
void CGameSocket::RecvBattleEvent(Packet & pkt)
{
uint8 bType = pkt.read<uint8>(), bEvent = pkt.read<uint8>();
if (bEvent == BATTLEZONE_OPEN || bEvent == BATTLEZONE_CLOSE)
{
g_pMain->m_sKillKarusNpc = 0;
g_pMain->m_sKillElmoNpc = 0;
g_pMain->m_byBattleEvent = bEvent;
if (bEvent == BATTLEZONE_CLOSE)
g_pMain->ResetBattleZone();
}
foreach_stlmap (itr, g_pMain->m_arNpc)
{
CNpc *pNpc = itr->second;
if (pNpc == nullptr)
continue;
if (pNpc->GetType() > 10 && (pNpc->GetNation() == KARUS || pNpc->GetNation() == ELMORAD))
{
if (bEvent == BATTLEZONE_OPEN || bEvent == BATTLEZONE_CLOSE)
pNpc->ChangeAbility(bEvent);
}
}
}
void CGameSocket::RecvNpcSpawnRequest(Packet & pkt)
{
uint16 sSid, sX, sY, sZ, sCount, sRadius, sDuration;
int16 socketID;
uint16 nEventRoom;
uint8 byZone;
uint8 nation;
bool nIsPet;
std::string strPetName;
std::string strUserName;
uint64 nSerial;
uint16 UserId;
bool bIsMonster;
float fX, fY, fZ;
pkt >> sSid >> bIsMonster >> byZone >> sX >> sY >> sZ >> sCount >> sRadius >> sDuration >> nation >> socketID >> nEventRoom >> nIsPet >> strPetName >> strUserName >> nSerial >> UserId;
fX = sX / 10.0f;
fY = sY / 10.0f;
fZ = sZ / 10.0f;
for (uint16 i = 0; i < sCount; i++)
g_pMain->SpawnEventNpc(sSid, bIsMonster,
byZone, fX, fY, fZ, sRadius, sDuration, nation, socketID, nEventRoom, nIsPet, strPetName, strUserName, nSerial, UserId);
}
void CGameSocket::RecvNpcKillRequest(Packet & pkt)
{
uint16 nid;
pkt >> nid;
if (nid < NPC_BAND) // is player
{
foreach_stlmap (itr, g_pMain->m_arNpc)
{
CNpc *pNpc = itr->second;
if (pNpc == nullptr)
continue;
if (pNpc->m_oSocketID != nid)
continue;
pNpc->m_oSocketID = -1;
pNpc->Dead();
}
}
else
{
CNpc* pNpc = g_pMain->GetNpcPtr(nid);
if (pNpc != nullptr)
pNpc->Dead();
}
}
void CGameSocket::RecvNpcUpdate(Packet & pkt)
{
uint16 sSid;
bool bIsMonster;
uint8 byGroup = 0;
uint16 sPid = 0;
pkt >> sSid >> bIsMonster >> byGroup >> sPid;
g_pMain->NpcUpdate(sSid, bIsMonster, byGroup, sPid);
}

View File

@ -0,0 +1,49 @@
#pragma once
#include "../shared/KOSocket.h"
#include "Party.h"
class CUser;
class MAP;
class CGameSocket : public KOSocket
{
public:
CParty m_Party;
CGameSocket(uint16 socketID, SocketMgr *mgr) : KOSocket(socketID, mgr, -1, 524288, 524288) {}
virtual void OnConnect();
void Initialize();
bool HandlePacket(Packet & pkt);
virtual void OnDisconnect();
void RecvServerConnect(Packet & pkt);
void RecvNpcMoveResult(Packet & pkt);
void RecvUserInfo(Packet & pkt);
void ReadUserInfo(Packet & pkt, CUser * pUser);
void RecvUserInOut(Packet & pkt);
void RecvUserMove(Packet & pkt);
void RecvUserLogOut(Packet & pkt);
void RecvUserRegene(Packet & pkt);
void RecvUserSetHP(Packet & pkt);
void RecvNpcHpChange(Packet & pkt);
void RecvUserUpdate(Packet & pkt);
void RecvZoneChange(Packet & pkt);
void RecvUserInfoAllData(Packet & pkt);
void RecvPartyInfoAllData(Packet & pkt);
void RecvGateOpen(Packet & pkt);
void RecvUserVisibility(Packet & pkt);
void RecvUserTransform(Packet & pkt);
void RecvHealMagic(Packet & pkt);
void RecvTimeAndWeather(Packet & pkt);
void RecvBattleEvent(Packet & pkt);
void RecvNpcSpawnRequest(Packet & pkt);
void RecvNpcKillRequest(Packet & pkt);
void RecvNpcUpdate(Packet & pkt);
bool SetUid(float x, float z, int id, int speed);
virtual ~CGameSocket();
};

487
server/AIServer/MAP.cpp Normal file
View File

@ -0,0 +1,487 @@
#include "stdafx.h"
#include "MAP.h"
#include "ServerDlg.h"
#include "Region.h"
#include "Npc.h"
#include "User.h"
#include "RoomEvent.h"
#include "../shared/packets.h"
#include <fstream>
#include <set>
#include "../shared/SMDFile.h"
INLINE int ParseSpace( char* tBuf, char* sBuf)
{
int i = 0, index = 0;
bool flag = false;
while (sBuf[index] == ' ' || sBuf[index] == '\t')
index++;
while (sBuf[index] !=' ' && sBuf[index] !='\t' && sBuf[index] != 0)
{
tBuf[i++] = sBuf[index++];
flag = true;
}
tBuf[i] = 0;
while (sBuf[index] == ' ' || sBuf[index] == '\t')
index++;
return !flag ? 0 : index;
};
using namespace std;
/* passthru methods */
int MAP::GetMapSize() { return m_smdFile->GetMapSize(); }
float MAP::GetUnitDistance() { return m_smdFile->GetUnitDistance(); }
int MAP::GetXRegionMax() { return m_smdFile->GetXRegionMax(); }
int MAP::GetZRegionMax() { return m_smdFile->GetZRegionMax(); }
short * MAP::GetEventIDs() { return m_smdFile->GetEventIDs(); }
MAP::MAP() : m_smdFile(nullptr), m_ppRegion(nullptr),
m_fHeight(nullptr), m_byRoomType(0), m_byRoomEvent(0),
m_byRoomStatus(RoomStatusInitialised), m_byInitRoomCount(0),
m_nZoneNumber(0), m_sKarusRoom(0), m_sElmoradRoom(0)
{
}
bool MAP::Initialize(_ZONE_INFO *pZone)
{
m_nZoneNumber = pZone->m_nZoneNumber;
m_byRoomEvent = pZone->m_byRoomEvent;
m_smdFile = SMDFile::Load(pZone->m_MapName);
if (m_smdFile != nullptr)
{
SetZoneAttributes(m_nZoneNumber);
foreach_stlmap_nolock(itr, g_pMain->m_ObjectEventArray)
{
if (itr->second->sZoneID == m_nZoneNumber)
{
_OBJECT_EVENT * pEvent = itr->second;
if (pEvent->sType == OBJECT_GATE
|| pEvent->sType == OBJECT_GATE2
|| pEvent->sType == OBJECT_GATE_LEVER
|| pEvent->sType == OBJECT_ANVIL
|| pEvent->sType == OBJECT_ARTIFACT
|| pEvent->sType == OBJECT_GATE_UNK)
g_pMain->AddObjectEventNpc(pEvent, this);
}
}
m_ppRegion = new CRegion*[m_smdFile->m_nXRegion];
for (int i = 0; i < m_smdFile->m_nXRegion; i++)
m_ppRegion[i] = new CRegion[m_smdFile->m_nZRegion]();
}
if (m_byRoomEvent > 0)
{
if (!LoadRoomEvent())
{
printf("ERROR: Unable to load room event (%d.aievt) for map - %s\n",
m_byRoomEvent, pZone->m_MapName.c_str());
m_byRoomEvent = 0;
}
else
{
m_byRoomEvent = 1;
}
}
return (m_smdFile != nullptr);
}
MAP::~MAP()
{
RemoveMapData();
if (m_smdFile != nullptr)
m_smdFile->DecRef();
}
void MAP::RemoveMapData()
{
if( m_ppRegion ) {
for(int i=0; i <= GetXRegionMax(); i++) {
delete[] m_ppRegion[i];
m_ppRegion[i] = nullptr;
}
delete[] m_ppRegion;
m_ppRegion = nullptr;
}
if (m_fHeight)
{
delete[] m_fHeight;
m_fHeight = nullptr;
}
m_arRoomEventArray.DeleteAllData();
}
bool MAP::IsMovable(int dest_x, int dest_y)
{
return m_smdFile->GetEventID(dest_x, dest_y) == 0;
}
void MAP::RegionUserAdd(int rx, int rz, int uid)
{
if (rx < 0 || rz < 0 || rx > GetXRegionMax() || rz > GetZRegionMax())
return;
Guard lock(m_lock);
CRegion * pRegion = &m_ppRegion[rx][rz];
if (pRegion == nullptr)
return;
int *pInt = new int;
*pInt = uid;
if (!pRegion->m_RegionUserArray.PutData(uid, pInt))
delete pInt;
pRegion->m_byMoving = !pRegion->m_RegionUserArray.IsEmpty();
}
bool MAP::RegionUserRemove(int rx, int rz, int uid)
{
if (rx < 0 || rz < 0 || rx > GetXRegionMax() || rz > GetZRegionMax())
return false;
Guard lock(m_lock);
CRegion * pRegion = &m_ppRegion[rx][rz];
if (pRegion == nullptr)
return false;
pRegion->m_RegionUserArray.DeleteData(uid);
pRegion->m_byMoving = !pRegion->m_RegionUserArray.IsEmpty();
return true;
}
void MAP::RegionNpcAdd(int rx, int rz, int nid)
{
if (rx < 0 || rz < 0 || rx > GetXRegionMax() || rz > GetZRegionMax())
return;
Guard lock(m_lock);
int *pInt = new int;
*pInt = nid;
if (!m_ppRegion[rx][rz].m_RegionNpcArray.PutData(nid, pInt))
delete pInt;
}
bool MAP::RegionNpcRemove(int rx, int rz, int nid)
{
if (rx < 0 || rz < 0 || rx > GetXRegionMax() || rz > GetZRegionMax())
return false;
Guard lock(m_lock);
m_ppRegion[rx][rz].m_RegionNpcArray.DeleteData( nid );
return true;
}
CRegion * MAP::GetRegion(uint16 regionX, uint16 regionZ)
{
if (regionX > GetXRegionMax()
|| regionZ > GetZRegionMax())
return nullptr;
Guard lock(m_lock);
return &m_ppRegion[regionX][regionZ];
}
bool MAP::LoadRoomEvent()
{
uint32 length, count;
string filename = string_format(MAP_DIR "%d.aievt", m_byRoomEvent);
char byte;
char buf[4096];
char first[1024];
char temp[1024];
int index = 0;
int t_index = 0, logic=0, exec=0;
int event_num = 0, nation = 0;
CRoomEvent* pEvent = nullptr;
ifstream is(filename);
if (!is)
{
printf("ERROR: %s does not exist or no permission to access.\n", filename.c_str());
return false;
}
is.seekg(0, is.end);
length = (uint32)is.tellg();
is.seekg (0, is.beg);
count = 0;
while (count < length)
{
is.read(&byte, 1);
count ++;
if( byte != '\r' && byte != '\n' ) buf[index++] = byte;
if((byte == '\n' || count == length ) && index > 1 ) {
buf[index] = (uint8) 0;
t_index = 0;
if( buf[t_index] == ';' || buf[t_index] == '/' ) { // 주석에 대한 처리
index = 0;
continue;
}
t_index += ParseSpace( first, buf + t_index );
if( !strcmp( first, "ROOM" ) ) {
logic = 0; exec = 0;
t_index += ParseSpace( temp, buf + t_index ); event_num = atoi( temp );
if( m_arRoomEventArray.IsExist(event_num) ) {
TRACE("Event Double !!\n" );
goto cancel_event_load;
}
pEvent = nullptr;
pEvent = SetRoomEvent( event_num );
}
else if( !strcmp( first, "TYPE" ) ) {
t_index += ParseSpace( temp, buf + t_index ); m_byRoomType = atoi( temp );
}
else if( !strcmp( first, "L" ) ) {
if( !pEvent ) {
goto cancel_event_load;
}
}
else if( !strcmp( first, "E" ) ) {
if (!pEvent
|| exec >= MAX_CHECK_EVENT)
goto cancel_event_load;
t_index += ParseSpace( temp, buf + t_index ); pEvent->m_Exec[exec].sNumber = atoi( temp );
t_index += ParseSpace( temp, buf + t_index ); pEvent->m_Exec[exec].sOption_1 = atoi( temp );
t_index += ParseSpace( temp, buf + t_index ); pEvent->m_Exec[exec].sOption_2 = atoi( temp );
exec++;
}
else if( !strcmp( first, "A" ) ) {
if (!pEvent
|| logic >= MAX_CHECK_EVENT)
goto cancel_event_load;
t_index += ParseSpace( temp, buf + t_index ); pEvent->m_Logic[logic].sNumber = atoi( temp );
t_index += ParseSpace( temp, buf + t_index ); pEvent->m_Logic[logic].sOption_1 = atoi( temp );
t_index += ParseSpace( temp, buf + t_index ); pEvent->m_Logic[logic].sOption_2 = atoi( temp );
logic++;
pEvent->m_byCheck = logic;
}
else if( !strcmp( first, "O" ) ) {
if( !pEvent ) {
goto cancel_event_load;
}
}
else if( !strcmp( first, "NATION" ) ) {
if( !pEvent ) {
goto cancel_event_load;
}
t_index += ParseSpace( temp, buf + t_index ); nation = atoi( temp );
if( nation == KARUS ) {
m_sKarusRoom++;
}
else if( nation == ELMORAD ) {
m_sElmoradRoom++;
}
}
else if( !strcmp( first, "POS" ) ) {
if( !pEvent ) {
goto cancel_event_load;
}
t_index += ParseSpace( temp, buf + t_index ); pEvent->m_iInitMinX = atoi( temp );
t_index += ParseSpace( temp, buf + t_index ); pEvent->m_iInitMinZ = atoi( temp );
t_index += ParseSpace( temp, buf + t_index ); pEvent->m_iInitMaxX = atoi( temp );
t_index += ParseSpace( temp, buf + t_index ); pEvent->m_iInitMaxZ = atoi( temp );
}
else if( !strcmp( first, "POSEND" ) ) {
if( !pEvent ) {
goto cancel_event_load;
}
t_index += ParseSpace( temp, buf + t_index ); pEvent->m_iEndMinX = atoi( temp );
t_index += ParseSpace( temp, buf + t_index ); pEvent->m_iEndMinZ = atoi( temp );
t_index += ParseSpace( temp, buf + t_index ); pEvent->m_iEndMaxX = atoi( temp );
t_index += ParseSpace( temp, buf + t_index ); pEvent->m_iEndMaxZ = atoi( temp );
}
else if( !strcmp( first, "END" ) ) {
if( !pEvent ) {
goto cancel_event_load;
}
}
index = 0;
}
}
is.close();
return true;
cancel_event_load:
printf("Unable to load AI EVT (%d.aievt), failed in or near event number %d.\n",
m_byRoomEvent, event_num);
is.close();
return false;
}
int MAP::IsRoomCheck(float fx, float fz)
{
int nX = (int)fx, nZ = (int)fz;
int minX=0, minZ=0, maxX=0, maxZ=0;
int room_number = 0;
foreach_stlmap_nolock (itr, m_arRoomEventArray)
{
CRoomEvent * pRoom = itr->second;
if (pRoom == nullptr
|| pRoom->isCleared())
continue;
if (pRoom->isInitialised())
{
minX = pRoom->m_iInitMinX; minZ = pRoom->m_iInitMinZ;
maxX = pRoom->m_iInitMaxX; maxZ = pRoom->m_iInitMaxZ;
}
else if (pRoom->isInProgress())
{
if (pRoom->m_Logic[0].sNumber != 4)
continue;
minX = pRoom->m_iEndMinX; minZ = pRoom->m_iEndMinZ;
maxX = pRoom->m_iEndMaxX; maxZ = pRoom->m_iEndMaxZ;
}
CRect r(minX, minZ, maxX, maxZ);
if (r.PtInRect(nX, nZ))
{
if (pRoom->isInitialised())
{
pRoom->m_byStatus = RoomStatusInProgress;
pRoom->m_tDelayTime = UNIXTIME;
room_number = itr->first;
TRACE(" Room Check - number = %d, x=%d, z=%d\n", room_number, nX, nZ);
//wsprintf(notify, "** 알림 : [%d Zone][%d] 방에 들어오신것을 환영합니다 **", m_nZoneNumber, pRoom->m_sRoomNumber);
//g_pMain->SendSystemMsg(notify, PUBLIC_CHAT);
}
else if(pRoom->isInProgress())// room already in progress
{
pRoom->m_byStatus = RoomStatusCleared;
//wsprintf(notify, "** 알림 : [%d Zone][%d] 목표지점까지 도착해서 클리어 됩니다ㅇ **", m_nZoneNumber, pRoom->m_sRoomNumber);
//g_pMain->SendSystemMsg(notify, PUBLIC_CHAT);
}
return room_number;
}
}
return room_number;
}
CRoomEvent* MAP::SetRoomEvent( int number )
{
CRoomEvent* pEvent = m_arRoomEventArray.GetData( number );
if( pEvent ) {
TRACE("#### SetRoom Error : double event number = %d ####\n", number);
return nullptr;
}
pEvent = new CRoomEvent();
pEvent->m_iZoneNumber = m_nZoneNumber;
pEvent->m_sRoomNumber = number;
if( !m_arRoomEventArray.PutData( pEvent->m_sRoomNumber, pEvent) ) {
delete pEvent;
pEvent = nullptr;
return nullptr;
}
return pEvent;
}
bool MAP::IsRoomStatusCheck()
{
int nClearRoom = 1,
nTotalRoom = m_arRoomEventArray.GetSize() + 1;
if (m_byRoomStatus == RoomStatusInProgress)
m_byInitRoomCount++;
foreach_stlmap_nolock (itr, m_arRoomEventArray)
{
CRoomEvent *pRoom = itr->second;
if (pRoom == nullptr)
{
TRACE("#### IsRoomStatusCheck Error : room empty number = %d ####\n", itr->first);
continue;
}
if (m_byRoomStatus == RoomStatusInitialised)
{
if (pRoom->isCleared())
nClearRoom += 1;
if (m_byRoomType == 0)
{
if (nTotalRoom == nClearRoom)
{
m_byRoomStatus = RoomStatusInProgress;
return true;
}
}
}
else if (m_byRoomStatus == RoomStatusInProgress)
{
if (m_byInitRoomCount >= 10)
{
pRoom->InitializeRoom();
nClearRoom += 1;
if (nTotalRoom == nClearRoom)
{
m_byRoomStatus = RoomStatusCleared;
return true;
}
}
}
else if (m_byRoomStatus == RoomStatusCleared)
{
m_byRoomStatus = RoomStatusInitialised;
m_byInitRoomCount = 0;
return true;
}
}
return false;
}
void MAP::InitializeRoom()
{
foreach_stlmap_nolock (itr, m_arRoomEventArray)
{
CRoomEvent *pRoom = itr->second;
if (pRoom == nullptr)
{
TRACE("#### InitializeRoom Error : room empty number = %d ####\n", itr->first);
continue;
}
pRoom->InitializeRoom();
m_byRoomStatus = RoomStatusInitialised;
m_byInitRoomCount = 0;
}
}

99
server/AIServer/MAP.h Normal file
View File

@ -0,0 +1,99 @@
#pragma once
#include "../N3BASE/N3ShapeMgr.h"
#include "../shared/STLMap.h"
#include "../shared/STLMapOnlyLoad.h"
#include "Extern.h"
#include "RoomEvent.h"
typedef CSTLMapOnlyLoad <_OBJECT_EVENT> ObjectEventArray;
typedef CSTLMapOnlyLoad <CRoomEvent> RoomEventArray;
class CRegion;
class CNpc;
class CUser;
class CBot;
// temporary
struct CSize
{
CSize() : cx(0), cy(0) {}
CSize(int cx, int cy) : cx(cx), cy(cy) {}
int cx, cy;
};
class SMDFile;
class MAP
{
public:
// Passthru methods
int GetMapSize();
float GetUnitDistance();
int GetXRegionMax();
int GetZRegionMax();
short * GetEventIDs();
CRegion** m_ppRegion; // 64미터의 타일정보..
int m_nZoneNumber; // zone number
int m_nServerNo;
float* m_fHeight;
uint8 m_byRoomType; // 방의 초기화관련( 0:자동으로 초기화, 1:전쟁이벤트 관련(특정조건이 완료시 초기화)
uint8 m_byRoomEvent; // event room(0:empty, 1:use)
RoomStatus m_byRoomStatus; // room status(1:진행중, 2:방을 초기화중, 3:방초기화 완료)
uint8 m_byInitRoomCount; // room 초기화 시간을 제어(몬스터와 동기화를 맞추기 위해)
RoomEventArray m_arRoomEventArray;
short m_sKarusRoom; // karus의 성갯수
short m_sElmoradRoom; // elmorad의 성갯수
std::recursive_mutex m_lock;
public:
MAP();
virtual ~MAP();
bool Initialize(_ZONE_INFO *pZone);
bool LoadRoomEvent();
float GetHeight( float x, float z );
bool RegionNpcRemove( int rx, int rz, int nid );
void RegionNpcAdd( int rx, int rz, int nid );
bool RegionUserRemove( int rx, int rz, int uid );
void RegionUserAdd( int rx, int rz, int uid );
CRegion * GetRegion(uint16 regionX, uint16 regionZ);
int IsRoomCheck(float fx, float fz); // 던젼에서 사용, 유저의 현재위치가 던젼의 어느 위치에 있는지를 판단
bool IsRoomStatusCheck();
bool IsMovable(int dest_x, int dest_y);
void InitializeRoom();
CRoomEvent* SetRoomEvent( int number );
void RemoveMapData();
SMDFile * m_smdFile;
/* the following should all be duplicated to AI server's map class for now */
INLINE bool canTradeWithOtherNation() { return (m_zoneFlags & ZF_TRADE_OTHER_NATION) != 0; }
INLINE bool canTalkToOtherNation() { return (m_zoneFlags & ZF_TALK_OTHER_NATION) != 0; }
INLINE bool canAttackOtherNation() { return (m_zoneFlags & ZF_ATTACK_OTHER_NATION) != 0; }
INLINE bool canAttackSameNation() { return (m_zoneFlags & ZF_ATTACK_SAME_NATION) != 0; }
INLINE bool isWarZone() { return (m_zoneFlags & ZF_WAR_ZONE) != 0; }
INLINE bool isNationPVPZone() { return canAttackOtherNation() && !canAttackSameNation(); }
INLINE bool areNPCsFriendly() { return (m_zoneFlags & ZF_FRIENDLY_NPCS) != 0; }
INLINE uint8 GetZoneType() { return m_zoneType; }
INLINE uint8 GetTariff() { return m_byTariff; }
INLINE uint8 GetMinLevelReq() { return m_byMinLevel; }
INLINE uint8 GetMaxLevelReq() { return m_byMaxLevel; }
protected:
void SetZoneAttributes(int zoneNumber);
ZoneAbilityType m_zoneType;
uint16 m_zoneFlags;
uint8 m_byTariff;
uint8 m_byMinLevel, m_byMaxLevel;
};

4252
server/AIServer/Npc.cpp Normal file

File diff suppressed because it is too large Load Diff

457
server/AIServer/Npc.h Normal file
View File

@ -0,0 +1,457 @@
#pragma once
#include "NpcTable.h"
#include "NpcMagicProcess.h"
#define MAX_PATH_SIZE 100
#define NPC_MAX_USER_LIST 5
#define NPC_ATTACK_SHOUT 0
#define NPC_SUBTYPE_LONG_MON 1
#define NPC_TRACING_STEP 100
#define NPC_HAVE_USER_LIST 100
#define NPC_HAVE_ITEM_LIST 6
#define NPC_PATTEN_LIST 5
#define NPC_PATH_LIST 50
#define NPC_MAX_PATH_LIST 10000
#define NPC_EXP_RANGE 50.0f
#define NPC_EXP_PERSENT 50
#define NPC_SECFORMETER_MOVE 4
#define NPC_SECFORMETER_RUN 4
#define NPC_VIEW_RANGE 100.0f
#define MAX_MAGIC_TYPE3 20
#define MAX_MAGIC_TYPE4 9
struct _NpcSkillList
{
short sSid;
uint8 tLevel;
uint8 tOnOff;
};
struct _NpcDamagedList
{
uint16 GetID;
int Damage;
uint32 lastdamagedt;
INLINE void Reset()
{
GetID = -1;
Damage = 0;
lastdamagedt = 0;
}
};
struct _NpcGiveItem
{
int sSid; // item serial number
short count; // item 갯수(돈은 단위)
};
struct _Target
{
uint16 id; // 공격대상 User uid
bool bSet;
float x; // User의 x pos
float y; // User의 y pos
float z; // User의 z pos
};
struct _PattenPos
{
short x;
short z;
};
struct _PathList
{
_PattenPos pPattenPos[NPC_MAX_PATH_LIST];
};
struct _TargetHealer
{
short sNID; // npc nid
short sValue; // 점수
};
class MAP;
#include "../GameServer/Unit.h"
enum MonSearchType
{
MonSearchSameFamily, // find any available mobs of the same family
MonSearchAny, // find any available mob
MonSearchNeedsHealing // find any mob that needs healing
};
enum CloseTargetResult
{
CloseTargetInvalid,
CloseTargetNotInRange,
CloseTargetInGeneralRange,
CloseTargetInAttackRange
};
enum NpcSpecialType
{
NpcSpecialTypeNone = 0,
NpcSpecialTypeCycleSpawn = 7,
NpcSpecialTypeKarusWarder1 = 90,
NpcSpecialTypeKarusWarder2 = 91,
NpcSpecialTypeElmoradWarder1 = 92,
NpcSpecialTypeElmoradWarder2 = 93,
NpcSpecialTypeKarusKeeper = 98,
NpcSpecialTypeElmoradKeeper = 99
};
struct __Vector3;
class CNpc : public Unit
{
public:
uint16 GetID() { return m_sNid; }
INLINE uint16 GetProtoID() { return GetProto()->m_sSid; }
std::string & GetName() { return GetProto()->m_strName; }
int32 GetHealth() { return m_iHP; }
int32 GetMaxHealth() { return GetProto()->m_iMaxHP; }
int32 GetMana() { return m_sMP; }
int32 GetMaxMana() { return GetProto()->m_sMaxMP; }
void GetInOut(Packet &, uint8) {}
void AddToRegion(int16 sRegionX, int16 sRegionZ) {}
void HpChange(int amount, Unit *pAttacker = nullptr, bool bSendToGameServer = true);
void MSpChange(int amount) {}
void NpcCalling(float fDis,float fDistance, __Vector3 oPos, __Vector3 cPost);
INLINE CNpcTable * GetProto() { return m_proto; }
INLINE uint8 GetType() { return GetProto()->m_tNpcType; }
INLINE bool isHealer() { return GetType() == NPC_HEALER; }
INLINE bool isGuard()
{
return GetType() == NPC_GUARD || GetType() == NPC_PATROL_GUARD || GetType() == NPC_STORE_GUARD;
}
INLINE bool isGate()
{
return GetType() == NPC_GATE
|| GetType() == NPC_GATE2
|| GetType() == NPC_PHOENIX_GATE
|| GetType() == NPC_SPECIAL_GATE
|| GetType() == NPC_VICTORY_GATE
|| GetType() == NPC_GATE_LEVER
|| GetType() == NPC_BORDER_MONUMENT;
}
INLINE bool isArtifact()
{
return GetType() == NPC_ARTIFACT
|| GetType() == NPC_DESTROYED_ARTIFACT
|| GetType() == NPC_ARTIFACT1
|| GetType() == NPC_ARTIFACT2
|| GetType() == NPC_ARTIFACT3
|| GetType() == NPC_ARTIFACT4;
}
INLINE bool isNonAttackingObject() { return isGate() || GetType() == NPC_GATE_LEVER || isArtifact() || GetType() == NPC_SCARECROW || GetType() == NPC_BORDER_MONUMENT || GetType() == NPC_CHAOS_STONE; }
INLINE bool isNonAttackableObject() { return GetType() == NPC_GATE_LEVER || GetType() == NPC_BORDER_MONUMENT; }
INLINE bool isDead() { return m_NpcState == NPC_DEAD || m_iHP <= 0; }
INLINE bool isAlive() { return !isDead(); }
INLINE bool isMonster() { return m_bMonster; }
INLINE int GetMyPath() { return (m_sRealPathCount < 0) ? -m_sRealPathCount : m_sRealPathCount;}
INLINE bool hasTarget() { return m_Target.bSet; }
CNpcTable *m_proto;
_Target m_Target; // 공격할 유저 저장,,
short m_ItemUserLevel; // 죽을때 매직 이상 아이템를 떨구기위해 참조해야하는 유저의레벨
_NpcDamagedList m_DamagedUserList[NPC_HAVE_USER_LIST]; // max NPC_HAVE_USER_LIST?
std::recursive_mutex m_damageListLock;
int m_TotalDamage;
short m_sMaxDamageUserid; // 나에게 최고의 데미지를 준 유저의 아이디 저장..
_PathList m_PathList; // Npc의 패스 리스트
_PattenPos m_pPattenPos; // Npc의 패턴,,
//int m_iPattenNumber; // 현재의 패턴번호
short m_iPattenFrame; // 패턴의 현재 위치..
uint8 m_byMoveType; // NPC의 행동타입(이동관련)
uint8 m_byInitMoveType; // NPC의 초기 행동타입(이동관련)
short m_sMaxPathCount, m_sRealPathCount; // NPC의 PathList Max Count
bool nIsPet;
std::string strPetName, strUserName;
uint16 UserId;
uint64 nSerial;
bool m_bFirstLive; // NPC 가 처음 생성되는지 죽었다 살아나는지 판단.
uint8 m_OldNpcState, m_NpcState;
short m_sNid;
float m_nInitX; // 처음 생성된 위치 X
float m_nInitY; // 처음 생성된 위치 Y
float m_nInitZ; // 처음 생성된 위치 Z
float m_fPrevX; // Prev X Pos;
float m_fPrevY; // Prev Y Pos;
float m_fPrevZ; // Prev Z Pos;
int m_DamagedUserListCount; // dmgx
//
// PathFind Info
//
short m_min_x;
short m_min_y;
short m_max_x;
short m_max_y;
typedef struct { long cx; long cy; } Size;
Size m_vMapSize;
float m_fStartPoint_X, m_fStartPoint_Y;
float m_fEndPoint_X, m_fEndPoint_Y;
short m_sStepCount;
CPathFind m_vPathFind;
_PathNode *m_pPath;
int m_nInitMinX; // 초기위치
int m_nInitMinY;
int m_nInitMaxX;
int m_nInitMaxY;
time_t m_fHPChangeTime;
time_t m_tFaintingTime;
time_t LastChangeTimeCC;
//----------------------------------------------------------------
// MONSTER DB 쪽에 있는 변수들
//----------------------------------------------------------------
short m_sSize; // 캐릭터의 비율(100 퍼센트 기준)
int m_iWeapon_1; // 착용 무기
int m_iWeapon_2; // 착용 무기
uint8 m_byActType; // 행동패턴
uint8 m_byRank; // 작위
uint8 m_byTitle; // 지위
int m_iSellingGroup; // 아이템 그룹(물건매매 담당 NPC의 경우만)
int m_iMaxHP; // 최대 HP
short m_sMaxMP; // 최대 MP
short m_sAttack; // 공격값(지금 사용하지 않음..)
short m_sAttackDelay; // 공격딜레이
short m_sSpeed; // 이동속도
float m_fSpeed_1; // 기본 이동 타입 (1초에 갈 수 있는 거리)
float m_fSpeed_2; // 뛰는 이동 타입.. (1초에 갈 수 있는 거리)
short m_sStandTime; // 서있는 시간
uint8 m_bySearchRange; // 적 탐지 범위
uint8 m_byAttackRange; // 사정거리
uint8 m_byTracingRange; // 추격 거리
int m_iMoney; // 떨어지는 돈
int m_iItem; // 떨어지는 아이템
int m_iHP; // 현재 HP
short m_sMP; // 현재 MP
float m_fSecForMetor; // 초당 갈 수 있는 거리..
//----------------------------------------------------------------
// MONSTER AI에 관련된 변수들
//----------------------------------------------------------------
uint8 m_tNpcAttType; // 공격 성향 : 선공(1), 후공(0)
bool m_bHasFriends; // When set, monsters behave in groups (defined by their family type) and will seek out help from nearby similar mobs.
uint8 m_byAttackPos; // User의 어느 부분에서 공격하느지를 판단(8방향)
uint8 m_byBattlePos; // 어떤 진형을 선택할 것인지를 판단..
bool m_byGateOpen; // 성문일 경우에.. 사용... Gate Npc Status -> 1 : open 0 : close
uint8 m_byMaxDamagedNation; // 나를 죽인 유저의 국가를 저장.. (1:카루스, 2:엘모라드)
uint8 m_byObjectType; // 보통은 0, object타입(성문, 레버)은 1
uint8 m_byDungeonFamily; // 던젼에서 같은 패밀리 묶음 (같은 방)
NpcSpecialType m_bySpecialType; // 몬스터의 형태가 변하는지를 판단(0:변하지 않음, 1:변하는 몬스터,
// 2:죽는경우 조정하는 몬스터(대장몬스터 죽을경우 성문이 열림),
// 3:대장몬스터의 죽음과 관련이 있는 몬스터(대장몬스터가 죽으면 관계되는 몬스터는 같이 죽도록)
// 4:변하면서 죽는경우 조정하는 몬스터 (m_sControlSid)
// 5:처음에 죽었있다가 출현하는 몬스터,,
// 6:일정시간이 지난 후에 행동하는 몬스터,,
// 100:죽었을때 데미지를 많이 입힌 유저를 기록해 주세여
uint8 m_byTrapNumber; // 던젼에서 트랩의 번호,,
uint8 m_byChangeType; // 0:정상상태, 1:변하기 위한 준비, 2:다른몬스터로 변함, 3:몬스터의 출현, 100:몬스터의 죽음
uint8 m_byRegenType; // 0:정상적으로 리젠이 됨.. , 1:한번 죽으면 리젠이 안되는 특수 몸, 2:리젠이 안됨
uint8 m_byDeadType; // 0:살아 있는 경우, 100:전쟁이벤트중 죽은 경우
//----------------------------------------------------------------
// MONSTER_POS DB 쪽에 있는 변수들
//----------------------------------------------------------------
time_t m_Delay; // this doesn't really need to be time_t, but we'll use it (at least for now) for consistency
time_t m_fDelayTime; // Npc Thread체크 타임...
uint8 m_byType;
int m_sRegenTime; // NPC 재생시간
int16 m_byDirection;
int m_nLimitMinX; // 활동 영역
int m_nLimitMinZ;
int m_nLimitMaxX;
int m_nLimitMaxZ;
bool m_bIsEventNpc;
float m_fAdd_x;
float m_fAdd_z;
float m_fBattlePos_x;
float m_fBattlePos_z;
float m_fSecForRealMoveMetor; // 초당 갈 수 있는 거리..(실제 클라이언트에 보내주는 거리)
bool m_bPathFlag; // 패스 파인드 실행여부 체크 변수..
//----------------------------------------------------------------
// NPC 이동 관련
//----------------------------------------------------------------
_NpcPosition m_pPoint[MAX_PATH_LINE]; // 이동시 참고 좌표
short m_iAniFrameIndex;
short m_iAniFrameCount;
uint8 m_byPathCount; // 패스를 따라 이동하는 몬스터 끼리 겹치지 않도록,,
bool m_bStopFollowingTarget; // when set, indicates that an NPC should stop following its target
uint8 m_byActionFlag; // 행동변화 플래그 ( 0 : 행동변화 없음, 1 : 공격에서 추격)
bool m_bTracing;
float m_fTracingStartX, m_fTracingStartZ;
short m_iFind_X[4]; // find enemy에서 찾을 Region검사영역
short m_iFind_Y[4];
float m_fOldSpeed_1; // 기본 이동 타입 (1초에 갈 수 있는 거리)
float m_fOldSpeed_2; // 뛰는 이동 타입.. (1초에 갈 수 있는 거리)
bool m_bMonster;
uint32 m_nActiveSkillID; // ID of skill currently being cast
int16 m_sActiveTargetID; // ID of the target of the skill currently being cast
uint16 m_sActiveCastTime; // Cast time of the skill currently being cast (in seconds)
bool m_bDelete; // when set, will remove the NPC from the server after execution.
int16 m_oSocketID; // owner user
uint16 m_bEventRoom;
int UnixGateOpen, UnixGateClose;
public:
CNpc();
virtual ~CNpc();
void Init(); // NPC 기본정보 초기화
void InitTarget(void);
void InitUserList();
void InitPos();
void Load(uint16 sNpcID, CNpcTable * proto, bool bMonster, uint8 nation = 0);
void SendMoveResult(float fX, float fY, float fZ, float fSpeed = 0.0f);
protected:
void ClearPathFindData(void);
public:
void FillNpcInfo(Packet & result);
void NpcStrategy(uint8 type);
int FindFriend(MonSearchType type = MonSearchSameFamily);
void FindFriendRegion(int x, int z, MAP* pMap, _TargetHealer* pHealer, MonSearchType type = MonSearchSameFamily);
bool IsCloseTarget(CUser *pUser, int nRange);
void SendExpToUserList();
INLINE void SetNPCEventRoom(uint16 nEventRoom) { m_bEventRoom = nEventRoom; }
void RecvAttackReq(int nDamage, uint16 sAttackerID, AttributeType attributeType = AttributeNone);
void ChangeTarget(int nAttackType, CUser *pUser);
void ChangeNTarget(CNpc *pNpc);
bool ResetPath();
bool GetTargetPos(float& x, float& z);
bool IsChangePath();
time_t Attack();
time_t LongAndMagicAttack();
void TracingAttack();
int GetTargetPath(int option = 0);
CloseTargetResult IsCloseTarget(int nRange, AttackType attackType);
bool StepMove();
bool StepNoPathMove();
bool IsMovingEnd();
int IsSurround(CUser* pUser);
bool IsDamagedUserList(CUser *pUser);
bool IsPathFindCheck(float fDistance);
void IsNoPathFind(float fDistance);
void GiveNpcHaveItem();
time_t NpcLive();
time_t NpcTracing();
time_t NpcAttacking();
time_t NpcMoving();
time_t NpcSleeping();
time_t NpcFainting();
time_t NpcHealing();
time_t NpcCasting();
time_t NpcStanding();
time_t NpcBack();
bool SetLive();
void ChaosCubeControl();
bool isInSpawnRange(int nX, int nZ);
bool RandomMove();
bool RandomBackMove();
bool IsInPathRange();
int GetNearPathPoint();
short GetDamage(Unit *pTarget, _MAGIC_TABLE *pSkill = nullptr, bool bPreviewOnly = false);
short GetDamage(CUser *pTarget, _MAGIC_TABLE *pSkill = nullptr, bool bPreviewOnly = false);
short GetDamage(CNpc *pTarget, _MAGIC_TABLE *pSkill = nullptr, bool bPreviewOnly = false);
void SendAttackRequest(int16 tid);
bool RegisterRegion(float x, float z);
void SendInOut(InOutType type);
void SendNpcInfo();
void SendRegionUpdate();
void Dead(Unit * pKiller = nullptr, bool bSendDeathPacket = true);
bool isShowBox();
bool FindEnemy();
bool CheckFindEnemy();
int FindEnemyRegion();
float FindEnemyExpand(int nRX, int nRZ, float fCompDis, UnitType unitType);
int GetMyField();
int GetDir(float x1, float z1, float x2, float z2);
void NpcMoveEnd();
void GetVectorPosition(__Vector3 & vOrig, __Vector3 & vDest, float fDis, __Vector3 * vResult);
void CalcAdaptivePosition(__Vector3 & vPosOrig, __Vector3 & vPosDest, float fAttackDistance, __Vector3 * vResult);
void ComputeDestPos(__Vector3 & vCur, float fDegree, float fDistance, __Vector3 * vResult);
void Yaw2D(float fDirX, float fDirZ, float& fYawResult);
float GetDistance(__Vector3 & vOrig, __Vector3 & vDest);
int PathFind(CPoint start, CPoint end, float fDistance);
bool GetUserInView();
bool GetUserInViewRange(int x, int z);
void MoveAttack();
void HpChange();
int ItemProdution(int item_number);
int GetItemGrade(int item_grade);
int GetItemCodeNumber(int level, int item_type);
int GetWeaponItemCodeNumber(bool bWeapon);
int GetPartyExp( int party_level, int man, int nNpcExp );
void ChangeAbility(int iChangeType);
bool Teleport();
bool isHostileTo(Unit * pTarget);
};

View File

@ -0,0 +1,35 @@
#include "stdafx.h"
#include "NpcMagicProcess.h"
#include "ServerDlg.h"
#include "Npc.h"
time_t CNpcMagicProcess::MagicPacket(uint8 opcode, uint32 nSkillID, int16 sCasterID, int16 sTargetID, int16 sData1, int16 sData2, int16 sData3)
{
_MAGIC_TABLE * pSkill = g_pMain->m_MagictableArray.GetData(nSkillID);
if (pSkill == nullptr)
return -1;
Packet result(AG_MAGIC_ATTACK_REQ, opcode);
result << nSkillID << sCasterID << sTargetID << sData1 << sData2 << sData3;
g_pMain->Send(&result);
// NOTE: Client controls skill hits.
// Since we block these, we need to handle this ourselves.
// This WILL need to be rewritten once spawns are though, as it is HORRIBLE.
if (opcode != MAGIC_EFFECTING)
{
CNpc * pNpc = g_pMain->GetNpcPtr(sCasterID);
if (pNpc == nullptr)
return -1;
pNpc->m_OldNpcState = pNpc->m_NpcState;
pNpc->m_NpcState = NPC_CASTING;
pNpc->m_nActiveSkillID = nSkillID;
pNpc->m_sActiveTargetID = sTargetID;
pNpc->m_sActiveCastTime = pSkill->bCastTime * MINUTE;
return pNpc->m_sActiveCastTime;
}
return -1;
}

View File

@ -0,0 +1,8 @@
#pragma once
class CNpcMagicProcess
{
public:
static time_t MagicPacket(uint8 opcode, uint32 nSkillID, int16 sCasterID, int16 sTargetID,
int16 sData1 = 0, int16 sData2 = 0, int16 sData3 = 0);
};

View File

@ -0,0 +1,66 @@
#pragma once
#define MONSTER_SPEED 5000
class CNpcTable
{
public:
uint16 m_sSid; // MONSTER(NPC) Serial ID
std::string m_strName; // MONSTER(NPC) Name
uint16 m_sPid; // MONSTER(NPC) Picture ID
uint16 m_sSize; // 캐릭터의 비율(100 퍼센트 기준)
uint32 m_iWeapon_1; // 무기계열(오른손)
uint32 m_iWeapon_2; // 무기계열(왼손)
uint8 m_byGroup; // 소속집단
uint8 m_byActType; // 행동패턴
uint8 m_tNpcType; // NPC Type
// 0 : Monster
// 1 : Normal NPC
uint8 m_byFamilyType; // 몹들사이에서 가족관계를 결정한다.
uint8 m_byRank; // 작위
uint8 m_byTitle; // 지위
uint32 m_iSellingGroup; // 아이템 그룹(물건매매 담당 NPC의 경우만)
uint16 m_sLevel; // level
uint32 m_iExp; // 경험치
uint32 m_iLoyalty; // loyalty
uint32 m_iMaxHP; // 최대 HP
uint16 m_sMaxMP; // 최대 MP
uint16 m_sAttack; // 공격값
uint16 m_sDefense; // 방어값
uint16 m_sHitRate; // 타격성공률
uint16 m_sEvadeRate; // 회피성공률
uint16 m_sDamage; // 기본 데미지
uint16 m_sAttackDelay; // 공격딜레이
uint16 m_sSpeed; // 이동속도
uint8 m_bySpeed_1; // 기본 이동 타입
uint8 m_bySpeed_2; // 뛰는 이동 타입..
uint16 m_sStandTime; // 서있는 시간
uint32 m_iMagic1; // 사용마법 1
uint32 m_iMagic2; // 사용마법 2
uint32 m_iMagic3; // 사용마법 3
uint16 m_byFireR; // 화염 저항력
uint16 m_byColdR; // 냉기 저항력
uint16 m_byLightningR; // 전기 저항력
uint16 m_byMagicR; // 마법 저항력
uint16 m_byDiseaseR; // 저주 저항력
uint16 m_byPoisonR; // 독 저항력
float m_fBulk;
uint8 m_bySearchRange; // 적 탐지 범위
uint8 m_byAttackRange; // 사정거리
uint8 m_byTracingRange; // 추격거리
uint32 m_iMoney; // 떨어지는 돈
uint16 m_iItem; // 떨어지는 아이템
uint8 m_byDirectAttack; // 공격방법( 0 : 직접, 1:롱공격(간접공격), 2:직,간접공격 )
uint8 m_byMagicAttack; // 마법공격( 0:마법공격 없음, 1:마법공격, 2:독공격, 3:힐링)
uint8 m_byGroupSpecial;
CNpcTable() : m_sSpeed(MONSTER_SPEED)
{
}
};

View File

@ -0,0 +1,221 @@
#include "stdafx.h"
#include "NpcThread.h"
#include "Npc.h"
#define DELAY 250
uint32 THREADCALL NpcThreadProc(void * pParam)
{
try
{
CNpcThread* pInfo = (CNpcThread *)pParam;
if (!pInfo)
return 0;
CNpc *pNpc= nullptr;
CNpc *pNpcList[32768];
time_t dwDiffTime = 0, dwTickTime = 0, fTime2 = 0;
int nTempTotalNPC, NpcCount = 0;
ThreadReloadNPC:
NpcCount = 0;
foreach (itr, pInfo->m_pNpcs)
{
pNpcList[NpcCount] = *itr;
if (pNpcList[NpcCount] == nullptr)
continue;
NpcCount++;
}
nTempTotalNPC = g_pMain->m_TotalNPC;
while (!g_bNpcExit)
{
fTime2 = getMSTime();
if (g_pMain->m_TotalNPC != nTempTotalNPC)
goto ThreadReloadNPC;
for (int x = 0; x < NpcCount; x++)
{
try
{
pNpc = nullptr;
pNpc = pNpcList[x];
if (pNpc == nullptr)
continue;
if(pNpc->GetID() < 0)
continue;
dwTickTime = fTime2 - pNpc->m_fDelayTime;
if (pNpc->m_Delay > (int)dwTickTime && !pNpc->m_bFirstLive && pNpc->m_Delay != 0)
{
if (pNpc->m_Delay < 0)
pNpc->m_Delay = 0;
if (pNpc->m_NpcState == NPC_STANDING
&& pNpc->CheckFindEnemy()
&& pNpc->FindEnemy())
{
pNpc->m_NpcState = NPC_ATTACKING;
pNpc->m_Delay = 0;
}
if (pNpc->GetName() != "Guard tower")
continue;
}
dwTickTime = fTime2 - pNpc->m_fHPChangeTime;
if (10000 < dwTickTime)
pNpc->HpChange();
uint8 bState = pNpc->m_NpcState;
time_t tDelay = -1;
switch (bState)
{
case NPC_LIVE:
tDelay = pNpc->NpcLive();
break;
case NPC_STANDING:
tDelay = pNpc->NpcStanding();
break;
case NPC_MOVING:
tDelay = pNpc->NpcMoving();
break;
case NPC_ATTACKING:
tDelay = pNpc->NpcAttacking();
break;
case NPC_TRACING:
tDelay = pNpc->NpcTracing();
break;
case NPC_FIGHTING:
tDelay = pNpc->Attack();
break;
case NPC_BACK:
tDelay = pNpc->NpcBack();
break;
case NPC_STRATEGY:
break;
case NPC_DEAD:
pNpc->m_NpcState = NPC_LIVE;
break;
case NPC_SLEEPING:
tDelay = pNpc->NpcSleeping();
break;
case NPC_FAINTING:
tDelay = pNpc->NpcFainting();
break;
case NPC_HEALING:
tDelay = pNpc->NpcHealing();
break;
case NPC_CASTING:
tDelay = pNpc->NpcCasting();
break;
}
// This may not be necessary, but it keeps behaviour identical.
if (bState != NPC_LIVE && bState != NPC_DEAD
&& pNpc->m_NpcState != NPC_DEAD)
pNpc->m_fDelayTime = getMSTime();
if (tDelay >= 0)
pNpc->m_Delay = tDelay;
if (pNpc->m_bDelete)
{
uint16 myId = pNpc->GetID();
Guard lock(g_pMain->m_freeIdsLock);
g_pMain->freeIDs.push_back(myId);
pInfo->RemoveNPC(pNpc);
g_pMain->m_arNpc.DeleteData(myId);
--g_pMain->m_TotalNPC;
goto ThreadReloadNPC;
}
}
catch (std::system_error & ex)
{
printf("[ %s ] Warning 1 : %s\n", __FUNCTION__, ex.what());
continue;
}
}
sleep(250);
}
}
catch (std::system_error & ex)
{
printf("[ %s ] Warning 2 : %s\n", __FUNCTION__, ex.what());
}
return 0;
}
uint32 THREADCALL ZoneEventThreadProc(void * pParam /* = nullptr */)
{
while (!g_bNpcExit)
{
foreach_stlmap_nolock (itr, g_pMain->g_arZone)
{
MAP *pMap = itr->second;
if (pMap == nullptr
|| pMap->m_byRoomEvent == 0
|| pMap->IsRoomStatusCheck())
continue;
foreach_stlmap_nolock (itr, pMap->m_arRoomEventArray)
{
CRoomEvent * pRoom = itr->second;
if (pRoom == nullptr
|| !pRoom->isInProgress())
continue;
pRoom->MainRoom();
}
}
sleep(1000);
}
return 0;
}
void CNpcThread::AddNPC(CNpc * pNpc)
{
Guard lock(m_lock);
m_pNpcs.insert(pNpc);
}
void CNpcThread::RemoveNPC(CNpc * pNpc)
{
Guard lock(m_lock);
m_pNpcs.erase(pNpc);
}
CNpcThread::CNpcThread()
{
}
CNpcThread::~CNpcThread()
{
Guard lock(m_lock);
m_pNpcs.clear();
}

View File

@ -0,0 +1,21 @@
#pragma once
uint32 THREADCALL NpcThreadProc(void * lpParam /* CNpcThread ptr */);
uint32 THREADCALL ZoneEventThreadProc(void * lpParam /* = nullptr */);
typedef std::set<CNpc *> NpcSet;
class CNpc;
class CNpcThread
{
public:
CNpcThread();
void AddNPC(CNpc * pNpc);
void RemoveNPC(CNpc * pNpc);
virtual ~CNpcThread();
public:
NpcSet m_pNpcs;
std::recursive_mutex m_lock;
Thread m_thread;
};

132
server/AIServer/Party.cpp Normal file
View File

@ -0,0 +1,132 @@
#include "stdafx.h"
#include "Party.h"
#include "User.h"
CParty::CParty()
{
}
CParty::~CParty()
{
}
void CParty::Initialize()
{
}
void CParty::PartyProcess(Packet & pkt)
{
uint8 opcode = pkt.read<uint8>();
switch (opcode)
{
case PARTY_CREATE:
PartyCreate(pkt);
break;
case PARTY_INSERT:
PartyInsert(pkt);
break;
case PARTY_REMOVE:
PartyRemove(pkt);
break;
case PARTY_DELETE:
PartyDelete(pkt);
break;
}
}
void CParty::PartyCreate(Packet & pkt)
{
uint16 sPartyIndex = pkt.read<uint16>(), sUid = pkt.read<uint16>();
short sHP = 0, sClass = 0;
uint8 byLevel= 0;
_PARTY_GROUP* pParty = nullptr;
CUser* pUser = nullptr;
pUser = g_pMain->GetUserPtr(sUid);
if(pUser) {
pUser->m_byNowParty = 1;
pUser->m_sPartyNumber = sPartyIndex;
}
pParty = new _PARTY_GROUP;
pParty->wIndex = sPartyIndex;
pParty->uid[0] = sUid;
if( g_pMain->m_arParty.PutData( pParty->wIndex, pParty ) ) {
TRACE("Party - Create() : Party 생성 number = %d, uid=%d, %d \n", sPartyIndex, pParty->uid[0], pParty->uid[1]);
}
}
void CParty::PartyInsert(Packet & pkt)
{
uint16 sPartyIndex = pkt.read<uint16>();
uint8 byIndex = pkt.read<uint8>();
uint16 sUid = pkt.read<uint16>(), sHP = 0, sClass = 0;
uint8 byLevel= 0;
_PARTY_GROUP* pParty = nullptr;
CUser* pUser = nullptr;
pParty = g_pMain->m_arParty.GetData( sPartyIndex );
if( !pParty ) { // 이상한 경우
return;
}
if(byIndex >= 0 && byIndex < 8) {
pParty->uid[byIndex] = sUid;
pUser = g_pMain->GetUserPtr(sUid);
if(pUser) {
pUser->m_byNowParty = 1;
pUser->m_sPartyNumber = sPartyIndex;
}
}
}
void CParty::PartyRemove(Packet & pkt)
{
uint16 sPartyIndex = pkt.read<uint16>(), sUid = pkt.read<uint16>();
_PARTY_GROUP* pParty = nullptr;
CUser* pUser = nullptr;
if (sUid > MAX_USER) return;
pParty = g_pMain->m_arParty.GetData( sPartyIndex );
if( !pParty ) { // 이상한 경우
return;
}
for( int i=0; i<8; i++ ) {
if( pParty->uid[i] != -1 ) {
if( pParty->uid[i] == sUid ) {
pParty->uid[i] = -1;
pUser = g_pMain->GetUserPtr(sUid);
if(pUser) {
pUser->m_byNowParty = 0;
pUser->m_sPartyNumber = -1;
}
}
}
}
}
void CParty::PartyDelete(Packet & pkt)
{
uint16 sPartyIndex = pkt.read<uint16>();
_PARTY_GROUP *pParty = g_pMain->m_arParty.GetData(sPartyIndex);
if (pParty == nullptr)
return;
for( int i=0; i<8; i++ ) {
if( pParty->uid[i] != -1 ) {
CUser *pUser = g_pMain->GetUserPtr(pParty->uid[i]);
if(pUser) {
pUser->m_byNowParty = 0;
pUser->m_sPartyNumber = -1;
}
}
}
g_pMain->m_arParty.DeleteData( pParty->wIndex );
}

16
server/AIServer/Party.h Normal file
View File

@ -0,0 +1,16 @@
#pragma once
class CParty
{
public:
CParty();
virtual ~CParty();
void Initialize();
void PartyDelete(Packet & pkt);
void PartyRemove(Packet & pkt);
void PartyInsert(Packet & pkt);
void PartyCreate(Packet & pkt);
void PartyProcess(Packet & pkt);
};

View File

@ -0,0 +1,338 @@
#include "stdafx.h"
#include "MAP.h"
#include "PathFind.h"
#include "ServerDlg.h"
#define LEVEL_ONE_FIND_CROSS 2
#define LEVEL_ONE_FIND_DIAGONAL 3
#define LEVEL_TWO_FIND_CROSS 11
#define LEVEL_TWO_FIND_DIAGONAL 10
CPathFind::CPathFind()
{
m_pStack = (STACK *)calloc(1, sizeof(STACK));
m_pOpen = nullptr;
m_pClosed = nullptr;
m_pMap = nullptr;
m_lMapUse = 0;
}
CPathFind::~CPathFind()
{
ClearData();
free(m_pStack);
}
void CPathFind::ClearData()
{
_PathNode *t_node1, *t_node2;
if(m_pOpen)
{
t_node1 = m_pOpen->NextNode;
while(t_node1)
{
t_node2 = t_node1->NextNode;
free(t_node1);
t_node1 = t_node2;
}
free(m_pOpen);
m_pOpen = nullptr;
}
if(m_pClosed)
{
t_node1 = m_pClosed->NextNode;
while(t_node1)
{
t_node2 = t_node1->NextNode;
free(t_node1);
t_node1 = t_node2;
}
free(m_pClosed);
m_pClosed = nullptr;
}
}
void CPathFind::SetMap(int x, int y, MAP * pMap, int16 min_x, int16 min_y)
{
m_vMapSize.cx = x;
m_vMapSize.cy = y;
m_pMap = pMap;
m_min_x = min_x;
m_min_y = min_y;
}
_PathNode *CPathFind::FindPath(int start_x, int start_y, int dest_x, int dest_y)
{
_PathNode *t_node, *r_node = nullptr;
// if(!m_pMap) return nullptr;
ClearData();
m_pOpen = (_PathNode *)calloc(1, sizeof(_PathNode));
m_pClosed = (_PathNode *)calloc(1, sizeof(_PathNode));
t_node = (_PathNode *)calloc(1, sizeof(_PathNode));
t_node->g = 0;
t_node->h = (int)sqrt((double)((start_x-dest_x)*(start_x-dest_x) + (start_y-dest_y)*(start_y-dest_y)));
// t_node->h = (int)std::max( start_x-dest_x, start_y-dest_y );
t_node->f = t_node->g + t_node->h;
t_node->x = start_x;
t_node->y = start_y;
int maxtry = abs(start_x-dest_x)*m_vMapSize.cx + abs(start_y-dest_y)*m_vMapSize.cy + 1;
int count = 0;
m_pOpen->NextNode = t_node;
while (1)
{
if (count++ > maxtry * 2)
return nullptr;
r_node = (_PathNode *)ReturnBestNode();
if (r_node == nullptr) return r_node;
if (r_node->x == dest_x && r_node->y == dest_y)
return r_node;
FindChildPath(r_node, dest_x, dest_y);
}
return r_node;
}
_PathNode *CPathFind::ReturnBestNode()
{
_PathNode *tmp;
if(m_pOpen->NextNode == nullptr) {
return nullptr;
}
tmp=m_pOpen->NextNode; // point to first node on m_pOpen
m_pOpen->NextNode=tmp->NextNode; // Make m_pOpen point to nextnode or nullptr.
tmp->NextNode=m_pClosed->NextNode;
m_pClosed->NextNode=tmp;
return(tmp);
}
void CPathFind::FindChildPath(_PathNode *node, int dx, int dy)
{
int x, y;
// UpperLeft
if(IsBlankMap(x=node->x-1,y=node->y-1))
FindChildPathSub(node, x, y, dx, dy, LEVEL_TWO_FIND_CROSS );
// Upper
if(IsBlankMap(x=node->x,y=node->y-1))
FindChildPathSub(node, x, y, dx, dy, LEVEL_TWO_FIND_DIAGONAL );
// UpperRight
if(IsBlankMap(x=node->x+1,y=node->y-1))
FindChildPathSub(node, x, y, dx, dy, LEVEL_TWO_FIND_CROSS );
// Right
if(IsBlankMap(x=node->x+1,y=node->y))
FindChildPathSub(node, x, y, dx, dy, LEVEL_TWO_FIND_DIAGONAL );
// LowerRight
if(IsBlankMap(x=node->x+1,y=node->y+1))
FindChildPathSub(node, x, y, dx, dy, LEVEL_TWO_FIND_CROSS );
// Lower
if(IsBlankMap(x=node->x,y=node->y+1))
FindChildPathSub(node, x, y, dx, dy, LEVEL_TWO_FIND_DIAGONAL );
// LowerLeft
if(IsBlankMap(x=node->x-1,y=node->y+1))
FindChildPathSub(node, x, y, dx, dy, LEVEL_TWO_FIND_CROSS );
// Left
if(IsBlankMap(x=node->x-1,y=node->y))
FindChildPathSub(node, x, y, dx, dy, LEVEL_TWO_FIND_DIAGONAL );
}
void CPathFind::FindChildPathSub(_PathNode *node, int x, int y, int dx, int dy, int arg)
{
int g, c=0;
_PathNode *old_node,*t_node;
g = node->g + arg;
if((old_node = CheckOpen(x, y)) != nullptr)
{
for(c = 0; c < 8; c++)
{
if(node->Child[c] == nullptr)
{
break;
}
}
node->Child[c] = old_node;
if(g < old_node->g)
{
old_node->Parent = node;
old_node->g = g;
old_node->f = g + old_node->h;
}
}
else if((old_node = CheckClosed(x, y)) != nullptr)
{
for(c = 0; c < 8; c++)
{
if(node->Child[c] == nullptr)
{
break;
}
}
node->Child[c] = old_node;
if(g < old_node->g)
{
old_node->Parent = node;
old_node->g = g;
old_node->f = g + old_node->h;
PropagateDown(old_node);
}
}
else
{
t_node = (_PathNode *)calloc(1, sizeof(_PathNode));
t_node->Parent = node;
t_node->g = g;
// t_node->h = (int)sqrt((x-dx)*(x-dx) + (y-dy)*(y-dy));
t_node->h = (int)std::max( x-dx, y-dy );
t_node->f = g + t_node->h;
t_node->x = x;
t_node->y = y;
Insert(t_node);
for(c = 0; c < 8; c++)
{
if(node->Child[c] == nullptr)
{
break;
}
}
node->Child[c] = t_node;
}
}
_PathNode *CPathFind::CheckOpen(int x, int y)
{
_PathNode *tmp = m_pOpen->NextNode;
while (tmp != nullptr)
{
if (tmp->x == x && tmp->y == y)
return tmp;
tmp = tmp->NextNode;
}
return nullptr;
}
_PathNode *CPathFind::CheckClosed(int x, int y)
{
_PathNode *tmp;
tmp = m_pClosed->NextNode;
while(tmp != nullptr)
{
if(tmp->x == x && tmp->y == y)
{
return tmp;
}
else
{
tmp = tmp->NextNode;
}
}
return nullptr;
}
void CPathFind::Insert(_PathNode *node)
{
_PathNode *tmp1, *tmp2;
int f;
if(m_pOpen->NextNode == nullptr)
{
m_pOpen->NextNode = node;
return;
}
f = node->f;
tmp1 = m_pOpen;
tmp2 = m_pOpen->NextNode;
while((tmp2 != nullptr) && (tmp2->f < f))
{
tmp1 = tmp2;
tmp2 = tmp2->NextNode;
}
node->NextNode = tmp2;
tmp1->NextNode = node;
}
void CPathFind::PropagateDown(_PathNode *old)
{
int c, g;
_PathNode *child, *parent;
g = old->g;
for(c = 0; c < 8; c++)
{
if((child = old->Child[c]) == nullptr)
{
break;
}
if(g+1 < child->g)
{
child->g = g+1;
child->f = child->g + child->h;
child->Parent = old;
Push(child);
}
}
while (m_pStack->NextStackPtr != nullptr)
{
parent = Pop();
for(c = 0; c < 8; c++)
{
if((child = parent->Child[c])==nullptr)
{
break;
}
if(parent->g+1 < child->g)
{
child->g = parent->g+1;
child->f = parent->g + parent->h;
child->Parent = parent;
Push(child);
}
}
}
}
void CPathFind::Push(_PathNode *node)
{
STACK *tmp;
tmp = (STACK *)calloc(1, sizeof(STACK));
tmp->NodePtr = node;
tmp->NextStackPtr = m_pStack->NextStackPtr;
m_pStack->NextStackPtr = tmp;
}
_PathNode *CPathFind::Pop()
{
_PathNode *t_node;
STACK *t_stack;
t_stack = m_pStack->NextStackPtr;
t_node = t_stack->NodePtr;
m_pStack->NextStackPtr = t_stack->NextStackPtr;
free(t_stack);
return t_node;
}
bool CPathFind::IsBlankMap(int x, int y)
{
return m_pMap->IsMovable(m_min_x + x, m_min_y + y);
}

View File

@ -0,0 +1,67 @@
#pragma once
// temporary
struct CPoint
{
CPoint() {}
CPoint(int x, int y) : x(x), y(y) {}
int x, y;
};
class CRect
{
public:
CRect(int x1, int y1, int x3, int y3)
: A(x1, y1), C(x3, y3) {}
bool PtInRect(int x, int y) { return (x >= A.x && x <= C.x && y >= A.y && y <= C.y); }
private:
CPoint A, C;
};
class _PathNode {
public:
int f;
int h;
int g;
int x;
int y;
_PathNode *Parent;
_PathNode *Child[8];
_PathNode *NextNode;
};
class STACK {
public:
_PathNode *NodePtr;
STACK *NextStackPtr;
};
class CPathFind
{
public:
bool IsBlankMap(int x, int y);
void SetMap(int x, int y, MAP * pMap, int16 min_x, int16 min_y);
void PropagateDown(_PathNode *old);
void Insert(_PathNode *node);
_PathNode *CheckOpen(int x, int y);
_PathNode *CheckClosed(int x, int y);
void FindChildPathSub(_PathNode *node, int x, int y, int dx, int dy, int arg);
void FindChildPath(_PathNode *node, int dx, int dy);
void ClearData();
_PathNode *ReturnBestNode();
_PathNode *FindPath(int start_x, int start_y, int dest_x, int dest_y);
CPathFind();
virtual ~CPathFind();
void Push(_PathNode *node);
_PathNode *Pop();
protected:
long m_lMapUse;
_PathNode *m_pOpen, *m_pClosed;
STACK *m_pStack;
MAP *m_pMap;
int16 m_min_x, m_min_y;
uint32 m_nMapSize;
CSize m_vMapSize;
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

15
server/AIServer/Region.h Normal file
View File

@ -0,0 +1,15 @@
#pragma once
#include "../shared/STLMap.h"
typedef CSTLMap <int> ZoneUserArray;
typedef CSTLMap <int> ZoneNpcArray;
class CRegion
{
public:
CRegion() : m_byMoving(0) {}
ZoneUserArray m_RegionUserArray;
ZoneNpcArray m_RegionNpcArray;
uint8 m_byMoving; // move : 1, not moving : 0
};

Binary file not shown.

View File

@ -0,0 +1,2 @@
#TargetFrameworkVersion=v4.0:PlatformToolSet=v142:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.17763.0
Release|Win32|F:\005SERVER\server source\|

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@


View File

@ -0,0 +1 @@


View File

@ -0,0 +1 @@


Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,60 @@
shared.lib(TimeThread.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in MagicProcess.obj
shared.lib(TimeThread.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MT_StaticRelease' in MagicProcess.obj
shared.lib(TimeThread.obj) : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification
shared.lib(ReferenceObject.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in MagicProcess.obj
shared.lib(ReferenceObject.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MT_StaticRelease' in MagicProcess.obj
shared.lib(globals.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in MagicProcess.obj
shared.lib(globals.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MT_StaticRelease' in MagicProcess.obj
shared.lib(SocketMgr.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in MagicProcess.obj
shared.lib(SocketMgr.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MT_StaticRelease' in MagicProcess.obj
shared.lib(Socket.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in MagicProcess.obj
shared.lib(Socket.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MT_StaticRelease' in MagicProcess.obj
shared.lib(KOSocket.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in MagicProcess.obj
shared.lib(KOSocket.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MT_StaticRelease' in MagicProcess.obj
shared.lib(Condition.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in MagicProcess.obj
shared.lib(Condition.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MT_StaticRelease' in MagicProcess.obj
shared.lib(signal_handler.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in MagicProcess.obj
shared.lib(signal_handler.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MT_StaticRelease' in MagicProcess.obj
shared.lib(SMDFile.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in MagicProcess.obj
shared.lib(SMDFile.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MT_StaticRelease' in MagicProcess.obj
shared.lib(tstring.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in MagicProcess.obj
shared.lib(tstring.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MT_StaticRelease' in MagicProcess.obj
shared.lib(Thread.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in MagicProcess.obj
shared.lib(Thread.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MT_StaticRelease' in MagicProcess.obj
shared.lib(Ini.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in MagicProcess.obj
shared.lib(Ini.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MT_StaticRelease' in MagicProcess.obj
shared.lib(SocketOpsWin32.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in MagicProcess.obj
shared.lib(SocketOpsWin32.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MT_StaticRelease' in MagicProcess.obj
shared.lib(OdbcConnection.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in MagicProcess.obj
shared.lib(OdbcConnection.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MT_StaticRelease' in MagicProcess.obj
shared.lib(OdbcRecordset.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in MagicProcess.obj
shared.lib(OdbcRecordset.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MT_StaticRelease' in MagicProcess.obj
shared.lib(OdbcCommand.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in MagicProcess.obj
shared.lib(OdbcCommand.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MT_StaticRelease' in MagicProcess.obj
shared.lib(stdafx.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in MagicProcess.obj
shared.lib(stdafx.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MT_StaticRelease' in MagicProcess.obj
shared.lib(CircularBuffer.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in MagicProcess.obj
shared.lib(CircularBuffer.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MT_StaticRelease' in MagicProcess.obj
shared.lib(SocketWin32.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in MagicProcess.obj
shared.lib(SocketWin32.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MT_StaticRelease' in MagicProcess.obj
shared.lib(DebugUtils.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in MagicProcess.obj
shared.lib(DebugUtils.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MT_StaticRelease' in MagicProcess.obj
shared.lib(JvCryption.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in MagicProcess.obj
shared.lib(JvCryption.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MT_StaticRelease' in MagicProcess.obj
shared.lib(OdbcParameter.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in MagicProcess.obj
shared.lib(OdbcParameter.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MT_StaticRelease' in MagicProcess.obj
LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library
shared.lib(OdbcRecordset.obj) : error LNK2001: unresolved external symbol __CrtDbgReport
shared.lib(OdbcCommand.obj) : error LNK2001: unresolved external symbol __CrtDbgReport
shared.lib(SocketWin32.obj) : error LNK2001: unresolved external symbol __CrtDbgReport
shared.lib(SMDFile.obj) : error LNK2001: unresolved external symbol __CrtDbgReport
shared.lib(tstring.obj) : error LNK2001: unresolved external symbol __CrtDbgReport
shared.lib(Ini.obj) : error LNK2001: unresolved external symbol __CrtDbgReport
shared.lib(OdbcConnection.obj) : error LNK2001: unresolved external symbol __CrtDbgReport
shared.lib(globals.obj) : error LNK2001: unresolved external symbol __CrtDbgReport
shared.lib(SocketMgr.obj) : error LNK2001: unresolved external symbol __CrtDbgReport
shared.lib(Socket.obj) : error LNK2001: unresolved external symbol __CrtDbgReport
shared.lib(KOSocket.obj) : error LNK2001: unresolved external symbol __CrtDbgReport
shared.lib(Ini.obj) : error LNK2001: unresolved external symbol __free_dbg
shared.lib(Ini.obj) : error LNK2001: unresolved external symbol __malloc_dbg
F:\005SERVER\server source\..\bin\Release\AIServer.exe : fatal error LNK1120: 3 unresolved externals

Binary file not shown.

View File

@ -0,0 +1,320 @@
#include "stdafx.h"
#include "RoomEvent.h"
#include "resource.h"
#include "Npc.h"
CRoomEvent::CRoomEvent()
{
m_iZoneNumber = 0;
m_sRoomNumber = 0;
m_byStatus = RoomStatusInitialised;
m_iInitMinX = 0;
m_iInitMinZ = 0;
m_iInitMaxX = 0;
m_iInitMaxZ = 0;
m_iEndMinX = 0;
m_iEndMinZ = 0;
m_iEndMaxX = 0;
m_iEndMaxZ = 0;
m_byCheck = 0;
m_byRoomType = 0;
Initialize();
}
CRoomEvent::~CRoomEvent()
{
}
void CRoomEvent::Initialize()
{
m_tDelayTime = 0;
m_byLogicNumber = 1;
for(int i=0; i<MAX_CHECK_EVENT; i++) {
m_Logic[i].sNumber = 0;
m_Logic[i].sOption_1 = 0;
m_Logic[i].sOption_2 = 0;
m_Exec[i].sNumber = 0;
m_Exec[i].sOption_1 = 0;
m_Exec[i].sOption_2 = 0;
}
}
void CRoomEvent::MainRoom()
{
// 조건 검색먼저 해야 겠지..
bool bCheck = false, bRunCheck = false;
int event_num = m_Logic[m_byLogicNumber-1].sNumber;
bCheck = CheckEvent(event_num);
if( bCheck ) {
event_num = m_Exec[m_byLogicNumber-1].sNumber;
bRunCheck = RunEvent( event_num );
if( bRunCheck ) {
//wsprintf(notify, "** 알림 : [%d]방이 클리어 되어습니다. **", m_sRoomNumber);
//g_pMain->SendSystemMsg(notify, PUBLIC_CHAT);
m_byStatus = RoomStatusCleared;
}
}
}
bool CRoomEvent::CheckEvent(int event_num)
{
int nMinute = 0, nOption_1 = 0, nOption_2 = 0;
CNpc* pNpc = nullptr;
bool bRetValue = false;
if( m_byLogicNumber == 0 || m_byLogicNumber > MAX_CHECK_EVENT ) {
TRACE("### Check Event Fail :: array overflow = %d ###\n", m_byLogicNumber);
return false;
}
switch( event_num ) {
case 1: // 특정 몬스터를 죽이는 경우
nOption_1 = m_Logic[ m_byLogicNumber-1 ].sOption_1;
pNpc = GetNpcPtr( nOption_1 );
if( pNpc ) {
if( pNpc->m_byChangeType == 100 ) return true;
} else {
if (nOption_1 != 11510 && nOption_1 != 21510)
TRACE("### CheckEvent Error : monster nid = %d, logic=%d ###\n", nOption_1, m_byLogicNumber);
}
//TRACE("---Check Event : monster dead = %d \n", nMonsterNid);
break;
case 2: // 모든 몬스터를 죽여라
bRetValue = CheckMonsterCount( 0, 0, 3 );
if( bRetValue ) {
TRACE("모든 몬스터를 죽여라 죽임\n");
return true;
}
break;
case 3: // 몇분동안 버텨라
nMinute = m_Logic[ m_byLogicNumber-1 ].sOption_1;
nMinute = nMinute * 60; // 분을 초로 변환
if (UNIXTIME >= m_tDelayTime + nMinute ) { // 제한시간 종료
return true;
}
break;
case 4: // 목표지점까지 이동
break;
case 5: // 특정몬스터를 옵션2의 마리수 만큼 죽여라
nOption_1 = m_Logic[ m_byLogicNumber-1 ].sOption_1;
nOption_2 = m_Logic[ m_byLogicNumber-1 ].sOption_2;
bRetValue = CheckMonsterCount( nOption_1, nOption_2, 1 );
if( bRetValue ) {
TRACE("특정몬스터(%d)를 %d마리 죽임\n", nOption_1, nOption_2);
return true;
}
break;
default:
TRACE("### Check Event Fail :: event number = %d ###\n", event_num);
break;
}
return false;
}
bool CRoomEvent::RunEvent( int event_num )
{
CNpc* pNpc = nullptr;
int nOption_1 = 0, nOption_2 = 0;
bool bRetValue = false;
switch( event_num ) {
case 1: // 다른 몬스터의 출현
nOption_1 = m_Exec[ m_byLogicNumber-1 ].sOption_1;
pNpc = GetNpcPtr( nOption_1 );
if( pNpc ) {
pNpc->m_byChangeType = 3; // 몬스터 출현해주세여...
pNpc->SetLive();
}
else {
TRACE("### RunEvent Error : 몬스터 출현 할 수 없당 = %d, logic=%d ###\n", nOption_1, m_byLogicNumber);
}
if( m_byCheck == m_byLogicNumber ) { // 방이 클리어
return true;
}
else m_byLogicNumber++;
break;
case 2: // 문이 열림
nOption_1 = m_Exec[ m_byLogicNumber-1 ].sOption_1;
pNpc = GetNpcPtr( nOption_1 );
if( pNpc ) {
}
else {
TRACE("### RunEvent Error : 문 담당 몬스터 출현 할 수 없당 = %d, logic=%d ###\n", nOption_1, m_byLogicNumber);
}
//wsprintf(notify, "** 알림 : [%d] 문이 열립니다 **", m_sRoomNumber);
//g_pMain->SendSystemMsg(notify, PUBLIC_CHAT);
if( m_byCheck == m_byLogicNumber ) { // 방이 클리어
return true;
}
else m_byLogicNumber++;
break;
case 3: // 다른 몬스터로 변환
if( m_byCheck == m_byLogicNumber ) { // 방이 클리어
return true;
}
break;
case 4: // 특정몬스터 옵션2의 마리수만큼 출현
nOption_1 = m_Exec[ m_byLogicNumber-1 ].sOption_1;
nOption_2 = m_Exec[ m_byLogicNumber-1 ].sOption_2;
bRetValue = CheckMonsterCount( nOption_1, nOption_2, 2 );
//wsprintf(notify, "** 알림 : [%d, %d] 몬스터 출현 **", nOption_1, nOption_2);
//g_pMain->SendSystemMsg(notify, PUBLIC_CHAT);
if( m_byCheck == m_byLogicNumber ) { // 방이 클리어
return true;
}
else m_byLogicNumber++;
break;
case 100: // 특정몬스터 옵션2의 마리수만큼 출현
nOption_1 = m_Exec[ m_byLogicNumber-1 ].sOption_1;
nOption_2 = m_Exec[ m_byLogicNumber-1 ].sOption_2;
TRACE("RunEvent - room=%d, option1=%d, option2=%d\n", m_sRoomNumber, nOption_1, nOption_2);
if( nOption_1 != 0 ) {
EndEventSay( nOption_1, nOption_2 );
}
if( m_byCheck == m_byLogicNumber ) { // 방이 클리어
return true;
}
else m_byLogicNumber++;
break;
default:
TRACE("### RunEvent Fail :: event number = %d ###\n", event_num);
break;
}
return false;
}
CNpc* CRoomEvent::GetNpcPtr( int sid )
{
if (m_mapRoomNpcArray.IsEmpty())
{
if (sid != 11510 && sid != 21510)
TRACE("### RoomEvent-GetNpcPtr() : monster empty, sid=%d ###\n",sid);
return nullptr;
}
foreach_stlmap (itr, m_mapRoomNpcArray)
{
CNpc *pNpc = g_pMain->GetNpcPtr(itr->first);
if (pNpc == nullptr
|| pNpc->GetProtoID() != sid)
continue;
return pNpc;
}
return nullptr;
}
bool CRoomEvent::CheckMonsterCount( int sid, int count, int type )
{
int nMonsterCount = 0, nTotalMonster = 0;
bool bRetValue = false;
int nMonster = m_mapRoomNpcArray.GetSize();
if (nMonster == 0)
{
if (sid != 11510 && sid != 21510)
TRACE("### RoomEvent-GetNpcPtr() : monster empty, sid=%d ###\n",sid);
return nullptr;
}
foreach_stlmap (itr, m_mapRoomNpcArray)
{
CNpc *pNpc = g_pMain->GetNpcPtr(itr->first);
if (pNpc == nullptr)
continue;
if (type == 4)
{
if (pNpc->m_byRegenType == 2) pNpc->m_byRegenType = 0;
pNpc->m_byChangeType = 0;
}
else if (type == 3)
{
if (pNpc->m_byDeadType == 100) nMonsterCount++;
if (nMonsterCount == nMonster) bRetValue = true;
}
else if (pNpc->GetProtoID() == sid)
{
if (type == 1)
{
if (pNpc->m_byChangeType == 100) nMonsterCount++;
if (nMonsterCount == count) bRetValue = true;
}
else if (type == 2)
{
pNpc->m_byChangeType = 3; nMonsterCount++;
if (nMonsterCount == count) bRetValue = true;
}
}
}
return bRetValue;
}
void CRoomEvent::InitializeRoom()
{
m_byStatus = RoomStatusInitialised;
m_tDelayTime = 0;
m_byLogicNumber = 1;
CheckMonsterCount(0, 0, 4); // 몬스터의 m_byChangeType=0으로 초기화
}
void CRoomEvent::EndEventSay( int option1, int option2 )
{
std::string buff;
switch (option1)
{
case 1:
{
switch (option2)
{
case 1:
g_pMain->GetServerResource(IDS_KARUS_CATCH_1, &buff);
break;
case 2:
g_pMain->GetServerResource(IDS_KARUS_CATCH_2, &buff);
break;
case 11:
g_pMain->GetServerResource(IDS_ELMORAD_CATCH_1, &buff);
break;
case 12:
g_pMain->GetServerResource(IDS_ELMORAD_CATCH_2, &buff);
break;
}
g_pMain->SendSystemMsg(buff, WAR_SYSTEM_CHAT);
} break;
case 2:
g_pMain->GetServerResource(IDS_KARUS_PATHWAY + (option2-1), &buff);
g_pMain->SendSystemMsg(buff, WAR_SYSTEM_CHAT);
// this is normal, we need to send the following packet as well.
case 3:
{
Packet result(AG_BATTLE_EVENT, uint8(BATTLE_MAP_EVENT_RESULT));
result << uint8(option2);
g_pMain->Send(&result);
} break;
}
}

View File

@ -0,0 +1,76 @@
#pragma once
#include "../shared/STLMap.h"
#define MAX_CHECK_EVENT 10
typedef CSTLMap <int> mapNpcArray;
struct _RoomEvent
{
short sNumber; // 명령어, 조건문 번호
short sOption_1; // option 1 (몬스터의 번호를 주로 가지고 있음)
short sOption_2; // option 2 (몬스터의 마리수)
};
class CNpc;
enum RoomStatus
{
RoomStatusInitialised = 1,
RoomStatusInProgress = 2,
RoomStatusCleared = 3
};
class CRoomEvent
{
public:
INLINE RoomStatus GetStatus() { return m_byStatus; }
INLINE bool isInitialised() { return GetStatus() == RoomStatusInitialised; }
INLINE bool isInProgress() { return GetStatus() == RoomStatusInProgress; }
INLINE bool isCleared() { return GetStatus() == RoomStatusCleared; }
int m_iZoneNumber; // zone number
short m_sRoomNumber; // room number (0:empty room)
RoomStatus m_byStatus; // room status (1:init, 2:progress, 3:clear)
uint8 m_byCheck; // 조건문의 갯수
uint8 m_byRoomType; // 방의 타입(0:일반, 1:함정방, 2:,,,,)
int m_iInitMinX; // room region x
int m_iInitMinZ;
int m_iInitMaxX;
int m_iInitMaxZ;
int m_iEndMinX; // room end region x 도착지점,,
int m_iEndMinZ;
int m_iEndMaxX;
int m_iEndMaxZ;
_RoomEvent m_Logic[MAX_CHECK_EVENT]; // 조건들
_RoomEvent m_Exec[MAX_CHECK_EVENT]; // 실행문
time_t m_tDelayTime; // time
mapNpcArray m_mapRoomNpcArray; // room npc uid array
private:
uint8 m_byLogicNumber; // 현재의 조건문 검사 번호 (조건번호는 1부터 시작됨) (m_byCheck와 m_byLogicNumber이 같다면 클리어 상태)
public:
CRoomEvent();
virtual ~CRoomEvent();
void MainRoom();
void InitializeRoom();
private:
void Initialize();
bool CheckEvent(int event_num);
bool RunEvent( int event_num );
bool CheckMonsterCount( int sid, int count, int type );
CNpc* GetNpcPtr( int sid );
void EndEventSay( int option1, int option2 );
};

File diff suppressed because it is too large Load Diff

149
server/AIServer/ServerDlg.h Normal file
View File

@ -0,0 +1,149 @@
#pragma once
#include "Define.h"
#include "../shared/KOSocketMgr.h"
#include "../shared/database/OdbcConnection.h"
#include "GameSocket.h"
#include "MAP.h"
#include "PathFind.h"
#include "../shared/STLMap.h"
#include "../shared/STLMapOnlyLoad.h"
class CNpcThread;
class CNpcTable;
class Unit;
typedef std::map <uint8, CNpcThread*> NpcThreadArray;
typedef CSTLMap <CNpcTable> NpcTableArray;
typedef CSTLMap <CNpc> NpcArray;
typedef CSTLMapOnlyLoad <_MAGIC_TABLE> MagictableArray;
typedef CSTLMapOnlyLoad <_MAGIC_TYPE1> Magictype1Array;
typedef CSTLMapOnlyLoad <_MAGIC_TYPE2> Magictype2Array;
typedef CSTLMapOnlyLoad <_MAGIC_TYPE4> Magictype4Array;
typedef CSTLMap <_PARTY_GROUP> PartyArray;
typedef CSTLMapOnlyLoad <_MAKE_WEAPON> MakeWeaponItemTableArray;
typedef CSTLMapOnlyLoad <_MAKE_ITEM_GRADE_CODE> MakeGradeItemTableArray;
typedef CSTLMapOnlyLoad <_MAKE_ITEM_LARE_CODE> MakeLareItemTableArray;
typedef std::list <int> ZoneNpcInfoList;
typedef CSTLMapOnlyLoad <MAP> ZoneArray;
typedef CSTLMapOnlyLoad <_K_MONSTER_ITEM> NpcItemArray;
typedef CSTLMapOnlyLoad <_MAKE_ITEM_GROUP> MakeItemGroupArray;
typedef CSTLMapOnlyLoad <_SERVER_RESOURCE> ServerResourceArray;
typedef CSTLMap <_NPC_LIVE_TIME> NpcLiveTimeArray;
typedef CSTLMapOnlyLoad <_OBJECT_EVENT> ObjectEventArray;
typedef std::map<uint16, CUser *> UserSessionMap;
class CServerDlg
{
private:
void ResumeAI();
bool CreateNpcThread();
bool GetMagicTableData();
bool GetMagicType1Data();
bool GetMagicType2Data();
bool GetMagicType4Data();
bool GetNpcTableData(bool bNpcData = true);
bool GetNpcItemTable();
bool GetMakeItemGroupTable();
bool GetMakeWeaponItemTableData();
bool GetMakeDefensiveItemTableData();
bool GetMakeGradeItemTableData();
bool GetMakeLareItemTableData();
bool GetServerResourceTable();
bool MapFileLoad();
void GetServerInfoIni();
bool GetObjectPostTableData();
public:
CServerDlg();
bool Startup();
void UserEventRoomUpdate(uint16 uid, uint16 RoomEvent);
bool LoadSpawnCallback(OdbcCommand *dbCommand);
void GameServerAcceptThread();
void GetServerResource(int nResourceID, std::string * result, ...);
bool AddObjectEventNpc(_OBJECT_EVENT* pEvent, MAP * pMap);
CNpc * SpawnEventNpc(uint16 sSid, bool bIsMonster, uint8 byZone, float fX, float fY, float fZ, uint16 Radius = 0, uint16 sDuration = 0, uint8 nation = 0, int16 socketID = -1,uint16 nEventRoom = 0, bool nIsPet = false, std::string strPetName = "", std::string strUserName = "", uint64 nSerial = 1, uint16 UserId = -1);
void NpcUpdate(uint16 sSid, bool bIsMonster, uint8 byGroup = 0, uint16 sPid = 0);
void AllNpcInfo();
Unit * GetUnitPtr(uint16 id);
CNpc * GetNpcPtr(uint16 npcId);
CUser* GetUserPtr(uint16 sessionId);
bool SetUserPtr(uint16 sessionId, CUser * pUser);
void DeleteUserPtr(uint16 sessionId);
MAP * GetZoneByID(int zonenumber);
static uint32 THREADCALL Timer_CheckAliveTest(void * lpParam);
static uint32 THREADCALL Timer_CheckLiveTimes(void * lpParam);
void CheckAliveTest();
void CheckLiveTimes();
void DeleteAllUserList(CGameSocket *pSock = nullptr);
void Send(Packet * pkt);
void SendSystemMsg(std::string & pMsg, int type=0);
void ResetBattleZone();
~CServerDlg();
public:
bool CSWOpen;
uint16 EventNpcID;
std::vector <uint16> freeIDs;
NpcArray m_arNpc;
NpcTableArray m_arMonTable;
NpcTableArray m_arNpcTable;
NpcThreadArray m_arNpcThread;
PartyArray m_arParty;
ZoneNpcInfoList m_ZoneNpcList;
MagictableArray m_MagictableArray;
Magictype1Array m_Magictype1Array;
Magictype2Array m_Magictype2Array;
Magictype4Array m_Magictype4Array;
MakeWeaponItemTableArray m_MakeWeaponItemArray;
MakeWeaponItemTableArray m_MakeDefensiveItemArray;
MakeGradeItemTableArray m_MakeGradeItemArray;
MakeLareItemTableArray m_MakeLareItemArray;
ZoneArray g_arZone;
NpcItemArray m_NpcItemArray;
MakeItemGroupArray m_MakeItemGroupArray;
ServerResourceArray m_ServerResourceArray;
NpcLiveTimeArray m_NpcLiveTimeArray;
ObjectEventArray m_ObjectEventArray;
Thread m_zoneEventThread;
// Military Camps
uint8 KarusBaseMilitaryCampCount, ElmoradBaseMilitaryCampCount, KarusEslantMilitaryCampCount, ElmoradEslantMilitaryCampCount, MoradonMilitaryCampCount;
std::string m_strGameDSN, m_strGameUID, m_strGamePWD;
OdbcConnection m_GameDB;
uint32 m_AIServerPort;
UserSessionMap m_pUser;
Atomic<uint16> MaxMonsterID;
Atomic<uint16> m_TotalNPC; // DB에있는 총 수
Atomic<uint16> m_CurrentNPC;
short m_sTotalMap; // Zone 수
short m_sMapEventNpc; // Map에서 읽어들이는 event npc 수
bool m_bFirstServerFlag; // 서버가 처음시작한 후 게임서버가 붙은 경우에는 1, 붙지 않은 경우 0
uint8 m_byBattleEvent; // 전쟁 이벤트 관련 플래그( 1:전쟁중이 아님, 0:전쟁중)
short m_sKillKarusNpc, m_sKillElmoNpc; // 전쟁동안에 죽은 npc숫자
uint16 m_iYear, m_iMonth, m_iDate, m_iHour, m_iMin, m_iAmount;
uint8 m_iWeather;
bool m_bIsNight;
std::recursive_mutex m_userLock, m_npcThreadLock, m_makeItemGroupLock, m_freeIdsLock;
KOSocketMgr<CGameSocket> m_socketMgr;
};
extern CServerDlg * g_pMain;

1392
server/AIServer/Unit.cpp.txt Normal file

File diff suppressed because it is too large Load Diff

125
server/AIServer/User.h Normal file
View File

@ -0,0 +1,125 @@
#pragma once
#include "Extern.h"
#include "../shared/STLMap.h"
#include "../GameServer/Unit.h"
class MAP;
enum TransformationType
{
TransformationNone,
TransformationMonster,
TransformationNPC,
TransformationSiege
};
class CUser : public Unit
{
public:
INLINE bool isGM() { return m_byIsOP == AUTHORITY_GAME_MASTER; }
virtual uint16 GetID() { return m_iUserId; }
virtual std::string & GetName() { return m_strUserID; }
virtual int32 GetHealth() { return m_sHP; }
virtual int32 GetMaxHealth() { return m_sMaxHP; }
virtual int32 GetMana() { return m_sMP; }
virtual int32 GetMaxMana() { return m_sMaxMP; }
virtual void GetInOut(Packet &, uint8) {}
virtual void AddToRegion(int16 sRegionX, int16 sRegionZ) {}
virtual void BlinkStart() {}
virtual void DcFlash() {}
virtual void ExpFlash() {}
virtual void WarFlash() {}
virtual void HpChange(int amount, Unit *pAttacker = nullptr, bool bSendToAI = true) {}
virtual void MSpChange(int amount) {}
virtual bool isDead() { return m_bLive == AI_USER_DEAD || GetHealth() <= 0; }
INLINE bool isInParty() { return m_byNowParty != 0; }
INLINE uint16 GetPartyID() { return m_sPartyNumber; }
std::string m_strUserID;
short m_iUserId; // User의 번호
uint8 m_bLive; // 죽었니? 살았니?
float m_fWill_x; // 다음 X 좌표
float m_fWill_y; // 다음 Y 좌표
float m_fWill_z; // 다음 Z 좌표
short m_sSpeed; // 유저의 스피드
short m_sHP; // HP
short m_sMP; // MP
short m_sMaxHP; // HP
short m_sMaxMP; // MP
uint8 m_state; // User의 상태
uint8 m_byNowParty;
uint8 m_byPartyTotalMan;
short m_sPartyTotalLevel;
short m_sPartyNumber;
uint16 m_sItemAc;
short m_sSurroundNpcNumber[8]; // Npc 다굴~
uint8 m_byIsOP;
uint8 m_bInvisibilityType;
TransformationType m_transformationType;
public:
void Initialize();
void InitNpcAttack();
void OnDeath(Unit * pKiller);
int IsSurroundCheck(float fX, float fY, float fZ, int NpcID);
void HealMagic();
void HealAreaCheck(int rx, int rz);
bool isHostileTo(Unit * pTarget);
bool isInArena();
bool isInPartyArena();
bool isInPVPZone();
bool isInSafetyArea();
short GetDamage(Unit *pTarget, _MAGIC_TABLE *pSkill = nullptr, bool bPreviewOnly = false);
CUser();
virtual ~CUser();
// Placeholders, for the magic system.
// These should really be using the same base class.
INLINE bool isInClan() { return false; }
INLINE uint16 GetClanID() { return 0; }
INLINE uint8 GetStat(StatType type) { return 0; }
INLINE void SetStatBuff(StatType type, int8 val) {}
INLINE void RemoveStatBuff(StatType type, int8 val) {}
INLINE void SetUserEventRoom(uint16 nEventRoom) {m_bEventRoom = nEventRoom;}
void RemoveSavedMagic(uint32 nSkillID) {}
void SendUserStatusUpdate(UserStatus type, UserStatusBehaviour status) {}
void SetUserAbility(bool bSendPacket = true) {}
void Send(Packet * pkt) {}
time_t m_tLastRegeneTime;
uint32 m_nOldAbnormalType;
uint8 m_sExpGainAmount;
uint8 m_bMaxWeightAmount, m_bNPGainAmount, m_bNoahGainAmount,
m_bPlayerAttackAmount, m_bSkillNPBonus,
m_bAddWeaponDamage;
uint16 m_sAddArmourAc;
uint8 m_bPctArmourAc;
uint8 m_FlashExpBonus;
uint8 m_FlashDcBonus;
uint8 m_FlashWarBonus;
bool m_bPremiumMerchant;
};

59
server/AIServer/main.cpp Normal file
View File

@ -0,0 +1,59 @@
#include "stdafx.h"
#include "../shared/signal_handler.h"
CServerDlg * g_pMain;
static Condition s_hEvent;
BOOL WINAPI _ConsoleHandler(DWORD dwCtrlType);
bool g_bRunning = true;
int main()
{
SetConsoleTitle("AI Server for Knight Online v" STRINGIFY(__VERSION));
// Override the console handler
SetConsoleCtrlHandler(_ConsoleHandler, TRUE);
HookSignals(&s_hEvent);
// Start up the time updater thread
StartTimeThread();
g_pMain = new CServerDlg();
// Startup server
if (g_pMain->Startup())
{
printf("\nServer started up successfully!\n");
// Wait until console's signaled as closing
s_hEvent.Wait();
}
else
{
system("pause");
}
printf("Server shutting down, please wait...\n");
// This seems redundant, but it's not.
// We still have the destructor for the dialog instance, which allows time for threads to properly cleanup.
g_bRunning = false;
delete g_pMain;
CleanupTimeThread();
UnhookSignals();
return 0;
}
BOOL WINAPI _ConsoleHandler(DWORD dwCtrlType)
{
s_hEvent.BeginSynchronized();
s_hEvent.Signal();
s_hEvent.EndSynchronized();
sleep(10000); // Win7 onwards allows 10 seconds before it'll forcibly terminate
return TRUE;
}

View File

@ -0,0 +1,781 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug-XP|Win32">
<Configuration>Debug-XP</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug-XP|x64">
<Configuration>Debug-XP</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-XP|Win32">
<Configuration>Release-XP</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-XP|x64">
<Configuration>Release-XP</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{36A92A8F-3820-435C-AC63-E861A556C1BB}</ProjectGuid>
<ProjectName>AIServer</ProjectName>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-XP|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-XP|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-XP|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110_xp</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-XP|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110_xp</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-XP|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-XP|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-XP|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-XP|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)..\bin\$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release-XP|Win32'">$(SolutionDir)..\bin\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release-XP|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release-XP|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release-XP|x64'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug-XP|Win32'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug-XP|x64'">true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)..\bin\$(Configuration)\</OutDir>
<IncludePath>E:\KO\KO CALISMALAR\boost;$(IncludePath)</IncludePath>
<LibraryPath>E:\KO\KO CALISMALAR\boost\libs;$(LibraryPath)</LibraryPath>
<ExcludePath>E:\KO\KO CALISMALAR\boost;$(ExcludePath)</ExcludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<IncludePath>C:\Users\Administrator\Desktop\2180\2117\boost_1_63_0;$(IncludePath)</IncludePath>
<LibraryPath>C:\Users\Administrator\Desktop\2180\2117\boost_1_63_0\stage;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-XP|Win32'">
<OutDir>$(SolutionDir)..\bin\$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-XP|x64'" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Midl>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>Win32</TargetEnvironment>
<TypeLibraryName>.\Release/Server.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<PreprocessorDefinitions>WIN32;AI_SERVER;NDEBUG;_WINDOWS;_3DSERVER;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>.\Release/Server.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Release/</AssemblerListingLocation>
<ObjectFileName>.\Release/</ObjectFileName>
<ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>
<BrowseInformation>false</BrowseInformation>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0412</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>ws2_32.lib;$(SolutionDir)../bin/$(Configuration)/shared.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SuppressStartupBanner>true</SuppressStartupBanner>
<SubSystem>NotSet</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
<IgnoreSpecificDefaultLibraries>
</IgnoreSpecificDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\Release/Server.bsc</OutputFile>
</Bscmake>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Midl>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Release/Server.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<PreprocessorDefinitions>WIN32;AI_SERVER;NDEBUG;_WINDOWS;_3DSERVER;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>.\Release/Server.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Release/</AssemblerListingLocation>
<ObjectFileName>.\Release/</ObjectFileName>
<ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>
<BrowseInformation>false</BrowseInformation>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0412</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>ws2_32.lib;$(SolutionDir)../bin/$(Configuration)/shared.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SuppressStartupBanner>true</SuppressStartupBanner>
<SubSystem>NotSet</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<IgnoreSpecificDefaultLibraries>
</IgnoreSpecificDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\Release/Server.bsc</OutputFile>
</Bscmake>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-XP|Win32'">
<Midl>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>Win32</TargetEnvironment>
<TypeLibraryName>.\Release/Server.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<PreprocessorDefinitions>WIN32;AI_SERVER;NDEBUG;_WINDOWS;_3DSERVER;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>.\Release/Server.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Release/</AssemblerListingLocation>
<ObjectFileName>.\Release/</ObjectFileName>
<ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>
<BrowseInformation>false</BrowseInformation>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0412</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>ws2_32.lib;$(SolutionDir)../bin/$(Configuration)/shared.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SuppressStartupBanner>true</SuppressStartupBanner>
<SubSystem>Console</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
<IgnoreSpecificDefaultLibraries>
</IgnoreSpecificDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\Release/Server.bsc</OutputFile>
</Bscmake>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-XP|x64'">
<Midl>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Release/Server.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<PreprocessorDefinitions>WIN32;AI_SERVER;NDEBUG;_WINDOWS;_3DSERVER;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>.\Release/Server.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Release/</AssemblerListingLocation>
<ObjectFileName>.\Release/</ObjectFileName>
<ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>
<BrowseInformation>false</BrowseInformation>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0412</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>ws2_32.lib;$(SolutionDir)../bin/$(Configuration)/shared.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SuppressStartupBanner>true</SuppressStartupBanner>
<SubSystem>Console</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<IgnoreSpecificDefaultLibraries>
</IgnoreSpecificDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\Release/Server.bsc</OutputFile>
</Bscmake>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Midl>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>Win32</TargetEnvironment>
<TypeLibraryName>.\Debug/Server.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;AI_SERVER;_DEBUG;_WINDOWS;_3DSERVER;_REPENT;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeaderOutputFile>.\Debug/Server.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Debug/</AssemblerListingLocation>
<ObjectFileName>.\Debug/</ObjectFileName>
<ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<PrecompiledHeader>Use</PrecompiledHeader>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0000</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>ws2_32.lib;$(SolutionDir)../bin/$(Configuration)/shared.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SuppressStartupBanner>true</SuppressStartupBanner>
<GenerateDebugInformation>true</GenerateDebugInformation>
<GenerateMapFile>true</GenerateMapFile>
<MapFileName>.\Debug/Server.map</MapFileName>
<SubSystem>NotSet</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
<IgnoreSpecificDefaultLibraries>
</IgnoreSpecificDefaultLibraries>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\Debug/Server.bsc</OutputFile>
</Bscmake>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Midl>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Debug/Server.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;AI_SERVER;_DEBUG;_WINDOWS;_3DSERVER;_REPENT;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeaderOutputFile>.\Debug/Server.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Debug/</AssemblerListingLocation>
<ObjectFileName>.\Debug/</ObjectFileName>
<ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>
<WarningLevel>Level1</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<PrecompiledHeader>Use</PrecompiledHeader>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0000</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>ws2_32.lib;$(SolutionDir)$(Platform)/$(Configuration)/shared.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SuppressStartupBanner>true</SuppressStartupBanner>
<GenerateDebugInformation>true</GenerateDebugInformation>
<GenerateMapFile>true</GenerateMapFile>
<MapFileName>.\Debug/Server.map</MapFileName>
<SubSystem>NotSet</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<IgnoreSpecificDefaultLibraries>
</IgnoreSpecificDefaultLibraries>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\Debug/Server.bsc</OutputFile>
</Bscmake>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-XP|Win32'">
<Midl>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>Win32</TargetEnvironment>
<TypeLibraryName>.\Debug/Server.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;AI_SERVER;_DEBUG;_WINDOWS;_3DSERVER;_REPENT;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeaderOutputFile>.\Debug/Server.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Debug/</AssemblerListingLocation>
<ObjectFileName>.\Debug/</ObjectFileName>
<ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<PrecompiledHeader>Use</PrecompiledHeader>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0000</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>ws2_32.lib;$(SolutionDir)../bin/$(Configuration)/shared.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SuppressStartupBanner>true</SuppressStartupBanner>
<GenerateDebugInformation>true</GenerateDebugInformation>
<GenerateMapFile>true</GenerateMapFile>
<MapFileName>.\Debug/Server.map</MapFileName>
<SubSystem>NotSet</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
<IgnoreSpecificDefaultLibraries>
</IgnoreSpecificDefaultLibraries>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\Debug/Server.bsc</OutputFile>
</Bscmake>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-XP|x64'">
<Midl>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Debug/Server.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;AI_SERVER;_DEBUG;_WINDOWS;_3DSERVER;_REPENT;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeaderOutputFile>.\Debug/Server.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Debug/</AssemblerListingLocation>
<ObjectFileName>.\Debug/</ObjectFileName>
<ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<PrecompiledHeader>Use</PrecompiledHeader>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0000</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>ws2_32.lib;$(SolutionDir)../bin/$(Configuration)/shared.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SuppressStartupBanner>true</SuppressStartupBanner>
<GenerateDebugInformation>true</GenerateDebugInformation>
<GenerateMapFile>true</GenerateMapFile>
<MapFileName>.\Debug/Server.map</MapFileName>
<SubSystem>NotSet</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<IgnoreSpecificDefaultLibraries>
</IgnoreSpecificDefaultLibraries>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\Debug/Server.bsc</OutputFile>
</Bscmake>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\GameServer\MagicProcess.cpp" />
<ClCompile Include="..\GameServer\Unit.cpp" />
<ClCompile Include="..\N3BASE\N3ShapeMgr.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug-XP|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug-XP|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release-XP|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release-XP|x64'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="GameSocket.cpp">
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug-XP|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug-XP|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release-XP|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release-XP|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release-XP|Win32'">
</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release-XP|x64'">
</PrecompiledHeader>
</ClCompile>
<ClCompile Include="main.cpp" />
<ClCompile Include="MAP.cpp">
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug-XP|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug-XP|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release-XP|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release-XP|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release-XP|Win32'">
</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release-XP|x64'">
</PrecompiledHeader>
</ClCompile>
<ClCompile Include="Npc.cpp">
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug-XP|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug-XP|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release-XP|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release-XP|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release-XP|Win32'">
</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release-XP|x64'">
</PrecompiledHeader>
</ClCompile>
<ClCompile Include="NpcMagicProcess.cpp">
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug-XP|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug-XP|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release-XP|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release-XP|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release-XP|Win32'">
</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release-XP|x64'">
</PrecompiledHeader>
</ClCompile>
<ClCompile Include="NpcThread.cpp">
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug-XP|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug-XP|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release-XP|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release-XP|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release-XP|Win32'">
</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release-XP|x64'">
</PrecompiledHeader>
</ClCompile>
<ClCompile Include="Party.cpp">
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug-XP|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug-XP|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release-XP|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release-XP|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release-XP|Win32'">
</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release-XP|x64'">
</PrecompiledHeader>
</ClCompile>
<ClCompile Include="PathFind.cpp">
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug-XP|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug-XP|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release-XP|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release-XP|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release-XP|Win32'">
</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release-XP|x64'">
</PrecompiledHeader>
</ClCompile>
<ClCompile Include="RoomEvent.cpp">
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug-XP|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug-XP|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release-XP|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release-XP|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release-XP|Win32'">
</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release-XP|x64'">
</PrecompiledHeader>
</ClCompile>
<ClCompile Include="ServerDlg.cpp">
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug-XP|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug-XP|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release-XP|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release-XP|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release-XP|Win32'">
</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release-XP|x64'">
</PrecompiledHeader>
</ClCompile>
<ClCompile Include="StdAfx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release-XP|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release-XP|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug-XP|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug-XP|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="AIUser.cpp">
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug-XP|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug-XP|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release-XP|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release-XP|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release-XP|Win32'">
</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release-XP|x64'">
</PrecompiledHeader>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\N3BASE\My_3DStruct.h" />
<ClInclude Include="..\N3BASE\N3ShapeMgr.h" />
<ClInclude Include="..\shared\database\MagicTableSet.h" />
<ClInclude Include="..\shared\database\MagicType1Set.h" />
<ClInclude Include="..\shared\database\MagicType2Set.h" />
<ClInclude Include="..\shared\database\MakeDefensiveTableSet.h" />
<ClInclude Include="..\shared\database\MakeGradeItemTableSet.h" />
<ClInclude Include="..\shared\database\MakeItemGroupSet.h" />
<ClInclude Include="..\shared\database\MakeLareItemTableSet.h" />
<ClInclude Include="..\shared\database\MakeWeaponTableSet.h" />
<ClInclude Include="..\shared\database\NpcItemSet.h" />
<ClInclude Include="..\shared\database\NpcPosSet.h" />
<ClInclude Include="..\shared\database\NpcTableSet.h" />
<ClInclude Include="..\shared\database\ObjectPosSet.h" />
<ClInclude Include="..\shared\database\ZoneInfoSet.h" />
<ClInclude Include="Define.h" />
<ClInclude Include="Extern.h" />
<ClInclude Include="GameSocket.h" />
<ClInclude Include="MAP.h" />
<ClInclude Include="Npc.h" />
<ClInclude Include="NpcMagicProcess.h" />
<ClInclude Include="NpcTable.h" />
<ClInclude Include="NpcThread.h" />
<ClInclude Include="Party.h" />
<ClInclude Include="PathFind.h" />
<ClInclude Include="Region.h" />
<ClInclude Include="RoomEvent.h" />
<ClInclude Include="ServerDlg.h" />
<ClInclude Include="StdAfx.h" />
<ClInclude Include="User.h" />
<ClInclude Include="Resource.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="RES\AIServer.rc" />
</ItemGroup>
<ItemGroup>
<Image Include="RES\AIServer.ico" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,174 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{369fe4a2-2b16-4ee3-aa20-f8f7e17f2310}</UniqueIdentifier>
<Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{a28bbc89-f194-4df4-a771-852c2fa9c91c}</UniqueIdentifier>
</Filter>
<Filter Include="Database">
<UniqueIdentifier>{20471dba-a07d-44f4-8d18-1dfea6801a6c}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{28f89997-9b80-4a68-8e92-b328a184b607}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl</Extensions>
</Filter>
<Filter Include="N3Base">
<UniqueIdentifier>{5056e633-713a-4c87-981f-339526193987}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="MAP.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Npc.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="NpcMagicProcess.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="NpcThread.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Party.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="PathFind.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="RoomEvent.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ServerDlg.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\N3BASE\N3ShapeMgr.cpp">
<Filter>N3Base</Filter>
</ClCompile>
<ClCompile Include="GameSocket.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="StdAfx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="AIUser.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\GameServer\Unit.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\GameServer\MagicProcess.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Define.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Extern.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="MAP.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Npc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="NpcMagicProcess.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="NpcTable.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="NpcThread.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Party.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="PathFind.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Region.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="RoomEvent.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="ServerDlg.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="StdAfx.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="User.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Resource.h">
<Filter>Resource Files</Filter>
</ClInclude>
<ClInclude Include="..\N3BASE\N3ShapeMgr.h">
<Filter>N3Base</Filter>
</ClInclude>
<ClInclude Include="..\N3BASE\My_3DStruct.h">
<Filter>N3Base</Filter>
</ClInclude>
<ClInclude Include="..\shared\database\MakeWeaponTableSet.h">
<Filter>Database</Filter>
</ClInclude>
<ClInclude Include="..\shared\database\NpcItemSet.h">
<Filter>Database</Filter>
</ClInclude>
<ClInclude Include="..\shared\database\NpcPosSet.h">
<Filter>Database</Filter>
</ClInclude>
<ClInclude Include="..\shared\database\NpcTableSet.h">
<Filter>Database</Filter>
</ClInclude>
<ClInclude Include="..\shared\database\ZoneInfoSet.h">
<Filter>Database</Filter>
</ClInclude>
<ClInclude Include="..\shared\database\MagicTableSet.h">
<Filter>Database</Filter>
</ClInclude>
<ClInclude Include="..\shared\database\MagicType1Set.h">
<Filter>Database</Filter>
</ClInclude>
<ClInclude Include="..\shared\database\MagicType2Set.h">
<Filter>Database</Filter>
</ClInclude>
<ClInclude Include="..\shared\database\MakeDefensiveTableSet.h">
<Filter>Database</Filter>
</ClInclude>
<ClInclude Include="..\shared\database\MakeGradeItemTableSet.h">
<Filter>Database</Filter>
</ClInclude>
<ClInclude Include="..\shared\database\MakeLareItemTableSet.h">
<Filter>Database</Filter>
</ClInclude>
<ClInclude Include="GameSocket.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\shared\database\MakeItemGroupSet.h">
<Filter>Database</Filter>
</ClInclude>
<ClInclude Include="..\shared\database\ObjectPosSet.h">
<Filter>Database</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="RES\AIServer.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<Image Include="RES\AIServer.ico">
<Filter>Resource Files</Filter>
</Image>
</ItemGroup>
</Project>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LocalDebuggerWorkingDirectory>$(SolutionDir)..\bin\$(Configuration)\</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LocalDebuggerWorkingDirectory>$(SolutionDir)..\bin\$(Configuration)\</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,6 @@
#define IDS_KARUS_CATCH_1 102
#define IDS_KARUS_CATCH_2 103
#define IDS_ELMORAD_CATCH_1 104
#define IDS_ELMORAD_CATCH_2 105
#define IDS_KARUS_PATHWAY 106
#define IDS_ELMORAD_PATHWAY 107

View File

@ -0,0 +1 @@
#include "stdafx.h"

9
server/AIServer/stdafx.h Normal file
View File

@ -0,0 +1,9 @@
#pragma once
#include "../shared/stdafx.h"
#include <math.h>
#include "Define.h" // define
#include "ServerDlg.h"
extern bool g_bRunning;

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More