Пример #1
0
        static public void CallEvent(string objMgPath, string eventName, MulticastDelegate delgt, params object[] eventParams)
        {
            try
            {
                delgt.DynamicInvoke(eventParams);
                if (!PurviewMgr.IsMainHost)
                {
                    object[] newparams = new object[eventParams.Length];

                    for (int i = 0; i < eventParams.Length; i++)
                    {
                        if (eventParams[i] is IGameObj)
                        {
                            newparams[i] = new GameObjSyncInfo(((IGameObj)eventParams[i]).MgPath);
                        }
                        else
                        {
                            newparams[i] = eventParams[i];
                        }
                    }

                    // 通过网络协议传递给主机
                    SyncCasheWriter.SubmitNewEvent(objMgPath, eventName, newparams);
                }
            }
            catch (Exception ex)
            {
                Log.Write(ex.ToString());
            }
        }
Пример #2
0
        static public void CallEvent(string objMgPath, string eventName, MulticastDelegate delgt, params object[] eventParams)
        {
            try
            {
                delgt.DynamicInvoke(eventParams);
                if (!PurviewMgr.IsMainHost)
                {
                    object[] newparams = new object[eventParams.Length];

                    for (int i = 0; i < eventParams.Length; i++)
                    {
                        if (eventParams[i] is IGameObj)
                        {
                            newparams[i] = new GameObjSyncInfo(((IGameObj)eventParams[i]).MgPath);
                        }
                        else
                        {
                            newparams[i] = eventParams[i];
                        }

                    }

                    // 通过网络协议传递给主机
                    SyncCasheWriter.SubmitNewEvent(objMgPath, eventName, newparams);
                }
            }
            catch (Exception ex)
            {
                Log.Write(ex.ToString());
            }
        }
Пример #3
0
        private static object[] ConvertObjArg(object[] args)
        {
            object[] newparams = new object[args.Length];

            for (int i = 0; i < args.Length; i++)
            {
                if (args[i] is IGameObj)
                {
                    newparams[i] = new GameObjSyncInfo(((IGameObj)args[i]).MgPath);
                }
                else
                {
                    newparams[i] = args[i];
                }
            }
            return(newparams);
        }
Пример #4
0
        private static object[] ConvertObjArg(object[] args)
        {
            object[] newparams = new object[args.Length];

            for (int i = 0; i < args.Length; i++)
            {
                if (args[i] is IGameObj)
                {
                    newparams[i] = new GameObjSyncInfo(((IGameObj)args[i]).MgPath);
                }
                else
                {
                    newparams[i] = args[i];
                }

            }
            return newparams;
        }