1
This commit is contained in:
commit
942c62661c
@ -113,7 +113,7 @@ bool App::Init(int argc, char* argv[])
|
|||||||
AsyncTaskMgr::Instance()->Init();
|
AsyncTaskMgr::Instance()->Init();
|
||||||
GuildMgr::Instance()->Init();
|
GuildMgr::Instance()->Init();
|
||||||
|
|
||||||
a8::UdpLog::Instance()->Info("friend_imserver starting instance_id:%d pid:%d ",
|
a8::UdpLog::Instance()->Info("friend_imserver starting instance_id:%d pid:%d 13423",
|
||||||
{
|
{
|
||||||
instance_id,
|
instance_id,
|
||||||
getpid(),
|
getpid(),
|
||||||
|
@ -61,18 +61,28 @@ struct RecommandFriendTask
|
|||||||
if (context.IsValid()) {
|
if (context.IsValid()) {
|
||||||
std::set<std::string>& exclude_account_ids = context.hum->GetExcludeAccountIds();
|
std::set<std::string>& exclude_account_ids = context.hum->GetExcludeAccountIds();
|
||||||
std::set<std::string> batch_account_ids;
|
std::set<std::string> batch_account_ids;
|
||||||
|
|
||||||
|
int my_gameid = f8::ExtractGameIdFromAccountId
|
||||||
|
(context.account_id);
|
||||||
|
int my_channel = f8::ExtractChannelIdFromAccountId
|
||||||
|
(context.account_id);
|
||||||
|
|
||||||
cs::SMRecommandFriend msg;
|
cs::SMRecommandFriend msg;
|
||||||
for (auto& pair : recommand_friends) {
|
for (auto& pair : recommand_friends) {
|
||||||
if (msg.friend_list_size() < 4) {
|
if (msg.friend_list_size() < 4) {
|
||||||
|
int target_gameid = f8::ExtractGameIdFromAccountId
|
||||||
|
(pair.second.base_data().account_id());
|
||||||
|
int target_channel = f8::ExtractChannelIdFromAccountId
|
||||||
|
(pair.second.base_data().account_id());
|
||||||
|
if (target_gameid != my_gameid || target_channel != my_channel) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
auto p = msg.add_friend_list() ;
|
auto p = msg.add_friend_list() ;
|
||||||
*p = pair.second;
|
*p = pair.second;
|
||||||
{
|
{
|
||||||
int channel = f8::ExtractChannelIdFromAccountId
|
|
||||||
(context.account_id);
|
|
||||||
int target_channel = f8::ExtractChannelIdFromAccountId
|
|
||||||
(p->base_data().account_id());
|
|
||||||
App::Instance()->PreProcAvatarUrl
|
App::Instance()->PreProcAvatarUrl
|
||||||
(channel,
|
(my_channel,
|
||||||
target_channel,
|
target_channel,
|
||||||
*p->mutable_base_data()->mutable_avatar_url());
|
*p->mutable_base_data()->mutable_avatar_url());
|
||||||
}
|
}
|
||||||
@ -89,15 +99,19 @@ struct RecommandFriendTask
|
|||||||
}
|
}
|
||||||
if (exclude_account_ids.find(user_info->base_data().account_id()) ==
|
if (exclude_account_ids.find(user_info->base_data().account_id()) ==
|
||||||
exclude_account_ids.end()) {
|
exclude_account_ids.end()) {
|
||||||
|
int target_gameid = f8::ExtractGameIdFromAccountId
|
||||||
|
(user_info->base_data().account_id());
|
||||||
|
int target_channel = f8::ExtractChannelIdFromAccountId
|
||||||
|
(user_info->base_data().account_id());
|
||||||
|
if (target_gameid != my_gameid || target_channel != my_channel) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
auto p = msg.add_friend_list();
|
auto p = msg.add_friend_list();
|
||||||
*p = *user_info;
|
*p = *user_info;
|
||||||
{
|
{
|
||||||
int channel = f8::ExtractChannelIdFromAccountId
|
|
||||||
(context.account_id);
|
|
||||||
int target_channel = f8::ExtractChannelIdFromAccountId
|
|
||||||
(p->base_data().account_id());
|
|
||||||
App::Instance()->PreProcAvatarUrl
|
App::Instance()->PreProcAvatarUrl
|
||||||
(channel,
|
(my_channel,
|
||||||
target_channel,
|
target_channel,
|
||||||
*p->mutable_base_data()->mutable_avatar_url());
|
*p->mutable_base_data()->mutable_avatar_url());
|
||||||
}
|
}
|
||||||
|
@ -166,11 +166,13 @@ void GuildMgr::__GuildCreate(f8::JsonHttpRequest* request)
|
|||||||
delete guild;
|
delete guild;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
long long name_ext1 = GetNameExt1(guild->_channel());
|
||||||
|
long long name_ext2 = 0;
|
||||||
if (GetGuildByName(
|
if (GetGuildByName(
|
||||||
guild->_gameid(),
|
guild->_gameid(),
|
||||||
guild->_channel(),
|
guild->_channel(),
|
||||||
guild->_name_ext1(),
|
name_ext1,
|
||||||
guild->_name_ext2(),
|
name_ext2,
|
||||||
guild->guild_name()
|
guild->guild_name()
|
||||||
)) {
|
)) {
|
||||||
request->resp_xobj->SetVal("errcode", 3);
|
request->resp_xobj->SetVal("errcode", 3);
|
||||||
@ -210,11 +212,6 @@ void GuildMgr::__GuildCreate(f8::JsonHttpRequest* request)
|
|||||||
guild->set_member_num(1);
|
guild->set_member_num(1);
|
||||||
guild->set__createtime(App::Instance()->nowtime);
|
guild->set__createtime(App::Instance()->nowtime);
|
||||||
guild->set__modifytime(App::Instance()->nowtime);
|
guild->set__modifytime(App::Instance()->nowtime);
|
||||||
long long name_ext1 = GetNameExt1(guild->_channel());
|
|
||||||
long long name_ext2 = 0;
|
|
||||||
if (f8::Channel_e::DOUYIN == guild->_channel()) {
|
|
||||||
name_ext1 = f8::Channel_e::DOUYIN;
|
|
||||||
}
|
|
||||||
std::string guild_name_base64;
|
std::string guild_name_base64;
|
||||||
a8::openssl::Base64Encode(guild->guild_name(), guild_name_base64);
|
a8::openssl::Base64Encode(guild->guild_name(), guild_name_base64);
|
||||||
DBEngine::Instance()->ExecAsyncScript
|
DBEngine::Instance()->ExecAsyncScript
|
||||||
@ -937,6 +934,7 @@ void GuildMgr::InternalSearch(const std::string& account_id,
|
|||||||
total_page = 0;
|
total_page = 0;
|
||||||
total_count = 0;
|
total_count = 0;
|
||||||
int gameid = f8::ExtractGameIdFromAccountId(account_id);
|
int gameid = f8::ExtractGameIdFromAccountId(account_id);
|
||||||
|
int channel = f8::ExtractChannelIdFromAccountId(account_id);
|
||||||
a8::CommonRank<cs::MFGuildBasic>* commonrank = GetGuildList(gameid);
|
a8::CommonRank<cs::MFGuildBasic>* commonrank = GetGuildList(gameid);
|
||||||
if (!commonrank || commonrank->GetList().empty()) {
|
if (!commonrank || commonrank->GetList().empty()) {
|
||||||
return;
|
return;
|
||||||
@ -955,6 +953,9 @@ void GuildMgr::InternalSearch(const std::string& account_id,
|
|||||||
if (guild_list->Size() >= page_size) {
|
if (guild_list->Size() >= page_size) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (guild->_channel() != channel) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
a8::MutableXObject* guild_xobj = a8::MutableXObject::NewObject();
|
a8::MutableXObject* guild_xobj = a8::MutableXObject::NewObject();
|
||||||
TypeConvert::Convert(guild, guild_xobj);
|
TypeConvert::Convert(guild, guild_xobj);
|
||||||
if (applyed_guilds.find(guild->guild_id()) != applyed_guilds.end()) {
|
if (applyed_guilds.find(guild->guild_id()) != applyed_guilds.end()) {
|
||||||
|
@ -118,6 +118,8 @@ message MFGuildBasic
|
|||||||
optional string owner_id = 8; //公会队长id
|
optional string owner_id = 8; //公会队长id
|
||||||
optional string owner_name = 9; //公会队长名字
|
optional string owner_name = 9; //公会队长名字
|
||||||
optional string owner_avatar_url = 10; //公会队长头像
|
optional string owner_avatar_url = 10; //公会队长头像
|
||||||
|
optional int32 owner_vip_lv = 12 [default = 0]; //vip等级
|
||||||
|
optional int32 owner_head = 13 [default = 0]; //头像框
|
||||||
optional int32 join_unlimited = 11; //不限制加入
|
optional int32 join_unlimited = 11; //不限制加入
|
||||||
optional int32 join_cond1 = 20; //加入条件1
|
optional int32 join_cond1 = 20; //加入条件1
|
||||||
optional int32 join_cond2 = 21; //加入条件2
|
optional int32 join_cond2 = 21; //加入条件2
|
||||||
|
@ -112,9 +112,13 @@ CREATE TABLE `guild` (
|
|||||||
`owner_id` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '公会主id',
|
`owner_id` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '公会主id',
|
||||||
`owner_name` tinyblob COMMENT '公会主名字',
|
`owner_name` tinyblob COMMENT '公会主名字',
|
||||||
`owner_avatar_url` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '公会主头像',
|
`owner_avatar_url` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '公会主头像',
|
||||||
|
`owner_vip_lv` int(11) NOT NULL DEFAULT '0' COMMENT 'owner vip等级',
|
||||||
|
`owner_head` int(11) NOT NULL DEFAULT '0' COMMENT 'owner 头像框',
|
||||||
`creator_id` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '公会创建者id',
|
`creator_id` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '公会创建者id',
|
||||||
`creator_name` tinyblob COMMENT '公会创建者名字',
|
`creator_name` tinyblob COMMENT '公会创建者名字',
|
||||||
`creator_avatar_url` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '公会创建者头像',
|
`creator_avatar_url` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '公会创建者头像',
|
||||||
|
`creator_vip_lv` int(11) NOT NULL DEFAULT '0' COMMENT 'creator vip等级',
|
||||||
|
`creator_head` int(11) NOT NULL DEFAULT '0' COMMENT 'creator 头像框',
|
||||||
`guild_data` mediumblob COMMENT '公会数据',
|
`guild_data` mediumblob COMMENT '公会数据',
|
||||||
`guild_status` int(11) NOT NULL DEFAULT '0' COMMENT '公会状态 0:新建(未确认) 1:已确认 2:已解散',
|
`guild_status` int(11) NOT NULL DEFAULT '0' COMMENT '公会状态 0:新建(未确认) 1:已确认 2:已解散',
|
||||||
`join_unlimited` int(11) NOT NULL DEFAULT '0' COMMENT '不限制加入',
|
`join_unlimited` int(11) NOT NULL DEFAULT '0' COMMENT '不限制加入',
|
||||||
|
7
sql/relationdb_n_migrate_201120_01.sql
Normal file
7
sql/relationdb_n_migrate_201120_01.sql
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
start transaction;
|
||||||
|
|
||||||
|
update `user` SET channel=substring(account_id, 1, 4),gameid=substring(account_id, 6, 4);
|
||||||
|
|
||||||
|
insert into version (version) values(2020112001);
|
||||||
|
|
||||||
|
commit;
|
10
sql/relationdb_n_migrate_201123_01.sql
Normal file
10
sql/relationdb_n_migrate_201123_01.sql
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
start transaction;
|
||||||
|
|
||||||
|
alter table `guild` add column `owner_vip_lv` int(11) NOT NULL DEFAULT '0' COMMENT 'owner vip等级';
|
||||||
|
alter table `guild` add column `owner_head` int(11) NOT NULL DEFAULT '0' COMMENT 'owner 头像框';
|
||||||
|
alter table `guild` add column `creator_vip_lv` int(11) NOT NULL DEFAULT '0' COMMENT 'creator vip等级';
|
||||||
|
alter table `guild` add column `creator_head` int(11) NOT NULL DEFAULT '0' COMMENT 'creator 头像框';
|
||||||
|
|
||||||
|
insert into version (version) values(2020112301);
|
||||||
|
|
||||||
|
commit;
|
Loading…
x
Reference in New Issue
Block a user