1
This commit is contained in:
parent
339e707ef9
commit
e32c76faa8
@ -387,8 +387,27 @@ void Guild::_CMGuildChange(f8::MsgHdr& hdr, const cs::CMGuildChange& msg)
|
|||||||
{
|
{
|
||||||
ss::SS_IM_ForwardGuildCMMsg *forward_msg = (ss::SS_IM_ForwardGuildCMMsg*)hdr.user_data;
|
ss::SS_IM_ForwardGuildCMMsg *forward_msg = (ss::SS_IM_ForwardGuildCMMsg*)hdr.user_data;
|
||||||
|
|
||||||
guild_name_ = msg.new_name();
|
if (msg.has_guild_name()) {
|
||||||
|
guild_name_ = msg.guild_name();
|
||||||
|
}
|
||||||
|
if (msg.has_guild_badge()) {
|
||||||
|
guild_badge_ = msg.guild_badge();
|
||||||
|
}
|
||||||
|
if (msg.has_guild_declaration()) {
|
||||||
|
guild_declaration_ = msg.guild_declaration();
|
||||||
|
}
|
||||||
|
if (msg.has_join_unlimited()) {
|
||||||
|
join_unlimited_ = msg.join_unlimited();
|
||||||
|
}
|
||||||
|
if (msg.has_join_cond1()) {
|
||||||
|
join_cond1_ = msg.join_cond1();
|
||||||
|
}
|
||||||
|
if (msg.has_join_cond2()) {
|
||||||
|
join_cond2_ = msg.join_cond2();
|
||||||
|
}
|
||||||
|
|
||||||
cs::SMGuildChange respmsg;
|
cs::SMGuildChange respmsg;
|
||||||
|
FillGuildBasic(respmsg.mutable_guild_basic());
|
||||||
GuildMgr::Instance()->ForwardGuildSMMsg(hdr.socket_handle,
|
GuildMgr::Instance()->ForwardGuildSMMsg(hdr.socket_handle,
|
||||||
forward_msg->context(),
|
forward_msg->context(),
|
||||||
respmsg);
|
respmsg);
|
||||||
|
@ -69,10 +69,11 @@ private:
|
|||||||
std::vector<std::set<std::string>> job_hash_;
|
std::vector<std::set<std::string>> job_hash_;
|
||||||
|
|
||||||
int gameid_ = 0;
|
int gameid_ = 0;
|
||||||
|
int channel_ = 0;
|
||||||
long long guild_id_ = 0;
|
long long guild_id_ = 0;
|
||||||
std::string guild_name_;
|
std::string guild_name_;
|
||||||
int guild_lv_ = 0;
|
int guild_lv_ = 0;
|
||||||
int guild_exp_ = 0;
|
double guild_exp_ = 0;
|
||||||
int guild_badge_ = 0;
|
int guild_badge_ = 0;
|
||||||
int guild_apply_num_ = 0;
|
int guild_apply_num_ = 0;
|
||||||
std::string guild_notice_;
|
std::string guild_notice_;
|
||||||
|
@ -55,6 +55,8 @@ void TypeConvert::Convert(a8::XObject& xobj, cs::MFGuildBasic* guild_basic)
|
|||||||
guild_basic->set_join_unlimited(xobj.At("join_unlimited")->AsXValue());
|
guild_basic->set_join_unlimited(xobj.At("join_unlimited")->AsXValue());
|
||||||
guild_basic->set_join_cond1(xobj.At("join_cond1")->AsXValue());
|
guild_basic->set_join_cond1(xobj.At("join_cond1")->AsXValue());
|
||||||
guild_basic->set_join_cond2(xobj.At("join_cond2")->AsXValue());
|
guild_basic->set_join_cond2(xobj.At("join_cond2")->AsXValue());
|
||||||
|
guild_basic->set__gameid(xobj.At("_gameid")->AsXValue());
|
||||||
|
guild_basic->set__channel(xobj.At("_channel")->AsXValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
void TypeConvert::Convert(a8::XObject& xobj, cs::MFPaging* paging)
|
void TypeConvert::Convert(a8::XObject& xobj, cs::MFPaging* paging)
|
||||||
|
@ -53,15 +53,16 @@ void GuildMgr::__GuildCreate(f8::JsonHttpRequest* request)
|
|||||||
DBEngine::Instance()->ExecAsyncScript
|
DBEngine::Instance()->ExecAsyncScript
|
||||||
(
|
(
|
||||||
conn,
|
conn,
|
||||||
"INSERT INTO `guild`(gameid, guild_id, guild_name, guild_lv, guild_exp, guild_badge, "
|
"INSERT INTO `guild`(gameid, channel, guild_id, guild_name, guild_lv, guild_exp, guild_badge, "
|
||||||
" guild_apply_num, guild_notice, guild_declaration, guild_log, owner_id, "
|
" guild_apply_num, guild_notice, guild_declaration, guild_log, owner_id, "
|
||||||
" owner_name, owner_avatar_url, creator_id, creator_name, creator_avatar_url, guild_member_num, "
|
" owner_name, owner_avatar_url, creator_id, creator_name, creator_avatar_url, guild_member_num, "
|
||||||
" guild_data, guild_status, join_unlimited, join_cond1, join_cond2, createtime, modifytime)"
|
" guild_data, guild_status, join_unlimited, join_cond1, join_cond2, createtime, modifytime)"
|
||||||
"VALUES(%d, %d, '%s', %d, %d, %d, %d, '%s', '%s', '%s', '%s', "
|
"VALUES(%d, %d, %d, '%s', %d, %d, %d, %d, '%s', '%s', '%s', '%s', "
|
||||||
" '%s', '%s', '%s', '%s', '%s', 1, "
|
" '%s', '%s', '%s', '%s', '%s', 1, "
|
||||||
" '%s', %d, %d, %d, %d, %d, %d);",
|
" '%s', %d, %d, %d, %d, %d, %d);",
|
||||||
{
|
{
|
||||||
guild->_gameid(),
|
guild->_gameid(),
|
||||||
|
guild->_channel(),
|
||||||
guild->guild_id(),
|
guild->guild_id(),
|
||||||
guild->guild_name(),
|
guild->guild_name(),
|
||||||
guild->guild_lv(),
|
guild->guild_lv(),
|
||||||
@ -289,7 +290,7 @@ void GuildMgr::LoadGuild(int instance_id, long long last_idx)
|
|||||||
"SELECT idx, gameid, guild_id, guild_name, guild_lv, guild_exp, guild_badge, guild_notice, "
|
"SELECT idx, gameid, guild_id, guild_name, guild_lv, guild_exp, guild_badge, guild_notice, "
|
||||||
" guild_declaration, owner_id, owner_name, owner_avatar_url, "
|
" guild_declaration, owner_id, owner_name, owner_avatar_url, "
|
||||||
" creator_id, creator_name, creator_avatar_url, guild_status, "
|
" creator_id, creator_name, creator_avatar_url, guild_status, "
|
||||||
" join_unlimited, join_cond1, join_cond2, createtime, modifytime "
|
" join_unlimited, join_cond1, join_cond2, createtime, modifytime, channel "
|
||||||
"FROM `guild` WHERE idx > %d;",
|
"FROM `guild` WHERE idx > %d;",
|
||||||
{
|
{
|
||||||
last_idx
|
last_idx
|
||||||
@ -317,6 +318,7 @@ void GuildMgr::LoadGuild(int instance_id, long long last_idx)
|
|||||||
guild->set_join_cond1(a8::XValue(row[14]));
|
guild->set_join_cond1(a8::XValue(row[14]));
|
||||||
guild->set_join_cond2(a8::XValue(row[15]));
|
guild->set_join_cond2(a8::XValue(row[15]));
|
||||||
guild->set__gameid(a8::XValue(row[1]));
|
guild->set__gameid(a8::XValue(row[1]));
|
||||||
|
guild->set__channel(a8::XValue(row[18]));
|
||||||
GuildMgr::Instance()->AddGuild(guild);
|
GuildMgr::Instance()->AddGuild(guild);
|
||||||
if (a8::XValue(row[0]).GetInt64() > last_idx) {
|
if (a8::XValue(row[0]).GetInt64() > last_idx) {
|
||||||
last_idx = a8::XValue(row[0]);
|
last_idx = a8::XValue(row[0]);
|
||||||
|
@ -19,11 +19,17 @@ void TypeConvert::Convert(const cs::MFGuildBasic* guild_basic, a8::MutableXObjec
|
|||||||
xobj->SetVal("join_unlimited", guild_basic->join_unlimited());
|
xobj->SetVal("join_unlimited", guild_basic->join_unlimited());
|
||||||
xobj->SetVal("join_cond1", guild_basic->join_cond1());
|
xobj->SetVal("join_cond1", guild_basic->join_cond1());
|
||||||
xobj->SetVal("join_cond2", guild_basic->join_cond2());
|
xobj->SetVal("join_cond2", guild_basic->join_cond2());
|
||||||
|
xobj->SetVal("_gameid", guild_basic->_gameid());
|
||||||
|
xobj->SetVal("_channel", guild_basic->_channel());
|
||||||
}
|
}
|
||||||
|
|
||||||
void TypeConvert::Convert(f8::JsonHttpRequest* request, cs::MFGuildBasic* guild_basic)
|
void TypeConvert::Convert(f8::JsonHttpRequest* request, cs::MFGuildBasic* guild_basic)
|
||||||
{
|
{
|
||||||
guild_basic->set__gameid(request->request.At("gameid")->AsXValue());
|
std::string owner_id = request->request.At("owner_id")->AsXValue().GetString();
|
||||||
|
int gameid = f8::ExtractGameIdFromAccountId(owner_id);
|
||||||
|
int channel = f8::ExtractChannelIdFromAccountId(owner_id);
|
||||||
|
guild_basic->set__gameid(gameid);
|
||||||
|
guild_basic->set__channel(channel);
|
||||||
guild_basic->set_guild_id(request->request.At("guild_id")->AsXValue());
|
guild_basic->set_guild_id(request->request.At("guild_id")->AsXValue());
|
||||||
guild_basic->set_guild_name(request->request.At("guild_name")->AsXValue().GetString());
|
guild_basic->set_guild_name(request->request.At("guild_name")->AsXValue().GetString());
|
||||||
guild_basic->set_guild_badge(request->request.At("guild_badge")->AsXValue());
|
guild_basic->set_guild_badge(request->request.At("guild_badge")->AsXValue());
|
||||||
|
@ -39,7 +39,7 @@ message MFBaseUserData
|
|||||||
optional int32 sex = 4; //性别 1:男 2:女 0:未知
|
optional int32 sex = 4; //性别 1:男 2:女 0:未知
|
||||||
optional int32 last_login_time = 5; //最后登录时间
|
optional int32 last_login_time = 5; //最后登录时间
|
||||||
optional int64 guild_id = 6; //工会id(没有公会的话为0)
|
optional int64 guild_id = 6; //工会id(没有公会的话为0)
|
||||||
optional int32 guild_job = 7; //公会职位 1:公会长 2:副公会长 3:精英成员 其他:普通会员
|
optional int32 guild_job = 7; //公会职位 1:公会长 2:副公会长 3:精英成员 其他(0):普通会员
|
||||||
|
|
||||||
optional int64 user_value1 = 50; //用户字段1
|
optional int64 user_value1 = 50; //用户字段1
|
||||||
optional int64 user_value2 = 51; //用户字段2
|
optional int64 user_value2 = 51; //用户字段2
|
||||||
@ -101,7 +101,7 @@ message MFGuildBasic
|
|||||||
optional int64 guild_id = 1; //公会id
|
optional int64 guild_id = 1; //公会id
|
||||||
optional string guild_name = 2; //公会名
|
optional string guild_name = 2; //公会名
|
||||||
optional int32 guild_lv = 3; //公会等级
|
optional int32 guild_lv = 3; //公会等级
|
||||||
optional int32 guild_exp = 4; //公会经验
|
optional double guild_exp = 4; //公会经验
|
||||||
optional int32 guild_badge = 5; //公会徽章
|
optional int32 guild_badge = 5; //公会徽章
|
||||||
optional int32 member_num = 6; //公会成员数
|
optional int32 member_num = 6; //公会成员数
|
||||||
optional string guild_declaration = 7; //公会宣言
|
optional string guild_declaration = 7; //公会宣言
|
||||||
@ -113,6 +113,7 @@ message MFGuildBasic
|
|||||||
optional int32 join_cond2 = 21; //加入条件2
|
optional int32 join_cond2 = 21; //加入条件2
|
||||||
|
|
||||||
optional int32 _gameid = 100; //gameid
|
optional int32 _gameid = 100; //gameid
|
||||||
|
optional int32 _channel = 101; //channel
|
||||||
}
|
}
|
||||||
|
|
||||||
//登录好友服
|
//登录好友服
|
||||||
@ -448,15 +449,21 @@ message SMGuildDismiss
|
|||||||
optional string errmsg = 2; //错误信息
|
optional string errmsg = 2; //错误信息
|
||||||
}
|
}
|
||||||
|
|
||||||
//公会改名
|
//修改公会信息(增量更新不需要修改的字段不传)
|
||||||
message CMGuildChange
|
message CMGuildChange
|
||||||
{
|
{
|
||||||
optional string new_name = 1; //新公会名
|
optional string guild_name = 1; //公会名字
|
||||||
|
optional int32 guild_badge = 2; //公会徽标
|
||||||
|
optional string guild_declaration = 3; //公会徽标
|
||||||
|
optional int32 join_unlimited = 4; //不限制加入
|
||||||
|
optional int32 join_cond1 = 5; //加入条件1
|
||||||
|
optional int32 join_cond2 = 6; //加入条件2
|
||||||
}
|
}
|
||||||
message SMGuildChange
|
message SMGuildChange
|
||||||
{
|
{
|
||||||
optional int32 errcode = 1; //错误码
|
optional int32 errcode = 1; //错误码
|
||||||
optional string errmsg = 2; //错误信息
|
optional string errmsg = 2; //错误信息
|
||||||
|
optional MFGuildBasic guild_basic = 3; //公会信息
|
||||||
}
|
}
|
||||||
|
|
||||||
//查询公会
|
//查询公会
|
||||||
@ -527,7 +534,7 @@ message SMGuildLog
|
|||||||
/*
|
/*
|
||||||
values[0]: account_id
|
values[0]: account_id
|
||||||
values[1]: 角色名
|
values[1]: 角色名
|
||||||
values[2]: 职位 1:队长 2:副队长 3:精英会员 其他:普通会员
|
values[2]: 职位 1:队长 2:副队长 3:精英会员 其他(0):普通会员
|
||||||
values[3]: 行为时间(unix时间戳)
|
values[3]: 行为时间(unix时间戳)
|
||||||
values[4]: 行为
|
values[4]: 行为
|
||||||
*/
|
*/
|
||||||
|
@ -90,10 +90,11 @@ DROP TABLE IF EXISTS `guild`;
|
|||||||
CREATE TABLE `guild` (
|
CREATE TABLE `guild` (
|
||||||
`idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
`idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
||||||
`gameid` int(11) NOT NULL DEFAULT '0' COMMENT 'gameid',
|
`gameid` int(11) NOT NULL DEFAULT '0' COMMENT 'gameid',
|
||||||
|
`channel` int(11) NOT NULL DEFAULT '0' COMMENT 'channel',
|
||||||
`guild_id` bigint NOT NULL COMMENT '公会id',
|
`guild_id` bigint NOT NULL COMMENT '公会id',
|
||||||
`guild_name` tinyblob COMMENT '公会名字',
|
`guild_name` tinyblob COMMENT '公会名字',
|
||||||
`guild_lv` int(11) NOT NULL DEFAULT '0' COMMENT '公会等级',
|
`guild_lv` int(11) NOT NULL DEFAULT '0' COMMENT '公会等级',
|
||||||
`guild_exp` int(11) NOT NULL DEFAULT '0' COMMENT '公会经验',
|
`guild_exp` double NOT NULL DEFAULT '0' COMMENT '公会经验',
|
||||||
`guild_badge` int(11) NOT NULL DEFAULT '0' COMMENT '公会徽章',
|
`guild_badge` int(11) NOT NULL DEFAULT '0' COMMENT '公会徽章',
|
||||||
`guild_apply_num` int(11) NOT NULL DEFAULT '0' COMMENT '申请人数',
|
`guild_apply_num` int(11) NOT NULL DEFAULT '0' COMMENT '申请人数',
|
||||||
`guild_members` blob COMMENT '公会管理员',
|
`guild_members` blob COMMENT '公会管理员',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user