gwang пре 4 година
родитељ
комит
377a144a51

+ 289 - 16
Gameserver/Amfphp/base/ErrCode.php

@@ -251,7 +251,7 @@ class ErrCode {
      * 晶石不足
      */
     const notenough_spar = 3046;
-    
+
     /**
      * 资源点不足
      */
@@ -315,7 +315,6 @@ class ErrCode {
      */
     const user_reward_typeno = 3031;
 
-
 // </editor-fold>
     //
     // <editor-fold defaultstate="collapsed" desc="    英雄错误码 33xx    ">
@@ -459,24 +458,26 @@ class ErrCode {
      * 英雄身上找不到这个言灵
      */
     const hero_yanling_notfound = 3328;
-    
+
     /**
-     *言灵等级配置缺失 
+     * 言灵等级配置缺失 
      */
     const hero_yanling_levelconst_no = 3329;
-    
+
     /**
-     *言灵等级已达上限
+     * 言灵等级已达上限
      */
     const hero_yanling_levelMax = 3330;
+
     /**
      * 重复言灵
      */
-     const hero_yanling_repeat = 3331;
-     /**
-      * 
-      */
-     const hero_yanling_starMax = 3332;
+    const hero_yanling_repeat = 3331;
+
+    /**
+     * 
+     */
+    const hero_yanling_starMax = 3332;
 //
 // </editor-fold>
     //
@@ -1149,24 +1150,297 @@ class ErrCode {
     const auction_failprice = 4708;
 // </editor-fold>
     //
-    // <editor-fold defaultstate="collapsed" desc="    公会错误码 - 48xx开始">
+    // <editor-fold defaultstate="collapsed" desc="公会错误码 - 48xx开始">
+
+    /**
+     * 玩家等级不足
+     */
+    const err_guild_userlevel = 4800;
+
+    /**
+     * 您已经属于一个公会成员了.
+     */
+    const err_guild_userhasbeenaguildmember = 4801;
+
+    /**
+     * 解散公会后的24小时冷却时间尚未过去.
+     */
+    const err_guild_dissmisscodingtime = 4802;
+
+    /**
+     * 同名公会已存在
+     */
+    const err_guild_nameexists = 4803;
+
+    /**
+     *  创建公会时所传公会名称参数为空.
+     */
+    const err_guild_nameEmputy = 4804;
 
     /**
      * 金币不足
      */
     const err_msg_goldnotenough = 4805;
 
+    /**
+     * 找不到公会数据
+     */
+    const err_guild_guildinfono = 4806;
+
+    /**
+     * 成员已满
+     */
+    const err_guild_memberfull = 4807;
+
+    /**
+     *  申请队列已满
+     */
+    const err_guild_applyListFull = 4808;
+
+    /**
+     * 公会未开启一键加入功能
+     */
+    const err_guild_quickinclosed = 4809;
+
+    /**
+     * 玩家不属于此公会
+     */
+    const err_guild_usernotguildmember = 4810;
+
+    /**
+     * 找不到玩家的公会信息
+     */
+    const err_guild_userguildinfono = 4811;
+
+    /**
+     * 玩家不是该公会的会长或是干部
+     */
+    const err_guild_usernotchairman = 4812;
+
+    /**
+     * 解散工会的时候, 公会不为空
+     */
+    const err_guild_notEmputy = 4813;
+
+    /**
+     * 会长不能开除自己.
+     */
+    const err_guild_cannotfireyourself = 4814;
+
+    /**
+     * 申请信息未找到
+     */
+    const err_guild_appmsgnotfount = 4815;
+
+    /**
+     * 申请信息已经处理过了
+     */
+    const err_guild_applymsgdealed = 4816;
+
     /**
      * 玩家不存在
      */
     const err_user_no = 4817;
 
     /**
-     * 操作码非法
+     * 无权限
+     */
+    const err_guild_nopermission = 4818;
+
+    /**
+     * 副会长名额已满
+     */
+    const err_guild_viceChairmanFull = 4819;
+
+//    /**
+//     * 操作码非法
+//     */
+//    const err_msg_cmd = 4820;
+
+    /**
+     * 徽章不能为null
+     */
+    const err_guild_imgEmputy = 4821;
+
+    /**
+     * 不能删除会长
+     */
+    const err_guild_cannotfireychairman = 4822;
+
+    /**
+     * 下一任会长必须是本公会的会员
+     */
+    // const err_guild_lastchairmanidnoexist = 4823;
+
+    /**
+     * 玩家已经是该职位
+     */
+    const err_guild_positionconflict = 4824;
+
+    /**
+     * 干部名额已满
+     */
+    const err_guild_OfficermanFull = 4825;
+
+    /**
+     * 没有限权设置此职位
+     */
+    const err_guild_cannotsetpositioncon = 4826;
+
+    /**
+     * 申请信息已经存在请稍候在申请
+     */
+    const err_guild_applymsgalwaysexist = 4827;
+
+    /**
+     * 申请信息被拒接
+     */
+    const err_guild_applymsgrejected = 4828;
+
+    /**
+     * 会长登陆时间信息发生改变无法弹劾,请刷新数据
+     */
+    const err_guild_notsatisfiedaccusecondition = 4829;
+
+    /**
+     * 不在弹劾有效时间内
+     */
+    const err_guild_noaccusevalidtimeperiod = 4830;
+
+    /**
+     * 弹劾 冷却中请稍候在弹劾
      */
-    const err_msg_cmd = 4820;
+    const err_guild_accusecooling = 4831;
 
+    /**
+     * 不允许申请加入该公会
+     */
+    const err_guild_noallowaddguild = 4832;
 
+    /**
+     * 会长没有被弹劾
+     */
+    const err_guild_chairmannoaccused = 4833;
+
+    /**
+     * 不允许反复弹劾
+     */
+    const err_guild_noallowagainaccuse = 4834;
+
+    /**
+     * 请求捐献数据不能为null
+     */
+    const err_guild_requestdonatecannotnull = 4835;
+
+    /**
+     * 请求捐献 时间不到
+     */
+    const err_guild_lessthannextrequestdonate = 4836;
+
+    /**
+     * 没有卡牌常量数据
+     */
+    const err_guild_nosegmentconst = 4837; //这个暂时用着,卡牌那应该有这个错误码
+
+    /**
+     * 不能请求该类型的卡牌
+     */
+    const err_guild_thiscardcannotrequestordonate = 4838; //这个暂时用着,卡牌那应该有这个错误码
+
+    /**
+     * 请求卡牌数量过多
+     */
+    const err_guild_requestcardnumtomuch = 4839; //这个暂时用着,卡牌那应该有这个错误码
+
+    /**
+     * 玩家没有足够的卡牌可以捐献
+     */
+    const err_guild_noenoughcardinfo = 4840; //这个暂时用着,卡牌那应该有这个错误码
+
+    /**
+     * 卡牌类型不一致
+     */
+    const err_guild_cardtypeinconformity = 4841;
+
+    /**
+     * 今天捐献卡牌数量已经达到最大值
+     */
+    const err_guild_donatecardnumreachlimit = 4842;
+
+    /**
+     * 已经超过捐献时间无法捐献
+     */
+    const err_guild_overdonatetime = 4843;
+
+    /**
+     * 玩家背包中没有该类型的碎片
+     */
+    const err_guild_usersegementnothechip = 4844;
+
+    /**
+     * 英雄合成碎片与参数id不一致
+     */
+    const err_guild_herochiptypeinconformity = 4846;
+
+    /**
+     * 不存在该英雄
+     */
+    const err_guild_nohero = 4847;
+
+    /**
+     * 该贡献度礼包没有开放
+     */
+    const err_guild_contributionGiftnoopen = 4848;
+
+    /**
+     * 该公会钻石礼包没有开放
+     */
+    const err_guild_cashGiftnoopen = 4849;
+
+    /**
+     * 贡献度不够
+     */
+    const err_guild_contributionnosatisfy = 4850;
+
+    /**
+     * 缺少礼包常量数据
+     */
+    const err_guild_noguildgiftconst = 4851;
+
+    /**
+     * 公会消息没有该卡牌的信息
+     */
+    const err_guild_guildjournalnothechipinfo = 4852;
+
+    /**
+     * 公会邮件内容不能为null
+     */
+    const err_guild_mailcontentcannotbenull = 4853;
+
+    /**
+     * 公会公告编辑冷却时间中
+     */
+    const err_guild_AnnouncementEditCooling = 4854;
+
+    /**
+     * 公会战 已经存在邀请数据,不能再次邀请
+     */
+    const err_guild_fightInvitealreadyexisted = 4855;
+
+    /**
+     * 公会战 邀请信息不存在
+     */
+    const err_guild_fightInvitenoexisted = 4856;
+
+    /**
+     * 公会战 在战斗中
+     */
+    const err_guild_fighting = 4857;
+
+    /**
+     * 公会战 在战斗中
+     */
+    const err_guild_applyconditionnoenough = 4858;
 
 // </editor-fold>
     // 
@@ -1183,7 +1457,6 @@ class ErrCode {
     const shop_monthlyvip_buyed = 4902;
 
 // </editor-fold>
-
     // <editor-fold defaultstate="collapsed" desc="   学院错误码 51xx">
 
     /**
@@ -1195,9 +1468,9 @@ class ErrCode {
      * 
      */
     const college_TaskCardStateError = 5202;
-    
     const college_courseNumError = 5203;
     const college_taskCardNumError = 5204;
+
 // </editor-fold>
     //
     // <editor-fold defaultstate="collapsed" desc="    反射方法    ">

+ 2 - 2
Gameserver/Amfphp/base/HashSaver.php

@@ -40,14 +40,14 @@ class HashSaver extends Object_ext {
     /**
      * 存储数据到redis
      */
-    function updateData($mem_key) {
+    function updateDataFull($mem_key) {
         return gMem()->hmset($mem_key, $this);
     }
 
     /**
      * 存储数据到redis
      */
-    function updateData2($mem_key) {
+    function updateDataByTag($mem_key) {
         $data = array();
         foreach (self::$save_tag as $k) {
             $data[$k] = $this->$k;

+ 1 - 0
Gameserver/Amfphp/base/Include.php

@@ -13,4 +13,5 @@ if (!defined("VO_ROOT")) {
     include_once VO_ROOT . '/MemKey_User.php';
     include_once VO_ROOT . '/MemKey_GameRun.php';
     include_once VO_ROOT . '/HashSaver.php';
+    include_once VO_ROOT . '/MemKey_Guild.php';
 }

+ 108 - 0
Gameserver/Amfphp/base/MemKey_Guild.php

@@ -0,0 +1,108 @@
+<?php
+
+namespace loyalsoft;
+
+/**
+ * Description of MemKey_Guild
+ *
+ * @author cyzhao
+ */
+class MemKey_Guild {
+//
+// <editor-fold defaultstate="collapsed" desc="    辅助方法  ">
+//
+
+    /**
+     * @return bool 是否使用短名称
+     */
+    private static function bUseShort() {
+//        return true;  # 全部启用
+        return defined('GAME_ONLINE') and GAME_ONLINE;
+    }
+
+    /**
+     * key前缀
+     * @param int $zoneid 分区id
+     * @param string $uid
+     * @return string
+     */
+    private static function Key_($zoneid, $uid) {
+        return self::bUseShort() ? 'u-' . $uid . '-' . $zoneid : 'user-' . $uid . '-zone' . $zoneid;
+    }
+
+// </editor-fold>
+
+    /**
+     * 获取玩家公会信息
+     * @param type $zoneid
+     * @return string
+     */
+    public static function getUserGuildInfo_hash($uid, $zoneid) {
+        return self::Key_($zoneid, $uid) . "-guild";
+    }
+
+    /**
+     * 公会列表缓存
+     * @param type $page
+     * @param type $zoneid
+     * @return type
+     */
+    public static function guildListCache($page, $zoneid) {
+        return "cache-guild-list" . "-zone" . $zoneid . $page;
+    }
+
+//    /**
+//     * 推荐公会列表缓存
+//     * @return string
+//     */
+//    static function guildRecommendationCache($zoneid) {
+//        return "cache-guild-recommendation" . "-zone" . $zoneid;
+//    }
+//
+//    /**
+//     *  推荐公会队列
+//     * @return string
+//     */
+//    static function constGuildRecommendationQueue($zoneid) {
+//        return "guild-recommendation-queue" . "-zone" . $zoneid;
+//    }
+
+    /**
+     * 获取公会信息
+     */
+    static function getGuildInfo_hash($gid, $zoneid) {
+        return "guild-" . $gid . "-zone" . $zoneid;
+    }
+
+    /**
+     * 获取当前最大公会ID,
+     * @return string
+     */
+    static function constGetCurrentMaxGuildID($zoneid) {
+        return "guild-currentmaxid" . "-zone" . $zoneid;
+    }
+
+//    /**
+//     * 【哈希】捐献请求记录
+//     * @return string
+//     */
+//    static function CacheGuildDonate($guildId, $zoneid) {
+//        return "guild-donate-" . $guildId . "-zone" . $zoneid;
+//    }
+//
+//    /**
+//     * 【LIST】捐献者记录
+//     * @return string
+//     */
+//    static function UserDonateRecordList($guildId, $index, $zoneid) {
+//        return "guild-donor-" . $guildId . "-" . $index . "-zone" . $zoneid;
+//    }
+//
+//    /**
+//     * 【LIST】除了捐献之外的日志
+//     * @return string
+//     */
+//    static function constGuildJournal($guildId, $zoneid) {
+//        return "guild-journal-" . $guildId . "-zone" . $zoneid;
+//    }
+}

+ 327 - 0
Gameserver/Amfphp/model/User/Data_Guild.php

@@ -0,0 +1,327 @@
+<?php
+
+namespace loyalsoft;
+
+/**
+ * 公会数据结构
+ */
+class Data_Guild extends HashSaver {
+
+    /**
+     * 公会的ID
+     * @var int
+     */
+    public $guildId;
+
+    /**
+     * 公会名称
+     * @var string
+     */
+    public $name;
+
+    /**
+     * 公会的等级
+     * @var int
+     */
+    public $level = 1;
+
+//    /**
+//     * 奖杯积分
+//     * @var int
+//     */
+//    public $cupScore = 0;
+
+    /**
+     * 玩家申请加入公会列表
+     * @var object
+     */
+    public $applylist;
+
+    /**
+     * 会长的OpenID
+     * @var string
+     */
+    public $chairman_id = "";
+
+    /**
+     * 会长 name
+     * @var string
+     */
+    public $chairman_name = "";
+
+//    /**
+//     * @var array 副会长集合
+//     */
+//    public $viceChairManArr = array();
+//
+//    /**
+//     * @var array 干部
+//     */
+//    public $officerManArr = array();
+
+    /**
+     * 公会成员
+     * @var array
+     */
+    public $members = array();
+
+    /**
+     * 公会的宗旨/公告
+     * @var string
+     */
+    public $declare = "";
+
+    /**
+     * 创建时间戳
+     * @var type
+     */
+    public $createts = 0;
+
+    /**
+     * 允许一键(快速)加入, 默认开启,1是需要审核,2,不允许任何人加入
+     * @var int
+     */
+    public $enableQuickIn = 0;
+
+    /**
+     * 徽章
+     * @var int
+     */
+    public $guild_img = 0;
+
+    /**
+     * 加入公会所需条件
+     * @var int
+     */
+    public $condition;
+
+//    /**
+//     * 弹劾 同意
+//     * @var type
+//     */
+//    public $accuse_agreed = array();
+//
+//    /**
+//     * 弹劾 拒接
+//     *  @var type
+//     */
+//    public $accuse_refuse = array();
+//    /**
+//     * 弹劾 时间
+//     * @var int
+//     */
+//    public $accuseTs = 0;
+//    /**
+//     * 弹劾 冷却时间
+//     * @var int
+//     */
+//    public $accuse_coolTime = 0;
+//    /**
+//     * 公会总贡献
+//     * @var int
+//     */
+//    public $allContribute = 0;
+//    /**
+//     * 公会公告编辑冷却时间
+//     * @var int
+//     */
+//    public $announcement_CoolingTs = 0;
+//
+//    /**
+//     * 公会公告内容
+//     * @var type
+//     */
+//    public $announcement_content = array();
+//    /**
+//     * 公会礼包购买数量记录
+//     * @var type
+//     */
+//    public $giftnum_record;
+
+    /**
+     * 检察公会最大人数 
+     * @return boolean
+     */
+    function checkmemberfull() { //根据成员的 贡献度
+        $levelInfo = GameConfig::guildlevel_getItem($this->level);
+        return count($this->members) >= $levelInfo->maxPersoNum;
+    }
+
+    function updateGuildMemberCount() {
+        daoInst()->update(GuildProc::tabGuild)
+                ->data(array('membercount' => count($this->members)))
+                ->where('guildId')->eq($this->guildId)
+                ->andWhere('zoneid')->eq(req()->zoneid)
+                ->exec();
+    }
+
+    /**
+     * 创建新公会
+     * @param type $mem
+     * @return Data_Guild
+     */
+    public static function NewGuildInit($creator_uid, $creator_name, $guildName, $declare = "公告", $guild_img = "-") {
+        $guildInfo = new Data_Guild();
+        $guildInfo->guildId = self::CreateNewGuildID();
+        $guildInfo->createts = now();
+        $guildInfo->members = array($creator_uid);
+        $guildInfo->level = 1;
+//        $guildInfo->cupScore = 0;
+        $guildInfo->applylist = ObjectInit();
+        $guildInfo->condition = ObjectInit();
+//        $guildInfo->giftnum_record = ObjectInit();
+
+        $guildInfo->chairman_id = $creator_uid;
+        $guildInfo->chairman_name = $creator_name;
+        $guildInfo->name = $guildName;
+
+        $guildInfo->declare = $declare;
+        $guildInfo->guild_img = $guild_img;
+        $guildInfo->enableQuickIn = 0;                                          # 0 可以直接加入, 1 需要审批, 2 不允许任何人加入
+//        $guildInfo->chairmanLastLogin = $base->lastLogin;
+        return $guildInfo;
+    }
+
+    private function CreateNewGuildID() {
+        $key_id = MemKey_Guild::constGetCurrentMaxGuildID(req()->zoneid);
+        return gMem()->increment($key_id);
+    }
+
+}
+
+// <editor-fold defaultstate="collapsed" desc="闲置">
+
+/**
+ * 玩家请求加入公会的消息结构体
+ */
+class UserApplyForGuildModel {
+
+    public $uid;
+    public $ts;
+    public $approved = false;
+    public $name;
+    public $level;
+
+    /**
+     * 创建一条新的请求信息
+     * @param type $oid
+     * @return UserApplyForGuildModel Description
+     */
+    public static function CreateApplyInfo($uid, $name, $level) {
+        $ret = new UserApplyForGuildModel();
+        $ret->uid = $uid;
+        $ret->ts = now();
+        $ret->name = $name;
+        $ret->level = $level;
+        $ret->approved = false;
+
+        return $ret;
+    }
+
+}
+
+/**
+ * 公会值日消息类型
+ */
+class GuildJournalType {
+
+    const Join = 1; //加入
+    const requestDonate = 2; //请求捐献
+    const Quit = 3; //退会
+    const ChangeChairMan = 4; //改变会长
+    const BuyGift = 5; //购买礼包
+
+}
+
+/**
+ * 公会日志数据体
+ */
+class GuildJournalModel {
+
+    public $ts;
+    public $uid;
+    public $type;
+    public $datas;
+
+    public static function CreateJoin($uid, $name) {
+        $journal = new GuildJournalModel();
+        $journal->ts = now();
+        $journal->type = GuildJournalType::Join;
+        $journal->uid = $uid;
+        $journal->datas = array();
+        $journal->datas [] = $uid;
+        $journal->datas [] = $name;
+        return $journal;
+    }
+
+    public static function RequestDonate($uid, $name, $cardId, $cardCount) {
+        $journal = new GuildJournalModel();
+        $journal->ts = now();
+        $journal->type = GuildJournalType::requestDonate;
+        $journal->uid = $uid;
+        $journal->datas = array();
+        $journal->datas [] = $uid;
+        $journal->datas [] = $name;
+        $journal->datas [] = $cardId;
+        $journal->datas [] = $cardCount;
+        $journal->datas [] = 0; //现在已得到的捐献数量
+        return $journal;
+    }
+
+    public static function CreateQuit($uid, $name) {
+        $journal = new GuildJournalModel();
+        $journal->ts = now();
+        $journal->type = GuildJournalType::Quit;
+        $journal->uid = $uid;
+        $journal->datas = array();
+        $journal->datas [] = $uid;
+        $journal->datas [] = $name;
+        return $journal;
+    }
+
+    public static function CreateChangeChairman($uid, $name, $transferedid, $transferedname) {
+        $journal = new GuildJournalModel();
+        $journal->ts = now();
+        $journal->type = GuildJournalType::ChangeChairMan;
+        $journal->uid = $uid;
+        $journal->datas = array();
+        $journal->datas [] = $uid;
+        $journal->datas [] = $name;
+        $journal->datas [] = $transferedid;
+        $journal->datas [] = $transferedname;
+        return $journal;
+    }
+
+    public static function BuyGift($uid, $name) {
+        $journal = new GuildJournalModel();
+        $journal->ts = now();
+        $journal->type = GuildJournalType::BuyGift;
+        $journal->uid = $uid;
+        $journal->datas = array();
+        $journal->datas [] = $uid;
+        $journal->datas [] = $name;
+
+        return $journal;
+    }
+
+}
+
+class GuildAnnouncementModel extends Object_ext {
+
+    public $ts;
+    public $title;
+    public $content;
+
+    function __construct($tag, $ts, $title, $content) {
+        if (1 == func_num_args() && $tag) {                                     # 默认的Object初始化方法
+            parent::__construct($tag);
+        } else {
+            $this->ts = $ts;
+            $this->title = $title;
+            $this->content = $content;
+        }
+    }
+
+}
+
+// </editor-fold>

+ 84 - 0
Gameserver/Amfphp/model/User/Data_UserGuild.php

@@ -0,0 +1,84 @@
+<?php
+
+namespace loyalsoft;
+
+/**
+ * 玩家公会数据
+ */
+class Data_UserGuild extends HashSaver {
+
+    /**
+     * @var int 时间戳, 用于清理每日申请记录
+     */
+    public $ts;
+
+    /**
+     * @var int 时间戳, 玩家加入/创建公会的时间
+     */
+    public $joints;
+
+    /**
+     * @var int 所属公会id
+     */
+    public $guildId = 0;
+
+    /**
+     * @var array 已经申请的公会列表
+     */
+    public $appliedguildlist = array();
+
+    /**
+     * @var dic<int,int> 申请过的公会记录
+     */
+    public $appliedguildRecord;
+//    
+
+    /**
+     * @var string 公会名称
+     */
+    public $guildName = "";
+
+    /**
+     * 角色类型
+     * @var type
+     */
+    public $position;
+
+    /**
+     * @var int 创建公会冷却时间
+     */
+    public $create_coding;
+
+    /**
+     * 清理
+     * @return Data_UserGuild
+     */
+    public function Clear() {
+        $this->ts = now();
+        $this->joints = now();                                                  // 玩家公会的创建时间
+        $this->guildId = 0;
+
+        $this->appliedguildlist = array();
+        $this->appliedguildRecord = ObjectInit();
+
+        //$userGuildinfo->position = 0; //职位
+
+        return $this;
+    }
+
+    /**
+     * 初始化个人公会信息 
+     */
+    public function __construct($args = null) {
+        if (isset($args)) {
+            parent::__construct($args);
+        } else {
+            $this->ts = now();
+            $this->joints = now();                                              // 玩家公会的创建时间
+            $this->guildId = 0;
+            $this->appliedguildlist = array();
+            $this->appliedguildRecord = ObjectInit();
+        }
+    }
+
+}

+ 8 - 9
Gameserver/Amfphp/model/User/Info_UserBase.php

@@ -7,7 +7,6 @@ namespace loyalsoft;
  * @author gwang(wanggangzero@qq.com)
  */
 class Info_UserBase extends Object_ext {
-    //put your code here
 
     /**
      * 第一次登录时间
@@ -30,17 +29,17 @@ class Info_UserBase extends Object_ext {
     /**
      * @var int 当前等级
      */
-    public $level;  //
+    public $level;
 
     /**
      * @var string 昵称
      */
-    public $name; // 昵称
+    public $name;
 
     /**
      * @var string 头像
      */
-    public $headImg;  // 头像
+    public $headImg;
 
     /**
      * @var int 头像框Id
@@ -55,13 +54,13 @@ class Info_UserBase extends Object_ext {
     /**
      * @var int 金币
      */
-    public $gold;  // 金币
+    public $gold;
 
     /**
      * 钻石
      * @var int
      */
-    public $cash; //
+    public $cash;
 
     /**
      * 分解后得倒的晶石
@@ -73,7 +72,7 @@ class Info_UserBase extends Object_ext {
      * 体力值
      * @var int
      */
-    public $tili = 120; //体力
+    public $tili = 120;
 
     /**
      * 当前经验
@@ -94,12 +93,12 @@ class Info_UserBase extends Object_ext {
     /**
      * @var int 历史充值总金额(单位:分)
      */
-    public $charge_amt = 0;  //
+    public $charge_amt = 0;
 
     /**
      * @var int 游戏内赠送游戏币总额
      */
-    public $gift_cash = 0;  //
+    public $gift_cash = 0;
 
     /**
      * 言灵等级消耗的资源点

+ 379 - 0
Gameserver/Amfphp/process/GuildProc.php

@@ -0,0 +1,379 @@
+<?php
+
+namespace loyalsoft;
+
+//define("GUILDAPPLYCAPACITY", 99);                                               # 公会申请记录的容量限制
+//define("CREATECODINGTIME", 86400);                                              # 退出公会开除会员后有24小时冷却时间, 不能加入其他公会
+//define("GUILDIDBASE", 100000);                                                  # 公会ID开始增长的基础值
+//define("GUILDMAXJOURNALCOUNT", 80);                                             # 公会日志最多存80条记录
+//define("ACCUSESUCCEEDNUM", 3);                                                  # 弹劾会长成功人数
+//define("ACCUSEFAILNUM", 2);                                                     # 弹劾会长失败人数
+//define("GUILDCUPSCOREREFUSE", 86400);                                           # 公会积分刷新时间间隔
+#
+//// 获取公会列表,PS根据等级排序
+//define("SQLSELECTGUILDBYLEVEL", "SELECT * FROM `tab_guild`  where `zoneid`=%d  ORDER BY `cupScore` DESC,`createts` LIMIT %s,20;");
+//// 查询公会总数量
+//define("SELECTGUILDCOUNT", "SELECT COUNT(`id`) FROM `tab_guild`  where `zoneid`=%d ;");
+//// 通过名称模糊查询公会
+//define("SQLSELECTGUILDBYNAME", "SELECT * FROM `tab_guild` WHERE `zoneid`=%d and (`guildId`=%d OR `name` like '%s') LIMIT 10;");
+//// 通过guildid查询公会
+//define("SQLSELECTGUILDBYGUILDID", "SELECT * FROM `tab_guild` WHERE `zoneid`=%d and `guildId`=%d ;");
+//// 检查公会名称是否已存在 =: 各区也不能重名
+//define("SQLCHECKISNAMEEXIST", "SELECT `id` FROM `tab_guild` WHERE `name`='%s' ");
+//// 创建公会
+//define("SQLCREATEGUILD", "INSERT INTO `tab_guild` (`guildId`, `name`, `createts`,`declare`,`membercount`, `chairman_id`, `chairman_name`,`guild_img`,`zoneid`,`cupScore`,`enableQuickIn`,`condition`) VALUES (%d, '%s',%d, '%s', %d,'%s','%s','%s', %d, %d,%d,'%s'); ");
+//// 更新公会成员数量
+//define("SQLUPDATEGUILDMEMBERCOUNT", "UPDATE `tab_guild` SET `membercount`=%d WHERE `guildId`=%d  and `zoneid`=%d ;");
+//// 更新公会的公告/宗旨 徽章
+//define("SQLUPDATEGUILDDECLARE", "UPDATE `tab_guild` SET `declare`='%s',`guild_img`='%s',`enableQuickIn`=%d,`condition`='%s' where `guildId`=%d and `zoneid`=%d;");
+//// 解散公会
+//define("SQLDISSMISS", "DELETE FROM `tab_guild` WHERE `guildId`=%d and `zoneid`=%d; ");
+//// 更新公会会长id name
+//define("SQLUPDATECHAIRMAN", "UPDATE `tab_guild` SET `chairman_id`='%s',`chairman_name`='%s' WHERE `guildId`=%d  and `zoneid`=%d ;");
+//// 更新公会积分
+//define("SQLUPDATEGUILDCUPSTORE", "UPDATE `tab_guild` SET `cupScore`=%d WHERE `guildId`=%d  and `zoneid`=%d ;");
+
+/**
+ *  公会模块 
+ */
+class GuildProc {
+
+    /**
+     * 表名
+     */
+    const tabGuild = '`tab_guild`';
+
+    /**
+     * 创建公会的冷却时间
+     */
+    const create_codingTime = 86400;
+
+    /**
+     * 逻辑分发
+     * 所有的Proc中必须有这样一个方法 
+     */
+    static function procMain() {
+        switch (req()->cmd) {
+            case CmdCode::cmd_guild_getUserGuildInfo:                           # 7000 查询自己的公会
+                return self::GetUserGuildInfo();
+            case CmdCode::cmd_guild_getList:                                    # 7001 查公会列表 公会浏览  列表以cupScore依据 从多到少排列 暂未开放
+                return self::GetGuildList();
+//            case CmdCode::cmd_guild_refuseGuildCupScore:                        # 7002 每日一次刷新公会积分
+//                return self::refuseGuildCupScore();
+            case CmdCode::cmd_guild_searchGuildByID:                            # 7003 通过id搜索公会
+                return self::SearchByGuildID();
+            case CmdCode::cmd_guild_create:                                     # 7004 创建公会
+                return self::CreateGuild();
+//            case CmdCode:: cmd_guild_apply:                                     # 7005 申请加入
+//                return self::ApplyForGuild($req);
+            case CmdCode::cmd_guild_QuickIn:                                    # 7006 一键加入
+                return self::QuickIn();
+//            case CmdCode::cmd_guild_GetGuildInfo:                             # 7007 请求本公会数据
+//                return self::GetGuildInfo($req);
+//            case CmdCode::cmd_guild_modifyDeclare:                            # 7008 编辑
+//                return self::ModifyDeclare($req);
+//            // case CmdCode::cmd_guild_chairmanQuit:                          # 7009 会长退会
+//            //    return self::chairmanQuit($req);
+//            case CmdCode::cmd_guild_fireMember:                               # 7010 开除
+//                return self::FireMember($req);
+//            case CmdCode::cmd_guild_approve:                                  # 7011 审批 申请
+//                return self:: Approve($req);
+//            case CmdCode::cmd_guild_setPriceChairman:                         # 7013 设置 会员 干部 副会长
+//                return self::SetViceChairman($req);
+            case CmdCode::cmd_guild_getGuildMembers:                            # 7014 获取成员信息
+                return self::GetGuildMembers();
+
+            // <editor-fold defaultstate="collapsed" desc=" 注释掉">
+//            case CmdCode::cmd_guild_quit:                                      # 7016 退会
+//                return self::QuitGuild($req);
+//            case CmdCode::cmd_guild_InitiateAccuse:                           # 7017 发起弹劾
+//                return self::InitiateAccuseChairMan($req);
+//            case CmdCode::cmd_guild_Accuse:                                   # 7018 同意弹劾
+//                return self::ApproveAccuseChairMan($req);
+//            case CmdCode::cmd_guild_ChairmanCancelAccuse:                     # 7019 会长取消本次弹劾
+//                return self::CancelAccuse($req);
+//            case CmdCode::cmd_guild_ApplyUserIntro:                           # 7020 申请者玩家简介
+//                return self::ApplyUserIntro($req);
+//            #捐献
+//            case CmdCode::cmd_guild_requestDonate:                            # 7021 请求捐献
+//                return self::requestDonate($req);
+//            case CmdCode::cmd_guild_donate:                                   # 7022 捐献
+//                return self::Donate($req);
+//            case CmdCode::cmd_guild_donateInfoRefresh:                        # 7023 到捐献时间后 刷新
+//                return self::donateInfoRefresh($req);
+//            #礼包
+//            case CmdCode::cmd_guild_buyDonateGift:                            # 7024 购买捐献度礼包
+//                return self::buyDonateGift($req);
+//            case CmdCode::cmd_guild_buyGuildCashGift:                         # 7025 购买公会钻石礼包 弃用
+//                return self::buyGuildCashGift($req);
+//            #公会公告 邮件 会长 副会长有权限
+//            case CmdCode::cmd_guild_announcement:                             # 7026 公告
+//                return self::announcement($req);
+//            case CmdCode::cmd_guild_noticeMail:                               # 7027 公会邮件
+//                return self::noticeMail($req);
+//            #公会战 未开启状态
+//            case CmdCode::cmd_guild_vsFightInvite:                            #7028 邀请战斗
+//                return self::vsFightInvite($req);
+//            case CmdCode::cmd_guild_cancelInvite:                             #7029 取消邀请战斗
+//                return self::cancelInvite($req);
+//            case CmdCode::cmd_guild_fight:                                    #7030 接受并战斗
+//                return self::fight($req);
+            // </editor-fold>
+            default:
+                return Err(ErrCode::cmd_err);
+        }
+    }
+
+// <editor-fold defaultstate="collapsed" desc="公会基础操作">
+
+    /**
+     * [7000]查询自己的公会信息
+     * 玩家打开公会的时候第一步就是这个,如果没有数据,就显示公会列表吧。
+     */
+    static function GetUserGuildInfo() {
+        $uid = req()->uid;
+        $zoneid = req()->zoneid;
+        $userGuildInfo = self:: getMemUserGuildInfo($uid, $zoneid);             # 取玩家公会信息
+        self::updateUserGuildInfo($userGuildInfo, $uid, $zoneid);               # 回写玩家公会数据  
+        return Resp::ok($userGuildInfo);
+    }
+
+    /**
+     * [7001]获取公会列表,
+     */
+    static function GetGuildList() {
+        $zoneid = req()->zoneid;
+        $page = intval(req()->paras[0]);                                        # 起始页索引编号
+        $startIndex = ($page - 1) * 20;                                         # 换算成index(按照1页20条计算)
+        if ($startIndex < 0) {                                                  # 防御: 避免出现 小于0的索引值
+            $startIndex = 0;
+        }
+
+        $memList = self::getGuildListCache($page, $zoneid);                     # 取缓存
+        if (empty($memList) || $memList->ts < now()) {
+            $memList = self::UpdateGuildListCache($zoneid, $startIndex, $page); # 更新并返回缓存的公会列表 
+        }
+
+        $result = array(#                                                       # 返回值
+            "totalcount" => $memList->count, #                                  # 有多少个公会 分页用
+            "guildlist" => $memList->table #                                    # 该页的公会信息
+        );
+        return Resp::ok($result);
+    }
+
+    /**
+     * [7003] 通过公会ID进行搜索 
+     */
+    static function SearchByGuildID() {
+        $zoneid = req()->zoneid;
+        $keywords = req()->paras[0];                                            // 搜索 关键字  
+        $sqlret = daoInst()->select()->from(self::tabGuild)
+                        ->where("`zoneid`=$zoneid and (`guildId`='$keywords' OR `name` like '%$keywords%')")
+                        ->limit(10)->fetchAll();
+        return Resp::ok(array(
+                    "guildInfo" => $sqlret,
+        ));
+    }
+
+    /**
+     * [7004]创建公会 
+     */
+    static function CreateGuild() {
+        $base = ctx()->base();
+        $zoneid = req()->zoneid;
+        $uid = req()->uid;                                                      // fromoid
+        //客户端参数解析
+        list($guildName, $declare, $guild_img, $applyType) = req()->paras;      # 公会名称, 宗旨, 徽章, 允许加入类型
+        $gcfg = glc();                                                          # 全局变量
+        $userGuildInfo = self:: getMemUserGuildInfo($uid, $zoneid);             # 取玩家公会信息
+        my_Assert($userGuildInfo->guildId <= 0, ErrCode::err_guild_userhasbeenaguildmember); # 防御: 已经加入公会
+        $n = daoInst()->select()->from(self::tabGuild)->where(" `name` ='$guildName' ")->count(); # 检查公会名称是否已存在
+        my_Assert($n <= 0, ErrCode::err_guild_nameexists);                      # 防御: 公会名称已存在
+        my_Assert(!empty($guildName), ErrCode::err_guild_nameEmputy);           # 防御: 参数公会名称为空 
+        my_Assert(!empty($guild_img), ErrCode::err_guild_imgEmputy);            # 防御: 参数公会图标为空
+
+        my_Assert($base->Consume_Gold($gcfg->Guild_Found_CostGold), ErrCode::err_msg_goldnotenough); # 扣除金币
+
+        $guildInfo = Data_Guild::NewGuildInit($uid, $base->name, $guildName);   # 创建公会MEM数据体,
+
+        $userGuildInfo->Clear();                                                # 创建/重置玩家公会信息
+        $userGuildInfo->guildId = $guildInfo->guildId;
+        $userGuildInfo->position = 'Chairman';
+        $userGuildInfo->guildName = $guildInfo->name;
+
+        if (GAME_ONLINE) {
+            $userGuildInfo->create_coding = now(self::create_codingTime);       # 设置冷却时间. Ps, 24小时内不准再创建公会.
+        }
+        // Mysql 插入公会记录
+        daoInst()->insert(self::tabGuild)
+                ->data(array(
+                    `guildId` => $guildInfo->guildId,
+                    `name` => $guildName,
+                    `createts` => $guildInfo->createts,
+                    `declare` => $declare,
+                    `membercount` => count($guildInfo->members),
+                    `chairman_id` => $uid,
+                    `chairman_name` => $base->name,
+                    `guild_img` => $guild_img,
+                    `zoneid` => $zoneid,
+                    `cupScore` => 0,
+                    'level' => 1,
+                    `enableQuickIn` => $guildInfo->enableQuickIn,
+                    `condition` => ''
+                ))->exec();
+
+        self::updateUserGuildInfo($userGuildInfo, $uid, $zoneid);               # 回写玩家公会数据
+        $guildInfo->updateDataFull(MemKey_Guild::getGuildInfo_hash($guildInfo->guildId, $zoneid)); # 保存公会数据 
+
+        UserProc::updateUserInfo();
+        return Resp::ok($guildInfo);                                            # 设置成功返回值
+    }
+
+    /**
+     * [7014] 获取公会成员信息 
+     */
+    static function GetGuildMembers() {
+        $mem = gMem();
+        $zoneID = req()->zoneid;
+        $guildId = req()->paras[0];                                             # 公会ID
+
+        $guildInfo = self::getMemGuildInfo($guildId, $zoneID);                  # 取公会信息 
+        my_Assert(isset($guildInfo), ErrCode::err_guild_guildinfono);           # 找不到公会
+        $memberArr = array();
+        foreach ($guildInfo->members as $mboid) {
+            $memberInfo = self::getMemUserGuildInfo($mboid, $zoneID);
+            $userInfo = UserProc::getUserInfo($mem, $zoneID, $mboid);
+            $memberInfo->name = $userInfo->game->name;                          # 刷新下昵称
+            $memberInfo->level = $userInfo->game->level;                        # 刷新下等级
+//            $memberInfo->fightPower = self::initFightTeamInfo($mem, $mboid, $zoneID);
+//            $memberInfo->uid = $mboid;                                           
+            $memberInfo->img = $userInfo->game->img;                            # 刷新下头像
+            $memberInfo->imgBorderId = $userInfo->game->imgBorderId;            # 刷新下头像框
+            $memberInfo->lastLogin = $userInfo->game->lastLogin;                # 成员最后登陆时间
+            unset($memberInfo->appliedguildlist);
+            unset($memberInfo->appliedguildRecord);
+            $memberArr[] = $memberInfo;
+        }
+//        $chairmanInfo = UserProc::getUserInfo($mem, $zoneID, $guildInfo->chairman_id);
+//        $guildInfo->chairmanLastLogin = $chairmanInfo->game->lastLogin;
+
+        return Resp::ok(array(
+                    "guildInfo" => $guildInfo,
+                    "member" => $memberArr,
+        ));
+    }
+
+    /**
+     * [7006] 一键加入公会 
+     */
+    static function QuickIn() {
+        $mem = gMem();
+        $zoneid = req()->zoneid;
+        $uid = req()->uid;                                                      # fromoid
+        $guildId = req()->paras[0];                                             # 公会ID
+
+        $userGuildInfo = self:: getMemUserGuildInfo($uid, $zoneid);             # 取玩家公会信息
+
+        my_Assert(0 == $userGuildInfo->guildId, ErrCode::err_guild_userhasbeenaguildmember); # 防御: 玩家已经加入某个公会
+        my_Assert($userGuildInfo->create_coding <= now(), ErrCode::err_guild_dissmisscodingtime); # 防御: 冷却中
+
+        $guildInfo = self::getMemGuildInfo($mem, $guildId, $zoneid);            # 公会信息
+        my_Assert(isset($guildInfo), ErrCode::err_guild_guildinfono);           # 找不到公会
+        my_Assert(!$guildInfo->checkmemberfull(), ErrCode::err_guild_memberfull); # 公会已满 Ps.公会成员数量 20~60
+        my_Assert(0 == $guildInfo->enableQuickIn, ErrCode::err_guild_quickinclosed); # 公会未开启一键加入功能(0 开放加入,1 需审批,2 不允许加入)
+// 直接跳过审批流程
+        $guildInfo->members[] = $uid;                                           # 添加成员
+        $userGuildInfo->Clear();                                                # 玩家数据清零
+        $userGuildInfo->guildId = $guildId;
+        $userGuildInfo->guildName = empty($guildInfo->name) ? "" : $guildInfo->name;
+        $userGuildInfo->appliedguildlist = array();                             # 清空玩家申请记录
+        $userGuildInfo->joints = now();
+        $userGuildInfo->position = 'Member';
+
+        $guildInfo->updateGuildMemberCount();                                   # 同步更新一下数据库中公会成员数量
+        $guildInfo->updateDataFull(MemKey_Guild::getGuildInfo_hash($guildInfo->guildId, $zoneid)); # 回写公会数据
+        self::updateUserGuildInfo($userGuildInfo, $uid, $zoneid);               # 回写玩家公会数据
+
+        return Resp::ok($userGuildInfo);                                        # 设置成功返回值
+    }
+
+// </editor-fold>
+// <editor-fold defaultstate="collapsed" desc="公会封装函数集合">
+
+    /**
+     * 读Redis中玩家公会信息 
+     * @param int $uid
+     * @param int $zoneid 
+     * @return Data_UserGuild
+     */
+    static function getMemUserGuildInfo($uid, $zoneid) {
+        $ret = new Data_UserGuild();
+        $ret->readDataFromMem(MemKey_Guild::getUserGuildInfo_hash($uid, $zoneid));
+        return $ret;
+    }
+
+    /**
+     * 回写玩家公会信息
+     * @param Data_UserGuild $userGuildInfo
+     * @param int $uid
+     * @param int $zoneid 
+     */
+    static function updateUserGuildInfo($userGuildInfo, $uid, $zoneid) {
+        $memkey = MemKey_Guild::getUserGuildInfo_hash($uid, $zoneid);
+        $userGuildInfo->updateDataFull($memkey);                                # 回写玩家公会数据  
+    }
+
+    /**
+     * 取指定guildid的公会数据 
+     * @param int $guildId
+     * @param int $zoneid 
+     * @return Data_Guild/null
+     */
+    static function getMemGuildInfo($guildId, $zoneid) {
+        $ret = new Data_Guild();
+        return $ret->readDataFromMem(MemKey_Guild::getGuildInfo_hash($guildId, $zoneid));
+    }
+
+    /**
+     * 获取公会列表缓存信息 ok 
+     * @param type $page
+     * @param type $zoneid
+     * @return {"count":0,"ts":0,"table":[]}
+     */
+    static function getGuildListCache($page, $zoneid) {
+        return gMem()->get(MemKey_Guild::guildListCache($page, $zoneid));
+    }
+
+    /**
+     * 更新并返回缓存的公会列表
+     * @param type $zoneid
+     * @param type $startIndex
+     * @param type $page
+     * @return type
+     */
+    static function UpdateGuildListCache($zoneid, $startIndex, $page) {
+        $dbret = daoInst()->select()->from(self::tabGuild)
+                ->where('zoneid')->eq($zoneid)
+                ->limit("$startIndex ,20")
+                ->fetchAll();
+        $count = daoInst()->select()->from(self::tabGuild)->where('zoneid')->eq($zoneid)->count();
+        $memList = ObjectInit();
+        $memList->ts = now(60);                                                 # 设置为3秒好了,如果体验差,再缩短一下
+        $memList->table = $dbret;
+        $memList->count = $count[0];
+        gMem()->set(MemKey_Guild::guildListCache($page, $zoneid), $memList);    # 更新缓存的公会列表 
+        return $memList;
+    }
+
+    /**
+     * 判断玩家是否公会会长
+     * @param type $uid
+     * @param type $guildInfo
+     * @return boolean
+     */
+    static function isGuildChairman($uid, $guildInfo) {
+        return $guildInfo->chairman_id == $uid;
+    }
+
+// </editor-fold>
+}

+ 1 - 3
Gameserver/Amfphp/process/UserProc.php

@@ -458,8 +458,6 @@ class UserProc {
             return null;
         }
         $usrInfo = new UserInfoMo();
-//        $usrInfo->zoneid = $zoneid;
-//        $usrInfo->uid = $uid;
         $g = new Data_UserGame($a);
         $usrInfo->game = $g;
         return $usrInfo;
@@ -484,7 +482,7 @@ class UserProc {
             $uid = req()->uid;
             $userInfo->game->baseInfo->lastSaveTs = now();
             $key = MemKey_User::Info_hash($zoneid, $uid);
-            return $userInfo->game->updateData($key);
+            return $userInfo->game->updateDataFull($key);
         }
         return false;
     }

+ 9 - 1
Gameserver/Amfphp/test.php

@@ -41,5 +41,13 @@ class A {
 
 }
 
-Err(1005);
+$tabName = 'tab_guild';
+$ret = GuildProc::getMemUserGuildInfo("gw", 1);
+$keywords = "青";
+$sqlret = daoInst()->select()->from($tabName)
+                ->where("`zoneid`=$zoneid and (`guildId`='$keywords' OR `name` like '%$keywords%')")
+                ->limit(10)->fetchAll();
+var_dump($sqlret);
+var_dump($ret);
+//Err(1005);
 //var_dump(Resp::err(3503, "时尚杂志opencv"));

+ 16 - 16
Gameserver/Amfphp/util/dao.php

@@ -586,7 +586,7 @@ class dao {
         try {
             $method = $this->method;
             $this->reset();
-//            var_dump($sql);
+            var_dump($sql);
             if ($this->slaveDBH and $method == 'select') {
                 return $this->slaveDBH->query($sql);
             } else {
@@ -1438,7 +1438,7 @@ class sql {
      * @return object the sql object.
      */
     public function where($arg1, $arg2 = null, $arg3 = null) {
-        if ($this->inCondition and ! $this->conditionIsTrue)
+        if ($this->inCondition and!$this->conditionIsTrue)
             return $this;
         if ($arg3 !== null) {
             $value = $this->quote($arg3);
@@ -1459,7 +1459,7 @@ class sql {
      * @return object the sql object.
      */
     public function andWhere($condition) {
-        if ($this->inCondition and ! $this->conditionIsTrue)
+        if ($this->inCondition and!$this->conditionIsTrue)
             return $this;
         $this->sql .= " AND $condition ";
         return $this;
@@ -1473,7 +1473,7 @@ class sql {
      * @return object the sql object.
      */
     public function orWhere($condition) {
-        if ($this->inCondition and ! $this->conditionIsTrue)
+        if ($this->inCondition and!$this->conditionIsTrue)
             return $this;
         $this->sql .= " OR $condition ";
         return $this;
@@ -1487,7 +1487,7 @@ class sql {
      * @return object the sql object.
      */
     public function eq($value) {
-        if ($this->inCondition and ! $this->conditionIsTrue)
+        if ($this->inCondition and!$this->conditionIsTrue)
             return $this;
         $this->sql .= " = " . $this->quote($value);
         return $this;
@@ -1501,7 +1501,7 @@ class sql {
      * @return void the sql object.
      */
     public function ne($value) {
-        if ($this->inCondition and ! $this->conditionIsTrue)
+        if ($this->inCondition and!$this->conditionIsTrue)
             return $this;
         $this->sql .= " != " . $this->quote($value);
         return $this;
@@ -1515,7 +1515,7 @@ class sql {
      * @return object the sql object.
      */
     public function gt($value) {
-        if ($this->inCondition and ! $this->conditionIsTrue)
+        if ($this->inCondition and!$this->conditionIsTrue)
             return $this;
         $this->sql .= " > " . $this->quote($value);
         return $this;
@@ -1529,7 +1529,7 @@ class sql {
      * @return object the sql object.
      */
     public function ge($value) {
-        if ($this->inCondition and ! $this->conditionIsTrue)
+        if ($this->inCondition and!$this->conditionIsTrue)
             return $this;
         $this->sql .= " >= " . $this->quote($value);
         return $this;
@@ -1543,7 +1543,7 @@ class sql {
      * @return object the sql object.
      */
     public function lt($value) {
-        if ($this->inCondition and ! $this->conditionIsTrue)
+        if ($this->inCondition and!$this->conditionIsTrue)
             return $this;
         $this->sql .= " < " . $this->quote($value);
 
@@ -1574,7 +1574,7 @@ class sql {
      * @return object the sql object.
      */
     public function between($min, $max) {
-        if ($this->inCondition and ! $this->conditionIsTrue)
+        if ($this->inCondition and!$this->conditionIsTrue)
             return $this;
         $min = $this->quote($min);
         $max = $this->quote($max);
@@ -1591,7 +1591,7 @@ class sql {
      */
     public function in($ids) {
 //        var_dump($ids);
-        if ($this->inCondition and ! $this->conditionIsTrue)
+        if ($this->inCondition and!$this->conditionIsTrue)
             return $this;
         $this->sql .= self::dbIN($ids);
         return $this;
@@ -1619,7 +1619,7 @@ class sql {
      * @return object the sql object.
      */
     public function notin($ids) {
-        if ($this->inCondition and ! $this->conditionIsTrue)
+        if ($this->inCondition and!$this->conditionIsTrue)
             return $this;
         $this->sql .= ' NOT ' . self::dbIN($ids);
         return $this;
@@ -1633,7 +1633,7 @@ class sql {
      * @return object the sql object.
      */
     public function like($string) {
-        if ($this->inCondition and ! $this->conditionIsTrue)
+        if ($this->inCondition and!$this->conditionIsTrue)
             return $this;
         $this->sql .= " LIKE " . $this->quote($string);
         return $this;
@@ -1647,7 +1647,7 @@ class sql {
      * @return object the sql object.
      */
     public function notLike($string) {
-        if ($this->inCondition and ! $this->conditionIsTrue)
+        if ($this->inCondition and!$this->conditionIsTrue)
             return $this;
         $this->sql .= "NOT LIKE " . $this->quote($string);
         return $this;
@@ -1662,7 +1662,7 @@ class sql {
      * @return object the sql object.
      */
     public function findInSet($str, $strList) {
-        if ($this->inCondition and ! $this->conditionIsTrue)
+        if ($this->inCondition and!$this->conditionIsTrue)
             return $this;
         $this->sql .= "FIND_IN_SET(" . $str . "," . $strList . ")";
     }
@@ -1675,7 +1675,7 @@ class sql {
      * @return object the sql object.
      */
     public function orderBy($order) {
-        if ($this->inCondition and ! $this->conditionIsTrue)
+        if ($this->inCondition and!$this->conditionIsTrue)
             return $this;
 
         $order = str_replace(array('|', '', '_'), ' ', $order);

+ 1 - 1
Gameserver/Public/gamesys/app/utils/dao.php

@@ -584,7 +584,7 @@ class dao {
         try {
             $method = $this->method;
             $this->reset();
-//            var_dump($sql);
+            var_dump($sql);
             if ($this->slaveDBH and $method == 'select') {
                 return $this->slaveDBH->query($sql);
             } else {