|
@@ -140,7 +140,7 @@ class GuildProc {
|
|
|
GuildProc::refuseGuildCupScore($req); # 公会积分清理
|
|
|
UserGuildModel::checkFirstlog($userGuildInfo); # 清理一下每日该清除的内容
|
|
|
}
|
|
|
- UserGuildModel::userGuildInfoInit($userGuildInfo, $uid, $game, $mem, $req->zoneid); # 更新数据
|
|
|
+ UserGuildModel::userGuildInfoInit($userGuildInfo, $uid, $game->baseInfo, $mem, $req->zoneid); # 更新数据
|
|
|
if (is_array($userGuildInfo->donateCount)) { # todo:上线后删除
|
|
|
$userGuildInfo->donateCount = ObjectInit();
|
|
|
}
|
|
@@ -242,7 +242,7 @@ class GuildProc {
|
|
|
$resp = new Resp();
|
|
|
$mem = $req->mem;
|
|
|
$paydb = CPayInit(); // 公会信息记录在paydb中了
|
|
|
- $game = $req->userInfo->game;
|
|
|
+ $baseInfo = $req->userInfo->game->baseInfo;
|
|
|
$zoneid = $req->zoneid;
|
|
|
//客户端参数解析
|
|
|
$uid = $req->uid; //fromoid
|
|
@@ -268,19 +268,19 @@ class GuildProc {
|
|
|
if ($guild_img == null) {
|
|
|
$resp = Resp::err(ErrCode::err_guild_imgEmputy);
|
|
|
} else {
|
|
|
- if ($game->gold < $gcfg->Guild_Found_CostGold) { # 检查是否拥有创建公会所需的金币,(等级超过20级,需要金币10万)
|
|
|
+ if ($baseInfo->gold < $gcfg->Guild_Found_CostGold) { # 检查是否拥有创建公会所需的金币,(等级超过20级,需要金币10万)
|
|
|
$resp = Resp::err(ErrCode::err_msg_goldnotenough);
|
|
|
} else {
|
|
|
- UserGameModel::Consume_Gold($game, $gcfg->Guild_Found_CostGold); //扣除金币
|
|
|
+ UserGameModel::Consume_Gold($baseInfo, $gcfg->Guild_Found_CostGold); //扣除金币
|
|
|
$guildInfo = GuildModel::NewGuildInit($mem, $zoneid); // 创建公会MEM数据体,
|
|
|
$guildInfo->declare = $declare;
|
|
|
$guildInfo->name = $guildName;
|
|
|
$guildInfo->members[] = $uid;
|
|
|
$guildInfo->chairman_id = $uid;
|
|
|
- $guildInfo->chairman_name = $game->name;
|
|
|
+ $guildInfo->chairman_name = $baseInfo->name;
|
|
|
$guildInfo->guild_img = $guild_img;
|
|
|
$guildInfo->enableQuickIn = 0;
|
|
|
- $guildInfo->chairmanLastLogin = $game->lastLogin;
|
|
|
+ $guildInfo->chairmanLastLogin = $baseInfo->lastLogin;
|
|
|
if ($applyType != null) {
|
|
|
$guildInfo->enableQuickIn = $applyType;
|
|
|
}
|
|
@@ -288,7 +288,7 @@ class GuildProc {
|
|
|
$obj->cupScore = $condition == null ? 0 : $condition;
|
|
|
$guildInfo->condition = json_encode($obj);
|
|
|
$userGuildInfo = UserGuildModel::Clear(); # 创建/重置玩家公会信息
|
|
|
- UserGuildModel::userGuildInfoInit($userGuildInfo, $uid, $game, $mem, $zoneid);
|
|
|
+ UserGuildModel::userGuildInfoInit($userGuildInfo, $uid, $baseInfo, $mem, $zoneid);
|
|
|
$userGuildInfo->guildId = $guildInfo->guildId;
|
|
|
$userGuildInfo->position = 'Chairman';
|
|
|
$userGuildInfo->guildName = $guildInfo->name;
|
|
@@ -299,8 +299,8 @@ class GuildProc {
|
|
|
$paydb->query(sprintf(SQLCREATEGUILD, $guildInfo->guildId, // Mysql 插入公会记录
|
|
|
$paydb->escape_string($guildName), $guildInfo->createts,
|
|
|
$paydb->escape_string($declare), count($guildInfo->members), $uid,
|
|
|
- $paydb->escape_string($game->name), $guild_img, $zoneid, $score, $guildInfo->enableQuickIn, $guildInfo->condition));
|
|
|
- self::pushNewJournal($mem, $guildInfo->guildId, GuildJournalModel::CreateJoin($uid, $game->name), $zoneid);
|
|
|
+ $paydb->escape_string($baseInfo->name), $guild_img, $zoneid, $score, $guildInfo->enableQuickIn, $guildInfo->condition));
|
|
|
+ self::pushNewJournal($mem, $guildInfo->guildId, GuildJournalModel::CreateJoin($uid, $baseInfo->name), $zoneid);
|
|
|
|
|
|
self::updateUserGuildInfo($mem, $uid, $userGuildInfo, $zoneid); // 回写数据
|
|
|
self::addGuildInfo($mem, $guildInfo->guildId, $guildInfo, $zoneid);
|
|
@@ -367,7 +367,7 @@ class GuildProc {
|
|
|
}
|
|
|
|
|
|
if ($is_apply) {
|
|
|
- $appinfo = UserApplyForGuildModel::CreateApplyInfo($uid, $game->name, $game->level); // t添加请求信息
|
|
|
+ $appinfo = UserApplyForGuildModel::CreateApplyInfo($uid, $game->baseInfo->name, $game->baseInfo->level); // t添加请求信息
|
|
|
$guildInfo->applylist->$uid = $appinfo;
|
|
|
if ($userGuildInfo == null) {
|
|
|
$userGuildInfo = UserGuildModel::Clear();
|
|
@@ -396,7 +396,7 @@ class GuildProc {
|
|
|
static function QuickIn($req) {
|
|
|
$resp = new Resp();
|
|
|
$mem = $req->mem;
|
|
|
- $game = $req->userInfo->game;
|
|
|
+ $game = $req->userInfo->game->baseInfo;
|
|
|
$zoneid = $req->zoneid;
|
|
|
$uid = $req->uid; //fromoid
|
|
|
// 公会相关数据模型
|
|
@@ -645,7 +645,7 @@ class GuildProc {
|
|
|
$targetUserGuildInfo->position = 'Member';
|
|
|
|
|
|
self::updateGuildMemberCount($guildInfo, $zoneID); // 同步更新一下数据库中公会成员数量
|
|
|
- self::pushNewJournal($mem, $guildId, GuildJournalModel::CreateJoin($targetId, $targetUser->game->name), $zoneID); // 插入日志
|
|
|
+ self::pushNewJournal($mem, $guildId, GuildJournalModel::CreateJoin($targetId, $targetUser->game->baseInfo->name), $zoneID); // 插入日志
|
|
|
} else {
|
|
|
#发送一封邮件通知玩家被拒绝
|
|
|
EmailProc::SendGuildApplyRefusedMail($zoneID, $targetId, $guildInfo->name);
|
|
@@ -711,9 +711,9 @@ class GuildProc {
|
|
|
if (self::isOfficerChairman($uid, $guildInfo)) {
|
|
|
self::removeOfficerChairman($guildInfo, $transferedid);
|
|
|
}
|
|
|
- self::updateDBGuildChairmanInfo($zoneID, $transfereduser->game->name, $transferedid, $guildId); // 更新数据库中关于工会的信息
|
|
|
+ self::updateDBGuildChairmanInfo($zoneID, $transfereduser->game->baseInfo->name, $transferedid, $guildId); // 更新数据库中关于工会的信息
|
|
|
// 插入公会日志
|
|
|
- self::pushNewJournal($mem, $guildId, GuildJournalModel::CreateChangeChairman($uid, $game->name, $transferedid, $transfereduser->game->name), $zoneID);
|
|
|
+ self::pushNewJournal($mem, $guildId, GuildJournalModel::CreateChangeChairman($uid, $game->baseInfo->name, $transferedid, $transfereduser->game->baseInfo->name), $zoneID);
|
|
|
|
|
|
self::updateGuildInfo($mem, $guildId, $guildInfo, $zoneID); // 更新公会数据
|
|
|
// 设置成功返回值
|
|
@@ -933,15 +933,15 @@ class GuildProc {
|
|
|
foreach ($guildInfo->members as $mboid) {
|
|
|
$memberInfo = self::getMemUserGuildInfo($mem, $mboid, $zoneID);
|
|
|
$userInfo = UserProc::getUserInfo($mem, $zoneID, $mboid);
|
|
|
- $memberInfo->name = $userInfo->game->name;
|
|
|
- $memberInfo->level = $userInfo->game->level;
|
|
|
+ $memberInfo->name = $userInfo->game->baseInfo->name;
|
|
|
+ $memberInfo->level = $userInfo->game->baseInfo->level;
|
|
|
$memberInfo->fightPower = self::initFightTeamInfo($mem, $mboid, $zoneID);
|
|
|
$memberInfo->uid = $mboid;
|
|
|
- $memberInfo->img = $userInfo->game->img;
|
|
|
- $memberInfo->imgBorderId = $userInfo->game->imgBorderId;
|
|
|
+ $memberInfo->img = $userInfo->game->baseInfo->img;
|
|
|
+ $memberInfo->imgBorderId = $userInfo->game->baseInfo->imgBorderId;
|
|
|
// $score = $mem->zscore($key_cur, $mboid);
|
|
|
$memberInfo->cupScore = $score == null ? 0 : $score;
|
|
|
- $memberInfo->lastLogin = $userInfo->game->lastLogin; #成员最后登陆时间
|
|
|
+ $memberInfo->lastLogin = $userInfo->game->baseInfo->lastLogin; #成员最后登陆时间
|
|
|
unset($memberInfo->appliedguildlist);
|
|
|
unset($memberInfo->appliedguildRecord);
|
|
|
$memberArr[] = $memberInfo;
|
|
@@ -952,7 +952,7 @@ class GuildProc {
|
|
|
}
|
|
|
|
|
|
$chairmanInfo = UserProc::getUserInfo($mem, $zoneID, $guildInfo->chairman_id);
|
|
|
- $guildInfo->chairmanLastLogin = $chairmanInfo->game->lastLogin;
|
|
|
+ $guildInfo->chairmanLastLogin = $chairmanInfo->game->baseInfo->lastLogin;
|
|
|
|
|
|
$resp = Resp::ok(array(
|
|
|
"guildInfo" => $guildInfo,
|
|
@@ -1032,7 +1032,7 @@ class GuildProc {
|
|
|
}
|
|
|
|
|
|
// todo: 公会日志加入信息
|
|
|
- self::pushNewJournal($mem, $guildId, GuildJournalModel::CreateQuit($uid, $game->name), $zoneid);
|
|
|
+ self::pushNewJournal($mem, $guildId, GuildJournalModel::CreateQuit($uid, $game->baseInfo->name), $zoneid);
|
|
|
// 同步更新一下公会成员数量
|
|
|
self::updateGuildMemberCount($guildInfo, $zoneid);
|
|
|
// 回写数据
|
|
@@ -1072,7 +1072,7 @@ class GuildProc {
|
|
|
$resp = Resp::err(ErrCode::err_guild_usernotguildmember);
|
|
|
} else {
|
|
|
$chairmanInfo = UserProc::getUserInfo($mem, $zoneid, $guildInfo->chairman_id);
|
|
|
- $lastLogin = $chairmanInfo->game->lastLogin; //86400
|
|
|
+ $lastLogin = $chairmanInfo->game->baseInfo->lastLogin; //86400
|
|
|
$ts = now() - $lastLogin;
|
|
|
if ($ts < glc()->Guild_ChairManLastLoginLimit) {
|
|
|
$resp = Resp::err(ErrCode::err_guild_notsatisfiedaccusecondition);
|
|
@@ -1238,9 +1238,9 @@ class GuildProc {
|
|
|
$applyGuildInfo = UserGuildModel::Clear();
|
|
|
}
|
|
|
#字段更新
|
|
|
- UserGuildModel::userGuildInfoInit($applyGuildInfo, $userId, $userInfo->game, $mem, $zoneid);
|
|
|
+ UserGuildModel::userGuildInfoInit($applyGuildInfo, $userId, $userInfo->game->baseInfo, $mem, $zoneid);
|
|
|
$applyGuildInfo->fightPower = GuildProc::initFightTeamInfo($mem, $userId, $zoneid); #$game->heroTeamConfig;
|
|
|
- $applyGuildInfo->lastLogin = $userInfo->game->lastLogin; #成员最后登陆时间
|
|
|
+ $applyGuildInfo->lastLogin = $userInfo->game->baseInfo->lastLogin; #成员最后登陆时间
|
|
|
//self::updateUserGuildInfo($mem, $applyGuildInfo->uid, $applyGuildInfo, $zoneid);
|
|
|
# 设置成功返回值
|
|
|
$resp = Resp::ok($applyGuildInfo);
|
|
@@ -1254,7 +1254,7 @@ class GuildProc {
|
|
|
|
|
|
/**
|
|
|
* [7021] 请求捐献
|
|
|
- * @param type $req
|
|
|
+ * @param req $req
|
|
|
*/
|
|
|
static function requestDonate($req) {
|
|
|
$resp = new Resp();
|
|
@@ -1324,7 +1324,7 @@ class GuildProc {
|
|
|
} else {
|
|
|
$userGuildInfo->requestCardTs = now(glc()->Guild_RequestCardIntervalTime);
|
|
|
#将碎片捐献信息存入哈希表中,时间戳为key+uid
|
|
|
- GuildProc::hsetGuildRequestDonateInfo($mem, $guildId, GuildJournalModel::RequestDonate($uid, $req->userInfo->game->name, $cardId, $cardCount), $uid, $zoneid);
|
|
|
+ GuildProc::hsetGuildRequestDonateInfo($mem, $guildId, GuildJournalModel::RequestDonate($uid, $req->userInfo->game->baseInfo->name, $cardId, $cardCount), $uid, $zoneid);
|
|
|
self::updateUserGuildInfo($mem, $uid, $userGuildInfo, $zoneid);
|
|
|
self::updateGuildInfo($mem, $guildId, $guildInfo, $zoneid);
|
|
|
# 设置成功返回值
|
|
@@ -1345,6 +1345,7 @@ class GuildProc {
|
|
|
|
|
|
/**
|
|
|
* [7022] 捐献
|
|
|
+ * @param Req $req Description
|
|
|
*/
|
|
|
static function donate($req) {
|
|
|
$resp = new Resp();
|
|
@@ -1400,8 +1401,8 @@ class GuildProc {
|
|
|
if ($reward) {
|
|
|
#捐献的人扣卡牌 +奖励
|
|
|
UserGameModel::Consume_HeroSegment($game, $segmentId, $segmentNum); //扣卡牌
|
|
|
- UserGameModel::Add_Gold($game, $guildReward->gold * $segmentNum); #加金币奖励
|
|
|
- UserGameModel::Add_Exp($req->userInfo->game, $guildReward->exp * $segmentNum); #加经验
|
|
|
+ UserGameModel::Add_Gold($game->baseInfo, $guildReward->gold * $segmentNum); #加金币奖励
|
|
|
+ UserGameModel::Add_Exp($req->userInfo->game->baseInfo, $guildReward->exp * $segmentNum); #加经验
|
|
|
$userGuildInfo->contribute += $guildReward->contribution * $segmentNum; #加贡献度
|
|
|
#计算所在公会总贡献度
|
|
|
$guildInfo->allContribute += $userGuildInfo->contribute;
|
|
@@ -1586,7 +1587,7 @@ class GuildProc {
|
|
|
|
|
|
/**
|
|
|
* [7024]购买 捐献度礼包
|
|
|
- * @param type $req
|
|
|
+ * @param req $req
|
|
|
*/
|
|
|
static function buyDonateGift($req) {
|
|
|
$resp = new Resp();
|
|
@@ -1596,7 +1597,7 @@ class GuildProc {
|
|
|
$uid = $req->uid; //审批者
|
|
|
$zoneid = $req->zoneid;
|
|
|
$libaoId = $req->paras[0]; //礼包id
|
|
|
- $game = $req->userInfo->game;
|
|
|
+ $baseInfo = $req->userInfo->game->baseInfo;
|
|
|
|
|
|
$userGuildInfo = self::getMemUserGuildInfo($mem, $uid, $zoneid);
|
|
|
if ($userGuildInfo == null || $userGuildInfo->guildId <= 0) {
|
|
@@ -1615,13 +1616,13 @@ class GuildProc {
|
|
|
if ($libaoInfo->donaterequire > $userGuildInfo->contribute) {
|
|
|
$resp = Resp::err(ErrCode::err_guild_contributionnosatisfy);
|
|
|
} else {
|
|
|
- $money = $libaoInfo->pricetype == 1 ? $game->gold - $libaoInfo->price : $game->cash - $libaoInfo->price;
|
|
|
+ $money = $libaoInfo->pricetype == 1 ? $baseInfo->gold - $libaoInfo->price : $baseInfo->cash - $libaoInfo->price;
|
|
|
$type = $libaoInfo->pricetype == 1 ? ErrCode::notenough_gold_msg : ErrCode::notenough_cash_msg;
|
|
|
if ($money < 0) {#钱不够
|
|
|
$resp = Resp::err($type);
|
|
|
} else {
|
|
|
#扣除花费
|
|
|
- $libaoInfo->pricetype == 1 ? UserGameModel::Consume_Gold($game, $libaoInfo->price) : UserGameModel::Consume_Cash($game, $libaoInfo->price);
|
|
|
+ $libaoInfo->pricetype == 1 ? UserGameModel::Consume_Gold($baseInfo, $libaoInfo->price) : UserGameModel::Consume_Cash($baseInfo, $libaoInfo->price);
|
|
|
#回存礼包
|
|
|
$err = StoreProc::AddMultiItemInStore($req, $libaoInfo->libaocontent, 5);
|
|
|
if ($err == 0) {
|
|
@@ -1647,7 +1648,7 @@ class GuildProc {
|
|
|
}
|
|
|
self::updateGuildInfo($mem, $guildInfo->guildId, $guildInfo, $zoneid);
|
|
|
UserProc::updateUserInfo();
|
|
|
- SystemProc::BuyGuildCashPack($zoneid, $game); # 插入系统消息
|
|
|
+ SystemProc::BuyGuildCashPack($zoneid, $baseInfo); # 插入系统消息
|
|
|
$resp = Resp::ok(array(
|
|
|
"result" => 0,
|
|
|
'store' => $req->userInfo->game->store,
|
|
@@ -1663,7 +1664,7 @@ class GuildProc {
|
|
|
|
|
|
/**
|
|
|
* [7025]购买 公会钻石礼包 弃用
|
|
|
- * @param type $req
|
|
|
+ * @param req $req
|
|
|
*/
|
|
|
static function buyGuildCashGift($req) {
|
|
|
$resp = new Resp();
|
|
@@ -1673,7 +1674,7 @@ class GuildProc {
|
|
|
$uid = $req->uid;
|
|
|
$zoneid = $req->zoneid;
|
|
|
$libaoId = $req->paras[0]; //礼包id
|
|
|
- $game = $req->userInfo->game;
|
|
|
+ $baseInfo = $req->userInfo->game->baseInfo;
|
|
|
|
|
|
$userGuildInfo = self::getMemUserGuildInfo($mem, $uid, $zoneid);
|
|
|
if ($userGuildInfo == null || $userGuildInfo->guildId <= 0) {
|
|
@@ -1688,13 +1689,13 @@ class GuildProc {
|
|
|
if ($libaoInfo == null || !$libaoInfo->isOpen && $guildInfo->level < $libaoInfo->openguildlevel) {
|
|
|
$resp = Resp::err(ErrCode::err_guild_contributionGiftnoopen);
|
|
|
} else {
|
|
|
- $money = $libaoInfo->pricetype == 1 ? $game->gold - $libaoInfo->price : $game->cash - $libaoInfo->price;
|
|
|
+ $money = $libaoInfo->pricetype == 1 ? $baseInfo->gold - $libaoInfo->price : $baseInfo->cash - $libaoInfo->price;
|
|
|
$type = $libaoInfo->pricetype == 1 ? ErrCode::notenough_gold_msg : ErrCode::notenough_cash_msg;
|
|
|
if ($money < 0) {#钱不够
|
|
|
$resp = Resp::err($type);
|
|
|
} else {
|
|
|
#扣除花费
|
|
|
- $libaoInfo->pricetype == 1 ? UserGameModel::Consume_Gold($game, $libaoInfo->price) : UserGameModel::Consume_Cash($game, $libaoInfo->price);
|
|
|
+ $libaoInfo->pricetype == 1 ? UserGameModel::Consume_Gold($baseInfo, $libaoInfo->price) : UserGameModel::Consume_Cash($baseInfo, $libaoInfo->price);
|
|
|
#回存礼包
|
|
|
$err = StoreProc::AddMultiItemInStore($req, $libaoInfo->libaocontent, 5);
|
|
|
if ($err == 0) {
|
|
@@ -1720,7 +1721,7 @@ class GuildProc {
|
|
|
}
|
|
|
self::updateGuildInfo($mem, $guildInfo->guildId, $guildInfo, $zoneid);
|
|
|
UserProc::updateUserInfo();
|
|
|
- SystemProc::BuyGuildCashPack($zoneid, $game); # 插入系统消息
|
|
|
+ SystemProc::BuyGuildCashPack($zoneid, $baseInfo); # 插入系统消息
|
|
|
$resp = Resp::ok(array(
|
|
|
"result" => 0,
|
|
|
'store' => $req->userInfo->game->store,
|
|
@@ -2063,7 +2064,7 @@ class GuildProc {
|
|
|
unset($guildInfo->members);
|
|
|
|
|
|
$chairman = UserProc::getUserInfo($mem, $zoneid, $guildInfo->chairman_id);
|
|
|
- $guildInfo->chairman_name = $chairman->game->name;
|
|
|
+ $guildInfo->chairman_name = $chairman->game->baseInfo->name;
|
|
|
$memList [] = $guildInfo;
|
|
|
} else { // 如果公会已经解散,添加到失效数组中
|
|
|
$invalidGuild[] = $guildId;
|