Exemplo n.º 1
0
func GetTableHandler(w http.ResponseWriter, r *http.Request) {

	client := GetCookie(r, CLIENT_COOKIE)
	enemy := GetCookie(r, OPPOSITE_COOKIE)

	field := model.GetPlayerField(client)
	isTurn := model.GetPlayerTurn(client)
	result := drawTable(enemy, isTurn, field)
	w.Write([]byte(result))
}
func getSideValue(client string) {

	side := model.GetPlayerSide(client)
	turn := model.GetPlayerTurn(client)

	resultIsCross := strconv.FormatBool(side)
	isHisTurn := strconv.FormatBool(turn)

	sendMessage(client, "IsCross:"+resultIsCross+";IsHisSide:"+isHisTurn)

}