Fix typo when messages from players are written

This commit is contained in:
Andrew 2022-01-28 19:00:14 -05:00
parent 51a07a1f0d
commit d1db65dc9c
2 changed files with 9 additions and 1 deletions

View File

@ -46,6 +46,10 @@ class ServerOutBuf:
ServerOutBuf.lines[self.server_id] = []
self.lsi = 0
def clear_term(self):
self.line_buffer = ''
ServerOutBuf.lines[self.server_id] = []
def process_byte(self, char):
if char == os.linesep[self.lsi]:
self.lsi += 1
@ -76,7 +80,7 @@ class ServerOutBuf:
break
def new_line_handler(self, new_line):
new_line = re.sub('(\033\\[(0;)?[0-9]*[A-z]?(;[0-9])?m?)|(> )', '', new_line)
new_line = re.sub('(\033\\[(0;)?[0-9]*[A-z]?(;[0-9])?m?)', ' ', new_line)
new_line = re.sub('[A-z]{2}\b\b', '', new_line)
highlighted = helper.log_colors(html.escape(new_line))

View File

@ -17,6 +17,7 @@ from tornado.ioloop import IOLoop
#TZLocal is set as a hidden import on win pipeline
from tzlocal import get_localzone
from cron_validator import CronValidator
from app.classes.controllers.servers_controller import Servers_Controller
from app.classes.models.server_permissions import Enum_Permissions_Server
from app.classes.models.crafty_permissions import Enum_Permissions_Crafty
@ -357,6 +358,9 @@ class PanelHandler(BaseHandler):
if not superuser:
self.redirect("/panel/error?error=Unauthorized access to Terminal")
return
server_obj = Servers_Controller.get_server_obj(server_id)
if page_data['server_stats']['running']:
server_obj.clear_term()
if subpage == 'logs':
if not page_data['permissions']['Logs'] in page_data['user_permissions']: