Giter Site home page Giter Site logo

youngmonkeys / ezyfox-server Goto Github PK

View Code? Open in Web Editor NEW
550.0 12.0 95.0 4.84 MB

A socket server (include SSL) supports realtime application, realtime game, MMORPG, messaging, chat and streaming data with TCP, UDP and Websocket

License: Apache License 2.0

Shell 0.01% Java 99.25% Groovy 0.05% HTML 0.69% Batchfile 0.01%
socket-server tcp-server websocket-server live-streaming socket-io udp-server game-server multiplayer-game-server realtime networking

ezyfox-server's Introduction

EzyFox Server

GitHub release Java CI with Maven License GitHub star chart

⚡ Empowering real-time experiences effortlessly ⚡

📖 Introduction

An Open Solution for all your Real-Time needs.

To develop online games rapidly, developers often need to use a game server engine like SmartFoxServer or Photon. Unfortunately, these engines come with a high price tag, especially as more and more users engage with our products. That's why we developed the EzyFox ecosystem, which aims to be free and open for anyone interested in building multiplayer games and applications.

The EzyFox ecosystem supports a wide range of essential components for enterprise product development, including TCP, UDP, WebSocket protocols with SSL encryption, HTTP RESTful API, Remote Procedure Call (RPC) protocol, Database Interaction, Memory Caching, and Message Queue.

With the EzyFox ecosystem, we can avoid the headache of choosing which technologies to use to manage and scale up an application, allowing us to focus solely on implementing business logic.

✨ Features

  • Core Container & Dependency Injection: Includes bean manipulation, auto-binding, auto-implementation, and more.
  • Multiple Communication Protocols: Supports TCP, UDP, WebSocket, and HTTP.
  • Traffic Encryption: Allows for traffic between clients and servers to be encrypted using SSL.
  • Multiple Client SDKs: Includes Android, iOS, Unity, React, C++, Flutter, and more.

🚀 Getting Started

Let's see how we can get started in just 5 minutes!

📑 Documentation

📐 Architecture Overview


  • An EzyFox server contains multiple zones.
  • A zone contains its user manager, multiple apps and multiple plugins.
  • An app contains its user manager.
  • A plugin only handles events and clients' requests.

See more detail about the sever architecture here

✏️ Examples

  1. Free Chat
  2. Space Game Cocos2d-x
  3. Space Shooter Unity
  4. Lucky Wheel Phaser HTML5
  5. One Two Three Simple Game Server
  6. Easy Smashers Unity

📜 Tutorials

  1. EzyChat: A simple real-time chat application
  2. EzyRoulette: A simple lucky wheel game

🔥 Benchmark

Ezyfox Server's benchmark involved broadcasting messages to 1000 concurrent users in one hour on a VPS with 512MB of RAM and 1 CPU core. You can watch this video to see how we conducted the test.

🔌 Client SDKs

  1. Android
  2. C/C++
  3. CSharp
  4. Flutter
  5. Java
  6. Javascript ECMAScript 6
  7. Javascript
  8. Netty
  9. Swift
  10. React Native

🎯 Game libraries

Game Box: Provide Entities, Managers, Handlers, Maths classes for many types of online games (Turn-based (Located), MMO, Normal), you can take a look here to get more details.

🔨 Development

Environment

  • JDK 1.8
  • Maven

Tests

Navigate to the source folder and run:

mvn test

🎉 Who uses EzyFox?

As the EzyFox community grows, we'd love to see how our open-source framework can help you and your organization solve real-world problems. Feel free to send a PR with your project name/organization name if you are using EzyFox.

Currently, the following organizations are officially using EzyFox:

  1. Defi Warrior
  2. EzySmashers
  3. ...
  4. Your awesome project ✨

💖 Support Us

Make a Meaningful Donation 😎

Currently, our operating budget is fully supported by our own salaries, and all product development is still based on voluntary contributions from a few organization members. The low budget is causing significant difficulties for us. Therefore, with a clear roadmap and an ambitious goal to provide intellectual products for the community, we would greatly appreciate your support in the form of a donation to help us take further steps. Thank you in advance for your meaningful contributions!

☎️ Contact Us

ezyfox-server's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ezyfox-server's Issues

Support Docker Build

Is your feature request related to a problem? Please describe.
Developers currently face challenges while setting up the development environment for the project. There are multiple dependencies, and the setup process can be time-consuming and error-prone, especially when working on different platforms or operating systems. This complexity hinders the onboarding of new contributors and slows down the development process.

Describe the solution you'd like
I propose adding a Dockerfile to the project's repository. The Dockerfile will define a containerized development environment with all the necessary dependencies and configurations to run the project seamlessly. By using Docker, developers can easily set up a consistent environment across different platforms, avoiding the hassles of dealing with dependencies manually.

Describe alternatives you've considered

  1. Manual Setup: Developers could continue setting up their development environment manually, but this approach is prone to errors and can lead to inconsistencies across different setups.
  2. Virtual Environments: Some developers might choose to use virtual environments, but this still requires installing and managing dependencies on the host system, leading to potential conflicts and difficulties in reproducing the same environment elsewhere.

Additional context
Adding a Dockerfile will not only simplify the development setup but also streamline the continuous integration and deployment processes. Developers will be able to use Docker-compose to manage complex setups with ease, further enhancing the project's development experience. Additionally, the Dockerfile can be accompanied by clear documentation on how to use it, making it accessible to both experienced and new contributors.

By adopting Docker, we can significantly improve the development workflow and foster a more collaborative and efficient development community around the project.

Thank you for considering this feature request. If there are any questions or suggestions, please feel free to ask or provide feedback.

Allows client send encryption algorithm in handshake request

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Demo link is not found

Describe the bug
image
To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Add getExecutorService method to EzyZoneChildContext

Is your feature request related to a problem? Please describe.
Currently, dev need to cast to use: ((EzySimpleAppContext)ctx).getExecutorService();

Describe the solution you'd like
Add getExecutorService method to EzyZoneChildContext to remove cast.

Describe alternatives you've considered
No

Additional context
No

Plugin 'org.apache.maven.plugins:maven-antrun-plugin:3.0.0' not found

Describe the bug
I use the server from the EzySmashers demo project and get two errors in File pom.xml:
Plugin 'org.apache.maven.plugins:maven-antrun-plugin:3.0.0' not found:84
Plugin 'org.apache.maven.plugins:maven-antrun-plugin:3.0.0' not found:85

To Reproduce
Steps to reproduce the behavior:

  1. Used IDE : IntelliJ IDEA Community Edition 2023.1.2
  2. Java version: 11.0.16.1
  3. maven-3.9.2
  4. See the error

Expected behavior
No errors

Screenshots
no screenshots

Desktop (please complete the following information):
mvn -v
Apache Maven 3.9.2 (c9616018c7a021c1c39be70fb2843d6f5f9b8a1c)
Maven home: C:\apache-maven-3.9.2
Java version: 11.0.16.1, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk-11.0.16.1
Default locale: de_DE, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

Smartphone (please complete the following information):
no information

Additional context
Is there some incompatibility or do i need other Java, Maven versions?

It is not possible to run two zones on one server with correct behaviour

Describe the bug
I have two Seperate Apps one for Account related things and one for Game related things. The works perfect from the IDE but not both at the same time because they use the same port.
So i deploy the server created two Zones:

		<zone>
			<name>free-game-server</name>
			<config-file>free-game-server-zone-settings.xml</config-file>
			<active>true</active>
		</zone>
		<zone>
			<name>free-account-server</name>
			<config-file>free-account-server-zone-settings.xml</config-file>
			<active>true</active>
		</zone>

The client send login request to the free-game-server with the correct Zone/App to the Game Server but the ezyfox server internal routes to the false free-account-server login plugin on the other Zone/App.

To Reproduce
if you want see the behaviour:

  1. Get a copy of the project https://github.com/Assambra/Free-MMORPG/releases/tag/0.10.0
  2. follow my README to create the database, mail stuff and deploy both servers into the ezyfox server
  3. Create a new Account
  4. Login (this normal should lead you to free-game-server login) and login to the Game-Server
  5. You will get some Error not authenticated, this happends because the Server use the Login from the Free-Account-Server
  6. Try to login again with User: Guest# Password: Assambra this is only allowed if the Client send Login to App/Zone free-account-server (no database login) and you see the Ezyfox server can't handle different Zones on one Server or doesnt route to the right App/Zone

Expected behavior
if the client send login with Zone/App it should lead on the Server to the right App/Zone

Screenshots

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context

Board cast for AppUserAdded

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

The client no longer receives position data for a short period of time

Describe the bug
I have strange behavior when I deploy the server and load it onto an external server and let it run. After about 10-15 seconds, the client will not receive any position data, but the server will continue to receive input data. I use the game box and can't log whether the error is that the messages are not being sent correctly or it's the server, e.g. due to packet drop/loss, firewall. No error message is output on the server and or client.
The error does not occur when the server is tested in the IDE or on a local deployed Server on my PC.

To Reproduce
Steps to reproduce the behavior:
I don't know how to reproduce it, or what additional information will help to reproduce this behaviour

Expected behavior
The client should allways reseive position updates from the Server.

Screenshots

Desktop (please complete the following information):

  • Windows 10
  • Works if runs the server locally in IDE IntellJ
  • Works on locally deploy and run the server

Smartphone (please complete the following information):

  • none information

Server (please complete the following information):

  • Hoster Hetzner
  • Virtual machine on a proxmox Server Host
  • OS Ubuntu 18.4.6 LTS
  • Java: openjdk version "1.8.0_362"
  • MongoDB

Additional context
Of course, it cannot be ruled out that it is the server or a setting from the host, for example. Firewall, incorrectly set route or something else. But I'm really confused as to where I can look for the error or how I can debug it.

Lỗi không add packages to scan

Nguyên nhân

  • Quên không set

