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

📄 gamemir.h

📁 是一个基于热血战国协议的网络游戏。现在脱机客户端先放出来给大家研究
💻 H
📖 第 1 页 / 共 2 页
字号:
/////////////////////////////////////////////////////////////////////////////
// name : GameMir.h
// desc : 热血传奇数据包接收处理文件

#pragma once

#include "stdafx.h"
#include "Net.h"
//#include "..\talktonpcdlg.h"
//#include "..\DialogSetting.h"
#include "EventModel.h"

#define MIR2_VERSION 20020522

#define SR_FAIL      0x0000
#define SR_SUCCESS   0x0001
#define SR_NOMOVE    0x0002

/////////////////////////////////////////////////////////////////////////////
//全局函数
//分析角色的名字
std::string ParseName(std::string);
//译解角色的名字
int DecodeName(const char*,char*); 
//汉字的Unicode编码
LPCWSTR ToUnicode(LPCSTR lpMultiByteStr, LPWSTR lpWideCharStr, int cchWideChar);
//Ansi编码
LPCSTR ToAnsi(LPCWSTR lpWideCharStr, LPSTR lpMultiByteStr, int cchMultiByteChar);

class CZhanGuoClientDlg;


class CGameMir : public CNet
{
public:
	DECLARE_DYNAMIC(CGameMir);

/////////////////////////////////////////////////////////////////////////////
//发送协议给服务器
public:

	/////////////////////////////////////////////////////////////////////////////
	//1.账号服务器
	//账号-登录账号服务器
	void SendLogin(std::string uid, std::string passwd);
	//账号-
	void SendNewAccount();//(ue: TUserEntry; ua: TUserEntryAdd);
	//账号-
	void SendUpdateAccount();//(ue: TUserEntry; ua: TUserEntryAdd);
	//账号-选择角色服务器
	void SendSelectServer(std::string svname);
	//账号-
	void SendChgPw(std::string id, std::string passwd, std::string newpasswd);

	/////////////////////////////////////////////////////////////////////////////
	//2.角色服务器
	//角色-创建角色
	void SendNewChr(std::string uid, std::string uname, std::string shair, std::string sjob, std::string ssex);
	//角色-分析角色
	void SendQueryChr(void);
	//角色-删除角色
	void SendDelChr(std::string chrname);
	//角色-选择角色
	void SendSelChr(std::string chrname);

	/////////////////////////////////////////////////////////////////////////////
	//3.登录游戏
	//发送--
	void SendRunLogin(void);
	//发送--
	void SendQueryUserName(int targetid, int x, int y);

	/////////////////////////////////////////////////////////////////////////////
	//4.基本行动
	//基本--角色的移动操作
	void SendActMsg(int ident, int x, int y, int dir);
	//基本--
	void SendButchAnimal(int x, int y, int dir, int actorid);

	/////////////////////////////////////////////////////////////////////////////
	//5.战斗行动
	//战斗--使用技能操作
	void SendSpellMsg(int ident, int x, int y, int dir, int target);

	/////////////////////////////////////////////////////////////////////////////
	//6.角色状态

	/////////////////////////////////////////////////////////////////////////////
	//7.物品道具
	//发送--
	void SendDropItem(std::string name, int itemserverindex);
	//发送--
	void SendPickup(void);
	//发送--
	void SendTakeOnItem(WORD where, int itmindex, std::string itmname);
	//发送--
	void SendTakeOffItem(WORD where, int itmindex, std::string itmname);
	//发送--
	void SendEat(int itmindex, std::string itmname);
	//发送--
	void SendGetDetailItem(int merchant, int menuindex, std::string itemname);
	//发送--
	void SendBuyItem(int merchant, int itemserverindex, std::string itemname);
	//发送--
	void SendMakeDrugItem(int merchant, std::string itemname);
	//发送--掉下游戏币
	void SendDropGold(int dropgold);

	/////////////////////////////////////////////////////////////////////////////
	//8.魔法技能
	//发送--
	void SendMagicKeyChange(int magid, std::string keych);

