改为离线技术
This commit is contained in:
parent
ecbba052c5
commit
3d1b61ce91
@ -1636,9 +1636,21 @@ void Human::SendUpdateMsg()
|
|||||||
void Human::SendGameOver()
|
void Human::SendGameOver()
|
||||||
{
|
{
|
||||||
if (entity_subtype == EST_Player) {
|
if (entity_subtype == EST_Player) {
|
||||||
|
#if 1
|
||||||
|
if (!sent_battlereport_) {
|
||||||
|
SendBattleReport();
|
||||||
|
sent_battlereport_ = true;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
cs::SMGameOver msg;
|
||||||
|
FillSMGameOver(msg);
|
||||||
|
SendNotifyMsg(msg);
|
||||||
|
}
|
||||||
|
#else
|
||||||
if (!sending_gameover_) {
|
if (!sending_gameover_) {
|
||||||
InternalSendGameOver();
|
InternalSendGameOver();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2168,3 +2180,44 @@ void Human::DeadDrop()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Human::SendBattleReport()
|
||||||
|
{
|
||||||
|
a8::MutableXObject* params = a8::MutableXObject::NewObject();
|
||||||
|
GenBattleReportData(params);
|
||||||
|
auto on_ok = [] (a8::XParams& param, a8::XObject& data)
|
||||||
|
{
|
||||||
|
};
|
||||||
|
auto on_error = [] (a8::XParams& param, const std::string& response)
|
||||||
|
{
|
||||||
|
a8::UdpLog::Instance()->Error("battleReport http error params: %s response: %s",
|
||||||
|
{
|
||||||
|
param.param2,
|
||||||
|
response
|
||||||
|
});
|
||||||
|
};
|
||||||
|
std::string url;
|
||||||
|
if (!f8::IsOnlineEnv()) {
|
||||||
|
if (App::Instance()->HasFlag(3)) {
|
||||||
|
url = "http://192.168.100.41/webapp/index.php?c=Role&a=battleReport";
|
||||||
|
} else {
|
||||||
|
url = "https://game2001api-test.kingsome.cn/webapp/index.php?c=Role&a=battleReport";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
url = "https://game2001api.kingsome.cn/webapp/index.php?c=Role&a=battleReport";
|
||||||
|
}
|
||||||
|
std::string data;
|
||||||
|
params->ToUrlEncodeStr(data);
|
||||||
|
f8::HttpClientPool::Instance()->HttpGet(
|
||||||
|
a8::XParams()
|
||||||
|
.SetSender(room->room_uuid)
|
||||||
|
.SetParam1(entity_uniid)
|
||||||
|
.SetParam2(data),
|
||||||
|
on_ok,
|
||||||
|
on_error,
|
||||||
|
url.c_str(),
|
||||||
|
*params,
|
||||||
|
MAX_SYS_HTTP_NUM + (room->room_uuid % MAX_USER_HTTP_NUM)
|
||||||
|
);
|
||||||
|
delete params;
|
||||||
|
}
|
||||||
|
@ -208,6 +208,7 @@ private:
|
|||||||
void InternalSendGameOver();
|
void InternalSendGameOver();
|
||||||
void DeadDrop();
|
void DeadDrop();
|
||||||
void FillSMGameOver(cs::SMGameOver& msg);
|
void FillSMGameOver(cs::SMGameOver& msg);
|
||||||
|
void SendBattleReport();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
long long last_shot_frameno_ = 0;
|
long long last_shot_frameno_ = 0;
|
||||||
@ -244,6 +245,7 @@ private:
|
|||||||
|
|
||||||
bool already_report_battle_ = false;
|
bool already_report_battle_ = false;
|
||||||
bool sending_gameover_ = false;
|
bool sending_gameover_ = false;
|
||||||
|
bool sent_battlereport_ = false;
|
||||||
bool sent_game_end_ = false;
|
bool sent_game_end_ = false;
|
||||||
int send_gameover_trycount_ = 0;
|
int send_gameover_trycount_ = 0;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user