fireOut() public static method

public static fireOut ( string eventname ) : void
eventname string
return void
Ejemplo n.º 1
0
        public override void onCreateAvatarResult(byte retcode, AVATAR_INFO info)
        {
            if (retcode == 0)
            {
                avatars.Add(info.dbid, info);
                Dbg.DEBUG_MSG("Account::onCreateAvatarResult: name=" + info.name);
            }
            else
            {
                Dbg.ERROR_MSG("Account::onCreateAvatarResult: retcode=" + retcode);
                if (retcode == 3)
                {
                    Dbg.ERROR_MSG("角色数量不能超过三个!");
                }
            }

            // ui event

            Event.fireOut("onCreateAvatarResult", new object[] { retcode, info, avatars });
        }
Ejemplo n.º 2
0
        public void onCreateAvatarResult(byte retcode, object info)
        {
            if (retcode == 0)
            {
                avatars.Add((UInt64)((Dictionary <string, object>)info)["dbid"], (Dictionary <string, object>)info);
                Dbg.DEBUG_MSG("Account::onCreateAvatarResult: name=" + (string)((Dictionary <string, object>)info)["name"]);
            }
            else
            {
                Dbg.ERROR_MSG("Account::onCreateAvatarResult: retcode=" + retcode);
                if (retcode == 3)
                {
                    Dbg.ERROR_MSG("角色数量不能超过三个!");
                }
            }

            // ui event

            Event.fireOut("onCreateAvatarResult", new object[] { retcode, info, avatars });
        }
Ejemplo n.º 3
0
        public void onAddBagItem(Dictionary <string, object> item)
        {
            Debug.LogWarning("get bag item " + item["name"] + " index is " + item["bagItemIndex"] + " count " + item["count"] + " stdMode " + item["stdMode"] + " func " + item["func"]);
            KnapsakItem bagItem = new KnapsakItem {
                serialnum   = (UInt64)item["serialnum"], tableId = (UInt32)item["tableId"], name = (string)item["name"], count = (Byte)item["count"],
                altnasIndex = (UInt32)item["altnasIndex"], bagFrameIndex = (Byte)item["bagFrameIndex"], bagItemIndex = (UInt16)item["bagItemIndex"], icon = (UInt32)item["icon"], modelId = (UInt32)item["modelId"],
                stdMode     = (Byte)item["stdMode"],
                weight      = (Byte)item["weight"],
                func        = (Byte)item["func"],
                PA1         = (UInt16)item["PA1"],
                PA2         = (UInt16)item["PA2"],
                MA1         = (UInt16)item["MA1"],
                MA2         = (UInt16)item["MA2"],
                PD1         = (UInt16)item["PD1"],

                PD2       = (UInt16)item["PD2"],
                MD1       = (UInt16)item["MD1"],
                MD2       = (UInt16)item["MD2"],
                HP        = (UInt32)item["HP"],
                MP        = (UInt32)item["MP"],
                Accurate  = (Byte)item["Accurate"],
                lucky     = (Byte)item["lucky"],
                holiness  = (Byte)item["holiness"],
                HPgen     = (Byte)item["HPgen"],
                MPgen     = (Byte)item["MPgen"],
                crit      = (Byte)item["crit"],
                need      = (Byte)item["need"],
                needLevel = (Byte)item["needLevel"],
                price     = (UInt32)item["price"],
                stock     = (Byte)item["stock"],
                script    = (string)item["script"],
            };

            //KnapSackInfo.inst.allKanpItems.Add(bagItem.bagFrameIndex, )
            if (!KnapSackInfo.inst.allKanpItems.ContainsKey(bagItem.bagFrameIndex))
            {
                KnapSackInfo.inst.allKanpItems.Add(bagItem.bagFrameIndex, new Dictionary <UInt16, KnapsakItem>());
            }
            KnapSackInfo.inst.allKanpItems[bagItem.bagFrameIndex].Add(bagItem.bagItemIndex, bagItem);
            Event.fireOut("AddBagItem", new object[] { this, bagItem.bagFrameIndex, bagItem.bagItemIndex });
        }
