<commit_before>package hxd.net;

class NetworkClient {

	var host : NetworkHost;
	var resultID : Int;
	public var seqID : Int;
	public var ownerObject : NetworkSerializable;

	public function new(h) {
		this.host = h;
	}

	public function sync() {
		host.fullSync(this);
	}

	@:allow(hxd.net.NetworkHost)
	function send(bytes : haxe.io.Bytes) {
	}

	public function sendMessage( msg : Dynamic ) {
		host.sendMessage(msg, this);
	}

	function error( msg : String ) {
		throw msg;
	}

	function processMessage( bytes : haxe.io.Bytes, pos : Int ) {
		var ctx = host.ctx;
		ctx.setInput(bytes, pos);
		var mid = ctx.getByte();
		switch( mid ) {
		case NetworkHost.SYNC:
			var o : hxd.net.NetworkSerializable = cast ctx.refs[ctx.getInt()];
			var old = o.__bits;
			var oldH = o.__host;
			o.__host = null;
			o.networkSync(ctx);
			o.__host = oldH;
			o.__bits = old;
		case NetworkHost.REG:
			var o : hxd.net.NetworkSerializable = cast ctx.getAnyRef();
			o.__host = host;
			host.makeAlive();
		case NetworkHost.UNREG:
			var o : hxd.net.NetworkSerializable = cast ctx.refs[ctx.getInt()];
			o.enableReplication = false;
			ctx.refs.remove(o.__uid);
		case NetworkHost.FULLSYNC:<commit_msg>minor<commit_after>package hxd.net;

class NetworkClient {

	var host : NetworkHost;
	var resultID : Int;
	public var seqID : Int;
	public var ownerObject : NetworkSerializable;

	public function new(h) {
		this.host = h;
	}

	public function sync() {
		host.fullSync(this);
	}

	@:allow(hxd.net.NetworkHost)
	function send(bytes : haxe.io.Bytes) {
	}

	public function sendMessage( msg : Dynamic ) {
		host.sendMessage(msg, this);
	}

	function error( msg : String ) {
		throw msg;
	}

	function processMessage( bytes : haxe.io.Bytes, pos : Int ) {
		var ctx = host.ctx;
		ctx.setInput(bytes, pos);
		var mid = ctx.getByte();
		switch( mid ) {
		case NetworkHost.SYNC:
			var o : hxd.net.NetworkSerializable = cast ctx.refs[ctx.getInt()];
			var old = o.__bits;
			var oldH = o.__host;
			o.__host = null;
			o.networkSync(ctx);
			o.__host = oldH;
			o.__bits = old;
		case NetworkHost.REG:
			var o : hxd.net.NetworkSerializable = cast ctx.getAnyRef();
			o.__host = host;
			host.makeAlive();
		case NetworkHost.UNREG:
			var o : hxd.net.NetworkSerializable = cast ctx.refs[ctx.getInt()];
			o.__host = null;
			ctx.refs.remove(o.__uid);
		case NetworkHost.FULLSYNC:
{'fraction_non_alphanumeric': 0.13135593220338984, 'fraction_numerical': 0.0, 'mean_word_length': 3.364140480591497, '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': '199490', 'n_tokens_mistral': 946, 'n_tokens_neox': 850, 'n_words': 203}