<commit_before>import plugins, packetFactory
import data.clients, data.players

@plugins.onConnectionHook
def checkConfig(user):
	if user.playerId in data.clients.connectedClients:
		clientPrefs = data.clients.connectedClients[user.playerId].getPrefs()
		if 'globalChat' not in clientPrefs:
			clientPrefs['globalChat'] = True
		data.clients.connectedClients[user.playerId].setPrefs(clientPrefs)

@plugins.commandHook("gon")
def enable(context, params):
	prefs = data.clients.connectedClients[context.playerId].getPrefs()
	prefs['globalChat'] = True
	context.sendCryptoPacket(packetFactory.ChatPacket(context.playerId, "[GlobalChat] Global chat enabled for this session.").build())
	data.clients.connectedClients[context.playerId].setPrefs(prefs)

@plugins.commandHook("goff")
def disable(context, params):
	prefs = data.clients.connectedClients[context.playerId].getPrefs()<commit_msg>Default global chat to false for now.<commit_after>import plugins, packetFactory
import data.clients, data.players

@plugins.onConnectionHook
def checkConfig(user):
	if user.playerId in data.clients.connectedClients:
		clientPrefs = data.clients.connectedClients[user.playerId].getPrefs()
		if 'globalChat' not in clientPrefs:
			clientPrefs['globalChat'] = False
		data.clients.connectedClients[user.playerId].setPrefs(clientPrefs)

@plugins.commandHook("gon")
def enable(context, params):
	prefs = data.clients.connectedClients[context.playerId].getPrefs()
	prefs['globalChat'] = True
	context.sendCryptoPacket(packetFactory.ChatPacket(context.playerId, "[GlobalChat] Global chat enabled for this session.").build())
	data.clients.connectedClients[context.playerId].setPrefs(prefs)

@plugins.commandHook("goff")
def disable(context, params):
	prefs = data.clients.connectedClients[context.playerId].getPrefs()
{'fraction_non_alphanumeric': 0.12075681691708402, 'fraction_numerical': 0.0, 'mean_word_length': 7.561904761904762, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5420331', 'n_tokens_mistral': 573, 'n_tokens_neox': 560, 'n_words': 97}