Skip to content

Commit

Permalink
Merge pull request #43 from xiaonanln/develop
Browse files Browse the repository at this point in the history
merge Develop
  • Loading branch information
xiaonanln authored Oct 25, 2017
2 parents d524904 + 3a807b9 commit c500a29
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/test_client/ClientEntity.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ var (
{"DoSayInWorldChannel", 5, time.Minute},
{"DoSayInProfChannel", 5, time.Minute},
{"DoTestListField", 10, time.Minute},
{"DoTestPublish", 10, time.Minute},
{"DoTestPublish", 1, time.Minute},
{"DoTestMsgbox", 10, time.Minute},
}
)
Expand Down
18 changes: 10 additions & 8 deletions examples/test_client/test_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,21 @@ import (
)

var (
quiet bool
configFile string
serverHost string
useWebSocket bool
useKCP bool
numClients int
noEntitySync bool
quiet bool
configFile string
serverHost string
useWebSocket bool
useKCP bool
numClients int
startClientId int
noEntitySync bool
)

func parseArgs() {
flag.BoolVar(&quiet, "quiet", false, "run client quietly with much less output")
flag.StringVar(&configFile, "configfile", "", "set config file path")
flag.IntVar(&numClients, "N", 1000, "Number of clients")
flag.IntVar(&startClientId, "S", 1, "Start ID of clients")
flag.StringVar(&serverHost, "server", "localhost", "replace server address")
flag.BoolVar(&useWebSocket, "ws", false, "use WebSocket to connect server")
flag.BoolVar(&useKCP, "kcp", false, "use KCP to connect server")
Expand Down Expand Up @@ -60,7 +62,7 @@ func main() {
var wait sync.WaitGroup
wait.Add(numClients)
for i := 0; i < numClients; i++ {
bot := newClientBot(i+1, useWebSocket, useKCP, noEntitySync, &wait)
bot := newClientBot(startClientId+i, useWebSocket, useKCP, noEntitySync, &wait)
go bot.run()
}
timer.StartTicks(time.Millisecond * 100)
Expand Down

0 comments on commit c500a29

Please sign in to comment.