Các file bị ảnh hưởng

  1. EzySimpleAppEntry
  2. EzySimplePluginEntry

Cách fix

  • Thay thế hàm beanContextBuilder.addAllClasses(reflection); bằng beanContextBuilder.scan(scanablePackages);
  • Tạo package com.tvd12.ezyfoxserver.support.v120.test.entry trong thư mục ezyfox-server-support/src/test
  • Thêm <package name="com.tvd12.ezyfoxserver.support.v120.test.entry"/> vào AllTests.tng.xml
  • Tạo file EzySimpleAppEntryTest với nội dung kiểu này:
package com.tvd12.ezyfoxserver.support.v120.test.entry;

import java.util.Set;

import org.testng.annotations.Test;

import com.tvd12.ezyfox.bean.EzyBeanContext;
import com.tvd12.ezyfox.bean.EzyPackagesToScanAware;
import com.tvd12.ezyfox.bean.annotation.EzySingleton;
import com.tvd12.ezyfox.collect.Sets;
import com.tvd12.ezyfoxserver.context.EzyAppContext;
import com.tvd12.ezyfoxserver.support.entry.EzySimpleAppEntry;
import com.tvd12.test.assertion.Asserts;

import static org.mockito.Mockito.*;

import lombok.Setter;

public class EzySimpleAppEntryTest {

	@Test
	public void scanPacakges() {
		// given
		EzyAppContext appContext = mock(EzyAppContext.class);
		
		InternalAppEntry sut = new InternalAppEntry();
		
		// when
		sut.config(appContext);
		
		// then
		EzyBeanContext beanContext = sut.beanContext;
		MongoConfig mongoConfig = beanContext.getBeanCast(MongoConfig.class);
		
		Set<String> expectedPackages = Sets.newHashSet(
			"com.tvd12.ezyfoxserver.support.v120.test.entry"
		);
		Asserts.assertEquals(expectedPackages, mongoConfig.packagesToScan);
		
		Singleton singleton = beanContext.getBeanCast(Singleton.class);
		Asserts.assertNotNull(singleton);
	}

	@EzySingleton
	public static class Singleton {
	}
	
	@Setter
	public static class MongoConfig implements EzyPackagesToScanAware {
		public Set<String> packagesToScan;
	}
	
	private static class InternalAppEntry extends EzySimpleAppEntry {
		
		public EzyBeanContext beanContext;
		
		@Override
		protected String[] getScanablePackages() {
			return new String[] {"com.tvd12.ezyfoxserver.support.v120.test.entry"};
		}
		
		@Override
		protected void postConfig(EzyAppContext context, EzyBeanContext beanContext) {
			this.beanContext = beanContext;
		}
	}
	
}
  • Tạo file EzySimplePluginEntryTest với nội dung kiểu trên

Quy trình

  • Code
  • Tạo branch mới và tạo PR và nhánh dev

EZYFOX_SERVER_HOME

Hi,
In pom.xml
<deploy.path>${env.EZYFOX_SERVER_HOME}</deploy.path>
cannot resolve symbol env.EZYFOX_SERVER_HOME,
how can fix this?

thanks in advance.

How to send a List<T> to the client

I didnt find only one time a example how to use responseFactory.newArrayResponse(), but this example is nested with other functions so its to hard to figured out what i realy need to polish this values to send over the network.

I want to send a List with this values:

public class Character {
    @EzyId
    Long id;

    Long accountId;

    String name;
    String sex;
    String race;
    String model;
}
@EzyDoHandle(Commands.CHARACTER_LIST)
    public void characterList(EzyUser user)
    {
        logger.info("user {} request character list", user.getName());
        
        responseFactory.newArrayResponse()
                .command(Commands.CHARACTER_LIST)
                .data(
                        newArrayList(
                                characterService.getAllCharacters(user)
                        )
                )
                .user(user)
                .execute();
    }

What extra files i need (response, model, ModelToResponseConverter)and how have they to look, i tryed a lot but allways same error: Caused by: java.lang.IllegalArgumentException: has no writer for class com.assambra.game.common.entity.Character

Next question on the client side i use the following to reseive the data is this correct?

private void OnCharacterListResponse(EzyAppProxy proxy, EzyArray data)
    {
        if(data.isEmpty())
            GameManager.Instance.ChangeScene(Scenes.CreateCharacter);
        else
        {
            GameManager.Instance.ChangeScene(Scenes.SelectCharacter);
            for (int i = 0; i < data.size(); i++)
            {
                EzyObject item = data.get<EzyObject>(i);
                EzyArray character = item.get<EzyArray>("characters");

                CharacterInfo characterInfo = new CharacterInfo();
                characterInfo.id = character.get<long>(0);
                characterInfo.accountId = character.get<long>(1);
                characterInfo.name = character.get<string>(2);
                characterInfo.sex = character.get<string>(3);
                characterInfo.race = character.get<string>(4);
                characterInfo.model = character.get<string>(5);

                GameManager.Instance.characterInfos.Add(characterInfo);
            }
        }
    }

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.