Ejemplo n.º 4
0
        public override void onReqAvatarList(AVATAR_INFOS_LIST infos)
        {
            avatars.Clear();
            Dbg.DEBUG_MSG("Account::onReqAvatarList: avatarsize=" + infos.values.Count);
            for (int i = 0; i < infos.values.Count; i++)
            {
                AVATAR_INFOS info = infos.values[i];
                Dbg.DEBUG_MSG("Account::onReqAvatarList: name" + i + "=" + info.name);
                avatars.Add(info.dbid, info);
            }

            // ui event
            Dictionary <UInt64, AVATAR_INFOS> avatarList = new Dictionary <UInt64, AVATAR_INFOS>(avatars);

            Event.fireOut("onReqAvatarList", new object[] { avatarList });

            if (infos.values.Count == 0)
            {
                return;
            }
        }
Ejemplo n.º 5
0
        //public void selectAvatarGame(UInt64 dbid)
        //{
        //    Dbg.DEBUG_MSG("Account::selectAvatarGame: dbid=" + dbid);
        //    baseCall("selectAvatarGame", dbid);
        //}

        public void onReqAvatarList(Dictionary <string, object> infos)
        {
            avatars.Clear();

            List <object> listinfos = (List <object>)infos["values"];

            Dbg.DEBUG_MSG("Account::onReqAvatarList: avatarsize=" + listinfos.Count);
            for (int i = 0; i < listinfos.Count; i++)
            {
                Dictionary <string, object> info = (Dictionary <string, object>)listinfos[i];
                Dbg.DEBUG_MSG("Account::onReqAvatarList: name" + i + "=" + (string)info["name"]);
                avatars.Add((UInt64)info["dbid"], info);
            }

            // ui event
            Dictionary <UInt64, Dictionary <string, object> > avatarList = new Dictionary <ulong, Dictionary <string, object> >(avatars);

            Event.fireOut("onReqAvatarList", new object[] { avatarList });

            // selectAvatarGame(avatars.Keys.ToList()[0]);
        }
Ejemplo n.º 6
0
        public override void onReqItemList(ITEM_INFO_LIST infos, ITEM_INFO_LIST equipInfos)
        {
            itemDict.Clear();
            List <ITEM_INFO> listinfos = infos.values;

            for (int i = 0; i < listinfos.Count; i++)
            {
                ITEM_INFO info = listinfos[i];
                itemDict.Add(info.UUID, info);
                itemIndex2Uids[info.itemIndex] = info.UUID;
            }
            equipItemDict.Clear();
            List <ITEM_INFO> elistinfos = equipInfos.values;

            for (int i = 0; i < elistinfos.Count; i++)
            {
                ITEM_INFO info = elistinfos[i];
                equipItemDict.Add(info.UUID, info);
                equipIndex2Uids[info.itemIndex] = info.UUID;
            }
            // ui event
            Event.fireOut("onReqItemList", new object[] { itemDict, equipItemDict });
        }
Ejemplo n.º 7
0
        public void _onConnectStatus(ConnectState state)
        {
            KBEngine.Event.deregisterIn(this);

            bool success = (state.error == "" && valid());

            if (success)
            {
                Dbg.DEBUG_MSG(string.Format("NetworkInterface::_onConnectStatus(), connect to {0} is success!", state.socket.RemoteEndPoint.ToString()));
                _packetReceiver = new PacketReceiver(this);
                _packetReceiver.startRecv();
            }
            else
            {
                Dbg.ERROR_MSG(string.Format("NetworkInterface::_onConnectStatus(), connect is error! ip: {0}:{1}, err: {2}", state.connectIP, state.connectPort, state.error));
            }

            Event.fireOut("onConnectStatus", new object[] { success });

            if (state.connectCB != null)
            {
                state.connectCB(state.connectIP, state.connectPort, success, state.userData);
            }
        }
