Exemplo n.º 1
0
void Battle::SetImReady( bool ready )
{
    UserBattleStatus& bs = m_serv.GetMe().BattleStatus();

    bs.ready = ready;

    //m_serv.GetMe().SetBattleStatus( bs );
    SendMyBattleStatus();
}
Exemplo n.º 2
0
void Battle::StartSpring()
{
	if ( UserExists( GetMe().GetNick() ) && !GetMe().Status().in_game )
	{
		GetMe().BattleStatus().ready = false;
		SendMyBattleStatus();
		GetMe().Status().in_game = spring().Run( *this );
		GetMe().SendMyUserStatus();
	}
	ui().OnBattleStarted( *this );
}
Exemplo n.º 3
0
void Battle::OnRequestBattleStatus()
{
    UserBattleStatus& bs = m_serv.GetMe().BattleStatus();
    bs.team = GetFreeTeam( true );
    bs.ally = GetFreeAlly( true );
    bs.spectator = false;
    bs.colour = sett().GetBattleLastColour();
    // theres some highly annoying bug with color changes on player join/leave.
    if ( !bs.colour.IsOk() ) bs.colour = GetFreeColour( GetMe() );

    SendMyBattleStatus();
}
Exemplo n.º 4
0
void Battle::StartSpring()
{
	if ( UserExists( GetMe().GetNick() ) && !GetMe().Status().in_game )
	{
		GetMe().BattleStatus().ready = false;
		SendMyBattleStatus();
		// set m_generating_script, this will make the script.txt writer realize we're just clients even if using a relayhost
		m_generating_script = true;
		GetMe().Status().in_game = spring().Run( *this );
		m_generating_script = false;
		GetMe().SendMyUserStatus();
	}
	ui().OnBattleStarted( *this );
}
Exemplo n.º 5
0
void Battle::OnUnitsyncReloaded( GlobalEvents::GlobalEventData data )
{
	IBattle::OnUnitsyncReloaded( data );
	if ( m_is_self_in ) SendMyBattleStatus();
}
Exemplo n.º 6
0
void Battle::OnUnitsyncReloaded( wxEvent& data )
{
	IBattle::OnUnitsyncReloaded( data );
	if ( m_is_self_in ) SendMyBattleStatus();
}