添加贡献度
This commit is contained in:
parent
c56a206f45
commit
db19ec61ec
@ -172,6 +172,9 @@ void Player::_CMUpdateUserInfo(f8::MsgHdr& hdr, const cs::CMUpdateUserInfo& msg)
|
|||||||
if (msg.has_head()) {
|
if (msg.has_head()) {
|
||||||
myself.base_data.head = msg.head();
|
myself.base_data.head = msg.head();
|
||||||
}
|
}
|
||||||
|
if (msg.contribute()) {
|
||||||
|
myself.base_data.contribute = msg.contribute();
|
||||||
|
}
|
||||||
if (msg.has_user_value1()) {
|
if (msg.has_user_value1()) {
|
||||||
myself.base_data.user_value1 = msg.user_value1();
|
myself.base_data.user_value1 = msg.user_value1();
|
||||||
}
|
}
|
||||||
@ -1421,7 +1424,7 @@ void Player::SaveToDB(a8::XParams param, f8::AsyncDBOnOkFunc on_ok, f8::AsyncDBO
|
|||||||
"UPDATE `user` SET friend_data='%s', modifytime=%d, "
|
"UPDATE `user` SET friend_data='%s', modifytime=%d, "
|
||||||
" nickname='%s', avatar_url='%s', sex=%d, data_version1=%d, "
|
" nickname='%s', avatar_url='%s', sex=%d, data_version1=%d, "
|
||||||
" user_value1=%d, user_value2=%d, user_value3=%d, "
|
" user_value1=%d, user_value2=%d, user_value3=%d, "
|
||||||
" vip_lv=%d, head=%d, "
|
" vip_lv=%d, head=%d, contribute=%d, "
|
||||||
" guild_id=%d, guild_job=%d, last_logintime=%d "
|
" guild_id=%d, guild_job=%d, last_logintime=%d "
|
||||||
"WHERE account_id='%s';",
|
"WHERE account_id='%s';",
|
||||||
{
|
{
|
||||||
@ -1436,6 +1439,7 @@ void Player::SaveToDB(a8::XParams param, f8::AsyncDBOnOkFunc on_ok, f8::AsyncDBO
|
|||||||
myself.base_data.user_value3,
|
myself.base_data.user_value3,
|
||||||
myself.base_data.vip_lv,
|
myself.base_data.vip_lv,
|
||||||
myself.base_data.head,
|
myself.base_data.head,
|
||||||
|
myself.base_data.contribute,
|
||||||
myself.base_data.guild_id,
|
myself.base_data.guild_id,
|
||||||
myself.base_data.guild_job,
|
myself.base_data.guild_job,
|
||||||
App::Instance()->nowtime,
|
App::Instance()->nowtime,
|
||||||
|
@ -518,7 +518,10 @@ void PlayerMgr::AsyncLogin2(const cs::CMLogin& msg)
|
|||||||
a8::XValue(data_set->at(0).at(7)), //user_value2
|
a8::XValue(data_set->at(0).at(7)), //user_value2
|
||||||
a8::XValue(data_set->at(0).at(8)), //user_value3
|
a8::XValue(data_set->at(0).at(8)), //user_value3
|
||||||
a8::XValue(data_set->at(0).at(9)), //guild_id
|
a8::XValue(data_set->at(0).at(9)), //guild_id
|
||||||
a8::XValue(data_set->at(0).at(10)).GetInt() //guild_job
|
a8::XValue(data_set->at(0).at(10)).GetInt(), //guild_job
|
||||||
|
a8::XValue(data_set->at(0).at(11)), //vip_lv
|
||||||
|
a8::XValue(data_set->at(0).at(12)), //head
|
||||||
|
a8::XValue(data_set->at(0).at(13)) //contribute
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
delete msg;
|
delete msg;
|
||||||
@ -542,7 +545,7 @@ void PlayerMgr::AsyncLogin2(const cs::CMLogin& msg)
|
|||||||
(conn_info,
|
(conn_info,
|
||||||
"SELECT account_id, nickname, avatar_url, sex, "
|
"SELECT account_id, nickname, avatar_url, sex, "
|
||||||
" data_version1, friend_data, user_value1, user_value2, user_value3, "
|
" data_version1, friend_data, user_value1, user_value2, user_value3, "
|
||||||
" guild_id, guild_job "
|
" guild_id, guild_job, vip_lv, head, contribute "
|
||||||
"FROM `user` WHERE account_id='%s';",
|
"FROM `user` WHERE account_id='%s';",
|
||||||
{
|
{
|
||||||
msg.account_id(),
|
msg.account_id(),
|
||||||
@ -567,7 +570,10 @@ void PlayerMgr::AsyncLoginOnOk(const std::string& account_id,
|
|||||||
long long user_value2,
|
long long user_value2,
|
||||||
long long user_value3,
|
long long user_value3,
|
||||||
long long guild_id,
|
long long guild_id,
|
||||||
int guild_job)
|
int guild_job,
|
||||||
|
int vip_lv,
|
||||||
|
int head,
|
||||||
|
int contribute)
|
||||||
{
|
{
|
||||||
f8::MsgHdr* hdr = GetHdrByAccountId(account_id);
|
f8::MsgHdr* hdr = GetHdrByAccountId(account_id);
|
||||||
if (hdr) {
|
if (hdr) {
|
||||||
@ -595,6 +601,9 @@ void PlayerMgr::AsyncLoginOnOk(const std::string& account_id,
|
|||||||
hum->myself.base_data.nickname = nickname;
|
hum->myself.base_data.nickname = nickname;
|
||||||
hum->myself.base_data.avatar_url = avatar_url;
|
hum->myself.base_data.avatar_url = avatar_url;
|
||||||
hum->myself.base_data.sex = sex;
|
hum->myself.base_data.sex = sex;
|
||||||
|
hum->myself.base_data.vip_lv = vip_lv;
|
||||||
|
hum->myself.base_data.head = head;
|
||||||
|
hum->myself.base_data.contribute = contribute;
|
||||||
hum->myself.base_data.base_data_version = data_version1;
|
hum->myself.base_data.base_data_version = data_version1;
|
||||||
hum->myself.base_data.user_value1 = user_value1;
|
hum->myself.base_data.user_value1 = user_value1;
|
||||||
hum->myself.base_data.user_value2 = user_value2;
|
hum->myself.base_data.user_value2 = user_value2;
|
||||||
|
@ -98,7 +98,10 @@ class PlayerMgr : public a8::Singleton<PlayerMgr>
|
|||||||
long long user_value2,
|
long long user_value2,
|
||||||
long long user_value3,
|
long long user_value3,
|
||||||
long long guild_id,
|
long long guild_id,
|
||||||
int guild_job);
|
int guild_job,
|
||||||
|
int vip_lv,
|
||||||
|
int head,
|
||||||
|
int contribute);
|
||||||
void AsyncLoginOnError(const std::string& account_id,
|
void AsyncLoginOnError(const std::string& account_id,
|
||||||
int step,
|
int step,
|
||||||
int error_code,
|
int error_code,
|
||||||
|
@ -82,6 +82,7 @@ void TypeConvert::Convert(const BaseUserData& base_data, ss::MFBaseUserDataDB& b
|
|||||||
base_data_pb.set_sex(base_data.sex);
|
base_data_pb.set_sex(base_data.sex);
|
||||||
base_data_pb.set_vip_lv(base_data.vip_lv);
|
base_data_pb.set_vip_lv(base_data.vip_lv);
|
||||||
base_data_pb.set_head(base_data.head);
|
base_data_pb.set_head(base_data.head);
|
||||||
|
base_data_pb.set_contribute(base_data.contribute);
|
||||||
base_data_pb.set_last_login_time(base_data.last_login_time);
|
base_data_pb.set_last_login_time(base_data.last_login_time);
|
||||||
base_data_pb.set_guild_id(base_data.guild_id);
|
base_data_pb.set_guild_id(base_data.guild_id);
|
||||||
base_data_pb.set_guild_job(base_data.guild_job);
|
base_data_pb.set_guild_job(base_data.guild_job);
|
||||||
@ -99,6 +100,7 @@ void TypeConvert::Convert(const ss::MFBaseUserDataDB& base_data_pb, BaseUserData
|
|||||||
base_data.sex = base_data_pb.sex();
|
base_data.sex = base_data_pb.sex();
|
||||||
base_data.vip_lv = base_data_pb.vip_lv();
|
base_data.vip_lv = base_data_pb.vip_lv();
|
||||||
base_data.head = base_data_pb.head();
|
base_data.head = base_data_pb.head();
|
||||||
|
base_data.contribute = base_data_pb.contribute();
|
||||||
base_data.last_login_time = base_data_pb.last_login_time();
|
base_data.last_login_time = base_data_pb.last_login_time();
|
||||||
base_data.guild_id = base_data_pb.guild_id();
|
base_data.guild_id = base_data_pb.guild_id();
|
||||||
base_data.guild_job = base_data_pb.guild_job();
|
base_data.guild_job = base_data_pb.guild_job();
|
||||||
@ -117,6 +119,7 @@ void TypeConvert::Convert(long long guild_id, int guild_job,
|
|||||||
base_data_pb.set_sex(member.sex);
|
base_data_pb.set_sex(member.sex);
|
||||||
base_data_pb.set_vip_lv(member.vip_lv);
|
base_data_pb.set_vip_lv(member.vip_lv);
|
||||||
base_data_pb.set_head(member.head);
|
base_data_pb.set_head(member.head);
|
||||||
|
base_data_pb.set_contribute(member.contribute);
|
||||||
base_data_pb.set_last_login_time(member.last_login_time);
|
base_data_pb.set_last_login_time(member.last_login_time);
|
||||||
base_data_pb.set_guild_id(guild_id);
|
base_data_pb.set_guild_id(guild_id);
|
||||||
base_data_pb.set_guild_job(guild_job);
|
base_data_pb.set_guild_job(guild_job);
|
||||||
@ -135,6 +138,7 @@ void TypeConvert::Convert(long long guild_id, int guild_job,
|
|||||||
base_data_pb.set_sex(member.sex);
|
base_data_pb.set_sex(member.sex);
|
||||||
base_data_pb.set_vip_lv(member.vip_lv);
|
base_data_pb.set_vip_lv(member.vip_lv);
|
||||||
base_data_pb.set_head(member.head);
|
base_data_pb.set_head(member.head);
|
||||||
|
base_data_pb.set_contribute(member.contribute);
|
||||||
base_data_pb.set_last_login_time(member.last_login_time);
|
base_data_pb.set_last_login_time(member.last_login_time);
|
||||||
base_data_pb.set_guild_id(guild_id);
|
base_data_pb.set_guild_id(guild_id);
|
||||||
base_data_pb.set_guild_job(guild_job);
|
base_data_pb.set_guild_job(guild_job);
|
||||||
@ -153,6 +157,7 @@ void TypeConvert::Convert(const ss::MFBaseUserDataDB& base_data_pb, GuildMember&
|
|||||||
member.sex = base_data_pb.sex();
|
member.sex = base_data_pb.sex();
|
||||||
member.vip_lv = base_data_pb.vip_lv();
|
member.vip_lv = base_data_pb.vip_lv();
|
||||||
member.head = base_data_pb.head();
|
member.head = base_data_pb.head();
|
||||||
|
member.contribute = base_data_pb.contribute();
|
||||||
member.last_login_time = base_data_pb.last_login_time();
|
member.last_login_time = base_data_pb.last_login_time();
|
||||||
member.user_value1 = base_data_pb.user_value1();
|
member.user_value1 = base_data_pb.user_value1();
|
||||||
member.user_value2 = base_data_pb.user_value2();
|
member.user_value2 = base_data_pb.user_value2();
|
||||||
@ -168,6 +173,7 @@ void TypeConvert::Convert(const cs::MFBaseUserData& base_data_pb, GuildMember& m
|
|||||||
member.sex = base_data_pb.sex();
|
member.sex = base_data_pb.sex();
|
||||||
member.vip_lv = base_data_pb.vip_lv();
|
member.vip_lv = base_data_pb.vip_lv();
|
||||||
member.head = base_data_pb.head();
|
member.head = base_data_pb.head();
|
||||||
|
member.contribute = base_data_pb.contribute();
|
||||||
member.last_login_time = base_data_pb.last_login_time();
|
member.last_login_time = base_data_pb.last_login_time();
|
||||||
member.user_value1 = base_data_pb.user_value1();
|
member.user_value1 = base_data_pb.user_value1();
|
||||||
member.user_value2 = base_data_pb.user_value2();
|
member.user_value2 = base_data_pb.user_value2();
|
||||||
@ -183,6 +189,7 @@ void TypeConvert::Convert(const cs::MFBaseUserData& base_data_pb, BaseUserData&
|
|||||||
base_data.sex = base_data_pb.sex();
|
base_data.sex = base_data_pb.sex();
|
||||||
base_data.vip_lv = base_data_pb.vip_lv();
|
base_data.vip_lv = base_data_pb.vip_lv();
|
||||||
base_data.head = base_data_pb.head();
|
base_data.head = base_data_pb.head();
|
||||||
|
base_data.contribute = base_data_pb.contribute();
|
||||||
base_data.online = base_data_pb._online();
|
base_data.online = base_data_pb._online();
|
||||||
base_data.last_login_time = base_data_pb.last_login_time();
|
base_data.last_login_time = base_data_pb.last_login_time();
|
||||||
base_data.guild_id = base_data_pb.guild_id();
|
base_data.guild_id = base_data_pb.guild_id();
|
||||||
@ -201,6 +208,7 @@ void TypeConvert::Convert(const BaseUserData& base_data, cs::MFBaseUserData& bas
|
|||||||
base_data_pb.set_sex(base_data.sex);
|
base_data_pb.set_sex(base_data.sex);
|
||||||
base_data_pb.set_vip_lv(base_data.vip_lv);
|
base_data_pb.set_vip_lv(base_data.vip_lv);
|
||||||
base_data_pb.set_head(base_data.head);
|
base_data_pb.set_head(base_data.head);
|
||||||
|
base_data_pb.set_contribute(base_data.contribute);
|
||||||
base_data_pb.set__online(base_data.online);
|
base_data_pb.set__online(base_data.online);
|
||||||
base_data_pb.set_last_login_time(base_data.last_login_time);
|
base_data_pb.set_last_login_time(base_data.last_login_time);
|
||||||
base_data_pb.set_guild_id(base_data.guild_id);
|
base_data_pb.set_guild_id(base_data.guild_id);
|
||||||
|
@ -12,6 +12,7 @@ struct BaseUserData
|
|||||||
int guild_job = 0;
|
int guild_job = 0;
|
||||||
int vip_lv = 0;
|
int vip_lv = 0;
|
||||||
int head = 0;
|
int head = 0;
|
||||||
|
int contribute = 0;
|
||||||
int last_login_time = 0;
|
int last_login_time = 0;
|
||||||
|
|
||||||
long long user_value1 = 0;
|
long long user_value1 = 0;
|
||||||
@ -98,6 +99,7 @@ struct GuildMember
|
|||||||
int sex = 0;
|
int sex = 0;
|
||||||
int vip_lv = 0;
|
int vip_lv = 0;
|
||||||
int head = 0;
|
int head = 0;
|
||||||
|
int contribute = 0;
|
||||||
int last_login_time = 0;
|
int last_login_time = 0;
|
||||||
|
|
||||||
long long user_value1 = 0;
|
long long user_value1 = 0;
|
||||||
|
@ -49,6 +49,7 @@ message MFBaseUserData
|
|||||||
optional int32 guild_job = 7; //公会职位 1:公会长 2:副公会长 3:精英成员 其他(0):普通会员
|
optional int32 guild_job = 7; //公会职位 1:公会长 2:副公会长 3:精英成员 其他(0):普通会员
|
||||||
optional int32 vip_lv = 8 [default = 0]; //性别
|
optional int32 vip_lv = 8 [default = 0]; //性别
|
||||||
optional int32 head = 9 [default = 0]; //头像框
|
optional int32 head = 9 [default = 0]; //头像框
|
||||||
|
optional int32 contribute = 10 [default = 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
|
||||||
@ -177,6 +178,7 @@ message CMUpdateUserInfo
|
|||||||
optional int32 sex = 4; //性别 1:男 2:女 0:未知
|
optional int32 sex = 4; //性别 1:男 2:女 0:未知
|
||||||
optional int32 vip_lv = 8; //性别
|
optional int32 vip_lv = 8; //性别
|
||||||
optional int32 head = 9; //头像框
|
optional int32 head = 9; //头像框
|
||||||
|
optional int32 contribute = 10; //贡献度
|
||||||
|
|
||||||
optional int64 user_value1 = 50; //用户字段1
|
optional int64 user_value1 = 50; //用户字段1
|
||||||
optional int64 user_value2 = 51; //用户字段2
|
optional int64 user_value2 = 51; //用户字段2
|
||||||
|
@ -49,6 +49,7 @@ message MFBaseUserDataDB
|
|||||||
optional int32 guild_job = 8; //公会职位
|
optional int32 guild_job = 8; //公会职位
|
||||||
optional int32 vip_lv = 9; //性别
|
optional int32 vip_lv = 9; //性别
|
||||||
optional int32 head = 10; //头像框
|
optional int32 head = 10; //头像框
|
||||||
|
optional int32 contribute = 11; //贡献度
|
||||||
|
|
||||||
optional int64 user_value1 = 50; //用户字段1
|
optional int64 user_value1 = 50; //用户字段1
|
||||||
optional int64 user_value2 = 51; //用户字段2
|
optional int64 user_value2 = 51; //用户字段2
|
||||||
|
@ -46,6 +46,7 @@ CREATE TABLE `user` (
|
|||||||
`sex` int(11) NOT NULL DEFAULT '0' COMMENT 'sex',
|
`sex` int(11) NOT NULL DEFAULT '0' COMMENT 'sex',
|
||||||
`vip_lv` int(11) NOT NULL DEFAULT '0' COMMENT 'vip等级',
|
`vip_lv` int(11) NOT NULL DEFAULT '0' COMMENT 'vip等级',
|
||||||
`head` int(11) NOT NULL DEFAULT '0' COMMENT '头像框id',
|
`head` int(11) NOT NULL DEFAULT '0' COMMENT '头像框id',
|
||||||
|
`contribute` int(11) NOT NULL DEFAULT '0' COMMENT '贡献度',
|
||||||
`friend_data` mediumblob COMMENT '好友数据',
|
`friend_data` mediumblob COMMENT '好友数据',
|
||||||
`data_version1` bigint NOT NULL DEFAULT '0' COMMENT 'data_version1',
|
`data_version1` bigint NOT NULL DEFAULT '0' COMMENT 'data_version1',
|
||||||
`user_value1` bigint NOT NULL DEFAULT '0' COMMENT 'user_value1',
|
`user_value1` bigint NOT NULL DEFAULT '0' COMMENT 'user_value1',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user