public virtual void RaiseError(int type, string message, BlockingCallback obj) { Program.Instance.Logger.Log(Everworld.Logging.Logger.LogLevel.Error, "ServerSession", "Error raised by server. {0}: {1}", type, message); if (type == 33) { ClearPendingCallbacks(); if (OnInvalidToken != null) OnInvalidToken(type, message, obj); } else if (type == 10) { ClearPendingCallbacks(); if (OnNewVersion != null) OnNewVersion(type, message, obj); } }
public BlockingCallback MakeBlockingRequest(Game.Requests.BaseRequest baseRequest) { BlockingCallback blocking = new BlockingCallback(baseRequest, this); MakeRequest(baseRequest, blocking); blocking.WaitEvent.WaitOne(); if (blocking.Result == null || blocking.Result.Result == null) { Program.Instance.Logger.Log(Everworld.Logging.Logger.LogLevel.Error, "ServerSession", "Result object was null."); return blocking; } double serverTime = (double)((blocking.Result.Result as FluorineFx.ASObject)["serverTime"]); double offset = serverTime - Everworld.Utility.Time.UnixTime(); _serverTimeOffset = offset; return blocking; }