Coder Social home page Coder Social logo

khangcodt / ezyfox-server Goto Github PK

View Code? Open in Web Editor NEW

This project forked from youngmonkeys/ezyfox-server

0.0 0.0 0.0 3.99 MB

a socket server (include SSL) supports for realtime game, MMORPG, message, chat and streaming data with tcp, udp and websocket

License: Apache License 2.0

Shell 0.06% Java 98.94% Groovy 0.07% HTML 0.89% Batchfile 0.03%

ezyfox-server's Introduction

ezyfox-server

Build Status

Documentation

  1. https://youngmonkeys.org/get-started/

  2. https://youngmonkeys.org/ezyfox-sever/

Synopsis

Ezyfox Server is a socket server. It supports TCP, UDP and Websocket protocol. It also provides manipulation beans, auto binding, auto implementation and more utilities.

Dependency

<dependency>
    <groupId>com.tvd12</groupId>
    <artifactId>ezyfox-server-embedded</artifactId>
    <version>1.1.9</version>
</dependency>

Benchmark

Ezyfox Server's benchmark with 1000 CCU broadcast messages in 1 hour on one VPS ram 512MB, CPU 1 core

Code Example

1. Create an app entry

public static class HelloAppEntry extends EzySimpleAppEntry {

    @Override
    protected String[] getScanableBeanPackages() {
        return new String[] {
                "com.tvd12.ezyfoxserver.embedded.test" // replace by your package
        };
    }

    @Override
    protected String[] getScanableBindingPackages() {
        return new String[] {
                "com.tvd12.ezyfoxserver.embedded.test" // replace by your package
        };
    }
    
    @Override
    protected EzyAppRequestController newUserRequestController(EzyBeanContext beanContext) {
        return EzyUserRequestAppSingletonController.builder()
                .beanContext(beanContext)
                .build();
    }
    
}

2. Create a plugin entry

public static class HelloPluginEntry extends EzySimplePluginEntry {

    @Override
    protected String[] getScanableBeanPackages() {
        return new String[] {
                "com.tvd12.ezyfoxserver.embedded.test" // replace by your package
        };
    }

}

3. Setup

EzyPluginSettingBuilder pluginSettingBuilder = new EzyPluginSettingBuilder()
        .name("hello")
        .addListenEvent(EzyEventType.USER_LOGIN)
        .entryLoader(HelloPluginEntryLoader.class);

EzyAppSettingBuilder appSettingBuilder = new EzyAppSettingBuilder()
        .name("hello")
        .entryLoader(HelloAppEntryLoader.class);

EzyZoneSettingBuilder zoneSettingBuilder = new EzyZoneSettingBuilder()
        .name("hello")
        .application(appSettingBuilder.build())
        .plugin(pluginSettingBuilder.build());

EzySimpleSettings settings = new EzySettingsBuilder()
        .zone(zoneSettingBuilder.build())
        .build();

4. Create and start a server

EzyEmbeddedServer server = EzyEmbeddedServer.builder()
        .settings(settings)
        .build();
server.start();

You can find full example here

Used by

  1. Free Chat
  2. Space Game Cocos2d-x
  3. Space Shooter Unity
  4. Lucky Wheel Phaser HTML5

Motivation

We are game server developers, We have a lot of online games and We must buy game server engine like SmarfoxServer or Photon but they are really expensive. We need make a change to help us and everyone. Free is good idea and We make Ezyfox server

API Reference

Tests

mvn test

Contributors

License

  • Apache License, Version 2.0

ezyfox-server's People

Contributors

tvd12 avatar sonph95 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.