package com.haxademic.demo.data;

import com.haxademic.core.app.P;
import com.haxademic.core.app.PAppletHax;
import com.haxademic.core.constants.AppSettings;
import com.haxademic.core.data.store.AppStoreDistributed;
import com.haxademic.core.data.store.IAppStoreListener;

public class Demo_AppStoreDistributed
extends PAppletHax
implements IAppStoreListener {
	public static void main(String args[]) { PAppletHax.main(Thread.currentThread().getStackTrace()[1].getClassName()); }
	
	
	protected void overridePropsFile() {
		p.appConfig.setProperty(AppSettings.SHOW_DEBUG, true );
		p.appConfig.setProperty(AppSettings.WIDTH, 400 );
	}

	public void setupFirstFrame() {
		P.storeDistributed = AppStoreDistributed.instance();
		P.storeDistributed.startServer();
		P.storeDistributed.startClient(null);
		P.store.addListener(this);
		P.println("MAKE SOCKET CLIENT RECONNETING LIKE SOLID SOCKET");
	}
	
	public void drawApp() {
		background(0);
		if(p.mouseX != p.pmouseX) P.storeDistributed.setNumber("mousePercentX()", p.mousePercentX());
		if(p.mouseY != p.pmouseY) P.storeDistributed.setNumber("mousePercentY()", p.mousePercentY());
		if(p.frameCount % 100 == 0) sendFrameMessage(); 
		P.store.showStoreValuesInDebugView();
	}
	
	protected void sendFrameMessage() {
		P.storeDistributed.setNumber("FRAME_COUNT", p.frameCount);
	}
	
	public void mouseClicked() {
		P.storeDistributed.setNumber("FRAME_CLICKED", p.frameCount);
	}
	
	/////////////////////////////////////////
	// AppStore callbacks
	/////////////////////////////////////////

	@Override
	public void updatedNumber(String key, Number val) {
//		p.debugView.setValue(key, val.floatValue());
	}

	@Override
	public void updatedString(String key, String val) {
//		p.debugView.setValue(key, val);
	}

	@Override
	public void updatedBoolean(String key, Boolean val) {
//		p.debugView.setValue(key, val);
	}	


}


@@ -826,73 +826,8 @@
 s);%0A
-%09%09P.println(%22MAKE SOCKET CLIENT RECONNETING LIKE SOLID SOCKET%22);%0A
 %09%7D%0A%09

Remove comment