Skip to content

Commit

Permalink
upgrade to 3.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Hu committed Feb 17, 2021
1 parent 8c44681 commit 83b4d70
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 103 deletions.
6 changes: 3 additions & 3 deletions game-cluster/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>g-engine-server</artifactId>
<groupId>info.xiaomo</groupId>
<version>3.1.3</version>
<version>3.1.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -20,12 +20,12 @@
<dependency>
<groupId>info.xiaomo</groupId>
<artifactId>g-engine</artifactId>
<version>3.1.3</version>
<version>3.1.4</version>
</dependency>
<dependency>
<groupId>info.xiaomo</groupId>
<artifactId>game-protocol</artifactId>
<version>3.1.3</version>
<version>3.1.4</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
6 changes: 3 additions & 3 deletions game-gate/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>g-engine-server</artifactId>
<groupId>info.xiaomo</groupId>
<version>3.1.3</version>
<version>3.1.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -20,12 +20,12 @@
<dependency>
<groupId>info.xiaomo</groupId>
<artifactId>g-engine</artifactId>
<version>3.1.3</version>
<version>3.1.4</version>
</dependency>
<dependency>
<groupId>info.xiaomo</groupId>
<artifactId>game-protocol</artifactId>
<version>3.1.3</version>
<version>3.1.4</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
6 changes: 3 additions & 3 deletions game-hall/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>g-engine-server</artifactId>
<groupId>info.xiaomo</groupId>
<version>3.1.3</version>
<version>3.1.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -20,12 +20,12 @@
<dependency>
<groupId>info.xiaomo</groupId>
<artifactId>game-protocol</artifactId>
<version>3.1.3</version>
<version>3.1.4</version>
</dependency>
<dependency>
<groupId>info.xiaomo</groupId>
<artifactId>g-engine</artifactId>
<version>3.1.3</version>
<version>3.1.4</version>
</dependency>
</dependencies>

Expand Down
2 changes: 1 addition & 1 deletion game-log/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>g-engine-server</artifactId>
<groupId>info.xiaomo</groupId>
<version>3.1.3</version>
<version>3.1.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
4 changes: 2 additions & 2 deletions game-protocol/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>g-engine-server</artifactId>
<groupId>info.xiaomo</groupId>
<version>3.1.3</version>
<version>3.1.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -20,7 +20,7 @@
<dependency>
<groupId>info.xiaomo</groupId>
<artifactId>g-engine</artifactId>
<version>3.1.3</version>
<version>3.1.4</version>
</dependency>
</dependencies>

Expand Down
16 changes: 8 additions & 8 deletions game-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>g-engine-server</artifactId>
<groupId>info.xiaomo</groupId>
<version>3.1.3</version>
<version>3.1.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -16,24 +16,24 @@
<dependency>
<groupId>info.xiaomo</groupId>
<artifactId>g-engine</artifactId>
<version>3.1.3</version>
<version>3.1.4</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
</dependency>
</dependencies>

Expand Down
42 changes: 0 additions & 42 deletions game-server/src/main/java/info/xiaomo/server/StopServerClient.java

This file was deleted.

71 changes: 35 additions & 36 deletions game-server/src/main/java/info/xiaomo/server/event/EventUtil.java
Original file line number Diff line number Diff line change
@@ -1,53 +1,52 @@
package info.xiaomo.server.event;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* 由于事件都是预先注册好的,所以这里不考虑多线程问题,不允许在游戏运行过成中动态添加观察者
*
* @author 张力
* @date 2014-12-6 上午11:19:00
* 2014-12-6 上午11:19:00
*/
public class EventUtil {

/**
* 游戏启动就初始化的监听者列表
*/
private final static Map<EventType, List<IEventListener>> PREPARED_LISTENERS = new HashMap<>(10);

/**
* 游戏运行中动态添加的监听者列表
*/
private final static Logger LOGGER = LoggerFactory.getLogger(EventUtil.class);

static void addListener(IEventListener listener, EventType type) {
List<IEventListener> listenerList = PREPARED_LISTENERS.computeIfAbsent(type, k -> new ArrayList<>());
listenerList.add(listener);
}

public static void fireEvent(EventType type) {
fireEvent(type, null);
}

public static void fireEvent(EventType type, Object obj) {

List<IEventListener> listenerList = PREPARED_LISTENERS.get(type);
if (listenerList != null) {
for (IEventListener listener : listenerList) {
try {
listener.update(type, obj);
} catch (Exception e) {
LOGGER.error("事件执行错误", e);
}
}
}
}
/**
* 游戏启动就初始化的监听者列表
*/
private final static Map<EventType, List<IEventListener>> PREPARED_LISTENERS = new HashMap<>(10);

/**
* 游戏运行中动态添加的监听者列表
*/
private final static Logger LOGGER = LoggerFactory.getLogger(EventUtil.class);

static void addListener(IEventListener listener, EventType type) {
List<IEventListener> listenerList = PREPARED_LISTENERS.computeIfAbsent(type, k -> new ArrayList<>());
listenerList.add(listener);
}

public static void fireEvent(EventType type) {
fireEvent(type, null);
}

public static void fireEvent(EventType type, Object obj) {

List<IEventListener> listenerList = PREPARED_LISTENERS.get(type);
if (listenerList != null) {
for (IEventListener listener : listenerList) {
try {
listener.update(type, obj);
} catch (Exception e) {
LOGGER.error("事件执行错误", e);
}
}
}
}


}
15 changes: 10 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>info.xiaomo</groupId>
<artifactId>g-engine-server</artifactId>
<packaging>pom</packaging>
<version>3.1.3</version>
<version>3.1.4</version>
<modules>
<module>game-server</module>
<module>game-log</module>
Expand All @@ -23,14 +23,14 @@
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<!--核心包start-->
<GEngine.version>3.1.3</GEngine.version>
<GEngine.version>3.1.4</GEngine.version>
<!--核心包end-->
<netty.version>[4.1.42,)</netty.version>
<apache-commons-codec.version>1.10</apache-commons-codec.version>
<kryo.version>3.0.3</kryo.version>
<fastjson.version>1.2.29</fastjson.version>
<httpclient.version>4.5.2</httpclient.version>
<slf4j.version>1.7.25</slf4j.version>
<slf4j.version>1.7.30</slf4j.version>
<dom4j.version>1.6.1</dom4j.version>
<logback.version>1.1.3</logback.version>
<commons-lang3.version>3.10</commons-lang3.version>
Expand All @@ -50,7 +50,7 @@
<dependency>
<groupId>info.xiaomo</groupId>
<artifactId>g-engine</artifactId>
<version>3.1.3</version>
<version>3.1.4</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
Expand All @@ -73,7 +73,12 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
<version>1.7.30</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.30</version>
</dependency>
<!--httpclient-->
<dependency>
Expand Down

0 comments on commit 83b4d70

Please sign in to comment.