/// <summary> /// Decodes this instance. /// </summary> public override void Decode() { base.Decode(); this._adminCommand = AdminCommandFactory.CreateDebugCommandByType(this.Stream.ReadVInt()); if (this._adminCommand != null) { this._adminCommand.Decode(this.Stream); } }
/// <summary> /// Called when a <see cref="SendGlobalChatLineMessage"/> is received. /// </summary> private void SendGlobalChatLineMessageReceived(SendGlobalChatLineMessage message) { string chatMessage = message.RemoveMessage(); if (chatMessage.StartsWith("/admin ", StringComparison.InvariantCultureIgnoreCase)) { AdminCommand adminCommand = AdminCommandFactory.CreateDebugCommandByName(chatMessage.Substring(7).ToLowerInvariant()); if (adminCommand != null) { if (adminCommand.GetServiceNodeType() != -1) { ExecuteAdminCommandMessage executeAdminCommandMessage = new ExecuteAdminCommandMessage(); executeAdminCommandMessage.SetDebugCommand(adminCommand); this._session.SendMessage(adminCommand.GetServiceNodeType(), executeAdminCommandMessage); return; } } } this._session.Room.ReceiveMessage(this._session.AvatarEntry, chatMessage); }