Ejemplo n.º 8
0
        public void onReqItemList(Dictionary <string, object> infos, Dictionary <string, object> equipInfos)
        {
            itemDict.Clear();
            List <object> listinfos = (List <object>)infos["values"];

            for (int i = 0; i < listinfos.Count; i++)
            {
                Dictionary <string, object> info = (Dictionary <string, object>)listinfos[i];
                itemDict.Add((UInt64)info["UUID"], info);
                itemIndex2Uids[(Int32)info["itemIndex"]] = (UInt64)info["UUID"];
            }
            equipItemDict.Clear();
            List <object> elistinfos = (List <object>)equipInfos["values"];

            for (int i = 0; i < elistinfos.Count; i++)
            {
                Dictionary <string, object> info = (Dictionary <string, object>)elistinfos[i];
                equipItemDict.Add((UInt64)info["UUID"], info);
                equipIndex2Uids[(Int32)info["itemIndex"]] = (UInt64)info["UUID"];
            }
            // ui event
            //Dictionary<UInt64, Dictionary<string, object>> itemDicttmp = new Dictionary<ulong, Dictionary<string, object>>(itemDict);
            Event.fireOut("onReqItemList", new object[] { itemDict, equipItemDict });
        }
Ejemplo n.º 9
0
        public override void equipItemRequest_re(ITEM_INFO itemInfo, ITEM_INFO equipItemInfo)
        {
            Event.fireOut("equipItemRequest_re", new object[] { itemInfo, equipItemInfo });
            UInt64 itemUUid      = itemInfo.UUID;
            UInt64 equipItemUUid = equipItemInfo.UUID;

            if (itemUUid == 0 && equipItemUUid != 0)//带上装备
            {
                equipItemDict[equipItemUUid] = equipItemInfo;
                itemDict.Remove(equipItemUUid);
            }
            else if (itemUUid != 0 && equipItemUUid != 0)//替换装备
            {
                itemDict.Remove(equipItemUUid);
                equipItemDict[equipItemUUid] = equipItemInfo;
                equipItemDict.Remove(itemUUid);
                itemDict[itemUUid] = itemInfo;
            }
            else if (itemUUid != 0 && equipItemUUid == 0)//脱下装备
            {
                equipItemDict.Remove(itemUUid);
                itemDict[itemUUid] = itemInfo;
            }
        }
Ejemplo n.º 10
0
        public void equipItemRequest_re(Dictionary <string, object> itemInfo, Dictionary <string, object> equipItemInfo)
        {
            Event.fireOut("equipItemRequest_re", new object[] { itemInfo, equipItemInfo });
            UInt64 itemUUid      = (UInt64)itemInfo["UUID"];
            UInt64 equipItemUUid = (UInt64)equipItemInfo["UUID"];

            if (itemUUid == 0 && equipItemUUid != 0)//带上装备
            {
                equipItemDict[equipItemUUid] = equipItemInfo;
                itemDict.Remove(equipItemUUid);
            }
            else if (itemUUid != 0 && equipItemUUid != 0)//替换装备
            {
                itemDict.Remove(equipItemUUid);
                equipItemDict[equipItemUUid] = equipItemInfo;
                equipItemDict.Remove(itemUUid);
                itemDict[itemUUid] = itemInfo;
            }
            else if (itemUUid != 0 && equipItemUUid == 0)//脱下装备
            {
                equipItemDict.Remove(itemUUid);
                itemDict[itemUUid] = itemInfo;
            }
        }
Ejemplo n.º 11
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);
 }
Ejemplo n.º 12
0
 /// <summary>
 /// 恢复相应道具
 /// </summary>
 /// <param name="propList">需要恢复的道具列表</param>
 public override void onResetProps(PROP_LIST propList)
 {
     KBEDebug.LogFormat("Room::onResetProps");
     Event.fireOut("onResetProps", propList);
 }
Ejemplo n.º 13
0
 public override void onLoadingFinish(int suc)
 {
     Event.fireOut("onLoadingFinish", suc);
 }
Ejemplo n.º 14
0
 //游戏结束
 public override void playerGameOver()
 {
     Event.fireOut("playerGameOver");
 }
Ejemplo n.º 15
0
 public virtual void onRemoveSkill(Int32 skillID)
 {
     Dbg.DEBUG_MSG(className + "::onRemoveSkill(" + skillID + ")");
     Event.fireOut("onRemoveSkill", new object[] { this });
     SkillBox.inst.remove(skillID);
 }
Ejemplo n.º 16
0
 public virtual void onJump()
 {
     Dbg.DEBUG_MSG(className + "::onJump: " + id);
     Event.fireOut("otherAvatarOnJump", new object[] { this });
 }
Ejemplo n.º 17
0
 public override void __init__()
 {
     Event.fireOut("onLoginSuccessfully", new object[] { KBEngineApp.app.entity_uuid, id, this });
     baseCall("reqAvatarList");
 }
Ejemplo n.º 18
0
 public override void onModelIDChanged(UInt32 oldValue)
 {
     // Dbg.DEBUG_MSG(className + "::set_modelID: " + old + " => " + v);
     Event.fireOut("set_modelID", new object[] { this, modelID });
 }
Ejemplo n.º 19
0
 public override void onModelScaleChanged(Byte oldValue)
 {
     // Dbg.DEBUG_MSG(className + "::set_modelScale: " + old + " => " + v);
     Event.fireOut("set_modelScale", new object[] { this, modelScale });
 }
Ejemplo n.º 20
0
 public override void onTimerChanged(int sec)
 {
     KBEDebug.LogFormat("Room::onTimerChanged:{0}, name:{1}", sec);
     Event.fireOut("onTimerChanged", sec);
 }
Ejemplo n.º 21
0
 public override void onReachDestination(int arg1, int arg2)
 {
     Event.fireOut("Room::onReachDestination", arg1, arg2);
 }
Ejemplo n.º 22
0
 // ReSharper disable once InconsistentNaming
 public void onMainAvatarLeaveSpace()
 {
     Event.fireOut("onMainAvatarLeaveSpace");
 }
Ejemplo n.º 23
0
 public override void __init__()
 {
     Event.fireOut("onAvatarEnterWorld", new object[] { KBEngineApp.app.entity_uuid, id, this });
     combat = new CombatImpl(this);
 }
Ejemplo n.º 24
0
 public void BuyResult(int result)
 {
     Event.fireOut("BuyResult", new object[] { this, System.Convert.ToBoolean(result) });
 }
Ejemplo n.º 25
0
 // ReSharper disable once InconsistentNaming
 public void onMainAvatarEnterSpace(int spaceId, string spaceName)
 {
     Event.fireOut("onMainAvatarEnterSpace", spaceId, spaceName);
 }
Ejemplo n.º 26
0
 //监听大小变化
 public override void onPlayerScaleChanged(float oldValue)
 {
     Event.fireOut("updatePlayerScale", new object[] { this, this.playerScale });
 }
Ejemplo n.º 27
0
 public void DoDialog(System.String npcName, System.String dialog)
 {
     Event.fireOut("DoDialog", new object[] { this, npcName, dialog });
 }
Ejemplo n.º 28
0
 //监听显示等级变化
 public override void onPlayerLayerChanged(int oldValue)
 {
     Event.fireOut("updatePlayerLayer", new object[] { this, this.playerLayer });
 }
Ejemplo n.º 29
0
 public override void __init__()
 {
     base.__init__();
     Event.fireOut("onLoginSuccessfully", new object[] { KBEngineApp.app.entity_uuid, id, this });
 }
Ejemplo n.º 30
0
 //玩家复活
 public override void playerAlive(byte[] arg1)
 {
     Event.fireOut("onPlayerAlive", new object[] { this });
 }