Esempio n. 1
0
        public void S_C_NPC_Kill(CMD_SC_GF_NPC_KILL _npcKill)
        {
            int _serverID = (int)_npcKill.gsNpcId;
            int _chair    = (int)_npcKill.gsChairId;
            int _value    = (int)_npcKill.gsRate * (int)_npcKill.gsPower;

            // 普通击杀.
            if (_npcKill.gsFlag == 0)
            {
                if (CanonCtrl.Instance.singleCanonList[_chair] != null)
                {
                    NPC_Kill_Class.NPC_Kill(_chair, (int)_npcKill.gsRate, (int)_npcKill.gsPower, _serverID, (int)_npcKill.gsNPCType);
                }
            }
            // 缓存击杀.
            else
            {
                if (_chair == CanonCtrl.Instance.realCanonID)
                {
                    if (CanonCtrl.Instance.singleCanonList[_chair] != null)
                    {
                        NPC_Kill_Class.NPC_Kill_AddCacheInList(_chair, (int)_npcKill.gsRate, (int)_npcKill.gsPower, _serverID, (int)_npcKill.gsNPCType);
                    }
                    C_S_WinFromCache(_npcKill.gsNpcId, _npcKill.gsPower, _npcKill.gsRate);
                }
            }
        }
        private bool DidNPCKill(int wHandleCode, byte[] wByteBuffer, int wDataSize)
        {
            int dataLen = wByteBuffer.Length;

            if (dataLen < wDataSize)
            {
                Debug.LogError("User join in data Error!!");
                return(false);
            }

            CMD_SC_GF_NPC_KILL npcKill = GameConvert.ByteToStruct <CMD_SC_GF_NPC_KILL>(wByteBuffer, wByteBuffer.Length);

            if (onNPCKillEvent != null)
            {
                onNPCKillEvent(npcKill);
            }


            return(true);
        }