Beispiel #1
0
 /// <summary>
 /// 切换装备回调
 /// </summary>
 /// <param name="itemID">装备id</param>
 /// <param name="suc">结果: 0-成功, 1-未拥有</param>
 public override void onChangeEquip(int itemID, byte suc)
 {
     KBEDebug.LogFormat("onChangeEquip {0}, result is {1}", itemID, suc);
     KBEDebug.LogFormat("current equip, head: {0}, clothes: {1}, hand: {2}, shoe: {3}, bag: {4}",
                        currentItemDict.head, currentItemDict.clothes, currentItemDict.hand, currentItemDict.shoe, currentItemDict.bag);
     Event.fireOut("onChangeEquip", itemID, (int)suc);
 }
Beispiel #2
0
        public override void __init__()
        {
            if (isPlayer())
            {
                #region register
                //匹配
                Event.registerIn("StartMatching", this, "StartMatching");
                Event.registerIn("updateProgress", this, "updateProgress");

                //比赛
                Event.registerIn("updatePlayer", this, "updatePlayer");
                Event.registerIn("regGetProps", this, "regGetProps");
                Event.registerIn("regUseProp", this, "regUseProp");
                Event.registerIn("regPropResult", this, "regPropResult");
                Event.registerIn("reachDestination", this, "reachDestination");
                Event.registerIn("regGetGold", this, "regGetGold");
                Event.registerIn("regBuyEquip", this, "regBuyEquip");
                Event.registerIn("regChangeEquip", this, "regChangeEquip");
                #endregion register

                // 触发登陆成功事件
                Event.fireOut("onLoginSuccessfully", KBEngineApp.app.entity_uuid, id, this);
            }

            KBEDebug.LogFormat("gold: {0}", gold);
            KBEDebug.LogFormat("current equip, head: {0}, clothes: {1}, hand: {2}, shoe: {3}, bag: {4}",
                               currentItemDict.head, currentItemDict.clothes, currentItemDict.hand, currentItemDict.shoe, currentItemDict.bag);
        }
Beispiel #3
0
 /// <summary>
 /// 设置玩家的地图和模式编号
 /// </summary>
 /// <param name="mapNum">地图</param>
 /// <param name="modeNum">模式</param>
 public override void onMapModeChanged(int mapNum, int modeNum)
 {
     if (isPlayer())
     {
         KBEDebug.LogFormat("Account::设置玩家的地图为: {0}, 模式为: {1}", mapNum, modeNum);
         Event.fireOut("onMapModeChanged", mapNum, modeNum);
     }
 }
Beispiel #4
0
 public void updateProgress(int tprogerss)
 {
     if (progress < tprogerss)
     {
         KBEDebug.LogFormat("Account::Player:{0} now progress {1}, update to rogress:{2}", name, progress, tprogerss);
         progress = tprogerss;
         cellEntityCall.regProgress(progress);
     }
 }
Beispiel #5
0
 public override void __init__()
 {
     KBEDebug.LogFormat("Room::Init");
 }
Beispiel #6
0
 public override void onTimerChanged(int sec)
 {
     KBEDebug.LogFormat("Room::onTimerChanged:{0}, name:{1}", sec);
     Event.fireOut("onTimerChanged", sec);
 }
Beispiel #7
0
 /// <summary>
 /// 技能施放结果回调
 /// </summary>
 /// <param name="userID">使用者ID</param>
 /// <param name="targetID">技能目标ID</param>
 /// <param name="type">prop_type</param>
 /// <param name="suc">结算结果:0-命中, 1-未命中</param>
 public override void onPropResult(int userID, int targetID, int type, byte suc)
 {
     KBEDebug.LogFormat("Room::onPropResult {0} use prop hit {1} : {2}", userID, targetID, suc == 0 ? true : false);
     Event.fireOut("onPropResult", userID, targetID, type, (int)suc);
 }
Beispiel #8
0
 /// <summary>
 /// 恢复相应道具
 /// </summary>
 /// <param name="propList">需要恢复的道具列表</param>
 public override void onResetProps(PROP_LIST propList)
 {
     KBEDebug.LogFormat("Room::onResetProps");
     Event.fireOut("onResetProps", propList);
 }
Beispiel #9
0
 public override void onEnterWorld()
 {
     base.onEnterWorld();
     KBEDebug.LogFormat("Room::onEnterWorld, room: {0}", id);
     // Event.fireOut("onEntityEnterWorld", KBEngineApp.app.entity_uuid, roomNo, this);
 }
Beispiel #10
0
        // public override void onProgressChanged(int oldValue)
        // {
        //     KBEDebug.LogFormat("Player:{0} onProgressChanged:{1}", name, progress);
        // }
        #endregion Matching Send

        #region Matching Callback
        public override void onEnterWorld()
        {
            base.onEnterWorld();
            KBEDebug.LogFormat("Account::onEnterWorld, id: {0},  name: {1},  roomNo: {2}", id, name, roomNo);
            Event.fireOut("onEntityEnterWorld", KBEngineApp.app.entity_uuid, roomNo, this);
        }
Beispiel #11
0
 /// <summary>
 /// 玩家登陆时在服务器中的状态
 /// </summary>
 /// <param name="arg1">0-未登录或未匹配; 1-匹配但未比赛; 2-比赛中</param>
 public override void onLoginState(int arg1)
 {
     KBEDebug.LogFormat("Account::onLoginState : {0}", arg1);
     Event.fireOut("onLoginState", arg1);
 }
Beispiel #12
0
 /// <summary>
 /// 得到金币回调
 /// </summary>
 /// <param name="tGold"></param>
 public override void onGetGold(int tGold)
 {
     KBEDebug.LogFormat("onGetGold {0}", tGold);
     Event.fireOut("onGetGold", tGold);
 }
Beispiel #13
0
 /// <summary>
 /// 切换装备
 /// </summary>
 /// <param name="itemID">装备id</param>
 public void regChangeEquip(int itemID)
 {
     KBEDebug.LogFormat("regChangeEquip: {0}", itemID);
     baseEntityCall.regChangeEquip(itemID);
 }
Beispiel #14
0
 /// <summary>
 /// 得到金币
 /// </summary>
 /// <param name="tGold"></param>
 public void regGetGold(int tGold)
 {
     KBEDebug.LogFormat("Account::regGetGold: {0}", tGold);
     baseEntityCall.regGetGold(tGold);
 }
Beispiel #15
0
 /// <summary>
 /// 有玩家施放技能
 /// </summary>
 /// <param name="arg1">使用者ID</param>
 /// <param name="arg2">技能目标ID</param>
 /// <param name="arg3">prop_type</param>
 /// <param name="arg4">使用技能时坐标</param>
 public override void onUseProp(int arg1, int arg2, int arg3, Vector3 arg4)
 {
     KBEDebug.LogFormat("Account::{0} use prop {1} to {2}, pos is {3}", arg1, arg2, arg3, arg4);
     Event.fireOut("onUseProp", arg1, arg2, arg3, arg4);
 }
Beispiel #16
0
 /// <summary>
 /// 玩家获得道具, 不一定是当前player
 /// </summary>
 /// <param name="arg1">id</param>
 /// <param name="arg2">prop_key</param>
 /// <param name="arg3">prop_type</param>
 public override void onGetPropsClient(int arg1, string arg2, int arg3)
 {
     KBEDebug.LogFormat("Account::onGetPropsClient, self id: {3}, owner id:{0}, key:{1}, type:{2}", arg1, arg2, arg3, id);
     Event.fireOut("onGetProps", arg1, arg2, arg3);
 }