Skip to content

Commit

Permalink
update gameserver
Browse files Browse the repository at this point in the history
  • Loading branch information
kuzhu1990 committed Aug 23, 2017
1 parent 6f1b40b commit c533000
Show file tree
Hide file tree
Showing 70 changed files with 902 additions and 88 deletions.
13 changes: 11 additions & 2 deletions logic/agent/agent_ctrl.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
local skynet = require "skynet"
local context = require "context"
local db_helper = require "common.db_helper"
local room_id = tonumber(skynet.getenv("room_id"))
local agent_ctrl = {}

local current_conf
Expand All @@ -8,11 +10,16 @@ function agent_ctrl.is_hall()
return current_conf.server_type == SERVER.HALL
end

function agent_ctrl.init(conf)
current_conf = conf
end

function agent_ctrl.on_login(ctx, player_info)
print("agent_ctrl.on_login ctx=", table.tostring(ctx), "player_info=", table.tostring(player_info))

if not agent_ctrl.is_hall() then
local update_online_info = {
room_id = room_id,
agentnode = current_conf.nodename,
agentaddr = skynet.self(),
agentver = current_conf.ver,
Expand All @@ -27,8 +34,10 @@ function agent_ctrl.on_logout(ctx)

end

function agent_ctrl.init(conf)
current_conf = conf
function agent_ctrl.reconnect(ctx)

end



return agent_ctrl
73 changes: 71 additions & 2 deletions logic/config/game_room_config.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--[[
房间id, 游戏id, 房间类型, 房间名称, 底注, 最小入场
room_id, game_id, room_type, room_name, init_bet, min_enter
房间id, 游戏id, 房间类型, 房间名称, 底注, 最小入场, 分组方式, 最小分组, 最大分组
room_id, game_id, room_type, room_name, init_bet, min_enter, group_type, min_group_player, max_group_player
]]
local game_room_config = {
[10101] = {
Expand All @@ -10,6 +10,9 @@ local game_room_config = {
room_name = [[平民场]],
init_bet = 0.10,
min_enter = 30.00,
group_type = 1,
min_group_player = 2,
max_group_player = 5,
},
[10102] = {
room_id = 10102,
Expand All @@ -18,6 +21,9 @@ local game_room_config = {
room_name = [[小资场]],
init_bet = 1.00,
min_enter = 50.00,
group_type = 1,
min_group_player = 2,
max_group_player = 5,
},
[10103] = {
room_id = 10103,
Expand All @@ -26,6 +32,9 @@ local game_room_config = {
room_name = [[老板场]],
init_bet = 5.00,
min_enter = 300.00,
group_type = 1,
min_group_player = 2,
max_group_player = 5,
},
[10104] = {
room_id = 10104,
Expand All @@ -34,6 +43,9 @@ local game_room_config = {
room_name = [[富豪场]],
init_bet = 10.00,
min_enter = 600.00,
group_type = 1,
min_group_player = 2,
max_group_player = 5,
},
[10201] = {
room_id = 10201,
Expand All @@ -42,6 +54,9 @@ local game_room_config = {
room_name = [[平民场]],
init_bet = 0.10,
min_enter = 30.00,
group_type = 1,
min_group_player = 2,
max_group_player = 2,
},
[10202] = {
room_id = 10202,
Expand All @@ -50,6 +65,9 @@ local game_room_config = {
room_name = [[小资场]],
init_bet = 1.00,
min_enter = 50.00,
group_type = 1,
min_group_player = 2,
max_group_player = 2,
},
[10203] = {
room_id = 10203,
Expand All @@ -58,6 +76,9 @@ local game_room_config = {
room_name = [[老板场]],
init_bet = 5.00,
min_enter = 300.00,
group_type = 1,
min_group_player = 2,
max_group_player = 2,
},
[10204] = {
room_id = 10204,
Expand All @@ -66,6 +87,9 @@ local game_room_config = {
room_name = [[富豪场]],
init_bet = 10.00,
min_enter = 600.00,
group_type = 1,
min_group_player = 3,
max_group_player = 2,
},
[10301] = {
room_id = 10301,
Expand All @@ -74,6 +98,9 @@ local game_room_config = {
room_name = [[乞丐场]],
init_bet = 0.10,
min_enter = 2.00,
group_type = 2,
min_group_player = 3,
max_group_player = 3,
},
[10302] = {
room_id = 10302,
Expand All @@ -82,6 +109,9 @@ local game_room_config = {
room_name = [[平民场]],
init_bet = 0.50,
min_enter = 10.00,
group_type = 2,
min_group_player = 3,
max_group_player = 3,
},
[10303] = {
room_id = 10303,
Expand All @@ -90,6 +120,9 @@ local game_room_config = {
room_name = [[小资场]],
init_bet = 1.00,
min_enter = 18.00,
group_type = 2,
min_group_player = 3,
max_group_player = 3,
},
[10304] = {
room_id = 10304,
Expand All @@ -98,6 +131,9 @@ local game_room_config = {
room_name = [[老板场]],
init_bet = 3.00,
min_enter = 72.00,
group_type = 2,
min_group_player = 3,
max_group_player = 3,
},
[10305] = {
room_id = 10305,
Expand All @@ -106,6 +142,9 @@ local game_room_config = {
room_name = [[富豪场]],
init_bet = 5.00,
min_enter = 120.00,
group_type = 2,
min_group_player = 3,
max_group_player = 3,
},
[10306] = {
room_id = 10306,
Expand All @@ -114,6 +153,9 @@ local game_room_config = {
room_name = [[世家场]],
init_bet = 10.00,
min_enter = 240.00,
group_type = 2,
min_group_player = 3,
max_group_player = 3,
},
[10307] = {
room_id = 10307,
Expand All @@ -122,6 +164,9 @@ local game_room_config = {
room_name = [[帝王场]],
init_bet = 20.00,
min_enter = 480.00,
group_type = 2,
min_group_player = 3,
max_group_player = 3,
},
[10401] = {
room_id = 10401,
Expand All @@ -130,6 +175,9 @@ local game_room_config = {
room_name = [[平民场]],
init_bet = 0.10,
min_enter = 30.00,
group_type = 1,
min_group_player = 2,
max_group_player = 5,
},
[10402] = {
room_id = 10402,
Expand All @@ -138,6 +186,9 @@ local game_room_config = {
room_name = [[小资场]],
init_bet = 1.00,
min_enter = 50.00,
group_type = 1,
min_group_player = 2,
max_group_player = 5,
},
[10403] = {
room_id = 10403,
Expand All @@ -146,6 +197,9 @@ local game_room_config = {
room_name = [[老板场]],
init_bet = 5.00,
min_enter = 300.00,
group_type = 1,
min_group_player = 2,
max_group_player = 5,
},
[10404] = {
room_id = 10404,
Expand All @@ -154,6 +208,9 @@ local game_room_config = {
room_name = [[富豪场]],
init_bet = 10.00,
min_enter = 600.00,
group_type = 1,
min_group_player = 2,
max_group_player = 5,
},
[10501] = {
room_id = 10501,
Expand All @@ -162,6 +219,9 @@ local game_room_config = {
room_name = [[平民场]],
init_bet = 1.00,
min_enter = 50.00,
group_type = 1,
min_group_player = 2,
max_group_player = 5,
},
[10502] = {
room_id = 10502,
Expand All @@ -170,6 +230,9 @@ local game_room_config = {
room_name = [[小资场]],
init_bet = 5.00,
min_enter = 200.00,
group_type = 1,
min_group_player = 2,
max_group_player = 5,
},
[10503] = {
room_id = 10503,
Expand All @@ -178,6 +241,9 @@ local game_room_config = {
room_name = [[老板场]],
init_bet = 10.00,
min_enter = 1000.00,
group_type = 1,
min_group_player = 2,
max_group_player = 5,
},
[10504] = {
room_id = 10504,
Expand All @@ -186,6 +252,9 @@ local game_room_config = {
room_name = [[富豪场]],
init_bet = 20.00,
min_enter = 5000.00,
group_type = 1,
min_group_player = 2,
max_group_player = 5,
},
}
return game_room_config
31 changes: 31 additions & 0 deletions logic/config/xpnn_desk_config.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
--[[
房间id, 游戏台坐位数, 底注, 最小入场
room_id, seat_count, init_bet, min_enter
]]
local xpnn_desk_config = {
[10101] = {
room_id = 10101,
seat_count = 5,
init_bet = 0.10,
min_enter = 30.00,
},
[10102] = {
room_id = 10102,
seat_count = 5,
init_bet = 1.00,
min_enter = 50.00,
},
[10103] = {
room_id = 10103,
seat_count = 5,
init_bet = 5.00,
min_enter = 300.00,
},
[10104] = {
room_id = 10104,
seat_count = 5,
init_bet = 10.00,
min_enter = 600.00,
},
}
return xpnn_desk_config
6 changes: 6 additions & 0 deletions logic/config/xpnn_module.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
local modules = {}

modules.desk = "desk.desk_impl"
modules.xpnn = "xpnn.xpnn_impl"

return modules
15 changes: 15 additions & 0 deletions logic/player/player_db.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
local db_mgr = require "common.db_mgr"

local player_db = {}

function player_db.get_player_info(id)
local mysqldb = db_mgr.get_mysql_db()
local sql = string.format("select * from tb_player where player_id = %d;", id)
local result = mysqldb:query(sql)
if result.err then
error(result.err)
end
return result[1]
end

return player_db
Loading

0 comments on commit c533000

Please sign in to comment.