private void OnError(object sender, ErrorArg e)
        {
            DebugUtil.LogError <RealTimeHandler>(DebugLocation.RealTime, "OnError", e.Error);
            if (PlayerHash != -1)
            {
                try
                {
                    if (GameService.HandlerType == EventHandlerType.NativeContext)
                    {
                        RealTimeEventHandlers.Reconnected?.Invoke(null, ReconnectStatus.Connecting);
                    }
                    else
                    {
                        GameService.SynchronizationContext?.Send(
                            delegate { RealTimeEventHandlers.Reconnected?.Invoke(null, ReconnectStatus.Connecting); },
                            null);
                    }
                }
                catch (Exception)
                {
                    // ignored
                }
            }

            if (_isDisposed)
            {
                return;
            }
            Init(true);
        }
        protected void OnClosed(ErrorArg errorArg)
        {
            IsAvailable = false;

            if (Type == GSLiveType.Command)
            {
                CommandEventHandlers.GsCommandClientError?.Invoke(null, new GameServiceException(errorArg.Error));
            }
            else
            {
                TurnBasedEventHandlers.GsTurnBasedClientError?.Invoke(null, new GameServiceException(errorArg.Error));
            }
        }
示例#3
0
 protected void OnClosed(ErrorArg errorArg)
 {
     Error?.Invoke(this, errorArg);
 }
示例#4
0
文件: MaxAmp2.cs 项目: maximkha/mcs
            private void HandleError(ErrorArg EA, string Errornm)
            {
                Func <ErrorArg, int> Callback = ErrorHandlers[Errornm];

                Callback.Invoke(EA);
            }