Results 1 to 4 of 4

Thread: Run a multiplayer server: random crash and weird behaviour

  1. #1
    Novice Pilot ITAF_Airone1989's Avatar
    Join Date
    Aug 2020
    Posts
    95
    Post Thanks / Like
    Total Downloaded
    812.8 KB

    Run a multiplayer server: random crash and weird behaviour

    Hi guys, I have some trouble with the server.


    Big problem number 1:

    It has a random crash. Sometimes after 30/40 minutes from the first mission, some other after several hours...
    If I'm inside the server appear a message with"connection lost due to: time out". Than in the DOS window everything seems to be ok (it also continue to load next missions) but you don't find the server in the multiplayer list.
    Now, because it's a server with AI could be this related with that? Like to many AI in the same place.. But it doesn't seems to happen during particular crowd dogfights.


    Big problem number 2:

    Sometimes AI don't spawn at all. The mission works like this: when you fly over a specific zone a message appear and some AI come. Everything seems to work fine, but then suddenly no message and no AI.
    I really have no idea about what is the problem, if I reload the mission everything is back to work normally.


    Small problem A: it's possible to change the direction of player air spawn? Cause all of them seem to be pointed North and I cannot modify it.


    Small problem B: randomly when you spawn in the air you have no elevators control. So your airplane just dive, spin and crash. This will happen every time you spawn from the same place, until you change side. Then if you try the previous spawn point everything works ok.


    Thank you very much!

  2. #2
    Supporting Member
    Join Date
    Feb 2015
    Posts
    325
    Post Thanks / Like
    Total Downloaded
    277.05 MB

    Re: Run a multiplayer server: random crash and weird behaviour


  3. #3
    Novice Pilot ITAF_Airone1989's Avatar
    Join Date
    Aug 2020
    Posts
    95
    Post Thanks / Like
    Total Downloaded
    812.8 KB

    Re: Run a multiplayer server: random crash and weird behaviour

    Solved big problem 1 using WatchDog.
    So thank you very much @DD_FT-

    Big problem 2 still remains. Could be a wrong script, but I cannot figure out what is wrong.
    There are 4 triggers and I did copy/paste from the first one, so I cannot understand why just the second one is not working while the others are fine.

  4. #4
    Ace
    Join Date
    May 2015
    Location
    Kansas City, Missouri area
    Posts
    515
    Post Thanks / Like
    Total Downloaded
    130.02 MB

    Re: Run a multiplayer server: random crash and weird behaviour

    Quote Originally Posted by Airone1989 View Post
    Solved big problem 1 using WatchDog.
    So thank you very much @DD_FT-

    Big problem 2 still remains. Could be a wrong script, but I cannot figure out what is wrong.
    There are 4 triggers and I did copy/paste from the first one, so I cannot understand why just the second one is not working while the others are fine.
    It probably has some small bug in it--a typo or the like.

    When you run a script within CloD you don't really have good access to the normal type of debugging tools you would like to have.

    What I'll often do instead, is resort to 1960s-style debugging where you just put a lot of "print" statements that show where you are in the code and also (for extra bonus points) print out various state variables as we go along.

    It can be as simple as interspersing some Console.WriteLine statements in the problem section of your code, every 1 or 2 or 3 lines:

    Code:
    Console.WriteLine("Trigger 4 #1");
    ..
    Console.WriteLine("Trigger 4 #2");
    ..
    Console.WriteLine("Trigger 4 #3");
    ..
    Console.WriteLine("Trigger 4 #4");
    ..
    Console.WriteLine("Trigger 4 #5");
    ..
    Console.WriteLine("Trigger 4 #6");
    ..
    etc.
    As crude as that is, when you run the mission and trigger that trigger, you'll then be able to go back to that section of code and reconstruct EXACTLY what happened and which lines executed and which didn't.

    That is the kind of information you need to debug a problem like this. Without that kind of info, you (and we) are just guessing.

    Another very useful technique is including try/catch.

    Like rewrite your current OnTrigger code to be enclosed in a try/catch, like this:

    Code:
     public override void OnTrigger(int missionNumber, string shortName, bool active)
     {
            try 
           {
    
                    [ALL YOUR CURRENT OnTrigger() CODE HERE]
    
    
            }
            catch (Exception ex) { Console.WriteLine("OnTrigger ERROR: " + ex.ToString());  }
    }
    Often you'll get better/more informative error messages from the console this way.
    System: Microsoft Windows 10 Pro 64 bit, 10.0.18362 N/A Build 18362, 20,437 MB |
    ASUS GeForce GTX 1060 3GB | Intel Core i5-2500 Quad-Core Processor 3.3 GHz 6 MB Cache LGA 1155 | Intel DB65AL motherboard | ARCTIC Freezer i11 CPU Cooler | SVGA 500 watt power supply | Microsoft Sidewinder 2 Force Feedback joystick

  5. Likes TWC_Fatal_Error liked this post

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •