예제 #1
0
 private void Awake()
 {
     if (console == null)
     {
         console = FindObjectOfType <KConsoleWindow>();
     }
     KDebug.Assert(console != null, "ConsoleInputListener:: Console reference is Null!!");
 }
                CommandResult ICommand.Run(params string[] a_args)
                {
                    string final = string.Empty;

                    for (int i = 0; i < a_args.Length; ++i)
                    {
                        final += a_args[i] + " ";
                    }

                    KDebug.Log(final);
                    return(new CommandResult(string.Empty));
                }
예제 #3
0
    public static void requestAddToMap(string mapid, Vector3 position)
    {
        KDebug.Log(Application.loadedLevelName + "  =============== song =====  5 ");
        //	Debug.Log("------------------------------------------------------------------------------------;sdkfj;alsdflk;asjdflkajsdfl;kajsdpf;jw[kdf';asdkf;djg;oiifhsfhofdklhg");
        ZMNetData zd = new ZMNetData((int)OpCode.CLIENT_ADD_TO_MAP);

        zd.writeString(mapid);
        zd.putFloat((float)position.x);
        zd.putFloat((float)position.y);
        zd.putFloat((float)position.z);
        ZealmConnector.sendRequest(zd);
    }
예제 #4
0
        /// <summary>
        /// Syscall interrupt handler. Dispatcher for every SysCall.
        /// </summary>
        private static void InterruptHandler(ref IDTStack stack, SysCallCallingType callingMethod)
        {
            var args = new SystemMessage
            {
                Target = (SysCallTarget)stack.EAX,
                Arg1   = stack.EBX,
                Arg2   = stack.ECX,
                Arg3   = stack.EDX,
                Arg4   = stack.ESI,
                Arg5   = stack.EDI,
                Arg6   = stack.EBP,
            };

            var commandNum = GetCommandNum(args.Target);

            if (KConfig.Log.SysCall)
            {
                KernelMessage.WriteLine("Got SysCall cmd={0} arg1={1:X8} arg2={2:X8} arg3={3:X8} arg4={4:X8} arg5={5:X8} arg6={6:X8}", (uint)args.Target, args.Arg1, args.Arg2, args.Arg3, args.Arg4, args.Arg5, args.Arg6);
            }

            Scheduler.SaveThreadState(Scheduler.GetCurrentThread().ThreadID, ref stack);

            var info = Commands[commandNum];

            if (info == null)
            {
                Panic.Error("Undefined SysCall");
            }

            var ctx = new SysCallContext
            {
                CallingType = callingMethod,
                Debug       = info.Debug,
            };

            if (info.Debug)
            {
                KDebug.DumpStats();
                Debug.Nop();
            }

            var result = info.Handler(ref ctx, ref args);

            if (KConfig.Log.SysCall)
            {
                KernelMessage.WriteLine("Result of Syscall cmd={0}: {1:X8}", (uint)args.Target, result);
            }

            stack.EAX = result;
        }
예제 #5
0
 public static void clearAOIObject()
 {
     KDebug.WriteLog("=======================clearAOIObject======================");
     aoiObject.Clear();
 }
예제 #6
0
//	IEnumerator YieldrefreshUnit(ZMNetData mData){
//		yield return StartCoroutine(refreshUnit(mData));
//	}

    int refreshUnit(ZMNetData mData)
    {
//		yield return new WaitForEndOfFrame();
        Quaternion rotation        = Quaternion.identity;
        bool       visible         = mData.readBoolean();
        int        instanceID      = mData.readInt();
        int        playerDuelState = mData.readInt();
        bool       isHangUp        = mData.readBoolean();
        int        forceValue      = mData.readInt();
        //string isrunning = mData.readString();
        int    positionX    = mData.readInt();
        float  positionY    = mData.getFloat() + 0.3f;
        int    positionZ    = mData.readInt();
        bool   isRiding     = mData.readBoolean();
        string selectMounts = mData.readString();
        //Debug.Log("==============" + positionX + "," + positionY+","+positionZ + "==================");
        Vector3 position = new Vector3(positionX, positionY, positionZ);
        int     playerID = mData.readInt();

        //NGUIDebug.Log("--------------------===============>visble:"+visible);
        if (visible)
        {
            //NGUIDebug.Log("@refreshUnit@\n");
            int aoiCount = ObjectAccessor.aoiObject.Count;
            KDebug.WriteLog("#######################################################" + aoiCount);
            //int settingCount = 10; //todo read setting
            int settingCount = PlayerPrefs.GetInt("HideOtherPlayers", 0) == 1 ? -1 : PlayerPrefs.GetInt("PlayerNum", 5);
            if (aoiCount > settingCount - 1)
            {
//                KDebug.WriteLog("#######################################################" + aoiCount + "         " + settingCount );
                return(-1);
            }
            else
            {
                int    proID         = mData.readInt();
                string name          = mData.readString();
                string equipItem     = mData.readString();
                string EquipItemSoul = mData.readString();


                string prefabName  = "";    //= mData.readString();
                int    skillBranch = 0;
                string skill       = "";
                int    proId       = 0;
                int    playerLevel = 0;
                int    Stamina     = 0;
                int    Strength    = 0;
                int    Agility     = 0;
                int    Intellect   = 0;
                int    Focus       = 0;
                int    hp          = 0;
                int    MaxHp       = 0;
                int    MaxMana     = 0;
                int    rank        = 0;

                string selectTitle = mData.readString();
                string title       = mData.readString();
                string VIPLevel    = mData.readString();
                string GuildName   = mData.readString();
                string PVPmyTeam   = mData.readString();

                string battlefieldLabel = "";
                if (proID == 1)
                {
                    prefabName = "ZhanShi";
                }
                else if (proID == 2)
                {
                    prefabName = "YouXia";
                }
                else if (proID == 3)
                {
                    prefabName = "FaShi";
                }

                object[] prefabInit = new object[2];
                prefabInit[0] = prefabName;
                prefabInit[1] = instanceID;
                allRes.SendMessage("PlayerprefabInit", prefabInit, SendMessageOptions.DontRequireReceiver);

                GameObject resourceGameObject = ObjectAccessor.getPrefab(prefabName);
                //			GameObject go = (GameObject)GameObject.Instantiate(resourceGameObject, position, rotation);
                GameObject go = PhotonNetwork.InstantiateSceneObject(prefabName, position, rotation, 0, null);

                if (go)
                {
                    ObjectAccessor.addAOIObject(instanceID, go);
                }

                playerLevel = mData.readInt();
                bool isInTown = mData.readBoolean();
                if (!isInTown)
                {
                    hp               = mData.readInt();
                    skillBranch      = mData.readInt();
                    skill            = mData.readString();
                    proId            = mData.readInt();
                    Stamina          = mData.readInt();
                    Strength         = mData.readInt();
                    Agility          = mData.readInt();
                    Intellect        = mData.readInt();
                    Focus            = mData.readInt();
                    battlefieldLabel = mData.readString();
                    MaxHp            = mData.readInt();
                    MaxMana          = mData.readInt();
                    rank             = mData.readInt();
                }
                //   NGUIDebug.Log("=========================================================>isInTown:"+isInTown);

                //			Debug.Log (isInTown);
                //			Debug.Log (skillBranch);
                //			Debug.Log (skill);
                //			Debug.Log (proId);
                //			Debug.Log (playerLevel);
                //			Debug.Log (Stamina);
                //			Debug.Log (Strength);
                //			Debug.Log (Agility);
                //			Debug.Log (Intellect);
                //			Debug.Log (Focus);
                if (go)
                {
                    object[] objs = new object[27];
                    objs[0]  = proID;
                    objs[1]  = name;
                    objs[2]  = equipItem;
                    objs[3]  = EquipItemSoul;
                    objs[4]  = skillBranch;
                    objs[5]  = skill;
                    objs[6]  = playerLevel;
                    objs[7]  = Stamina;
                    objs[8]  = Strength;
                    objs[9]  = Agility;
                    objs[10] = Intellect;
                    objs[11] = Focus;
                    objs[12] = playerID;
                    objs[13] = battlefieldLabel;
                    objs[14] = hp;

                    objs[15] = selectTitle;
                    objs[16] = title;
                    objs[17] = VIPLevel;
                    objs[18] = GuildName;
                    objs[19] = PVPmyTeam;
                    if (isRiding)
                    {
                        objs[20] = 1;
                    }
                    else
                    {
                        objs[20] = 0;
                    }
                    objs[21] = selectMounts;
                    objs[22] = MaxHp;
                    objs[23] = MaxMana;
                    objs[24] = forceValue;
                    objs[25] = rank;
                    objs[26] = playerDuelState;
                    go.SendMessage("SetBasisValue", objs, SendMessageOptions.DontRequireReceiver);

                    /*if(! isRiding && isrunning != ""){
                     *      go.SendMessage("SyncAnimation" , isrunning , SendMessageOptions.DontRequireReceiver);
                     * }*/
//					if(isHangUp){
//						go.SendMessage("YieldSitDown" , SendMessageOptions.DontRequireReceiver);
//					}else{
//						go.SendMessage("YieldStandUp" , SendMessageOptions.DontRequireReceiver);
//					}
                }
            }
        }
        else
        {
            GameObject objDes = ObjectAccessor.getAOIObject(instanceID);
            if (objDes != null)
            {
                objDes.SendMessage("ClearPetArray", SendMessageOptions.DontRequireReceiver);
                Destroy(objDes);
                ObjectAccessor.removeAOIObject(instanceID);
            }
            //todo remove
        }
        return(0);
    }