Skip to content

Commit

Permalink
Merge pull request #44 from xiaonanln/develop
Browse files Browse the repository at this point in the history
remove send client id
  • Loading branch information
xiaonanln authored Oct 25, 2017
2 parents c500a29 + 794d897 commit 9c091e6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion components/gate/ClientProxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (cp *ClientProxy) serve() {
}()

cp.GoWorldConnection.SetAutoFlush(time.Millisecond * 50)
cp.SendSetClientClientID(cp.clientid) // set the clientid on the client side
//cp.SendSetClientClientID(cp.clientid) // set the clientid on the client side

for {
var msgtype proto.MsgType
Expand Down
14 changes: 4 additions & 10 deletions examples/test_client/ClientBot.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ var (
type ClientBot struct {
sync.Mutex

id int
clientid common.ClientID
id int

waiter *sync.WaitGroup
conn *proto.GoWorldConnection
Expand Down Expand Up @@ -363,9 +362,9 @@ func (bot *ClientBot) handlePacket(msgtype proto.MsgType, packet *netutil.Packet
bot.updateEntityPosition(entityID, entity.Vector3{x, y, z})
bot.updateEntityYaw(entityID, yaw)
}
} else if msgtype == proto.MT_SET_CLIENT_CLIENTID {
clientid := packet.ReadClientID()
bot.setClientID(clientid)
//} else if msgtype == proto.MT_SET_CLIENT_CLIENTID {
// clientid := packet.ReadClientID()
// bot.setClientID(clientid)
} else {
gwlog.Panicf("unknown msgtype: %v", msgtype)
if consts.DEBUG_MODE {
Expand All @@ -374,11 +373,6 @@ func (bot *ClientBot) handlePacket(msgtype proto.MsgType, packet *netutil.Packet
}
}

func (bot *ClientBot) setClientID(clientid common.ClientID) {
gwlog.Infof("%s set client id = %s", bot, clientid)
bot.clientid = clientid
}

func (bot *ClientBot) updateEntityPosition(entityID common.EntityID, position entity.Vector3) {
//gwlog.Debugf("updateEntityPosition %s => %s", entityID, position)
if bot.entities[entityID] == nil {
Expand Down
2 changes: 1 addition & 1 deletion goworld.ini
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ log_level=debug
compress_connection=1
; supported compress formats: gwsnappy|snappy|flate|lz4|lzw
compress_format=gwsnappy
encrypt_connection=1
encrypt_connection=0
rsa_key=rsa.key
rsa_certificate=rsa.crt
heartbeat_check_interval = 0
Expand Down

0 comments on commit 9c091e6

Please sign in to comment.