	/////////////////////////////////////////////////////////////////////////////
	//9.商人功能
	//发送--
	void SendMerchantDlgSelect(int merchant, std::string rstr);
	//发送--
	void SendQueryPrice(int merchant, int itemindex, std::string itemname);
	//发送--
	void SendQueryRepairCost(int merchant, int itemindex, std::string itemname);
	//发送--
	void SendSellItem(int merchant, int itemindex, std::string itemname);
	//发送--
	void SendRepairItem(int merchant, int itemindex, std::string itemname);

	/////////////////////////////////////////////////////////////////////////////
	//10.仓库功能
	//发送--
	void SendStorageItem(int merchant, int itemindex, std::string itemname);
	//发送--
	void SendTakeBackStorageItem(int merchant, int itemserverindex, std::string itemname);

	/////////////////////////////////////////////////////////////////////////////
	//11.交易功能
	//发送--
	void SendDealTry(void); //菊俊 荤恩捞 乐绰瘤 八荤
	//发送--
	void SendCancelDeal(void);
	//发送--
	void SendAddDealItem();//(ci: TClientItem);
	//发送--
	void SendDelDealItem();//(ci: TClientItem);
	//发送--
	void SendChangeDealGold(int gold);
	//发送--
	void SendDealEnd(void);

	/////////////////////////////////////////////////////////////////////////////
	//12.组队功能
	//发送--设置组队模式
	void SendGroupMode(bool onoff);
	//发送--创建组队
	void SendCreateGroup(std::string withwho);
	//发送--增加组队成员
	void SendAddGroupMember(std::string withwho);
	//发送--删除帮会成员
	void SendDelGroupMember(std::string withwho);

	/////////////////////////////////////////////////////////////////////////////
	//13.帮会功能
	//发送--
	void SendGuildHome(void);
	//发送--
	void SendGuildDlg(void);
	//发送--
	void SendGuildMemberList(void);
	//发送--
	void SendGuildAddMem(std::string who);
	//发送--
	void SendGuildDelMem(std::string who);
	//发送--帮会更新后的公告信息
	void SendGuildUpdateNotice(std::string notices);
	//发送--帮会会员编辑的等级
	void SendGuildUpdateGrade(std::string rankinfo);
	//发送--
	void SendSpeedHackUser(void);  //SpeedHaker 荤侩磊甫 辑滚俊 烹焊茄促.
	//发送--
	void SendAdjustBonus();//(remain: integer; babil: TNakedAbility);
	//发送--
	void SendPassword(std::string sPassword, int nIdent);

	/////////////////////////////////////////////////////////////////////////////
	//14.聊天功能
	//发送--用户说话内容,也做为调试命令输入
	void SendSay(std::string str);

	/////////////////////////////////////////////////////////////////////////////
	//15.地图相关
	//发送--
	void SendWantMiniMap(void);

	/////////////////////////////////////////////////////////////////////////////
	//16.其他协议

/////////////////////////////////////////////////////////////////////////////
//接收协议函数
private:
	/////////////////////////////////////////////////////////////////////////////
	//1.账号服务器
	//账号-选择角色服务器
	void RecvPassOKSelectServer(MMSG& msg, char* body);
	//账号-密码-失败
	void RecvPassWDFail(MMSG& msg, char* body);

	/////////////////////////////////////////////////////////////////////////////
	//2.角色服务器
	//角色_选择服务器_成功
	void RecvSelectSreverOK(MMSG& msg, char* body);
	//角色-请求角色列表-成功
	void RecvQueryChr(MMSG& msg, char* body);
	//角色-请求角色列表-失败
	void RecvQueryChrFail(MMSG& msg, char* body);
	//开始_开始游戏
	void RecvStartPlay(MMSG& msg, char* body);
	//开始_游戏公告
	void RecvSendNotice(MMSG& msg, char* body);
	//消息_系统信息
	void RecvSysMessage(MMSG& msg, char* body);

⌨️ 快捷键说明

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