当前位置: 首页>>代码示例>>Golang>>正文


Golang QTPacket.ReadUint32方法代码示例

本文整理汇总了Golang中Network.QTPacket.ReadUint32方法的典型用法代码示例。如果您正苦于以下问题:Golang QTPacket.ReadUint32方法的具体用法?Golang QTPacket.ReadUint32怎么用?Golang QTPacket.ReadUint32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Network.QTPacket的用法示例。


在下文中一共展示了QTPacket.ReadUint32方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: NewTeamPokeFromPacket

func NewTeamPokeFromPacket(_packet *pnet.QTPacket) *TeamPoke {
	teamPoke := TeamPoke{}
	teamPoke.UID = NewUniqueIdFromPacket(_packet)
	teamPoke.Nick = _packet.ReadString()
	teamPoke.Item = int(_packet.ReadUint16())
	teamPoke.Ability = int(_packet.ReadUint16())
	teamPoke.Nature = int(_packet.ReadUint8())
	teamPoke.Gender = int(_packet.ReadUint8())
	// teamPoke.Gen = (int)_packet.ReadByte()
	teamPoke.Shiny = _packet.ReadBool()
	teamPoke.Happiness = int(_packet.ReadUint8())
	teamPoke.Level = int(_packet.ReadUint8())

	teamPoke.Moves = make([]int, 4)
	for i := 0; i < 4; i++ {
		teamPoke.Moves[i] = int(_packet.ReadUint32())
	}
	teamPoke.DVs = make([]int, 6)
	for i := 0; i < 6; i++ {
		teamPoke.DVs[i] = int(_packet.ReadUint8())
	}
	teamPoke.EVs = make([]int, 6)
	for i := 0; i < 6; i++ {
		teamPoke.EVs[i] = int(_packet.ReadUint8())
	}

	return &teamPoke
}
开发者ID:gasperko,项目名称:pokemon-universe,代码行数:28,代码来源:teampoke.go

示例2: battleMessage

func (c *POClient) battleMessage(_packet *pnet.QTPacket) {
	if c.battle != nil {
		_packet.ReadUint32() // Supporting only one battle, unneeded
		_packet.ReadUint32() // Discard the size, unneeded
		c.battle.ReceiveCommand(_packet)
	}
}
开发者ID:gasperko,项目名称:pokemon-universe,代码行数:7,代码来源:poclient.go

示例3: engageBattle

func (c *POClient) engageBattle(_packet *pnet.QTPacket) {
	c.bID = int(_packet.ReadUint32())
	pID1 := int(_packet.ReadUint32())
	pID2 := int(_packet.ReadUint32())
	if pID1 == 0 { // This is us!
		battleConf := NewBattleConfFromPacket(_packet)
		// Start the battle
		c.battle = NewBattle(c, battleConf, _packet, c.players[battleConf.GetId(0)], c.players[battleConf.GetId(1)], c.mePlayer.Id, c.bID)

		fmt.Printf("Battle between %s and %s started!\n", c.mePlayer.Nick, c.players[pID2].Nick)
	}
}
开发者ID:gasperko,项目名称:pokemon-universe,代码行数:12,代码来源:poclient.go

示例4: NewShallowBattlePokeFromPacket

func NewShallowBattlePokeFromPacket(_packet *pnet.QTPacket, _isMe bool) *ShallowBattlePoke {
	shallowPoke := ShallowBattlePoke{Types: make([]int, 2)}
	shallowPoke.UID = NewUniqueIdFromPacket(_packet)
	shallowPoke.RNick = _packet.ReadString()
	shallowPoke.Nick = shallowPoke.RNick
	if !_isMe {
		shallowPoke.Nick = "the foe's " + shallowPoke.Nick

		shallowPoke.getName()
		shallowPoke.getTypes()
	}

	shallowPoke.LifePercent = int(_packet.ReadUint8())
	shallowPoke.fullStatus = _packet.ReadUint32()
	shallowPoke.Gender = int(_packet.ReadUint8())
	shallowPoke.Shiny = _packet.ReadBool()
	shallowPoke.Level = int(_packet.ReadUint32())

	return &shallowPoke
}
开发者ID:gasperko,项目名称:pokemon-universe,代码行数:20,代码来源:shallowbattlepoke.go

示例5: receivedBeginTurn

func (b *Battle) receivedBeginTurn(_packet *pnet.QTPacket) {
	turn := _packet.ReadUint32()
	b.WriteToHist(fmt.Sprintf("Start of turn %d!\n", turn))
}
开发者ID:gasperko,项目名称:pokemon-universe,代码行数:4,代码来源:battle.go


注:本文中的Network.QTPacket.ReadUint32方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。