Skip to content

Commit

Permalink
export Modules
Browse files Browse the repository at this point in the history
  • Loading branch information
name5566 committed Aug 24, 2015
1 parent 56524b1 commit 5dec35b
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 8 deletions.
5 changes: 4 additions & 1 deletion src/server/game/internal/module.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package internal

import (
"github.com/name5566/leaf/module"
"server/base"
"server/game"
)

func init() {
game.Module = new(Module)
}

var skeleton = base.NewSkeleton(game.ChanRPC)

type Module struct {
Expand Down
7 changes: 7 additions & 0 deletions src/server/game/module.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package game

import (
"github.com/name5566/leaf/module"
)

var Module module.Module
6 changes: 5 additions & 1 deletion src/server/gate/internal/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ import (
"github.com/name5566/leaf/log"
"server/conf"
"server/game"
_ "server/gate"
"server/gate"
"server/msg"
)

func init() {
gate.Module = new(Module)
}

type Module struct {
*gate.TCPGate
}
Expand Down
7 changes: 7 additions & 0 deletions src/server/gate/module.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package gate

import (
"github.com/name5566/leaf/module"
)

var Module module.Module
4 changes: 4 additions & 0 deletions src/server/login/internal/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import (
"server/login"
)

func init() {
login.Module = new(Module)
}

var skeleton = base.NewSkeleton(login.ChanRPC)

type Module struct {
Expand Down
7 changes: 7 additions & 0 deletions src/server/login/module.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package login

import (
"github.com/name5566/leaf/module"
)

var Module module.Module
12 changes: 6 additions & 6 deletions src/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ import (
"github.com/name5566/leaf"
lconf "github.com/name5566/leaf/conf"
"server/conf"
game "server/game/internal"
gate "server/gate/internal"
login "server/login/internal"
"server/game"
"server/gate"
"server/login"
)

func main() {
lconf.LogLevel = conf.Server.LogLevel
lconf.LogPath = conf.Server.LogPath

leaf.Run(
new(game.Module),
new(gate.Module),
new(login.Module),
game.Module,
gate.Module,
login.Module,
)
}

0 comments on commit 5dec35b

Please sign in to comment.