This commit is contained in:
aozhiwei 2020-08-10 16:47:56 +08:00
parent 5c093d1505
commit 74bd5e36f5
3 changed files with 5 additions and 0 deletions

View File

@ -34,6 +34,7 @@ void JsonDataMgr::Init()
gameserver_cluster_json_.ReadFromFile(gameserver_cluster_json_file);
ip = GetConf()->At("ip")->AsXValue().GetString();
listen_port = GetConf()->At("listen_port")->AsXValue();
server_info = a8::Format("%s:%d", {ip, listen_port});
Reload();
}

View File

@ -16,6 +16,8 @@ public:
std::string ip;
int listen_port = 0;
std::string server_info;
void Reload();
private:

View File

@ -16,6 +16,7 @@
#include "typeconvert.h"
#include "playermgr.h"
#include "perfmonitor.h"
#include "jsondatamgr.h"
const int kREVIVE_BUFF_ID = 1005;
@ -1332,6 +1333,7 @@ void Player::PushJoinRoomMsg()
cs::SMJoinedNotify notifymsg;
notifymsg.set_error_code(0);
notifymsg.set_room_mode((int)room->GetRoomMode());
notifymsg.set_server_info(JsonDataMgr::Instance()->server_info);
room->FillSMJoinedNotify(this, notifymsg);
GGListener::Instance()->SendToClient(socket_handle, 0, notifymsg);
}