Skip to content

Commit

Permalink
clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansu committed Jun 15, 2021
1 parent 6b65bbf commit 6ad04bd
Show file tree
Hide file tree
Showing 26 changed files with 282 additions and 443 deletions.
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
[
{
"dropId": 1001,
"itemType": 1,
"itemId": 2,
"num": 10,
"dropType": 2,
"dropValue": 10011
},
{
"dropId": 1002,
"itemType": 3,
"itemId": 10001,
"num": 1,
"dropType": 1,
"dropValue": 100
},
{
"dropId": 1002,
"itemType": 3,
"itemId": 10002,
"num": 1,
"dropType": 1,
"dropValue": 100
}
[
{
"dropId": 1001,
"itemType": 1,
"itemId": 2,
"num": 10,
"dropType": 2,
"dropValue": 10011
},
{
"dropId": 1002,
"itemType": 3,
"itemId": 10001,
"num": 1,
"dropType": 1,
"dropValue": 100
},
{
"dropId": 1002,
"itemType": 3,
"itemId": 10002,
"num": 1,
"dropType": 1,
"dropValue": 100
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
{
"enable": true,
"node_id": "web-1",
"address": ":10820",
"rpc_address": "127.0.0.1:20820",
"address": "127.0.0.1:10820",
"rpc_address": "127.0.0.1:30820",
"__settings__": {
"maintain_state": 2,
"ref_logger": "game_log"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
{
"logger": {
"game_log": {
"level": "debug",
"enable_write_file": false,
"enable_console": true,
"file_path": "logs/game.log",
"max_size": 128,
"max_age": 7,
"max_backups": 0,
"compress": false,
"time_format": "15:04:05.000",
"print_caller": true
},
"test_handler": {
"level": "debug",
"enable_write_file": true,
"enable_console": false,
"file_path": "logs/test_handler.log",
"max_size": 128,
"max_age": 7,
"max_backups": 0,
"compress": false,
"time_format": "15:04:05.000"
}
}
{
"logger": {
"game_log": {
"level": "debug",
"enable_write_file": false,
"enable_console": true,
"file_path": "logs/game.log",
"max_size": 128,
"max_age": 7,
"max_backups": 0,
"compress": false,
"time_format": "15:04:05.000",
"print_caller": true
},
"test_handler": {
"level": "debug",
"enable_write_file": true,
"enable_console": false,
"file_path": "logs/test_handler.log",
"max_size": 128,
"max_age": 7,
"max_backups": 0,
"compress": false,
"time_format": "15:04:05.000"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
[
{
"dropId": 1011,
"itemType": 1,
"itemId": 2,
"num": 10,
"dropType": 2,
"dropValue": 2,
"desc": "desc test1"
},
{
"dropId": 1002,
"itemType": 3,
"itemId": 10001,
"num": 1,
"dropType": 1,
"dropValue": 10
},
{
"dropId": 1002,
"itemType": 3,
"itemId": 10002,
"num": 1,
"dropType": 1,
"dropValue": 100
}
[
{
"dropId": 1011,
"itemType": 1,
"itemId": 2,
"num": 10,
"dropType": 2,
"dropValue": 2,
"desc": "desc test1"
},
{
"dropId": 1002,
"itemType": 3,
"itemId": 10001,
"num": 1,
"dropType": 1,
"dropValue": 10
},
{
"dropId": 1002,
"itemType": 3,
"itemId": 10002,
"num": 1,
"dropType": 1,
"dropValue": 100
}
]
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"dropId": 9011,
"itemType": 91,
"itemId": 93,
"num": 90,
"dropType": 92,
"dropValue": 9,
"desc": "desc1111222"
{
"dropId": 9011,
"itemType": 91,
"itemId": 93,
"num": 90,
"dropType": 92,
"dropValue": 9,
"desc": "desc1111222"
}
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
{
"cluster": {
"mode": "nodes",
"nodes": {
"web": [
{
"enable": true,
"node_id": "web-1",
"address": ":10820",
"rpc_address": "127.0.0.1:20820",
"__settings__": {
"maintain_state": 2,
"@ref_logger": "game_log"
}
}
],
"game": [
{
"enable": true,
"node_id": "game-1",
"address": ":10860",
"rpc_address": "127.0.0.1:20860",
"__settings__": {
"maintain_state": 2,
"dbs": [
"x_game-1"
],
"ref_logger": "game_log"
}
}
]
},
"etcd": {
}
}
{
"cluster": {
"mode": "nodes",
"nodes": {
"web": [
{
"enable": true,
"node_id": "web-1",
"address": ":10820",
"rpc_address": "127.0.0.1:20820",
"__settings__": {
"maintain_state": 2,
"@ref_logger": "game_log"
}
}
],
"game": [
{
"enable": true,
"node_id": "game-1",
"address": ":10860",
"rpc_address": "127.0.0.1:20860",
"__settings__": {
"maintain_state": 2,
"dbs": [
"x_game-1"
],
"ref_logger": "game_log"
}
}
]
},
"etcd": {
}
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"data_config": {
"parser": "json",
"data_source": "file",
"file": {
"file_path": "data_config/",
"ext_name": ".json",
"reload_time": 3000
},
"redis": {
"redis_key": "config:server:xgame"
}
}
{
"data_config": {
"parser": "json",
"data_source": "file",
"file": {
"file_path": "data_config/",
"ext_name": ".json",
"reload_time": 3000
},
"redis": {
"redis_key": "config:server:xgame"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
{
"debug": true,
"include": [
"common/logger.json",
"profile-local-cluster.json",
"profile-local-data-config.json"
],
"db": [
{
"enable": true,
"group_id": "center_db",
"id": "center_db",
"db_name": "dev_xgame_center",
"host": "192.168.1.20",
"user_name": "gameserver",
"password": "password",
"max_idle_connect": 4,
"max_open_connect": 8,
"log_mode": true
},
{
"enable": true,
"group_id": "game_db",
"id": "game_db_1",
"db_name": "game_db_1",
"host": "192.168.1.20",
"user_name": "gameserver",
"password": "password",
"max_idle_connect": 4,
"max_open_connect": 8,
"log_mode": true
}
]
{
"debug": true,
"include": [
"common/logger.json",
"profile-local-cluster.json",
"profile-local-data-config.json"
],
"db": [
{
"enable": true,
"group_id": "center_db",
"id": "center_db",
"db_name": "dev_xgame_center",
"host": "192.168.1.20",
"user_name": "gameserver",
"password": "password",
"max_idle_connect": 4,
"max_open_connect": 8,
"log_mode": true
},
{
"enable": true,
"group_id": "game_db",
"id": "game_db_1",
"db_name": "game_db_1",
"host": "192.168.1.20",
"user_name": "gameserver",
"password": "password",
"max_idle_connect": 4,
"max_open_connect": 8,
"log_mode": true
}
]
}
2 changes: 1 addition & 1 deletion _examples/test1_data_config/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func main() {
}

func app() {
testApp := cherry.NewDefaultApp()
testApp := cherry.NewApp("../profile_split/", "local", "game-1")

defer testApp.OnShutdown()

Expand Down
2 changes: 1 addition & 1 deletion _examples/test1_handler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func main() {
}

func app() {
testApp := cherry.NewDefaultApp()
testApp := cherry.NewApp("../profile_single/", "local", "game-1")

defer testApp.OnShutdown(
func() {
Expand Down
2 changes: 1 addition & 1 deletion _examples/test_gin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

func main() {
testApp := cherry.NewDefaultApp()
testApp := cherry.NewApp("../profile_single/", "local", "web-1")
defer testApp.OnShutdown()

httpServer := cherryGin.NewHttp("http_server_1", testApp.ThisNode().Address())
Expand Down
Loading

0 comments on commit 6ad04bd

Please sign in to comment.