Esempio n. 1
0
// MakeMinorUpdate will apply the update to the local gamestate before returning
// and will queue up the update to be sent to all other clients on an unreliable
// and ordered channel.
func (c *Client) MakeMinorUpdate(update types.Update) {
	c.GameMutex.Lock()
	update.ApplyUpdate(-1, c.Game)
	c.GameMutex.Unlock()
	c.MinorUpdatesChan <- update
}
Esempio n. 2
0
// MakeMajorUpdate will apply the update to the local gamestate before returning
// and will queue up the update to be sent to all clients on a reliable and
// ordered channel.
func (host *Host) MakeMajorUpdate(update types.Update) {
	host.GameMutex.Lock()
	update.ApplyUpdate(-2, host.Game)
	host.GameMutex.Unlock()
	host.majorUpdates <- update
}