From 871beba9096bd2e597238525f3dd59a2d5dbf46a Mon Sep 17 00:00:00 2001
From: hzqst <113660872@qq.com>
Date: Thu, 27 Jun 2019 18:22:02 +0800
Subject: [PATCH] add new
---
CGALib/CGALib.vcxproj | 13 +-
CGALib/gameinterface.cpp | 702 +++++++----
CGALib/gameinterface.h | 362 +++++-
CGALib/packdata.h | 584 ++++++++-
CGANode/async.h | 16 +-
CGANode/binding.gyp | 8 +-
CGANode/chat.cc | 171 +--
CGANode/connect.cc | 8 +
CGANode/info.cc | 116 +-
CGANode/item.cc | 1021 +++++++++++++++-
CGANode/item.h | 9 +-
CGANode/main.cc | 62 +-
CGANode/map.cc | 570 +++++++--
CGANode/map.h | 12 +-
CGANode/npc.cc | 119 +-
CGANode/work.cc | 198 +--
CGANode/work.h | 3 +-
cgahook/cgahook.vcxproj | 10 +-
cgahook/dump.cpp | 27 +
cgahook/gameservice.cpp | 2497 +++++++++++++++++++++++++++++++++-----
cgahook/gameservice.h | 283 ++++-
cgahook/main.cpp | 44 +-
cgahook/server.cpp | 47 +-
23 files changed, 5784 insertions(+), 1098 deletions(-)
create mode 100644 cgahook/dump.cpp
diff --git a/CGALib/CGALib.vcxproj b/CGALib/CGALib.vcxproj
index e18ee6f..b2aa106 100644
--- a/CGALib/CGALib.vcxproj
+++ b/CGALib/CGALib.vcxproj
@@ -29,7 +29,6 @@
{85FCBAC1-6F19-4754-B277-97E6386F6D51}
Win32Proj
CGALib
- 10.0.17763.0
@@ -84,7 +83,7 @@
Level3
Disabled
WIN32;_DEBUG;_LIB;CGA_EXPORT;%(PreprocessorDefinitions)
- ../boost;../rest_rpc/;../rest_rpc/spdlog/include;../rest_rpc/iguana;../rest_rpc/iguana/third_party/msgpack/include
+ ../boost_1_63_0;../rest_rpc/;../rest_rpc/spdlog/include;../rest_rpc/iguana;../rest_rpc/iguana/third_party/msgpack/include
MultiThreadedDebugDLL
true
4101
@@ -93,7 +92,7 @@
Windows
- ../boost/stage/lib
+ ../boost_1_63_0/stage/lib
@@ -117,7 +116,7 @@
true
true
WIN32;NDEBUG;_LIB;CGA_EXPORT;%(PreprocessorDefinitions)
- ../boost;../rest_rpc/;../rest_rpc/spdlog/include;../rest_rpc/iguana;../rest_rpc/iguana/third_party/msgpack/include
+ ../boost_1_63_0;../rest_rpc/;../rest_rpc/spdlog/include;../rest_rpc/iguana;../rest_rpc/iguana/third_party/msgpack/include
MultiThreadedDLL
true
4101
@@ -128,7 +127,7 @@
true
- ../boost/stage/lib
+ ../boost_1_63_0/stage/lib
@@ -140,7 +139,7 @@
true
true
NDEBUG;_LIB;%(PreprocessorDefinitions)
- ../boost;../rest_rpc/;../rest_rpc/spdlog/include;../rest_rpc/iguana;../rest_rpc/iguana/third_party/msgpack/include
+ ../boost_1_63_0;../rest_rpc/;../rest_rpc/spdlog/include;../rest_rpc/iguana;../rest_rpc/iguana/third_party/msgpack/include
Windows
@@ -148,7 +147,7 @@
true
- ../boost/stage/lib
+ ../boost_1_63_0/stage/lib
diff --git a/CGALib/gameinterface.cpp b/CGALib/gameinterface.cpp
index 5439fdd..a778354 100644
--- a/CGALib/gameinterface.cpp
+++ b/CGALib/gameinterface.cpp
@@ -32,11 +32,15 @@ namespace CGAServiceProtocol
TIMAX_DEFINE_PROTOCOL(DropItem, bool(int));
TIMAX_DEFINE_PROTOCOL(UseItem, bool(int));
TIMAX_DEFINE_PROTOCOL(MoveItem, bool(int, int, int));
+ TIMAX_DEFINE_PROTOCOL(DropPet, bool(int));
+ TIMAX_DEFINE_PROTOCOL(GetMapIndex, std::tuple());
TIMAX_DEFINE_PROTOCOL(GetMapXY, std::tuple());
TIMAX_DEFINE_PROTOCOL(GetMapXYFloat, std::tuple());
TIMAX_DEFINE_PROTOCOL(GetMoveSpeed, std::tuple());
TIMAX_DEFINE_PROTOCOL(GetMapName, std::string());
TIMAX_DEFINE_PROTOCOL(GetMapUnits, cga_map_units_t());
+ TIMAX_DEFINE_PROTOCOL(GetMapCollisionTable, cga_map_cells_t(bool));
+ TIMAX_DEFINE_PROTOCOL(GetMapObjectTable, cga_map_cells_t(bool));
TIMAX_DEFINE_PROTOCOL(WalkTo, void(int,int));
TIMAX_DEFINE_PROTOCOL(TurnTo, void(int, int));
TIMAX_DEFINE_PROTOCOL(ForceMove, bool(int, bool));
@@ -49,15 +53,12 @@ namespace CGAServiceProtocol
TIMAX_DEFINE_PROTOCOL(ClickNPCDialog, bool(int, int));
TIMAX_DEFINE_PROTOCOL(SellNPCStore, bool(cga_sell_items_t));
TIMAX_DEFINE_PROTOCOL(BuyNPCStore, bool(cga_buy_items_t));
- TIMAX_DEFINE_PROTOCOL(PlayerMenuSelect, bool(int));
+ TIMAX_DEFINE_PROTOCOL(PlayerMenuSelect, bool(int, std::string));
TIMAX_DEFINE_PROTOCOL(UnitMenuSelect, bool(int));
TIMAX_DEFINE_PROTOCOL(IsBattleUnitValid, bool(int));
TIMAX_DEFINE_PROTOCOL(GetBattleUnit, cga_battle_unit_t(int));
TIMAX_DEFINE_PROTOCOL(GetBattleUnits, cga_battle_units_t());
- TIMAX_DEFINE_PROTOCOL(GetBattleRoundCount, int());
- TIMAX_DEFINE_PROTOCOL(GetBattlePlayerPosition, int());
- TIMAX_DEFINE_PROTOCOL(GetBattlePlayerStatus, int());
- TIMAX_DEFINE_PROTOCOL(GetBattlePetId, int());
+ TIMAX_DEFINE_PROTOCOL(GetBattleContext, cga_battle_context_t());
TIMAX_DEFINE_PROTOCOL(BattleNormalAttack, bool(int));
TIMAX_DEFINE_PROTOCOL(BattleSkillAttack, bool(int, int, int));
TIMAX_DEFINE_PROTOCOL(BattleDefense, bool());
@@ -72,11 +73,21 @@ namespace CGAServiceProtocol
TIMAX_DEFINE_PROTOCOL(SetBattleEndTick, void(int));
TIMAX_DEFINE_PROTOCOL(SetWorkDelay, void(int));
TIMAX_DEFINE_PROTOCOL(SetWorkAcceleration, void(int));
+ TIMAX_DEFINE_PROTOCOL(SetImmediateDoneWork, void(bool));
TIMAX_DEFINE_PROTOCOL(StartWork, bool(int,int));
TIMAX_DEFINE_PROTOCOL(CraftItem, bool(cga_craft_item_t));
TIMAX_DEFINE_PROTOCOL(AssessItem, bool(int,int));
TIMAX_DEFINE_PROTOCOL(GetCraftInfo, cga_craft_info_t(int,int));
TIMAX_DEFINE_PROTOCOL(GetCraftsInfo, cga_crafts_info_t(int));
+ TIMAX_DEFINE_PROTOCOL(DoRequest, bool(int));
+ TIMAX_DEFINE_PROTOCOL(EnableFlags, bool(int, bool));
+ TIMAX_DEFINE_PROTOCOL(TradeAddStuffs, void(cga_sell_items_t, cga_sell_pets_t, int));
+ TIMAX_DEFINE_PROTOCOL(GetTeamPlayerInfo, cga_team_players_t());
+ TIMAX_DEFINE_PROTOCOL(FixMapWarpStuck, void(int));
+ TIMAX_DEFINE_PROTOCOL(SetNoSwitchAnim, void(bool));
+ TIMAX_DEFINE_PROTOCOL(GetMoveHistory, std::vector());
+ TIMAX_DEFINE_PROTOCOL(SetWindowResolution, void(int, int));
+ TIMAX_DEFINE_PROTOCOL(RequestDownloadMap, void(int, int, int, int));
TIMAX_DEFINE_FORWARD(NotifyServerShutdown, int);
TIMAX_DEFINE_FORWARD(NotifyBattleAction, int);
TIMAX_DEFINE_FORWARD(NotifyPlayerMenu, cga_player_menu_items_t);
@@ -84,6 +95,9 @@ namespace CGAServiceProtocol
TIMAX_DEFINE_FORWARD(NotifyNPCDialog, cga_npc_dialog_t);
TIMAX_DEFINE_FORWARD(NotifyWorkingResult, cga_working_result_t);
TIMAX_DEFINE_FORWARD(NotifyChatMsg, cga_chat_msg_t);
+ TIMAX_DEFINE_FORWARD(NotifyTradeStuffs, cga_trade_stuff_info_t);
+ TIMAX_DEFINE_FORWARD(NotifyTradeDialog, cga_trade_dialog_t);
+ TIMAX_DEFINE_FORWARD(NotifyTradeState, int);
}
namespace CGA
@@ -116,793 +130,930 @@ namespace CGA
{
try
{
- m_connected = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::Connect);
+ m_connected = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::Connect);
}
catch (timax::rpc::exception const &e) { m_connected = false; }
- catch (msgpack::parse_error &e) {}
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return m_connected;
}
virtual bool Initialize(cga_game_data_t &data) {
if (m_connected) {
try {
- m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::Initialize, data);
+ m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::Initialize, data);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool IsInGame(int &ingame) {
if (m_connected) {
try {
- ingame = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::IsInGame);
+ ingame = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::IsInGame);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool GetWorldStatus(int &status) {
if (m_connected) {
try {
- status = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::GetWorldStatus);
+ status = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::GetWorldStatus);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool GetGameStatus(int &status) {
if (m_connected) {
try {
- status = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::GetGameStatus);
+ status = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::GetGameStatus);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool GetPlayerInfo(cga_player_info_t &info){
if (m_connected) {
try {
- info = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::GetPlayerInfo);
+ info = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::GetPlayerInfo);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool SetPlayerFlagEnabled(int index, bool enable) {
if (m_connected) {
try {
- m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::SetPlayerFlagEnabled, index, enable);
+ m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::SetPlayerFlagEnabled, index, enable);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool IsPlayerFlagEnabled(int index, bool &enable) {
if (m_connected) {
try {
- enable = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::IsPlayerFlagEnabled, index);
+ enable = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::IsPlayerFlagEnabled, index);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool IsPetValid(int petid, bool &valid) {
if (m_connected) {
try {
- valid = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::IsPetValid, petid);
+ valid = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::IsPetValid, petid);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool GetPetInfo(int petid, cga_pet_info_t &info) {
if (m_connected) {
try {
- info = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::GetPetInfo, petid);
+ info = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::GetPetInfo, petid);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool GetPetsInfo(cga_pets_info_t &info) {
if (m_connected) {
try {
- info = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::GetPetsInfo);
+ info = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::GetPetsInfo);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool IsPetSkillValid(int petid, int skillid, bool &valid) {
if (m_connected) {
try {
- valid = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::IsPetSkillValid, petid, skillid);
+ valid = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::IsPetSkillValid, petid, skillid);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool GetPetSkillInfo(int petid, int skillpos, cga_pet_skill_info_t &skill) {
if (m_connected) {
try {
- skill = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::GetPetSkillInfo, petid, skillpos);
+ skill = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::GetPetSkillInfo, petid, skillpos);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool GetPetSkillsInfo(int petid, cga_pet_skills_info_t &skills) {
if (m_connected) {
try {
- skills = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::GetPetSkillsInfo, petid);
+ skills = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::GetPetSkillsInfo, petid);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool IsSkillValid(int skillid, bool &valid) {
if (m_connected) {
try {
- valid = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::IsSkillValid, skillid);
+ valid = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::IsSkillValid, skillid);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool GetSkillInfo(int skillid, cga_skill_info_t &info) {
if (m_connected) {
try {
- info = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::GetSkillInfo, skillid);
+ info = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::GetSkillInfo, skillid);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool GetSkillsInfo(cga_skills_info_t &info) {
if (m_connected) {
try {
- info = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::GetSkillsInfo);
+ info = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::GetSkillsInfo);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool GetSubSkillInfo(int skillid, int stage, cga_subskill_info_t &info) {
if (m_connected) {
try {
- info = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::GetSubSkillInfo, skillid, stage);
+ info = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::GetSubSkillInfo, skillid, stage);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return 0;
}
virtual bool GetSubSkillsInfo(int skillid, cga_subskills_info_t &info) {
if (m_connected) {
try {
- info = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::GetSubSkillsInfo, skillid);
+ info = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::GetSubSkillsInfo, skillid);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return 0;
}
virtual bool IsItemValid(int itempos, bool &valid) {
if (m_connected) {
try {
- valid = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::IsItemValid, itempos);
+ valid = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::IsItemValid, itempos);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool GetItemInfo(int itempos, cga_item_info_t &info) {
if (m_connected) {
try {
- info = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::GetItemInfo, itempos);
+ info = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::GetItemInfo, itempos);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool GetItemsInfo(cga_items_info_t &info) {
if (m_connected) {
try {
- info = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::GetItemsInfo);
+ info = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::GetItemsInfo);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool GetBankItemsInfo(cga_items_info_t &info) {
if (m_connected) {
try {
- info = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::GetBankItemsInfo);
+ info = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::GetBankItemsInfo);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool DropItem(int itempos, bool &result) {
if (m_connected) {
try {
- result = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::DropItem, itempos);
+ result = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::DropItem, itempos);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool UseItem(int itempos, bool &result) {
if (m_connected) {
try {
- result = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::UseItem, itempos);
+ result = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::UseItem, itempos);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool MoveItem(int itempos, int dstpos, int count, bool &result) {
if (m_connected) {
try {
- result = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::MoveItem, itempos, dstpos, count);
+ result = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::MoveItem, itempos, dstpos, count);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
+ }
+ return false;
+ }
+ virtual bool DropPet(int petpos, bool &result) {
+ if (m_connected) {
+ try {
+ result = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::DropPet, petpos);
+ return true;
+ }
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
+ }
+ return false;
+ }
+ virtual bool GetMapIndex(int &index1, int &index2, int &index3) {
+ if (m_connected) {
+ try {
+ std::tuple tup = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::GetMapIndex);
+ index1 = std::get<0>(tup);
+ index2 = std::get<1>(tup);
+ index3 = std::get<2>(tup);
+ return true;
+ }
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool GetMapXY(int &x, int &y) {
if (m_connected) {
try {
- std::tuple tup = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::GetMapXY);
+ std::tuple tup = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::GetMapXY);
x = std::get<0>(tup);
y = std::get<1>(tup);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool GetMapXYFloat(float &x, float &y) {
if (m_connected) {
try {
- std::tuple tup = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::GetMapXYFloat);
+ std::tuple tup = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::GetMapXYFloat);
x = std::get<0>(tup);
y = std::get<1>(tup);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool GetMoveSpeed(float &x, float &y) {
if (m_connected) {
try {
- std::tuple tup = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::GetMoveSpeed);
+ std::tuple tup = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::GetMoveSpeed);
x = std::get<0>(tup);
y = std::get<1>(tup);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool GetMapName(std::string &name) {
if (m_connected) {
try {
- name = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::GetMapName);
+ name = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::GetMapName);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool GetMapUnits(cga_map_units_t &units) {
if (m_connected) {
try {
- units = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::GetMapUnits);
+ units = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::GetMapUnits);
+ return true;
+ }
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
+ }
+ return false;
+ }
+ virtual bool GetMapCollisionTable(bool loadall, cga_map_cells_t &cells) {
+ if (m_connected) {
+ try {
+ cells = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::GetMapCollisionTable, loadall);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
+ }
+ return false;
+ }
+ virtual bool GetMapObjectTable(bool loadall, cga_map_cells_t &cells) {
+ if (m_connected) {
+ try {
+ cells = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::GetMapObjectTable, loadall);
+ return true;
+ }
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool WalkTo(int x, int y) {
if (m_connected) {
try {
- m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::WalkTo, x, y);
+ m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::WalkTo, x, y);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool TurnTo(int x, int y) {
if (m_connected) {
try {
- m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::TurnTo, x, y);
+ m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::TurnTo, x, y);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool ForceMove(int dir, bool show, bool &result) {
if (m_connected) {
try {
- result = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::ForceMove, dir, show);
+ result = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::ForceMove, dir, show);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool ForceMoveTo(int x, int y, bool show, bool &result) {
if (m_connected) {
try {
- result = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::ForceMoveTo, x, y, show);
+ result = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::ForceMoveTo, x, y, show);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool IsMapCellPassable(int x, int y, bool &result) {
if (m_connected) {
try {
- result = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::IsMapCellPassable, x, y);
+ result = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::IsMapCellPassable, x, y);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool SetMoveSpeed(int speed) {
if (m_connected) {
try {
- m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::SetMoveSpeed, speed);
+ m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::SetMoveSpeed, speed);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool LogBack() {
if (m_connected) {
try {
- m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::LogBack);
+ m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::LogBack);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool LogOut() {
if (m_connected) {
try {
- m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::LogOut);
+ m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::LogOut);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool SayWords(std::string &str, int color , int range, int size) {
if (m_connected) {
try {
- m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::SayWords, str, color, range, size);
+ m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::SayWords, str, color, range, size);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool ClickNPCDialog(int option, int index, bool &result) {
if (m_connected) {
try {
- result = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::ClickNPCDialog, option, index);
+ result = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::ClickNPCDialog, option, index);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool SellNPCStore(cga_sell_items_t &items, bool &result) {
if (m_connected) {
try {
- result = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::SellNPCStore, items);
+ result = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::SellNPCStore, items);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool BuyNPCStore(cga_buy_items_t &items, bool &result) {
if (m_connected) {
try {
- result = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::BuyNPCStore, items);
+ result = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::BuyNPCStore, items);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
- virtual bool PlayerMenuSelect(int menuindex, bool &result) {
+ virtual bool PlayerMenuSelect(int menuindex, std::string &menustring, bool &result) {
if (m_connected) {
try {
- result = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::PlayerMenuSelect, menuindex);
+ result = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::PlayerMenuSelect, menuindex, menustring);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool UnitMenuSelect(int menuindex, bool &result) {
if (m_connected) {
try {
- result = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::UnitMenuSelect, menuindex);
+ result = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::UnitMenuSelect, menuindex);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool IsBattleUnitValid(int pos, bool &valid) {
if (m_connected) {
try {
- valid = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::IsBattleUnitValid, pos);
+ valid = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::IsBattleUnitValid, pos);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool GetBattleUnit(int pos, cga_battle_unit_t &unit) {
if (m_connected) {
try {
- unit = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::GetBattleUnit, pos);
+ unit = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::GetBattleUnit, pos);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
virtual bool GetBattleUnits(cga_battle_units_t &units) {
if (m_connected) {
try {
- units = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::GetBattleUnits);
+ units = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::GetBattleUnits);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
- virtual bool GetBattleRoundCount(int &count) {
+ virtual bool GetBattleContext(cga_battle_context_t &ctx) {
if (m_connected) {
try {
- count = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::GetBattleRoundCount);
+ ctx = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::GetBattleContext);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
- virtual bool GetBattlePlayerPosition(int &pos) {
+ virtual bool BattleNormalAttack(int target, bool &result) {
if (m_connected) {
try {
- pos = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::GetBattlePlayerPosition);
+ result = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::BattleNormalAttack, target);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
- virtual bool GetBattlePlayerStatus(int &status) {
+ virtual bool BattleSkillAttack(int skillpos, int skilllv, int target, bool &result) {
if (m_connected) {
try {
- status = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::GetBattlePlayerStatus);
+ result = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::BattleSkillAttack, skillpos, skilllv, target);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
- virtual bool GetBattlePetId(int &petid) {
+ virtual bool BattleDefense(bool &result) {
if (m_connected) {
try {
- petid = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::GetBattlePetId);
+ result = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::BattleDefense);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
- virtual bool BattleNormalAttack(int target, bool &result) {
+ virtual bool BattleEscape(bool &result) {
if (m_connected) {
try {
- result = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::BattleNormalAttack, target);
+ result = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::BattleEscape);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
- virtual bool BattleSkillAttack(int skillpos, int skilllv, int target, bool &result) {
+ virtual bool BattleExchangePosition(bool &result) {
if (m_connected) {
try {
- result = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::BattleSkillAttack, skillpos, skilllv, target);
+ result = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::BattleExchangePosition);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
- virtual bool BattleDefense(bool &result) {
+ virtual bool BattleChangePet(int petid, bool &result) {
if (m_connected) {
try {
- result = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::BattleDefense);
+ result = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::BattleChangePet, petid);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
- virtual bool BattleEscape(bool &result) {
+ virtual bool BattleUseItem(int itempos, int target, bool &result) {
if (m_connected) {
try {
- result = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::BattleEscape);
+ result = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::BattleUseItem, itempos, target);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
- virtual bool BattleExchangePosition(bool &result) {
+ virtual bool BattlePetSkillAttack(int skillpos, int target, bool &result) {
if (m_connected) {
try {
- result = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::BattleExchangePosition);
+ result = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::BattlePetSkillAttack, skillpos, target);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
- virtual bool BattleChangePet(int petid, bool &result) {
+ virtual bool BattleSetHighSpeedEnabled(bool enable) {
if (m_connected) {
try {
- result = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::BattleChangePet, petid);
+ m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::BattleSetHighSpeedEnabled, enable);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
- virtual bool BattleUseItem(int itempos, int target, bool &result) {
+ virtual bool BattleSetShowHPMPEnabled(bool enable) {
if (m_connected) {
try {
- result = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::BattleUseItem, itempos, target);
+ m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::BattleSetShowHPMPEnabled, enable);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
- virtual bool BattlePetSkillAttack(int skillpos, int target, bool &result) {
+ virtual bool GetBattleEndTick(int &msec) {
if (m_connected) {
try {
- result = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::BattlePetSkillAttack, skillpos, target);
+ msec = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::GetBattleEndTick);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
- virtual bool BattleSetHighSpeedEnabled(bool enable) {
+ virtual bool SetBattleEndTick(int msec) {
if (m_connected) {
try {
- m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::BattleSetHighSpeedEnabled, enable);
+ m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::SetBattleEndTick, msec);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
- virtual bool BattleSetShowHPMPEnabled(bool enable) {
+ virtual bool SetWorkDelay(int delay)
+ {
if (m_connected) {
try {
- m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::BattleSetShowHPMPEnabled, enable);
+ m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::SetWorkDelay, delay);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
- virtual bool GetBattleEndTick(int &msec) {
+ virtual bool SetWorkAcceleration(int percent)
+ {
if (m_connected) {
try {
- msec = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::GetBattleEndTick);
+ m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::SetWorkAcceleration, percent);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
- virtual bool SetBattleEndTick(int msec) {
+ virtual bool SetImmediateDoneWork(bool enable)
+ {
if (m_connected) {
try {
- m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::SetBattleEndTick, msec);
+ m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::SetImmediateDoneWork, enable);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
- virtual bool SetWorkDelay(int delay)
+ virtual bool StartWork(int skill_index, int sub_index, bool &result)
{
if (m_connected) {
try {
- m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::SetWorkDelay, delay);
+ result = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::StartWork, skill_index, sub_index);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
- virtual bool SetWorkAcceleration(int percent)
+ virtual bool CraftItem(cga_craft_item_t &craft, bool &result)
{
if (m_connected) {
try {
- m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::SetWorkAcceleration, percent);
+ result = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::CraftItem, craft);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) {
+ OutputDebugStringA(e.what());
+ }
}
return false;
}
- virtual bool StartWork(int skill_index, int sub_index, bool &result)
+ virtual bool AssessItem(int skill_index, int itempos, bool &result)
{
if (m_connected) {
try {
- result = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::StartWork, skill_index, sub_index);
+ result = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::AssessItem, skill_index, itempos);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
- virtual bool CraftItem(cga_craft_item_t &craft, bool &result)
+ virtual bool GetCraftInfo(int skill_index, int sub_index, cga_craft_info_t &info)
{
if (m_connected) {
try {
- result = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::CraftItem, craft);
+ info = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::GetCraftInfo, skill_index, sub_index);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
- virtual bool AssessItem(int skill_index, int itempos, bool &result)
+ virtual bool GetCraftsInfo(int skill_index, cga_crafts_info_t &info)
{
if (m_connected) {
try {
- result = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::AssessItem, skill_index, itempos);
+ info = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::GetCraftsInfo, skill_index);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
- virtual bool GetCraftInfo(int skill_index, int sub_index, cga_craft_info_t &info)
+
+ virtual bool DoRequest(int request_type, bool &result)
{
if (m_connected) {
try {
- info = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::GetCraftInfo, skill_index, sub_index);
+ result = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::DoRequest, request_type);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
- virtual bool GetCraftsInfo(int skill_index, cga_crafts_info_t &info)
+ virtual bool EnableFlags(int type, bool enable, bool &result)
{
if (m_connected) {
try {
- info = m_client.call(std::chrono::milliseconds(1000), m_endpoint, CGAServiceProtocol::GetCraftsInfo, skill_index);
+ result = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::EnableFlags, type, enable);
return true;
}
- catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA(__FUNCTION__); }
- catch (msgpack::parse_error &e) {}
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
+ }
+ return false;
+ }
+ virtual bool TradeAddStuffs(cga_sell_items_t items, cga_sell_pets_t pets, int gold)
+ {
+ if (m_connected) {
+ try {
+ m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::TradeAddStuffs, items, pets, gold);
+ return true;
+ }
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
+ }
+ return false;
+ }
+ virtual bool GetTeamPlayerInfo(cga_team_players_t &result)
+ {
+ if (m_connected) {
+ try {
+ result = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::GetTeamPlayerInfo);
+ return true;
+ }
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
+ }
+ return false;
+ }
+ virtual bool FixMapWarpStuck(int type)
+ {
+ if (m_connected) {
+ try {
+ m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::FixMapWarpStuck, type);
+ return true;
+ }
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
+ }
+ return false;
+ }
+ virtual bool SetNoSwitchAnim(bool enable)
+ {
+ if (m_connected) {
+ try {
+ m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::SetNoSwitchAnim, enable);
+ return true;
+ }
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
+ }
+ return false;
+ }
+ virtual bool GetMoveHistory(std::vector &v)
+ {
+ if (m_connected) {
+ try {
+ v = m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::GetMoveHistory);
+ return true;
+ }
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
+ }
+ return false;
+ }
+ virtual bool SetWindowResolution(int w, int h)
+ {
+ if (m_connected) {
+ try {
+ m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::SetWindowResolution, w, h);
+ return true;
+ }
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
+ }
+ return false;
+ }
+ virtual bool RequestDownloadMap(int xbottom, int ybottom, int xsize, int ysize)
+ {
+ if (m_connected) {
+ try {
+ m_client.call(std::chrono::milliseconds(5000), m_endpoint, CGAServiceProtocol::RequestDownloadMap, xbottom, ybottom, xsize, ysize);
+ return true;
+ }
+ catch (timax::rpc::exception const &e) { if (e.get_error_code() != timax::rpc::error_code::TIMEOUT) m_connected = false; OutputDebugStringA("rpc exception from " __FUNCTION__); OutputDebugStringA(e.get_error_message().c_str()); }
+ catch (msgpack::parse_error &e) { OutputDebugStringA("parse exception from " __FUNCTION__); OutputDebugStringA(e.what()); }
}
return false;
}
@@ -1048,6 +1199,75 @@ namespace CGA
}
return false;
}
+ virtual bool RegisterTradeStuffsNotify(const std::function &callback)
+ {
+ if (m_connected)
+ {
+ try
+ {
+ m_async_client.sub(m_endpoint, CGAServiceProtocol::NotifyTradeStuffs,
+ [callback](cga_trade_stuff_info_t rs) {
+ if (callback)
+ callback(rs);
+ },
+ [](auto const& e) {
+ OutputDebugStringA(e.get_error_message().c_str());
+ }
+ );
+ return true;
+ }
+ catch (timax::rpc::exception const& e) {
+ OutputDebugStringA(e.get_error_message().c_str());
+ }
+ }
+ return false;
+ }
+ virtual bool RegisterTradeDialogNotify(const std::function &callback)
+ {
+ if (m_connected)
+ {
+ try
+ {
+ m_async_client.sub(m_endpoint, CGAServiceProtocol::NotifyTradeDialog,
+ [callback](cga_trade_dialog_t rs) {
+ if (callback)
+ callback(rs);
+ },
+ [](auto const& e) {
+ OutputDebugStringA(e.get_error_message().c_str());
+ }
+ );
+ return true;
+ }
+ catch (timax::rpc::exception const& e) {
+ OutputDebugStringA(e.get_error_message().c_str());
+ }
+ }
+ return false;
+ }
+ virtual bool RegisterTradeStateNotify(const std::function &callback)
+ {
+ if (m_connected)
+ {
+ try
+ {
+ m_async_client.sub(m_endpoint, CGAServiceProtocol::NotifyTradeState,
+ [callback](int rs) {
+ if (callback)
+ callback(rs);
+ },
+ [](auto const& e) {
+ OutputDebugStringA(e.get_error_message().c_str());
+ }
+ );
+ return true;
+ }
+ catch (timax::rpc::exception const& e) {
+ OutputDebugStringA(e.get_error_message().c_str());
+ }
+ }
+ return false;
+ }
};
CGAInterface *CreateInterface()
diff --git a/CGALib/gameinterface.h b/CGALib/gameinterface.h
index 462a8c8..03a5dc3 100644
--- a/CGALib/gameinterface.h
+++ b/CGALib/gameinterface.h
@@ -14,6 +14,74 @@ namespace CGA
cg_item_6000,
};
+ typedef struct cga_playerpet_detail_info_s
+ {
+ cga_playerpet_detail_info_s()
+ {
+ points_remain = 0;
+ points_endurance = 0;
+ points_strength = 0;
+ points_defense = 0;
+ points_agility = 0;
+ points_magical = 0;
+ value_attack = 0;
+ value_defensive = 0;
+ value_agility = 0;
+ value_spirit = 0;
+ value_recovery = 0;
+ resist_poison = 0;
+ resist_sleep = 0;
+ resist_medusa = 0;
+ resist_drunk = 0;
+ resist_chaos = 0;
+ resist_forget = 0;
+ fix_critical = 0;
+ fix_strikeback = 0;
+ fix_accurancy = 0;
+ fix_dodge = 0;
+ element_earth = 0;
+ element_water = 0;
+ element_fire = 0;
+ element_wind = 0;
+ }
+ cga_playerpet_detail_info_s(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10,
+ int a11, int a12, int a13, int a14, int a15, int a16, int a17, int a18, int a19, int a20,
+ int a21, int a22, int a23, int a24, int a25) :
+ points_remain(a1), points_endurance(a2), points_strength(a3), points_defense(a4), points_agility(a5), points_magical(a6),
+ value_attack(a7), value_defensive(a8), value_agility(a9), value_spirit(a10), value_recovery(a11),
+ resist_poison(a12), resist_sleep(a13), resist_medusa(a14), resist_drunk(a15), resist_chaos(a16), resist_forget(a17),
+ fix_critical(a18), fix_strikeback(a19), fix_accurancy(a20), fix_dodge(a21),
+ element_earth(a22), element_water(a23), element_fire(a24), element_wind(a25)
+ {
+
+ }
+ int points_remain;
+ int points_endurance;
+ int points_strength;
+ int points_defense;
+ int points_agility;
+ int points_magical;
+ int value_attack;
+ int value_defensive;
+ int value_agility;
+ int value_spirit;
+ int value_recovery;
+ int resist_poison;
+ int resist_sleep;
+ int resist_medusa;
+ int resist_drunk;
+ int resist_chaos;
+ int resist_forget;
+ int fix_critical;
+ int fix_strikeback;
+ int fix_accurancy;
+ int fix_dodge;
+ int element_earth;
+ int element_water;
+ int element_fire;
+ int element_wind;
+ }cga_playerpet_detail_info_t;
+
typedef struct cga_player_info_s
{
cga_player_info_s()
@@ -25,6 +93,7 @@ namespace CGA
xp = 0;
maxxp = 0;
health = 0;
+ souls = 0;
level = 0;
gold = 0;
unitid = 0;
@@ -33,8 +102,8 @@ namespace CGA
usingpunchclock = false;
}
- cga_player_info_s(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10, int a11, int a12, int a13, std::string &a14, std::string &a15)
- : hp(a1), maxhp(a2), mp(a3), maxmp(a4), xp(a5), maxxp(a6), health(a7), level(a8), gold(a9), unitid(a10), petid(a11), punchclock(a12), usingpunchclock(a13 ? true : false), name(a14), job(a15)
+ cga_player_info_s(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10, int a11, int a12, int a13, int a14, std::string &a15, std::string &a16, const cga_playerpet_detail_info_t &a17, int a18, int a19, int a20)
+ : hp(a1), maxhp(a2), mp(a3), maxmp(a4), xp(a5), maxxp(a6), health(a7), souls(a8), level(a9), gold(a10), unitid(a11), petid(a12), punchclock(a13), usingpunchclock(a14 ? true : false), name(a15), job(a16), detail(a17), manu_endurance(a18), manu_skillful(a19), manu_intelligence(a20)
{
}
@@ -46,6 +115,7 @@ namespace CGA
int xp;
int maxxp;
int health;
+ int souls;
int level;
int gold;
int unitid;
@@ -54,6 +124,11 @@ namespace CGA
bool usingpunchclock;
std::string name;
std::string job;
+ std::vector titles;
+ cga_playerpet_detail_info_t detail;
+ int manu_endurance;
+ int manu_skillful;
+ int manu_intelligence;
}cga_player_info_t;
typedef struct cga_pet_info_s
@@ -70,11 +145,14 @@ namespace CGA
level = 0;
flags = 0;
race = 0;
+ loyality = 0;
battle_flags = 0;
index = 0;
}
- cga_pet_info_s(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10, int a11, int a12, std::string &a13, std::string &a14)
- : hp(a1), maxhp(a2), mp(a3), maxmp(a4), xp(a5), maxxp(a6), health(a7), level(a8), flags(a9), race(a10), battle_flags(a11), index(a12), name(a13), realname(a14)
+ cga_pet_info_s(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10,
+ int a11, int a12, int a13, std::string &a14, std::string &a15, const cga_playerpet_detail_info_t &a16)
+ : hp(a1), maxhp(a2), mp(a3), maxmp(a4), xp(a5), maxxp(a6), health(a7), level(a8), flags(a9), race(a10),
+ loyality(a11), battle_flags(a12), index(a13), name(a14), realname(a15), detail(a16)
{
}
@@ -88,14 +166,63 @@ namespace CGA
int level;
int flags;
int race;
+ int loyality;
int battle_flags;
int index;
std::string name;
std::string realname;
+ cga_playerpet_detail_info_t detail;
}cga_pet_info_t;
typedef std::vector cga_pets_info_t;
+ typedef struct cga_trade_pet_info_s
+ {
+ cga_trade_pet_info_s()
+ {
+ level = 0;
+ race = 0;
+ maxhp = 0;
+ maxmp = 0;
+ loyality = 0;
+ skill_count = 0;
+ image_id = 0;
+ index = 0;
+ }
+ cga_trade_pet_info_s(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8,
+ std::string &a9, std::string &a10, const cga_playerpet_detail_info_t &a11)
+ : level(a1), race(a2), maxhp(a3), maxmp(a4), loyality(a5), skill_count(a6), image_id(a7), index(a8),
+ name(a9), realname(a10), detail(a11)
+ {
+
+ }
+ int level;
+ int race;
+ int maxhp;
+ int maxmp;
+ int loyality;
+ int skill_count;
+ int image_id;
+ int index;
+ std::string name;
+ std::string realname;
+ cga_playerpet_detail_info_t detail;
+ }cga_trade_pet_info_t;
+
+ typedef struct cga_trade_pet_skill_info_s
+ {
+ cga_trade_pet_skill_info_s()
+ {
+ index = 0;
+ }
+ cga_trade_pet_skill_info_s(int a1)
+ {
+
+ }
+ int index;
+ std::vector skills;
+ }cga_trade_pet_skill_info_t;
+
typedef struct cga_pet_skill_info_s
{
cga_pet_skill_info_s()
@@ -129,9 +256,10 @@ namespace CGA
skill_id = 0;
pos = 0;
index = 0;
+ slotsize = 0;
}
- cga_skill_info_s(std::string &a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9)
- : name(a1), lv(a2), maxlv(a3), xp(a4), maxxp(a5), skill_id(a6), type(a7), pos(a8), index(a9)
+ cga_skill_info_s(std::string &a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10)
+ : name(a1), lv(a2), maxlv(a3), xp(a4), maxxp(a5), skill_id(a6), type(a7), pos(a8), index(a9), slotsize(a10)
{
}
std::string name;
@@ -143,6 +271,7 @@ namespace CGA
int type;
int pos;
int index;
+ int slotsize;
}cga_skill_info_t;
typedef std::vector cga_skills_info_t;
@@ -154,9 +283,10 @@ namespace CGA
cost = 0;
flags = 0;
level = 0;
+ available = false;
}
- cga_subskill_info_s(std::string &a1, std::string &a2, int a3, int a4, int a5)
- : name(a1), info(a2), cost(a3), flags(a4), level(a5)
+ cga_subskill_info_s(std::string &a1, std::string &a2, int a3, int a4, int a5, bool a6)
+ : name(a1), info(a2), cost(a3), flags(a4), level(a5), available(a6)
{
}
@@ -165,6 +295,7 @@ namespace CGA
int cost;
int flags;
int level;
+ bool available;
}cga_subskill_info_t;
typedef std::vector cga_subskills_info_t;
@@ -209,11 +340,12 @@ namespace CGA
maxhp = 0;
curmp = 0;
maxmp = 0;
+ flags = 0;
pos = 0;
}
- cga_battle_unit_s(std::string &a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8) :
- name(a1), modelid(a2), level(a3), curhp(a4), maxhp(a5), curmp(a6), maxmp(a7), pos(a8)
+ cga_battle_unit_s(std::string &a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9) :
+ name(a1), modelid(a2), level(a3), curhp(a4), maxhp(a5), curmp(a6), maxmp(a7), flags(a8), pos(a9)
{
}
@@ -224,6 +356,7 @@ namespace CGA
int maxhp;
int curmp;
int maxmp;
+ int flags;
int pos;
}cga_battle_unit_t;
@@ -304,9 +437,11 @@ namespace CGA
xpos = 0;
ypos = 0;
item_count = 0;
+ injury = 0;
+ level = 0;
}
- cga_map_unit_s(int a1, int a2, int a3, int a4, int a5, int a6, int a7, std::string &a8, std::string &a9, std::string &a10)
- : valid(a1), type(a2), unit_id(a3), model_id(a4), xpos(a5), ypos(a6), item_count(a7), unit_name(a8), nick_name(a9), item_name(a10)
+ cga_map_unit_s(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10, std::string &a11, std::string &a12, std::string &a13, std::string &a14)
+ : valid(a1), type(a2), unit_id(a3), model_id(a4), xpos(a5), ypos(a6), item_count(a7), injury(a8), level(a9), flags(a10), unit_name(a11), nick_name(a12), title_name(a13), item_name(a14)
{
}
@@ -317,8 +452,12 @@ namespace CGA
int xpos;
int ypos;
int item_count;
+ int injury;
+ int level;
+ int flags;
std::string unit_name;
std::string nick_name;
+ std::string title_name;
std::string item_name;
}cga_map_unit_t;
@@ -342,6 +481,8 @@ namespace CGA
typedef std::vector cga_sell_items_t;
+ typedef std::vector cga_sell_pets_t;
+
typedef struct cga_buy_item_s
{
cga_buy_item_s()
@@ -377,7 +518,7 @@ namespace CGA
int skill_index;
int subskill_index;
int sub_type;
- int itempos[5];
+ int itempos[6];
}cga_craft_item_t;
typedef struct cga_working_result_s
@@ -479,6 +620,116 @@ namespace CGA
int size;
}cga_chat_msg_t;
+ typedef struct cga_trade_stuff_s
+ {
+ cga_trade_stuff_s()
+ {
+ gold = 0;
+ }
+
+ cga_sell_items_t items;
+ cga_sell_pets_t pets;
+ int gold;
+ }cga_trade_stuff_t;
+
+ typedef struct cga_trade_stuff_info_s
+ {
+ cga_trade_stuff_info_s()
+ {
+ gold = 0;
+ type = 0;
+ }
+ cga_trade_stuff_info_s(int a1) : type (a1)
+ {
+ gold = 0;
+ }
+
+ cga_items_info_t items;
+ cga_trade_pet_info_t pet;
+ cga_trade_pet_skill_info_t petskills;
+ int gold;
+ int type;
+ }cga_trade_stuff_info_t;
+
+ typedef struct cga_team_player_s
+ {
+ cga_team_player_s()
+ {
+ unit_id = 0;
+ hp = 0;
+ mp = 0;
+ maxhp = 0;
+ }
+ cga_team_player_s(int a1, int a2, int a3, int a4, const std::string &a5) : unit_id(a1), hp(a2), mp(a3), maxhp(a4), name(a5)
+ {
+
+ }
+ int unit_id;
+ int hp;
+ int mp;
+ int maxhp;
+ std::string name;
+ }cga_team_player_t;
+
+ typedef std::vector cga_team_players_t;
+
+ typedef struct cga_map_cells_s
+ {
+ cga_map_cells_s()
+ {
+ x_bottom = 0;
+ y_bottom = 0;
+ x_size = 0;
+ y_size = 0;
+ }
+ cga_map_cells_s(int a1, int a2, int a3, int a4, short *a5) : x_bottom(a1), y_bottom(a2), x_size(a3), y_size(a4)
+ {
+ cell.resize(a3 * a4);
+ memcpy(cell.data(), a5, sizeof(short) * a3 * a4);
+ }
+ int x_bottom;
+ int y_bottom;
+ int x_size;
+ int y_size;
+ std::vector cell;
+ }cga_map_cells_t;
+
+ typedef struct cga_trade_dialog_s
+ {
+ cga_trade_dialog_s()
+ {
+ level = 0;
+ }
+ cga_trade_dialog_s(std::string &a1, int a2)
+ : name(a1), level(a2)
+ {
+ }
+ std::string name;
+ int level;
+ }cga_trade_dialog_t;
+
+ typedef struct cga_battle_context_s
+ {
+ cga_battle_context_s() {
+
+
+ }
+ cga_battle_context_s(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9) :
+ round_count(a1), player_pos(a2), player_status(a3), skill_performed(a4), skill_allowbit(a5), petskill_allowbit(a6), weapon_allowbit(a7), petid(a8), effect_flags(a9)
+ {
+
+ }
+ int round_count;
+ int player_pos;
+ int player_status;
+ int skill_performed;
+ int skill_allowbit;
+ int petskill_allowbit;
+ int weapon_allowbit;
+ int petid;
+ int effect_flags;
+ }cga_battle_context_t;
+
typedef struct CGAShare_s
{
int ProcessId;
@@ -492,27 +743,70 @@ namespace CGA
int reserved;
}cga_game_data_t;
+#define TRADE_STUFFS_ITEM 1
+#define TRADE_STUFFS_PET 2
+#define TRADE_STUFFS_PETSKILL 3
+#define TRADE_STUFFS_GOLD 4
+
+#define TRADE_STATE_CANCEL 0
+#define TRADE_STATE_READY 1
+#define TRADE_STATE_CONFIRM 2
+#define TRADE_STATE_SUCCEED 3
+
#define FL_BATTLE_ACTION_ISPLAYER 1
#define FL_BATTLE_ACTION_ISDOUBLE 2
#define FL_BATTLE_ACTION_ISSKILLPERFORMED 4
-
+#define FL_BATTLE_ACTION_END 8
+
+#define FL_SKILL_SELECT_TARGET 0x1
+#define FL_SKILL_SELECT_DEAD 0x2
+#define FL_SKILL_TO_PET 0x4
+#define FL_SKILL_TO_SELF 0x8
+#define FL_SKILL_TO_TEAMMATE 0x10
+#define FL_SKILL_TO_ENEMY 0x20
#define FL_SKILL_SINGLE 0x40
#define FL_SKILL_MULTI 0x80
#define FL_SKILL_ALL 0x100
#define FL_SKILL_BOOM 0x200
-
-#define PLAYER_ENABLE_FLAG_PK 0
-#define PLAYER_ENABLE_FLAG_TEAMCHAT 1
-#define PLAYER_ENABLE_FLAG_JOINTEAM 2
-#define PLAYER_ENABLE_FLAG_CARD 3
-#define PLAYER_ENABLE_FLAG_TRADE 4
-#define PLAYER_ENABLE_FLAG_FAMILY 5
+#define FL_SKILL_FRONT_ONLY 0x400
+
+#define FL_DEBUFF_SLEEP 0x20
+#define FL_DEBUFF_MEDUSA 0x40
+#define FL_DEBUFF_DRUNK 0x80
+#define FL_DEBUFF_CHAOS 0x100
+#define FL_DEBUFF_FORGET 0x200
+#define FL_DEBUFF_POISON 0x400
+#define FL_DEBUFF_ANY (FL_DEBUFF_SLEEP | FL_DEBUFF_MEDUSA | FL_DEBUFF_DRUNK | FL_DEBUFF_CHAOS | FL_DEBUFF_FORGET | FL_DEBUFF_POISON)
+
+#define ENABLE_FLAG_PK 0
+#define ENABLE_FLAG_TEAMCHAT 1
+#define ENABLE_FLAG_JOINTEAM 2
+#define ENABLE_FLAG_CARD 3
+#define ENABLE_FLAG_TRADE 4
+#define ENABLE_FLAG_FAMILY 5
#define WORK_TYPE_CRAFTING 1
#define WORK_TYPE_ASSESSING 2
#define WORK_TYPE_HEALING 3
#define WORK_TYPE_GATHERING 4
+#define REQUEST_TYPE_PK 1
+#define REQUEST_TYPE_JOINTEAM 3
+#define REQUEST_TYPE_EXCAHNGECARD 4
+#define REQUEST_TYPE_TRADE 5
+#define REQUEST_TYPE_KICKTEAM 11
+#define REQUEST_TYPE_LEAVETEAM 12
+#define REQUEST_TYPE_TRADE_CONFIRM 13
+#define REQUEST_TYPE_TRADE_REFUSE 14
+#define REQUEST_TYPE_TEAM_CHAT 15
+
+#define PLAYER_MENU_HEAL 1
+#define PLAYER_MENU_ITEM 2
+#define PLAYER_MENU_TRADE 3
+
+#define UNIT_MENU_HEAL 1
+#define UNIT_MENU_ITEM 2
+
class CGAInterface
{
public:
@@ -547,11 +841,15 @@ namespace CGA
virtual bool GetBankItemsInfo(cga_items_info_t &info) = 0;
virtual bool DropItem(int itempos, bool &result) = 0;
virtual bool MoveItem(int itempos, int dstpos, int count, bool &result) = 0;
+ virtual bool DropPet(int petpos, bool &result) = 0;
+ virtual bool GetMapIndex(int &index1, int &index2, int &index3) = 0;
virtual bool GetMapXY(int &x, int &y) = 0;
virtual bool GetMapXYFloat(float &x, float &y) = 0;
virtual bool GetMoveSpeed(float &x, float &y) = 0;
virtual bool GetMapName(std::string &name) = 0;
virtual bool GetMapUnits(cga_map_units_t &units) = 0;
+ virtual bool GetMapCollisionTable(bool loadall, cga_map_cells_t &cells) = 0;
+ virtual bool GetMapObjectTable(bool loadall, cga_map_cells_t &cells) = 0;
virtual bool WalkTo(int x, int y) = 0;
virtual bool TurnTo(int x, int y) = 0;
@@ -567,16 +865,13 @@ namespace CGA
virtual bool ClickNPCDialog(int option, int index, bool &result) = 0;
virtual bool SellNPCStore(cga_sell_items_t &items, bool &result) = 0;
virtual bool BuyNPCStore(cga_buy_items_t &items, bool &result) = 0;
- virtual bool PlayerMenuSelect(int menuindex, bool &result) = 0;
+ virtual bool PlayerMenuSelect(int menuindex, std::string &menustring, bool &result) = 0;
virtual bool UnitMenuSelect(int menuindex, bool &result) = 0;
virtual bool IsBattleUnitValid(int pos, bool &valid) = 0;
virtual bool GetBattleUnit(int pos, cga_battle_unit_t &unit) = 0;
virtual bool GetBattleUnits(cga_battle_units_t &units) = 0;
- virtual bool GetBattleRoundCount(int &count) = 0;
- virtual bool GetBattlePlayerPosition(int &pos) = 0;
- virtual bool GetBattlePlayerStatus(int &status) = 0;
- virtual bool GetBattlePetId(int &petid) = 0;
+ virtual bool GetBattleContext(cga_battle_context_t &ctx) = 0;
virtual bool BattleNormalAttack(int target, bool &result) = 0;
virtual bool BattleSkillAttack(int skillpos, int skilllv, int target, bool &result) = 0;
@@ -592,12 +887,24 @@ namespace CGA
virtual bool SetBattleEndTick(int msec) = 0;
virtual bool SetWorkDelay(int delay) = 0;
virtual bool SetWorkAcceleration(int percent) = 0;
+ virtual bool SetImmediateDoneWork(bool enable) = 0;
virtual bool StartWork(int skill_index, int sub_index, bool &result) = 0;
virtual bool CraftItem(cga_craft_item_t &craft, bool &result) = 0;
virtual bool AssessItem(int skill_index, int itempos, bool &result) = 0;
virtual bool GetCraftInfo(int skill_index, int sub_index, cga_craft_info_t &info) = 0;
virtual bool GetCraftsInfo(int skill_index, cga_crafts_info_t &info) = 0;
+ virtual bool DoRequest(int request_type, bool &result) = 0;
+ virtual bool EnableFlags(int type, bool enable, bool &result) = 0;
+ virtual bool TradeAddStuffs(cga_sell_items_t items, cga_sell_pets_t pets, int gold) = 0;
+ virtual bool GetTeamPlayerInfo(cga_team_players_t &result) = 0;
+
+ virtual bool FixMapWarpStuck(int type) = 0;
+ virtual bool SetNoSwitchAnim(bool enable) = 0;
+ virtual bool GetMoveHistory(std::vector &v) = 0;
+ virtual bool SetWindowResolution(int w, int h) = 0;
+ virtual bool RequestDownloadMap(int xbottom, int ybottom, int xsize, int ysize) = 0;
+
virtual bool RegisterServerShutdownNotify(const std::function &callback) = 0;
virtual bool RegisterBattleActionNotify(const std::function &callback) = 0;
virtual bool RegisterPlayerMenuNotify(const std::function &callback) = 0;
@@ -605,6 +912,9 @@ namespace CGA
virtual bool RegisterNPCDialogNotify(const std::function &callback) = 0;
virtual bool RegisterWorkingResultNotify(const std::function &callback) = 0;
virtual bool RegisterChatMsgNotify(const std::function &callback) = 0;
+ virtual bool RegisterTradeStuffsNotify(const std::function &callback) = 0;
+ virtual bool RegisterTradeDialogNotify(const std::function &callback) = 0;
+ virtual bool RegisterTradeStateNotify(const std::function &callback) = 0;
};
extern "C" CGAInterface *CreateInterface();
diff --git a/CGALib/packdata.h b/CGALib/packdata.h
index 563e307..7299687 100644
--- a/CGALib/packdata.h
+++ b/CGALib/packdata.h
@@ -13,7 +13,7 @@ namespace msgpack {
struct convert {
msgpack::object const& operator()(msgpack::object const& o, cga_player_info_t& v) const {
if (o.type != msgpack::type::ARRAY) throw msgpack::type_error();
- if (o.via.array.size != 15) throw msgpack::type_error();
+ if (o.via.array.size != 21) throw msgpack::type_error();
v.hp = o.via.array.ptr[0].as();
v.maxhp = o.via.array.ptr[1].as();
v.mp = o.via.array.ptr[2].as();
@@ -21,14 +21,20 @@ namespace msgpack {
v.xp = o.via.array.ptr[4].as();
v.maxxp = o.via.array.ptr[5].as();
v.health = o.via.array.ptr[6].as();
- v.level = o.via.array.ptr[7].as();
- v.gold = o.via.array.ptr[8].as();
- v.unitid = o.via.array.ptr[9].as();
- v.petid = o.via.array.ptr[10].as();
- v.punchclock = o.via.array.ptr[11].as();
- v.usingpunchclock = o.via.array.ptr[12].as();
- v.name = o.via.array.ptr[13].as();
- v.job = o.via.array.ptr[14].as();
+ v.souls = o.via.array.ptr[7].as();
+ v.level = o.via.array.ptr[8].as();
+ v.gold = o.via.array.ptr[9].as();
+ v.unitid = o.via.array.ptr[10].as();
+ v.petid = o.via.array.ptr[11].as();
+ v.punchclock = o.via.array.ptr[12].as();
+ v.usingpunchclock = o.via.array.ptr[13].as();
+ v.name = o.via.array.ptr[14].as();
+ v.job = o.via.array.ptr[15].as();
+ v.titles = o.via.array.ptr[16].as>();
+ v.detail = o.via.array.ptr[17].as();
+ v.manu_endurance = o.via.array.ptr[18].as();
+ v.manu_skillful = o.via.array.ptr[19].as();
+ v.manu_intelligence = o.via.array.ptr[20].as();
return o;
}
};
@@ -38,7 +44,7 @@ namespace msgpack {
template
packer& operator()(msgpack::packer& o, cga_player_info_t const& v) const {
// packing member variables as an array.
- o.pack_array(15);
+ o.pack_array(21);
o.pack(v.hp);
o.pack(v.maxhp);
o.pack(v.mp);
@@ -46,6 +52,7 @@ namespace msgpack {
o.pack(v.xp);
o.pack(v.maxxp);
o.pack(v.health);
+ o.pack(v.souls);
o.pack(v.level);
o.pack(v.gold);
o.pack(v.unitid);
@@ -54,6 +61,11 @@ namespace msgpack {
o.pack(v.usingpunchclock);
o.pack(v.name);
o.pack(v.job);
+ o.pack(v.titles);
+ o.pack(v.detail);
+ o.pack(v.manu_endurance);
+ o.pack(v.manu_skillful);
+ o.pack(v.manu_intelligence);
return o;
}
};
@@ -62,7 +74,7 @@ namespace msgpack {
struct object_with_zone {
void operator()(msgpack::object::with_zone& o, cga_player_info_t const& v) const {
o.type = type::ARRAY;
- o.via.array.size = 15;
+ o.via.array.size = 21;
o.via.array.ptr = static_cast(o.zone.allocate_align(sizeof(msgpack::object) * o.via.array.size));
o.via.array.ptr[0] = msgpack::object(v.hp, o.zone);
o.via.array.ptr[1] = msgpack::object(v.maxhp, o.zone);
@@ -71,14 +83,20 @@ namespace msgpack {
o.via.array.ptr[4] = msgpack::object(v.xp, o.zone);
o.via.array.ptr[5] = msgpack::object(v.maxxp, o.zone);
o.via.array.ptr[6] = msgpack::object(v.health, o.zone);
- o.via.array.ptr[7] = msgpack::object(v.level, o.zone);
- o.via.array.ptr[8] = msgpack::object(v.gold, o.zone);
- o.via.array.ptr[9] = msgpack::object(v.unitid, o.zone);
- o.via.array.ptr[10] = msgpack::object(v.petid, o.zone);
- o.via.array.ptr[11] = msgpack::object(v.punchclock, o.zone);
- o.via.array.ptr[12] = msgpack::object(v.usingpunchclock, o.zone);
- o.via.array.ptr[13] = msgpack::object(v.name, o.zone);
- o.via.array.ptr[14] = msgpack::object(v.job, o.zone);
+ o.via.array.ptr[7] = msgpack::object(v.souls, o.zone);
+ o.via.array.ptr[8] = msgpack::object(v.level, o.zone);
+ o.via.array.ptr[9] = msgpack::object(v.gold, o.zone);
+ o.via.array.ptr[10] = msgpack::object(v.unitid, o.zone);
+ o.via.array.ptr[11] = msgpack::object(v.petid, o.zone);
+ o.via.array.ptr[12] = msgpack::object(v.punchclock, o.zone);
+ o.via.array.ptr[13] = msgpack::object(v.usingpunchclock, o.zone);
+ o.via.array.ptr[14] = msgpack::object(v.name, o.zone);
+ o.via.array.ptr[15] = msgpack::object(v.job, o.zone);
+ o.via.array.ptr[16] = msgpack::object(v.titles, o.zone);
+ o.via.array.ptr[17] = msgpack::object(v.detail, o.zone);
+ o.via.array.ptr[18] = msgpack::object(v.manu_endurance, o.zone);
+ o.via.array.ptr[19] = msgpack::object(v.manu_skillful, o.zone);
+ o.via.array.ptr[20] = msgpack::object(v.manu_intelligence, o.zone);
}
};
@@ -88,7 +106,7 @@ namespace msgpack {
struct convert {
msgpack::object const& operator()(msgpack::object const& o, cga_pet_info_t& v) const {
if (o.type != msgpack::type::ARRAY) throw msgpack::type_error();
- if (o.via.array.size != 14) throw msgpack::type_error();
+ if (o.via.array.size != 16) throw msgpack::type_error();
v.hp = o.via.array.ptr[0].as();
v.maxhp = o.via.array.ptr[1].as();
v.mp = o.via.array.ptr[2].as();
@@ -99,10 +117,12 @@ namespace msgpack {
v.level = o.via.array.ptr[7].as();
v.flags = o.via.array.ptr[8].as();
v.race = o.via.array.ptr[9].as();
- v.battle_flags = o.via.array.ptr[10].as();
- v.index = o.via.array.ptr[11].as();
- v.name = o.via.array.ptr[12].as();
- v.realname = o.via.array.ptr[13].as();
+ v.loyality = o.via.array.ptr[10].as();
+ v.battle_flags = o.via.array.ptr[11].as();
+ v.index = o.via.array.ptr[12].as();
+ v.name = o.via.array.ptr[13].as();
+ v.realname = o.via.array.ptr[14].as();
+ v.detail = o.via.array.ptr[15].as();
return o;
}
};
@@ -112,7 +132,7 @@ namespace msgpack {
template
packer& operator()(msgpack::packer& o, cga_pet_info_t const& v) const {
// packing member variables as an array.
- o.pack_array(14);
+ o.pack_array(16);
o.pack(v.hp);
o.pack(v.maxhp);
o.pack(v.mp);
@@ -123,10 +143,12 @@ namespace msgpack {
o.pack(v.level);
o.pack(v.flags);
o.pack(v.race);
+ o.pack(v.loyality);
o.pack(v.battle_flags);
o.pack(v.index);
o.pack(v.name);
o.pack(v.realname);
+ o.pack(v.detail);
return o;
}
};
@@ -135,7 +157,7 @@ namespace msgpack {
struct object_with_zone {
void operator()(msgpack::object::with_zone& o, cga_pet_info_t const& v) const {
o.type = type::ARRAY;
- o.via.array.size = 14;
+ o.via.array.size = 16;
o.via.array.ptr = static_cast(o.zone.allocate_align(sizeof(msgpack::object) * o.via.array.size));
o.via.array.ptr[0] = msgpack::object(v.hp, o.zone);
o.via.array.ptr[1] = msgpack::object(v.maxhp, o.zone);
@@ -147,10 +169,112 @@ namespace msgpack {
o.via.array.ptr[7] = msgpack::object(v.level, o.zone);
o.via.array.ptr[8] = msgpack::object(v.flags, o.zone);
o.via.array.ptr[9] = msgpack::object(v.race, o.zone);
- o.via.array.ptr[10] = msgpack::object(v.battle_flags, o.zone);
- o.via.array.ptr[11] = msgpack::object(v.index, o.zone);
- o.via.array.ptr[12] = msgpack::object(v.name, o.zone);
- o.via.array.ptr[13] = msgpack::object(v.realname, o.zone);
+ o.via.array.ptr[10] = msgpack::object(v.loyality, o.zone);
+ o.via.array.ptr[11] = msgpack::object(v.battle_flags, o.zone);
+ o.via.array.ptr[12] = msgpack::object(v.index, o.zone);
+ o.via.array.ptr[13] = msgpack::object(v.name, o.zone);
+ o.via.array.ptr[14] = msgpack::object(v.realname, o.zone);
+ o.via.array.ptr[15] = msgpack::object(v.detail, o.zone);
+ }
+ };
+
+ //trade_pet_info
+
+ template<>
+ struct convert {
+ msgpack::object const& operator()(msgpack::object const& o, cga_trade_pet_info_t& v) const {
+ if (o.type != msgpack::type::ARRAY) throw msgpack::type_error();
+ if (o.via.array.size != 10) throw msgpack::type_error();
+
+ v.level = o.via.array.ptr[0].as();
+ v.race = o.via.array.ptr[1].as();
+ v.maxhp = o.via.array.ptr[2].as();
+ v.maxmp = o.via.array.ptr[3].as();
+ v.skill_count = o.via.array.ptr[4].as();
+ v.image_id = o.via.array.ptr[5].as();
+ v.index = o.via.array.ptr[6].as();
+ v.name = o.via.array.ptr[7].as();
+ v.realname = o.via.array.ptr[8].as();
+ v.detail = o.via.array.ptr[9].as();
+
+ return o;
+ }
+ };
+
+ template<>
+ struct pack {
+ template
+ packer& operator()(msgpack::packer& o, cga_trade_pet_info_t const& v) const {
+ // packing member variables as an array.
+ o.pack_array(10);
+ o.pack(v.level);
+ o.pack(v.race);
+ o.pack(v.maxhp);
+ o.pack(v.maxmp);
+ o.pack(v.skill_count);
+ o.pack(v.image_id);
+ o.pack(v.index);
+ o.pack(v.name);
+ o.pack(v.realname);
+ o.pack(v.detail);
+ return o;
+ }
+ };
+
+ template <>
+ struct object_with_zone {
+ void operator()(msgpack::object::with_zone& o, cga_trade_pet_info_t const& v) const {
+ o.type = type::ARRAY;
+ o.via.array.size = 10;
+ o.via.array.ptr = static_cast(o.zone.allocate_align(sizeof(msgpack::object) * o.via.array.size));
+ o.via.array.ptr[0] = msgpack::object(v.level, o.zone);
+ o.via.array.ptr[1] = msgpack::object(v.race, o.zone);
+ o.via.array.ptr[2] = msgpack::object(v.maxhp, o.zone);
+ o.via.array.ptr[3] = msgpack::object(v.maxmp , o.zone);
+ o.via.array.ptr[4] = msgpack::object(v.skill_count, o.zone);
+ o.via.array.ptr[5] = msgpack::object(v.image_id, o.zone);
+ o.via.array.ptr[6] = msgpack::object(v.index, o.zone);
+ o.via.array.ptr[7] = msgpack::object(v.name, o.zone);
+ o.via.array.ptr[8] = msgpack::object(v.realname, o.zone);
+ o.via.array.ptr[9] = msgpack::object(v.detail, o.zone);
+ }
+ };
+
+ //cga_trade_pet_skill_info_t
+
+ template<>
+ struct convert {
+ msgpack::object const& operator()(msgpack::object const& o, cga_trade_pet_skill_info_t& v) const {
+ if (o.type != msgpack::type::ARRAY) throw msgpack::type_error();
+ if (o.via.array.size != 2) throw msgpack::type_error();
+
+ v.index = o.via.array.ptr[0].as();
+ v.skills = o.via.array.ptr[1].as>();
+
+ return o;
+ }
+ };
+
+ template<>
+ struct pack {
+ template
+ packer& operator()(msgpack::packer& o, cga_trade_pet_skill_info_t const& v) const {
+ // packing member variables as an array.
+ o.pack_array(2);
+ o.pack(v.index);
+ o.pack(v.skills);
+ return o;
+ }
+ };
+
+ template <>
+ struct object_with_zone {
+ void operator()(msgpack::object::with_zone& o, cga_trade_pet_skill_info_t const& v) const {
+ o.type = type::ARRAY;
+ o.via.array.size = 2;
+ o.via.array.ptr = static_cast(o.zone.allocate_align(sizeof(msgpack::object) * o.via.array.size));
+ o.via.array.ptr[0] = msgpack::object(v.index, o.zone);
+ o.via.array.ptr[1] = msgpack::object(v.skills, o.zone);
}
};
@@ -205,7 +329,7 @@ namespace msgpack {
struct convert {
msgpack::object const& operator()(msgpack::object const& o, cga_skill_info_t& v) const {
if (o.type != msgpack::type::ARRAY) throw msgpack::type_error();
- if (o.via.array.size != 9) throw msgpack::type_error();
+ if (o.via.array.size != 10) throw msgpack::type_error();
v.name = o.via.array.ptr[0].as();
v.lv = o.via.array.ptr[1].as();
v.maxlv = o.via.array.ptr[2].as();
@@ -215,6 +339,7 @@ namespace msgpack {
v.type = o.via.array.ptr[6].as();
v.pos = o.via.array.ptr[7].as();
v.index = o.via.array.ptr[8].as();
+ v.slotsize = o.via.array.ptr[9].as();
return o;
}
};
@@ -224,7 +349,7 @@ namespace msgpack {
template
packer& operator()(msgpack::packer& o, cga_skill_info_t const& v) const {
// packing member variables as an array.
- o.pack_array(9);
+ o.pack_array(10);
o.pack(v.name);
o.pack(v.lv);
o.pack(v.maxlv);
@@ -234,6 +359,7 @@ namespace msgpack {
o.pack(v.type);
o.pack(v.pos);
o.pack(v.index);
+ o.pack(v.slotsize);
return o;
}
};
@@ -242,7 +368,7 @@ namespace msgpack {
struct object_with_zone {
void operator()(msgpack::object::with_zone& o, cga_skill_info_t const& v) const {
o.type = type::ARRAY;
- o.via.array.size = 9;
+ o.via.array.size = 10;
o.via.array.ptr = static_cast(o.zone.allocate_align(sizeof(msgpack::object) * o.via.array.size));
o.via.array.ptr[0] = msgpack::object(v.name, o.zone);
o.via.array.ptr[1] = msgpack::object(v.lv, o.zone);
@@ -253,6 +379,7 @@ namespace msgpack {
o.via.array.ptr[6] = msgpack::object(v.type, o.zone);
o.via.array.ptr[7] = msgpack::object(v.pos, o.zone);
o.via.array.ptr[8] = msgpack::object(v.index, o.zone);
+ o.via.array.ptr[9] = msgpack::object(v.slotsize, o.zone);
}
};
@@ -262,12 +389,13 @@ namespace msgpack {
struct convert {
msgpack::object const& operator()(msgpack::object const& o, cga_subskill_info_t& v) const {
if (o.type != msgpack::type::ARRAY) throw msgpack::type_error();
- if (o.via.array.size != 5) throw msgpack::type_error();
+ if (o.via.array.size != 6) throw msgpack::type_error();
v.name = o.via.array.ptr[0].as();
v.info = o.via.array.ptr[1].as();
v.cost = o.via.array.ptr[2].as();
v.flags = o.via.array.ptr[3].as();
v.level = o.via.array.ptr[4].as();
+ v.available = o.via.array.ptr[5].as();
return o;
}
};
@@ -277,12 +405,13 @@ namespace msgpack {
template
packer& operator()(msgpack::packer& o, cga_subskill_info_t const& v) const {
// packing member variables as an array.
- o.pack_array(5);
+ o.pack_array(6);
o.pack(v.name);
o.pack(v.info);
o.pack(v.cost);
o.pack(v.flags);
o.pack(v.level);
+ o.pack(v.available);
return o;
}
};
@@ -291,13 +420,14 @@ namespace msgpack {
struct object_with_zone {
void operator()(msgpack::object::with_zone& o, cga_subskill_info_t const& v) const {
o.type = type::ARRAY;
- o.via.array.size = 5;
+ o.via.array.size = 6;
o.via.array.ptr = static_cast(o.zone.allocate_align(sizeof(msgpack::object) * o.via.array.size));
o.via.array.ptr[0] = msgpack::object(v.name, o.zone);
o.via.array.ptr[1] = msgpack::object(v.info, o.zone);
o.via.array.ptr[2] = msgpack::object(v.cost, o.zone);
o.via.array.ptr[3] = msgpack::object(v.flags, o.zone);
o.via.array.ptr[4] = msgpack::object(v.level, o.zone);
+ o.via.array.ptr[5] = msgpack::object(v.available, o.zone);
}
};
@@ -370,7 +500,7 @@ namespace msgpack {
struct convert {
msgpack::object const& operator()(msgpack::object const& o, cga_battle_unit_t& v) const {
if (o.type != msgpack::type::ARRAY) throw msgpack::type_error();
- if (o.via.array.size != 8) throw msgpack::type_error();
+ if (o.via.array.size != 9) throw msgpack::type_error();
v.name = o.via.array.ptr[0].as();
v.modelid = o.via.array.ptr[1].as();
v.level = o.via.array.ptr[2].as();
@@ -378,7 +508,8 @@ namespace msgpack {
v.maxhp = o.via.array.ptr[4].as();
v.curmp = o.via.array.ptr[5].as();
v.maxmp = o.via.array.ptr[6].as();
- v.pos = o.via.array.ptr[7].as();
+ v.flags = o.via.array.ptr[7].as();
+ v.pos = o.via.array.ptr[8].as();
return o;
}
};
@@ -388,7 +519,7 @@ namespace msgpack {
template
packer& operator()(msgpack::packer& o, cga_battle_unit_t const& v) const {
// packing member variables as an array.
- o.pack_array(8);
+ o.pack_array(9);
o.pack(v.name);
o.pack(v.modelid);
o.pack(v.level);
@@ -396,6 +527,7 @@ namespace msgpack {
o.pack(v.maxhp);
o.pack(v.curmp);
o.pack(v.maxmp);
+ o.pack(v.flags);
o.pack(v.pos);
return o;
}
@@ -405,7 +537,7 @@ namespace msgpack {
struct object_with_zone {
void operator()(msgpack::object::with_zone& o, cga_battle_unit_t const& v) const {
o.type = type::ARRAY;
- o.via.array.size = 8;
+ o.via.array.size = 9;
o.via.array.ptr = static_cast(o.zone.allocate_align(sizeof(msgpack::object) * o.via.array.size));
o.via.array.ptr[0] = msgpack::object(v.name, o.zone);
o.via.array.ptr[1] = msgpack::object(v.modelid, o.zone);
@@ -414,7 +546,8 @@ namespace msgpack {
o.via.array.ptr[4] = msgpack::object(v.maxhp, o.zone);
o.via.array.ptr[5] = msgpack::object(v.curmp, o.zone);
o.via.array.ptr[6] = msgpack::object(v.maxmp, o.zone);
- o.via.array.ptr[7] = msgpack::object(v.pos, o.zone);
+ o.via.array.ptr[7] = msgpack::object(v.flags, o.zone);
+ o.via.array.ptr[8] = msgpack::object(v.pos, o.zone);
}
};
@@ -565,7 +698,7 @@ namespace msgpack {
struct convert {
msgpack::object const& operator()(msgpack::object const& o, cga_map_unit_t& v) const {
if (o.type != msgpack::type::ARRAY) throw msgpack::type_error();
- if (o.via.array.size != 10) throw msgpack::type_error();
+ if (o.via.array.size != 14) throw msgpack::type_error();
v.valid = o.via.array.ptr[0].as();
v.type = o.via.array.ptr[1].as();
v.model_id = o.via.array.ptr[2].as();
@@ -573,9 +706,13 @@ namespace msgpack {
v.xpos = o.via.array.ptr[4].as();
v.ypos = o.via.array.ptr[5].as();
v.item_count = o.via.array.ptr[6].as();
- v.unit_name = o.via.array.ptr[7].as();
- v.nick_name = o.via.array.ptr[8].as();
- v.item_name = o.via.array.ptr[9].as();
+ v.injury = o.via.array.ptr[7].as();
+ v.level = o.via.array.ptr[8].as();
+ v.flags = o.via.array.ptr[9].as();
+ v.unit_name = o.via.array.ptr[10].as();
+ v.nick_name = o.via.array.ptr[11].as();
+ v.title_name = o.via.array.ptr[12].as();
+ v.item_name = o.via.array.ptr[13].as();
return o;
}
};
@@ -585,7 +722,7 @@ namespace msgpack {
template
packer& operator()(msgpack::packer& o, cga_map_unit_t const& v) const {
// packing member variables as an array.
- o.pack_array(10);
+ o.pack_array(14);
o.pack(v.valid);
o.pack(v.type);
o.pack(v.model_id);
@@ -593,8 +730,12 @@ namespace msgpack {
o.pack(v.xpos);
o.pack(v.ypos);
o.pack(v.item_count);
+ o.pack(v.injury);
+ o.pack(v.level);
+ o.pack(v.flags);
o.pack(v.unit_name);
o.pack(v.nick_name);
+ o.pack(v.title_name);
o.pack(v.item_name);
return o;
}
@@ -604,7 +745,7 @@ namespace msgpack {
struct object_with_zone {
void operator()(msgpack::object::with_zone& o, cga_map_unit_t const& v) const {
o.type = type::ARRAY;
- o.via.array.size = 10;
+ o.via.array.size = 14;
o.via.array.ptr = static_cast(o.zone.allocate_align(sizeof(msgpack::object) * o.via.array.size));
o.via.array.ptr[0] = msgpack::object(v.valid, o.zone);
o.via.array.ptr[1] = msgpack::object(v.type, o.zone);
@@ -613,9 +754,58 @@ namespace msgpack {
o.via.array.ptr[4] = msgpack::object(v.xpos, o.zone);
o.via.array.ptr[5] = msgpack::object(v.ypos, o.zone);
o.via.array.ptr[6] = msgpack::object(v.item_count, o.zone);
- o.via.array.ptr[7] = msgpack::object(v.unit_name, o.zone);
- o.via.array.ptr[8] = msgpack::object(v.nick_name, o.zone);
- o.via.array.ptr[9] = msgpack::object(v.item_name, o.zone);
+ o.via.array.ptr[7] = msgpack::object(v.injury, o.zone);
+ o.via.array.ptr[8] = msgpack::object(v.level, o.zone);
+ o.via.array.ptr[9] = msgpack::object(v.flags, o.zone);
+ o.via.array.ptr[10] = msgpack::object(v.unit_name, o.zone);
+ o.via.array.ptr[11] = msgpack::object(v.nick_name, o.zone);
+ o.via.array.ptr[12] = msgpack::object(v.title_name, o.zone);
+ o.via.array.ptr[13] = msgpack::object(v.item_name, o.zone);
+ }
+ };
+
+ //cga_map_cells_t
+
+ template<>
+ struct convert {
+ msgpack::object const& operator()(msgpack::object const& o, cga_map_cells_t& v) const {
+ if (o.type != msgpack::type::ARRAY) throw msgpack::type_error();
+ if (o.via.array.size != 5) throw msgpack::type_error();
+ v.x_bottom = o.via.array.ptr[0].as();
+ v.y_bottom = o.via.array.ptr[1].as();
+ v.x_size = o.via.array.ptr[2].as();
+ v.y_size = o.via.array.ptr[3].as();
+ v.cell = o.via.array.ptr[4].as>();
+ return o;
+ }
+ };
+
+ template<>
+ struct pack {
+ template
+ packer& operator()(msgpack::packer& o, cga_map_cells_t const& v) const {
+ // packing member variables as an array.
+ o.pack_array(5);
+ o.pack(v.x_bottom);
+ o.pack(v.y_bottom);
+ o.pack(v.x_size);
+ o.pack(v.y_size);
+ o.pack(v.cell);
+ return o;
+ }
+ };
+
+ template <>
+ struct object_with_zone {
+ void operator()(msgpack::object::with_zone& o, cga_map_cells_t const& v) const {
+ o.type = type::ARRAY;
+ o.via.array.size = 5;
+ o.via.array.ptr = static_cast(o.zone.allocate_align(sizeof(msgpack::object) * o.via.array.size));
+ o.via.array.ptr[0] = msgpack::object(v.x_bottom, o.zone);
+ o.via.array.ptr[1] = msgpack::object(v.y_bottom, o.zone);
+ o.via.array.ptr[2] = msgpack::object(v.x_size, o.zone);
+ o.via.array.ptr[3] = msgpack::object(v.y_size, o.zone);
+ o.via.array.ptr[4] = msgpack::object(v.cell, o.zone);
}
};
@@ -700,11 +890,11 @@ namespace msgpack {
struct convert {
msgpack::object const& operator()(msgpack::object const& o, cga_craft_item_t& v) const {
if (o.type != msgpack::type::ARRAY) throw msgpack::type_error();
- if (o.via.array.size != 8) throw msgpack::type_error();
+ if (o.via.array.size != 9) throw msgpack::type_error();
v.skill_index = o.via.array.ptr[0].as();
v.subskill_index = o.via.array.ptr[1].as();
v.sub_type = o.via.array.ptr[2].as();
- for(int i = 0;i < 5; ++i)
+ for(int i = 0;i < 6; ++i)
v.itempos[i] = o.via.array.ptr[3 + i].as();
return o;
}
@@ -715,11 +905,11 @@ namespace msgpack {
template
packer& operator()(msgpack::packer& o, cga_craft_item_t const& v) const {
// packing member variables as an array.
- o.pack_array(8);
+ o.pack_array(9);
o.pack(v.skill_index);
o.pack(v.subskill_index);
o.pack(v.sub_type);
- for (int i = 0; i < 5; ++i)
+ for (int i = 0; i < 6; ++i)
o.pack(v.itempos[i]);
return o;
}
@@ -729,12 +919,12 @@ namespace msgpack {
struct object_with_zone {
void operator()(msgpack::object::with_zone& o, cga_craft_item_t const& v) const {
o.type = type::ARRAY;
- o.via.array.size = 8;
+ o.via.array.size = 9;
o.via.array.ptr = static_cast(o.zone.allocate_align(sizeof(msgpack::object) * o.via.array.size));
o.via.array.ptr[0] = msgpack::object(v.skill_index, o.zone);
o.via.array.ptr[1] = msgpack::object(v.subskill_index, o.zone);
o.via.array.ptr[2] = msgpack::object(v.sub_type, o.zone);
- for (int i = 0; i < 5; ++i)
+ for (int i = 0; i < 6; ++i)
o.via.array.ptr[3 + i] = msgpack::object(v.itempos[i], o.zone);
}
};
@@ -967,6 +1157,288 @@ namespace msgpack {
}
};
+ //cga_trade_stuff_info_t
+ template<>
+ struct convert {
+ msgpack::object const& operator()(msgpack::object const& o, cga_trade_stuff_info_t& v) const {
+ if (o.type != msgpack::type::ARRAY) throw msgpack::type_error();
+ if (o.via.array.size != 5) throw msgpack::type_error();
+ v.items = o.via.array.ptr[0].as();
+ v.pet = o.via.array.ptr[1].as();
+ v.petskills = o.via.array.ptr[2].as();
+ v.gold = o.via.array.ptr[3].as();
+ v.type = o.via.array.ptr[4].as();
+ return o;
+ }
+ };
+
+ template<>
+ struct pack {
+ template
+ packer& operator()(msgpack::packer& o, cga_trade_stuff_info_t const& v) const {
+ // packing member variables as an array.
+ o.pack_array(5);
+ o.pack(v.items);
+ o.pack(v.pet);
+ o.pack(v.petskills);
+ o.pack(v.gold);
+ o.pack(v.type);
+ return o;
+ }
+ };
+
+ template <>
+ struct object_with_zone {
+ void operator()(msgpack::object::with_zone& o, cga_trade_stuff_info_t const& v) const {
+ o.type = type::ARRAY;
+ o.via.array.size = 5;
+ o.via.array.ptr = static_cast(o.zone.allocate_align(sizeof(msgpack::object) * o.via.array.size));
+ o.via.array.ptr[0] = msgpack::object(v.items, o.zone);
+ o.via.array.ptr[1] = msgpack::object(v.pet, o.zone);
+ o.via.array.ptr[2] = msgpack::object(v.petskills, o.zone);
+ o.via.array.ptr[3] = msgpack::object(v.gold, o.zone);
+ o.via.array.ptr[4] = msgpack::object(v.type, o.zone);
+ }
+ };
+
+ //cga_team_player_t
+ template<>
+ struct convert {
+ msgpack::object const& operator()(msgpack::object const& o, cga_team_player_t& v) const {
+ if (o.type != msgpack::type::ARRAY) throw msgpack::type_error();
+ if (o.via.array.size != 5) throw msgpack::type_error();
+ v.unit_id = o.via.array.ptr[0].as();
+ v.hp = o.via.array.ptr[1].as();
+ v.mp = o.via.array.ptr[2].as();
+ v.maxhp = o.via.array.ptr[3].as();
+ v.name = o.via.array.ptr[4].as();
+ return o;
+ }
+ };
+
+ template<>
+ struct pack {
+ template
+ packer& operator()(msgpack::packer& o, cga_team_player_t const& v) const {
+ // packing member variables as an array.
+ o.pack_array(5);
+ o.pack(v.unit_id);
+ o.pack(v.hp);
+ o.pack(v.mp);
+ o.pack(v.maxhp);
+ o.pack(v.name);
+ return o;
+ }
+ };
+
+ template <>
+ struct object_with_zone {
+ void operator()(msgpack::object::with_zone& o, cga_team_player_t const& v) const {
+ o.type = type::ARRAY;
+ o.via.array.size = 5;
+ o.via.array.ptr = static_cast(o.zone.allocate_align(sizeof(msgpack::object) * o.via.array.size));
+ o.via.array.ptr[0] = msgpack::object(v.unit_id, o.zone);
+ o.via.array.ptr[1] = msgpack::object(v.hp, o.zone);
+ o.via.array.ptr[2] = msgpack::object(v.mp, o.zone);
+ o.via.array.ptr[3] = msgpack::object(v.maxhp, o.zone);
+ o.via.array.ptr[4] = msgpack::object(v.name, o.zone);
+ }
+ };
+
+ //cga_trade_dialog_t
+ template<>
+ struct convert {
+ msgpack::object const& operator()(msgpack::object const& o, cga_trade_dialog_t& v) const {
+ if (o.type != msgpack::type::ARRAY) throw msgpack::type_error();
+ if (o.via.array.size != 2) throw msgpack::type_error();
+ v.name = o.via.array.ptr[0].as();
+ v.level = o.via.array.ptr[1].as();
+ return o;
+ }
+ };
+
+ template<>
+ struct pack {
+ template
+ packer& operator()(msgpack::packer& o, cga_trade_dialog_t const& v) const {
+ // packing member variables as an array.
+ o.pack_array(2);
+ o.pack(v.name);
+ o.pack(v.level);
+ return o;
+ }
+ };
+
+ template <>
+ struct object_with_zone {
+ void operator()(msgpack::object::with_zone& o, cga_trade_dialog_t const& v) const {
+ o.type = type::ARRAY;
+ o.via.array.size = 2;
+ o.via.array.ptr = static_cast(o.zone.allocate_align(sizeof(msgpack::object) * o.via.array.size));
+ o.via.array.ptr[0] = msgpack::object(v.name, o.zone);
+ o.via.array.ptr[1] = msgpack::object(v.level, o.zone);
+ }
+ };
+
+ //cga_battle_context_t
+ template<>
+ struct convert {
+ msgpack::object const& operator()(msgpack::object const& o, cga_battle_context_t& v) const {
+ if (o.type != msgpack::type::ARRAY) throw msgpack::type_error();
+ if (o.via.array.size != 9) throw msgpack::type_error();
+ v.round_count = o.via.array.ptr[0].as();
+ v.player_pos = o.via.array.ptr[1].as();
+ v.player_status = o.via.array.ptr[2].as();
+ v.skill_performed = o.via.array.ptr[3].as();
+ v.skill_allowbit = o.via.array.ptr[4].as();
+ v.petskill_allowbit = o.via.array.ptr[5].as();
+ v.weapon_allowbit = o.via.array.ptr[6].as();
+ v.petid = o.via.array.ptr[7].as();
+ v.effect_flags = o.via.array.ptr[8].as();
+ return o;
+ }
+ };
+
+ template<>
+ struct pack {
+ template
+ packer& operator()(msgpack::packer& o, cga_battle_context_t const& v) const {
+ // packing member variables as an array.
+ o.pack_array(9);
+ o.pack(v.round_count);
+ o.pack(v.player_pos);
+ o.pack(v.player_status);
+ o.pack(v.skill_performed);
+ o.pack(v.skill_allowbit);
+ o.pack(v.petskill_allowbit);
+ o.pack(v.weapon_allowbit);
+ o.pack(v.petid);
+ o.pack(v.effect_flags);
+ return o;
+ }
+ };
+
+ template <>
+ struct object_with_zone {
+ void operator()(msgpack::object::with_zone& o, cga_battle_context_t const& v) const {
+ o.type = type::ARRAY;
+ o.via.array.size = 8;
+ o.via.array.ptr = static_cast(o.zone.allocate_align(sizeof(msgpack::object) * o.via.array.size));
+ o.via.array.ptr[0] = msgpack::object(v.round_count, o.zone);
+ o.via.array.ptr[1] = msgpack::object(v.player_pos, o.zone);
+ o.via.array.ptr[2] = msgpack::object(v.player_status, o.zone);
+ o.via.array.ptr[3] = msgpack::object(v.skill_performed, o.zone);
+ o.via.array.ptr[4] = msgpack::object(v.skill_allowbit, o.zone);
+ o.via.array.ptr[5] = msgpack::object(v.petskill_allowbit, o.zone);
+ o.via.array.ptr[6] = msgpack::object(v.weapon_allowbit, o.zone);
+ o.via.array.ptr[7] = msgpack::object(v.petid, o.zone);
+ o.via.array.ptr[8] = msgpack::object(v.effect_flags, o.zone);
+ }
+ };
+
+ //cga_playerpet_detail_info_t
+ template<>
+ struct convert {
+ msgpack::object const& operator()(msgpack::object const& o, cga_playerpet_detail_info_t& v) const {
+ if (o.type != msgpack::type::ARRAY) throw msgpack::type_error();
+ if (o.via.array.size != 25) throw msgpack::type_error();
+ v.points_remain = o.via.array.ptr[0].as();
+ v.points_endurance = o.via.array.ptr[1].as();
+ v.points_strength = o.via.array.ptr[2].as