View Single Post
  #6  
Old 06-05-2011, 10:51 AM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

Just looked through your cs code and it looks great. I wish I could know c# half as good as you do. Sure I have many questions if you do not mind )

We use similar actor destroy code on Repka. It used to have an issue of stopping bomber engines when a player switches to a gunner or navigator position. Did you manage to solve this issue? Does adding this line helps in this respect or it was added for different purposes?
Code:
        foreach (AiActor actor in actorMain.Group().GetItems())
Quote:
Originally Posted by TheEnlightenedFlorist View Post
Also, players are allowed to spawn groups of up to four bombers so they don't have to fly alone.
What happens if a player creates 20 bomber groups in a row one by one? I think they should be destroyed immediately in this case or this can ruin any server. I have seen people creating 20 single Stukas on Repka just for fun. They were destroyed with 5 minutes delay. But with groups different code is probably needed. Just a thought.

Code:
        List<Player> bluePlayers = new List<Player>();

        foreach (Player p in GamePlay.gpRemotePlayers())
        {
            if (p.Army() == 2)
                bluePlayers.Add(p);
        }

        GamePlay.gpHUDLogCenter(bluePlayers.ToArray(), msg);
Why do you have to add players to a list first and then print message to the list members. Can you print message directly to array members like in this example (for server log msg)?

Code:
	private void serverMessage(string msg)
        {
            Player pl = GamePlay.gpPlayer();
            Player[] players = { pl };
            object[] args = { msg };
            GamePlay.gpLogServer(players, msg, args);
        }
This is not my code and I did not check if this code works but I think it does.
Reply With Quote