⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 network6.cpp

📁 国内著名网络游戏dragon的服务端完整源码 内附完整数据库结构
💻 CPP
字号:
#include "..\stdafx.h"
#include "DefaultHeader.h"
#include "Sealstone.h"
#include "..\\lowerlayers\\servertable.h"
#include "..\\lowerlayers\\servertable2.h"
#include "scrp_exe.h"
extern CServerTable* g_pServerTable;
void SendProxyWantChangeDBDEMON()
{
//	g_pServerTable->SendToProxyServer( (char*)pPacket, dwLength );
	g_pServerTable->RequestToSetDBDemon();
}

void MoveToHomeTown(CHARLIST *Caster)
{
	switch(Caster->name_status.nation)
	{
	case NW_BY :	{MapMove(Caster->GetServerID(),"MA-IN",245,115);	}break;
	case NW_ZY :	{MapMove(Caster->GetServerID(),"RENES_C",210,175);	}break;
	case NW_YL :	{MapMove(Caster->GetServerID(),"BARANTAN",325,98);	}break;
	default:		break;					
	}
}

void MoveToHomeTownWithAilve(CHARLIST *Caster)
{
	SkillMgr.CharacterToAlive(Caster);
	MoveToHomeTown(Caster);
}

extern DWORD GetAbilityRedistributionMoney(t_connection c[], int cn);		// 020115 LTS

void SendCMD_COMFORM_RESET_ABILITY(CHARLIST *ch)//020820 lsw//020901 lsw
{
	if(!ch) {return;}

	for(int i = 0; i < 8;i++)
	{
		if(ch->equip[i].item_no)//厘馒 等霸 乐促搁//020701 lsw
		{
			return;
		}
	}

	const int cn = ch->GetServerID();
		 
	const DWORD tempAbilityRedistributionMoney=GetAbilityRedistributionMoney(connections,cn);
	if (ch->GetBankMoney()>=tempAbilityRedistributionMoney)	// 农芭唱 鞍促搁  //捣八荤
	{
		//某腐磐 捞抚阑 朝赴促
		t_packet p;
		p.h.header.type=CMD_COMFORM_RESET_ABILILTY;				
		p.h.header.size=sizeof(t_ComformResetAbililty);
		memcpy(p.u.ComformResetAbililty.szName,ch->Name,20);
		p.u.ComformResetAbililty.szName[20]= 0;
		p.u.ComformResetAbililty.cn = ch->GetServerID();
		QueuePacket(connections,DB_DEMON,&p,1);
	}
	else//捣绝垒酒
	{
		t_packet packet;
		packet.h.header.type=CMD_CHECK_ABILITY_CHANGE_MONEY;				
		packet.h.header.size=sizeof(t_CommonDataC);
		packet.u.NationWar.CommonDataC.Data=0;	// 角菩
		QueuePacket(connections,cn,&packet,1);
	}	
}

void RecvCMD_COMFORM_RESET_ABILITY(t_packet &packet)//020820 lsw//020901 lsw
{
	CHARLIST *ch = CheckServerId(packet.u.ComformResetAbililty.cn);

	if(!ch) {return;}

	if(!packet.u.ComformResetAbililty.iIsAble)//020827 lsw
	{
		OutMessage(ch,2,710);
		return;
	}

	if(strcmp(ch->Name, packet.u.ComformResetAbililty.szName))
	{
		{return;}
	}
	DWORD tempAbilityRedistributionMoney;
	packet.h.header.type=CMD_CHECK_ABILITY_CHANGE_MONEY;				
	packet.h.header.size=sizeof(t_CommonDataC);
	for(int i = 0; i < 8;i++)
	{
		if(ch->equip[i].item_no)//厘馒 等霸 乐促搁//020701 lsw
		{
			return;
		}
	}

	const int cn = ch->GetServerID();
	tempAbilityRedistributionMoney=GetAbilityRedistributionMoney(connections,cn);
	
	if (ch->DecBankMoney(tempAbilityRedistributionMoney, BMCT_RESET_ABILITY)) // 捣阑 绝浚促
	{	//< CSD-030723
		packet.u.NationWar.CommonDataC.Data=1;	// 己傍
		RecvReqResetAbility(cn);									// 绢呼犁盒硅 风凭阑 龋免茄促.
	}	//> CSD-030723
	else
	{
		packet.u.NationWar.CommonDataC.Data=0;	// 角菩
	}
	QueuePacket(connections,cn,&packet,1);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -