use of com.tvd12.ezyfoxserver.client.entity.EzyObject in project dahlia by youngmonkeys.
the class FieldSimpleWriters method write.
@Override
public void write(FileProxy file, Map<String, FieldSetting> settings, EzyObject values) throws IOException {
for (Entry<String, FieldSetting> e : settings.entrySet()) {
Object value = values.get(e.getKey());
write(file, e.getKey(), e.getValue(), value);
}
}
use of com.tvd12.ezyfoxserver.client.entity.EzyObject in project ezyfox-server-example by tvd12.
the class SocketClientSetup method setup.
public void setup(EzyClient client, boolean useUdp) {
int count = counter.incrementAndGet();
EzySetup setup = client.setup();
setup.addDataHandler(EzyCommand.HANDSHAKE, new HandshakeHandler(count));
setup.addDataHandler(EzyCommand.LOGIN, new LoginSuccessHandler(useUdp));
setup.addDataHandler(EzyCommand.UDP_HANDSHAKE, new UdpHandshakeHandler());
setup.addDataHandler(EzyCommand.APP_ACCESS, new AccessAppHandler(useUdp, messageCount, executorService));
EzyAppSetup appSetup = setup.setupApp("hello-world");
appSetup.addDataHandler("broadcastMessage", (app, data) -> {
// String message = ((EzyObject)data).get("message", String.class);
// System.out.println("tcp > server response: " + message);
});
appSetup.addDataHandler("udpBroadcastMessage", (app, data) -> {
// String message = ((EzyObject)data).get("message", String.class);
// System.out.println("udp > server response: " + message);
});
}
use of com.tvd12.ezyfoxserver.client.entity.EzyObject in project ezyfox-server-android-client by youngmonkeys.
the class EzyArrayToList method toList.
@SuppressWarnings({ "rawtypes", "unchecked" })
public List toList(EzyArray array) {
List answer = new ArrayList<>();
for (int i = 0; i < array.size(); ++i) {
Object item = array.get(i);
Object sitem = item;
if (item != null) {
EzyObjectToMap objectToMap = EzyObjectToMap.getInstance();
if (item instanceof EzyObject)
sitem = objectToMap.toMap((EzyObject) item);
else if (item instanceof EzyArray)
sitem = toList((EzyArray) item);
}
answer.add(sitem);
}
return answer;
}
use of com.tvd12.ezyfoxserver.client.entity.EzyObject in project ezyfox-server-android-client by youngmonkeys.
the class EzyEntityObjects method newObject.
public static EzyObject newObject(Map map) {
EzyObject obj = EzyEntityFactory.newObject();
obj.putAll(map);
return obj;
}
use of com.tvd12.ezyfoxserver.client.entity.EzyObject in project ezyfox-server-android-client by youngmonkeys.
the class EzyEntityObjects method newObject.
public static EzyObject newObject(Object key, Object value) {
EzyObject obj = EzyEntityFactory.newObject();
obj.put(key, value);
return obj;
}
Aggregations