PDA

View Full Version : IL-2 Server Master v1.0


TheEnlightenedFlorist
05-25-2011, 02:12 AM
IL-2 Server Master is software that allows you to interact with a mission script while it is running. With this software, you can run portions of your script on demand. Possibilities are many. Let your imagination run wild! :-P

Here is an abridged version of the manual included with the software.

Install

1. Extract IL2ServerMasterLibrary.dll to "Steam\steamapps\common\il-2 sturmovik cliffs of dover\".

2. Put the following code in you mission's script.

using System;
using System.Collections;
using maddox.game;
using maddox.game.world;
using System.Reflection;
using System.IO;


public class Mission : AMission
{
MethodInfo mi;
Type classType;
object obj;

public override void OnBattleStarted()
{
base.OnBattleStarted();

try
{
//Load the new DLL from the specified path and set the current method to popCommand().
Assembly a = null;
a = Assembly.LoadFrom(Directory.GetCurrentDirectory() + @"\IL2ServerMasterLibrary.dll");
classType = a.GetType("IL2ServerMasterLibrary.ServerMaster");
obj = Activator.CreateInstance(classType, new object[] { "password", 11000 }); //First argument is the password, second is port number.
mi = classType.GetMethod("popCommand");
}
catch (Exception e)
{
GamePlay.gpLogServer(new Player[] { GamePlay.gpPlayer() }, "Could not load Server Master. :(", null);
}
}
public override void OnBattleStoped()
{
base.OnBattleStoped();

//Set method to Stop(). Stop the DLL.
mi = classType.GetMethod("Stop");
mi.Invoke(obj, null);
}


public override void OnTickGame()
{
base.OnTickGame();

//get the command from Server Master
string[] command = (string[])mi.Invoke(obj, null);

//if command is not null, there is a command to be executed
if (command != null)
{
// Do the command.
}
}
}

3. Change password and port number in above code to appropriate values. Port can be left default if desired. You may need to open the port in your firewall to access the server throught the internet.

4. Start your server with the new script and fire up the included executable.

5. Send a command to your server. If the server receives the command you will get a message next to the "Send Command" button.

6. Write code to actually do something with the commands. :) My code returns commands in an array of strings. The string at position zero is the command, the rest are the arguments. It returns null if there are no commands to be executed. There is an example of how to get a command in the above code.


As this is the first release, there may be bugs in it. If you need any help using it or getting it installed, I'd be happy to help. Feature requests are welcome also. :)

Airwarfare.com Download (http://airwarfare.com/sow/index.php?option=com_jdownloads&Itemid=53&view=viewdownload&catid=60&cid=71)

Thee_oddball
05-25-2011, 02:33 AM
well done:) this looks very promising

SYN_Flashman
05-26-2011, 10:02 AM
Sorry this hasn't had more attention. We at Syn will be having a look at this and no doubt be back with many questions!

I have one for you now: Will this allow us to rotate to a new mission after a set time without disconnecting all the players? (you know, like we used to do in IL2)

One issue we at Syndicate is finding is that whilst having all sorts of scripts is great, every time an AI mission spawns the pings creep up (though we might be doing something wrong). If we can start a new mission every 4 hours or so we could eliminate quite a few of the AI.

At the moment we are trying to run a mission that can be left to its own devices for many hours as we have no way of rotating the (whole) missions as we used to do in IL2 unless we restart the server. As such we cram our mission with repeating AI via submissions but we think this essentailly clogs it up. The pings get higher and the loading time gets longer as time goes on.

If Server Commander works and allows us to rotate the maps then this should help solve that problem. It would allow us to create a morning, afternoon and evening mission to recreate the daylight hours and have those rotate. The beauty of the scripts of course is we can make endless variations of the same base map.

Also, as you say intefeing with the script whilst the mission is in progress opens up all sorts of possibilities I haven't even looked at yet!

TheEnlightenedFlorist
05-27-2011, 01:03 AM
I have one for you now: Will this allow us to rotate to a new mission after a set time without disconnecting all the players? (you know, like we used to do in IL2)

I don't think so. I was hoping we'd be able to call gpBattleStop(), then immediately load a new mission, but gpBattleStop() doesn't seem to stop the battle. It might be a bug, or it might be intended for something else.

One issue we at Syndicate is finding is that whilst having all sorts of scripts is great, every time an AI mission spawns the pings creep up (though we might be doing something wrong). If we can start a new mission every 4 hours or so we could eliminate quite a few of the AI.

If you think AI are starting to pile up in your server, try putting the following code into your OnTickGame() method. Every five minutes, it should print to the chat bar the number of AirGroups in the server. It's not an exact count of the number of AI aircraft on the server, but if the number continually climbs, you know that not all AI are being taken care of. Also, it will only work if there is more than one aircraft on both sides, so you might not see it immediately after starting the server.


if (GamePlay.gpAirGroups(1) != null && GamePlay.gpAirGroups(2) != null)
{
if (Time.tickCounter() % 9000 == 0)
{
int totalAircraft = GamePlay.gpAirGroups(1).Length + GamePlay.gpAirGroups(2).Length;
GamePlay.gpLogServer(new Player[] { GamePlay.gpPlayer() }, totalAircraft.ToString(), null);
GamePlay.gpLogServer(GamePlay.gpRemotePlayers(), totalAircraft.ToString(), null);
}
}

Tiger27
05-27-2011, 01:25 AM
Just wondering if this is a typo?

base.OnBattleStoped();

TheEnlightenedFlorist
05-27-2011, 01:35 AM
Just wondering if this is a typo?

base.OnBattleStoped();

No, it's misspelled in the code. Most of the devs don't speak English so it's understandable. It's also far too late to change it now. :grin:

Flashman
05-27-2011, 06:57 AM
Thanks EF,

Its a shame this battle stop business doesn't work. I tried simply typing it into the server DOS box yesterday and the thing just froze!

I will try your AI airgroups count code and see if that can shed any light. We did have an improvement yeserday, the pings crept up but then stabilised (I used a different scripting method which I won't go into here).

Cheers!

Flashman
05-27-2011, 09:16 AM
If you think AI are starting to pile up in your server, try putting the following code into your OnTickGame() method. Every five minutes, it should print to the chat bar the number of AirGroups in the server. It's not an exact count of the number of AI aircraft on the server, but if the number continually climbs, you know that not all AI are being taken care of. Also, it will only work if there is more than one aircraft on both sides, so you might not see it immediately after starting the server.


if (GamePlay.gpAirGroups(1) != null && GamePlay.gpAirGroups(2) != null)
{
if (Time.tickCounter() % 9000 == 0)
{
int totalAircraft = GamePlay.gpAirGroups(1).Length + GamePlay.gpAirGroups(2).Length;
GamePlay.gpLogServer(new Player[] { GamePlay.gpPlayer() }, totalAircraft.ToString(), null);
GamePlay.gpLogServer(GamePlay.gpRemotePlayers(), totalAircraft.ToString(), null);
}
}


Hi EF. I put this into my script and tried it offline (compile said it was OK) but no messages showed up. Does it send thse to the server log? Im guessing it does given the 'gpLogServer' command. I don't actually mind if it does, rather than it show up on screen. No idea how to enable the log in single player though.

Just spent about an hour working out how many AI groups should be in the air at a given moment on the mission, so this would be great to compare.

Thx

TheEnlightenedFlorist
05-27-2011, 09:30 AM
Hi EF. I put this into my script and tried it offline (compile said it was OK) but no messages showed up. Does it send thse to the server log? Im guessing it does given the 'gpLogServer' command. I don't actually mind if it does, rather than it show up on screen. No idea how to enable the log in single player though.

Just spent about an hour working out how many AI groups should be in the air at a given moment on the mission, so this would be great to compare.

Thx

Was there at least one aircraft in existence on each side? The number should be showing up in the chat bar. I only tested it on my own server, so I know it shows up for the server, but it should show up for all players. If it's still not showing up, I don't know how to make the number show up without plastering it in those big gold letters in the center of the screen. :grin:

Ataros
05-27-2011, 09:36 AM
If you think AI are starting to pile up in your server, try putting the following code into your OnTickGame() method.

Trying to run it (see end of code)

public override void OnTickGame()
{
if (Time.tickCounter() % 45000 == 9000) // 45000=25 min repeat. 9000=5 min delay.
{
// randomly selects 1 of several submissions excluding the recent one

Random RandomIncident = new Random();
int CurrentMissionSelected;

do
{
CurrentMissionSelected = RandomIncident.Next(1, 4);
}
while (LastMissionLoaded == CurrentMissionSelected);

LastMissionLoaded = CurrentMissionSelected;

switch (CurrentMissionSelected)

{
case 1:
GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/BoF1/BoF1_air01.mis");
//GamePlay.gpHUDLogCenter("Intel: Enemy activity is expected at E3!");
//600
initTime = 0.0;
Timeout(initTime += 600, () =>
{
GamePlay.gpHUDLogCenter("Attention! Enemy activity is expected at E3!");
});
//600+600
Timeout(initTime += 600, () =>
{
GamePlay.gpHUDLogCenter("Attention! Help is needed at E3/D4!");
});
break;
case 2:
GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/BoF1/BoF1_sea01.mis");
//GamePlay.gpHUDLogCenter("Intel: Cover your shipping at C4!");
//500
initTime = 0.0;
Timeout(initTime += 450, () =>
{
GamePlay.gpHUDLogCenter("Attention! Cover your shipping at C4!");
});
//500+300
Timeout(initTime += 300, () =>
{
GamePlay.gpHUDLogCenter("Attention! Ships are under attack at C4!");
});
break;
case 3:
GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/BoF1/BoF1_air02.mis");
//GamePlay.gpHUDLogCenter("Intel: Enemy activity is expected at E2!");
//600
initTime = 0.0;
Timeout(initTime += 600, () =>
{
GamePlay.gpHUDLogCenter("Attention! Enemy activity is expected at E2!");
});
//600+300
Timeout(initTime += 300, () =>
{
GamePlay.gpHUDLogCenter("Attention! All fighters please proceed to E2/D3!");
});
break;
}
}

///////////////////////

//loads small submissions w/o messages

if (Time.tickCounter() % 216000 == 108000) // 216000=120 min repeat. 108000=60 min delay.
{
GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/BoF1/BoF1_small01.mis");
}

if (Time.tickCounter() % 216000 == 215999) // 216000=120 min repeat. 215999=120 min delay.
{
GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/BoF1/BoF1_small02.mis");
}

/////////// Counts AI groups on the server.

if (GamePlay.gpAirGroups(1) != null && GamePlay.gpAirGroups(2) != null)
{
if (Time.tickCounter() % 9000 == 0)
{
int totalAircraft = GamePlay.gpAirGroups(1).Length + GamePlay.gpAirGroups(2).Length;
GamePlay.gpLogServer(new Player[] { GamePlay.gpPlayer() }, totalAircraft.ToString(), null);
GamePlay.gpLogServer(GamePlay.gpRemotePlayers(), totalAircraft.ToString(), null);
}
}
}

Get these errors:
[13:05:14] Battle starting...[13:05:14] Server: Battle begins!
[13:05:14] ok
[13:05:14] Server to [Server]: 4
[13:05:14]
[13:05:14] =================================================
[13:05:14] System.IndexOutOfRangeException: Индекс находился вне границ массива.
[13:05:14]
[13:05:14] Server stack trace:
[13:05:14] в WLxT1kvtHRQOtMZZl62.DRdThMvpbN33CGywFW7.wXZFyNGvcs 2(Player[] , Boolean , String , Object[] )
[13:05:14] в WLxT1kvtHRQOtMZZl62.DRdThMvpbN33CGywFW7.ppDoUYCpY9 HF87vxRBGe(Object , Boolean , Object , Object )
[13:05:14] в WLxT1kvtHRQOtMZZl62.DRdThMvpbN33CGywFW7.0AAFyzF3TV d(Player[] , String , Object[] )
[13:05:14] в UXx9sZjCf3yc9i99GpR.69j9o82zIn0dDNk0dpm.LogServer( Player[] , String , Object[] )
[13:05:14] в maddox.game.GameDef.gpLogServer(Player[] to, String format, Object[] args)
[13:05:14] в System.Runtime.Remoting.Messaging.StackBuilderSink ._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
[13:05:14] в System.Runtime.Remoting.Messaging.StackBuilderSink .SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
[13:05:14]
[13:05:14] Exception rethrown at [0]:
[13:05:14] в System.Runtime.Remoting.Proxies.RealProxy.HandleRe turnMessage(IMessage reqMsg, IMessage retMsg)
[13:05:14] в System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData& msgData, Int32 type)
[13:05:14] в maddox.game.IGamePlay.gpLogServer(Player[] to, String format, Object[] args)
[13:05:14] в Mission.OnTickGame()
[13:05:14] в maddox.game.ABattle.OnTickGame()
[13:05:14] в maddox.game.world.Strategy.OnTickGame()
[13:05:14] в System.Runtime.Remoting.Messaging.StackBuilderSink ._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
[13:05:14] в System.Runtime.Remoting.Messaging.StackBuilderSink .SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
[13:05:14]
[13:05:14] Exception rethrown at [1]:
[13:05:14] в System.Runtime.Remoting.Proxies.RealProxy.HandleRe turnMessage(IMessage reqMsg, IMessage retMsg)
[13:05:14] в System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData& msgData, Int32 type)
[13:05:14] в maddox.game.IBattle.OnTickGame()
[13:05:14] в maddox.game.GameDef.tickGame()
[13:05:14] в 13yXBRPwF6JbN5OXHZ6.NTKTOgPPsXwbvypIj6k.Z37cRDxFul C()
[13:05:14] в RKuLtykUFmi8DgWf36W.9FOhqSkweWrYgooHcsk.neSF4RIW4t 3(Boolean , Boolean )
[13:05:14] =================================================
[13:09:43] Server to [Server]: 4
[13:09:43]
[13:09:43] =================================================
[13:09:43] System.IndexOutOfRangeException: Индекс находился вне границ массива.
[13:09:43]
[13:09:43] Server stack trace:
[13:09:43] в WLxT1kvtHRQOtMZZl62.DRdThMvpbN33CGywFW7.wXZFyNGvcs 2(Player[] , Boolean , String , Object[] )
[13:09:43] в WLxT1kvtHRQOtMZZl62.DRdThMvpbN33CGywFW7.ppDoUYCpY9 HF87vxRBGe(Object , Boolean , Object , Object )
[13:09:43] в WLxT1kvtHRQOtMZZl62.DRdThMvpbN33CGywFW7.0AAFyzF3TV d(Player[] , String , Object[] )
[13:09:43] в UXx9sZjCf3yc9i99GpR.69j9o82zIn0dDNk0dpm.LogServer( Player[] , String , Object[] )
[13:09:43] в maddox.game.GameDef.gpLogServer(Player[] to, String format, Object[] args)
[13:09:43] в System.Runtime.Remoting.Messaging.StackBuilderSink ._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
[13:09:43] в System.Runtime.Remoting.Messaging.StackBuilderSink .SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
[13:09:43]
[13:09:43] Exception rethrown at [0]:
[13:09:43] в System.Runtime.Remoting.Proxies.RealProxy.HandleRe turnMessage(IMessage reqMsg, IMessage retMsg)
[13:09:43] в System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData& msgData, Int32 type)
[13:09:43] в maddox.game.IGamePlay.gpLogServer(Player[] to, String format, Object[] args)
[13:09:43] в Mission.OnTickGame()
[13:09:43] в maddox.game.ABattle.OnTickGame()
[13:09:43] в maddox.game.world.Strategy.OnTickGame()
[13:09:43] в System.Runtime.Remoting.Messaging.StackBuilderSink ._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
[13:09:43] в System.Runtime.Remoting.Messaging.StackBuilderSink .SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
[13:09:43]
[13:09:43] Exception rethrown at [1]:
[13:09:43] в System.Runtime.Remoting.Proxies.RealProxy.HandleRe turnMessage(IMessage reqMsg, IMessage retMsg)
[13:09:43] в System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData& msgData, Int32 type)
[13:09:43] в maddox.game.IBattle.OnTickGame()
[13:09:43] в maddox.game.GameDef.tickGame()
[13:09:43] в 13yXBRPwF6JbN5OXHZ6.NTKTOgPPsXwbvypIj6k.Z37cRDxFul C()
[13:09:43] в RKuLtykUFmi8DgWf36W.9FOhqSkweWrYgooHcsk.neSF4RIW4t 3(Boolean , Boolean )
[13:09:43] =================================================
[13:09:44] Loading mission ...
[13:09:44] Server: A new group of 4 Blue aircraft identified as Ju 87 B-2 was reported in sector >,<.
[13:09:44] Server: A new group of 2 Red aircraft identified as Walrus was reported in sector C,<.
[13:09:44] Server: A new group of 4 Red aircraft identified as Blenheim I was reported in sector D,<.
[13:09:44] Server: A group of Blue 3xDo 215 B-1 just appeared in sector E,4.
[13:09:44] Mission loaded. time = 0.180
[13:14:18] Server to [Server]: 8
[13:14:18]
[13:14:18] =================================================
[13:14:18] System.IndexOutOfRangeException: Индекс находился вне границ массива.
[13:14:18]
[13:14:18] Server stack trace:
[13:14:18] в WLxT1kvtHRQOtMZZl62.DRdThMvpbN33CGywFW7.wXZFyNGvcs 2(Player[] , Boolean , String , Object[] )
[13:14:18] в WLxT1kvtHRQOtMZZl62.DRdThMvpbN33CGywFW7.ppDoUYCpY9 HF87vxRBGe(Object , Boolean , Object , Object )
[13:14:18] в WLxT1kvtHRQOtMZZl62.DRdThMvpbN33CGywFW7.0AAFyzF3TV d(Player[] , String , Object[] )
[13:14:18] в UXx9sZjCf3yc9i99GpR.69j9o82zIn0dDNk0dpm.LogServer( Player[] , String , Object[] )
[13:14:18] в maddox.game.GameDef.gpLogServer(Player[] to, String format, Object[] args)
[13:14:18] в System.Runtime.Remoting.Messaging.StackBuilderSink ._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
[13:14:18] в System.Runtime.Remoting.Messaging.StackBuilderSink .SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
[13:14:18]
[13:14:18] Exception rethrown at [0]:
[13:14:18] в System.Runtime.Remoting.Proxies.RealProxy.HandleRe turnMessage(IMessage reqMsg, IMessage retMsg)
[13:14:18] в System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData& msgData, Int32 type)
[13:14:18] в maddox.game.IGamePlay.gpLogServer(Player[] to, String format, Object[] args)
[13:14:18] в Mission.OnTickGame()
[13:14:18] в maddox.game.ABattle.OnTickGame()
[13:14:18] в maddox.game.world.Strategy.OnTickGame()
[13:14:18] в System.Runtime.Remoting.Messaging.StackBuilderSink ._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
[13:14:18] в System.Runtime.Remoting.Messaging.StackBuilderSink .SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
[13:14:18]
[13:14:18] Exception rethrown at [1]:
[13:14:18] в System.Runtime.Remoting.Proxies.RealProxy.HandleRe turnMessage(IMessage reqMsg, IMessage retMsg)
[13:14:18] в System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData& msgData, Int32 type)
[13:14:18] в maddox.game.IBattle.OnTickGame()
[13:14:18] в maddox.game.GameDef.tickGame()
[13:14:18] в 13yXBRPwF6JbN5OXHZ6.NTKTOgPPsXwbvypIj6k.Z37cRDxFul C()
[13:14:18] в RKuLtykUFmi8DgWf36W.9FOhqSkweWrYgooHcsk.neSF4RIW4t 3(Boolean , Boolean )
[13:14:18] =================================================
[13:16:54] Server: Bofors murdered the Gunner of a Ju 87 B-2 () (AI).
[13:18:48] Server to [Server]: 9
[13:18:48]
[13:18:48] =================================================
[13:18:48] System.IndexOutOfRangeException: Индекс находился вне границ массива.
[13:18:48]
[13:18:48] Server stack trace:
[13:18:48] в WLxT1kvtHRQOtMZZl62.DRdThMvpbN33CGywFW7.wXZFyNGvcs 2(Player[] , Boolean , String , Object[] )
[13:18:48] в WLxT1kvtHRQOtMZZl62.DRdThMvpbN33CGywFW7.ppDoUYCpY9 HF87vxRBGe(Object , Boolean , Object , Object )
[13:18:48] в WLxT1kvtHRQOtMZZl62.DRdThMvpbN33CGywFW7.0AAFyzF3TV d(Player[] , String , Object[] )
[13:18:48] в UXx9sZjCf3yc9i99GpR.69j9o82zIn0dDNk0dpm.LogServer( Player[] , String , Object[] )
[13:18:48] в maddox.game.GameDef.gpLogServer(Player[] to, String format, Object[] args)
[13:18:48] в System.Runtime.Remoting.Messaging.StackBuilderSink ._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
[13:18:48] в System.Runtime.Remoting.Messaging.StackBuilderSink .SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
[13:18:48]
[13:18:48] Exception rethrown at [0]:
[13:18:48] в System.Runtime.Remoting.Proxies.RealProxy.HandleRe turnMessage(IMessage reqMsg, IMessage retMsg)
[13:18:48] в System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData& msgData, Int32 type)
[13:18:48] в maddox.game.IGamePlay.gpLogServer(Player[] to, String format, Object[] args)
[13:18:48] в Mission.OnTickGame()
[13:18:48] в maddox.game.ABattle.OnTickGame()
[13:18:48] в maddox.game.world.Strategy.OnTickGame()
[13:18:48] в System.Runtime.Remoting.Messaging.StackBuilderSink ._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
[13:18:48] в System.Runtime.Remoting.Messaging.StackBuilderSink .SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
[13:18:48]
[13:18:48] Exception rethrown at [1]:
[13:18:48] в System.Runtime.Remoting.Proxies.RealProxy.HandleRe turnMessage(IMessage reqMsg, IMessage retMsg)
[13:18:48] в System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData& msgData, Int32 type)
[13:18:48] в maddox.game.IBattle.OnTickGame()
[13:18:48] в maddox.game.GameDef.tickGame()
[13:18:48] в 13yXBRPwF6JbN5OXHZ6.NTKTOgPPsXwbvypIj6k.Z37cRDxFul C()
[13:18:48] в RKuLtykUFmi8DgWf36W.9FOhqSkweWrYgooHcsk.neSF4RIW4t 3(Boolean , Boolean )
[13:18:48] =================================================

How can it be fixed?

Flashman
05-27-2011, 09:37 AM
Was there at least one aircraft in existence on each side? The number should be showing up in the chat bar. I only tested it on my own server, so I know it shows up for the server, but it should show up for all players. If it's still not showing up, I don't know how to make the number show up without plastering it in those big gold letters in the center of the screen. :grin:


I will check my timing. This is the only thing in my mission which uses tick counts so perhaps ive missed something... wouldn't be the first time. But yeah there where plenty of AI when it should have run the first time. Will see what I can see.

TheEnlightenedFlorist
05-27-2011, 09:43 AM
Try this:


if (GamePlay.gpAirGroups(1) != null && GamePlay.gpAirGroups(2) != null)
{
if (Time.tickCounter() % 9000 == 0)
{
int totalAircraft = GamePlay.gpAirGroups(1).Length + GamePlay.gpAirGroups(2).Length;
GamePlay.gpLogServer(new Player[] { GamePlay.gpPlayer() }, totalAircraft.ToString(), null);
if(GamePlay.gpRemotePlayers() != null)
{
GamePlay.gpLogServer(GamePlay.gpRemotePlayers(), totalAircraft.ToString(), null);
}
}
}

That might help with Flashman's problem too.

Ataros
05-27-2011, 09:51 AM
[13:45:21] =================================================
[13:45:21] System.IndexOutOfRangeException: Индекс находился вне границ массива.
[13:45:21]
[13:45:21] Server stack trace:
[13:45:21] в WLxT1kvtHRQOtMZZl62.DRdThMvpbN33CGywFW7.wXZFyNGvcs 2(Player[] , Boolean , String , Object[] )
[13:45:21] в WLxT1kvtHRQOtMZZl62.DRdThMvpbN33CGywFW7.ppDoUYCpY9 HF87vxRBGe(Object , Boolean , Object , Object )
[13:45:21] в WLxT1kvtHRQOtMZZl62.DRdThMvpbN33CGywFW7.0AAFyzF3TV d(Player[] , String , Object[] )
[13:45:21] в UXx9sZjCf3yc9i99GpR.69j9o82zIn0dDNk0dpm.LogServer( Player[] , String , Object[] )
[13:45:21] в maddox.game.GameDef.gpLogServer(Player[] to, String format, Object[] args)
[13:45:21] в System.Runtime.Remoting.Messaging.StackBuilderSink ._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
[13:45:21] в System.Runtime.Remoting.Messaging.StackBuilderSink .SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
[13:45:21]
[13:45:21] Exception rethrown at [0]:
[13:45:21] в System.Runtime.Remoting.Proxies.RealProxy.HandleRe turnMessage(IMessage reqMsg, IMessage retMsg)
[13:45:21] в System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData& msgData, Int32 type)
[13:45:21] в maddox.game.IGamePlay.gpLogServer(Player[] to, String format, Object[] args)
[13:45:21] в Mission.OnTickGame()
[13:45:21] в maddox.game.ABattle.OnTickGame()
[13:45:21] в maddox.game.world.Strategy.OnTickGame()
[13:45:21] в System.Runtime.Remoting.Messaging.StackBuilderSink ._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
[13:45:21] в System.Runtime.Remoting.Messaging.StackBuilderSink .SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
[13:45:21]
[13:45:21] Exception rethrown at [1]:
[13:45:21] в System.Runtime.Remoting.Proxies.RealProxy.HandleRe turnMessage(IMessage reqMsg, IMessage retMsg)
[13:45:21] в System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData& msgData, Int32 type)
[13:45:21] в maddox.game.IBattle.OnTickGame()
[13:45:21] в maddox.game.GameDef.tickGame()
[13:45:21] в 13yXBRPwF6JbN5OXHZ6.NTKTOgPPsXwbvypIj6k.Z37cRDxFul C()
[13:45:21] в RKuLtykUFmi8DgWf36W.9FOhqSkweWrYgooHcsk.neSF4RIW4t 3(Boolean , Boolean )
[13:45:21] =================================================
[13:49:51] Server to [Server]: 4
[13:49:51]
[13:49:51] =================================================
[13:49:51] System.IndexOutOfRangeException: Индекс находился вне границ массива.
[13:49:51]
[13:49:51] Server stack trace:
[13:49:51] в WLxT1kvtHRQOtMZZl62.DRdThMvpbN33CGywFW7.wXZFyNGvcs 2(Player[] , Boolean , String , Object[] )
[13:49:51] в WLxT1kvtHRQOtMZZl62.DRdThMvpbN33CGywFW7.ppDoUYCpY9 HF87vxRBGe(Object , Boolean , Object , Object )
[13:49:51] в WLxT1kvtHRQOtMZZl62.DRdThMvpbN33CGywFW7.0AAFyzF3TV d(Player[] , String , Object[] )
[13:49:51] в UXx9sZjCf3yc9i99GpR.69j9o82zIn0dDNk0dpm.LogServer( Player[] , String , Object[] )
[13:49:51] в maddox.game.GameDef.gpLogServer(Player[] to, String format, Object[] args)
[13:49:51] в System.Runtime.Remoting.Messaging.StackBuilderSink ._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
[13:49:51] в System.Runtime.Remoting.Messaging.StackBuilderSink .SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
[13:49:51]

TheEnlightenedFlorist
05-27-2011, 09:58 AM
Wait, are you running it on a dedicated server? If so, try this. Otherwise, I'm out of ideas. :(

if (GamePlay.gpAirGroups(1) != null && GamePlay.gpAirGroups(2) != null)
{
if (Time.tickCounter() % 9000 == 0)
{
int totalAircraft = GamePlay.gpAirGroups(1).Length + GamePlay.gpAirGroups(2).Length;
if(GamePlay.gpPlayer() != null)
{
GamePlay.gpLogServer(new Player[] { GamePlay.gpPlayer() }, totalAircraft.ToString(), null);
}
if(GamePlay.gpRemotePlayers() != null)
{
GamePlay.gpLogServer(GamePlay.gpRemotePlayers(), totalAircraft.ToString(), null);
}
}
}

Ataros
05-27-2011, 10:07 AM
Sorry, same

[14:02:10] System.IndexOutOfRangeException: Индекс находился вне границ массива.
[14:02:10]
[14:02:10] Server stack trace:
[14:02:10] в WLxT1kvtHRQOtMZZl62.DRdThMvpbN33CGywFW7.wXZFyNGvcs 2(Player[] , Boolean , String , Object[] )
[14:02:10] в WLxT1kvtHRQOtMZZl62.DRdThMvpbN33CGywFW7.ppDoUYCpY9 HF87vxRBGe(Object , Boolean , Object , Object )
[14:02:10] в WLxT1kvtHRQOtMZZl62.DRdThMvpbN33CGywFW7.0AAFyzF3TV d(Player[] , String , Object[] )
[14:02:10] в UXx9sZjCf3yc9i99GpR.69j9o82zIn0dDNk0dpm.LogServer( Player[] , String , Object[] )
[14:02:10] в maddox.game.GameDef.gpLogServer(Player[] to, String format, Object[] args)
[14:02:10] в System.Runtime.Remoting.Messaging.StackBuilderSink ._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
[14:02:10] в System.Runtime.Remoting.Messaging.StackBuilderSink .SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
[14:02:10]
[14:02:10] Exception rethrown at [0]:
[14:02:10] в System.Runtime.Remoting.Proxies.RealProxy.HandleRe turnMessage(IMessage reqMsg, IMessage retMsg)
[14:02:10] в System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData& msgData, Int32 type)
[14:02:10] в maddox.game.IGamePlay.gpLogServer(Player[] to, String format, Object[] args)
[14:02:10] в Mission.OnTickGame()
[14:02:10] в maddox.game.ABattle.OnTickGame()
[14:02:10] в maddox.game.world.Strategy.OnTickGame()
[14:02:10] в System.Runtime.Remoting.Messaging.StackBuilderSink ._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
[14:02:10] в System.Runtime.Remoting.Messaging.StackBuilderSink .SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
[14:02:10]
[14:02:10] Exception rethrown at [1]:
[14:02:10] в System.Runtime.Remoting.Proxies.RealProxy.HandleRe turnMessage(IMessage reqMsg, IMessage retMsg)
[14:02:10] в System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData& msgData, Int32 type)
[14:02:10] в maddox.game.IBattle.OnTickGame()
[14:02:10] в maddox.game.GameDef.tickGame()
[14:02:10] в 13yXBRPwF6JbN5OXHZ6.NTKTOgPPsXwbvypIj6k.Z37cRDxFul C()
[14:02:10] в RKuLtykUFmi8DgWf36W.9FOhqSkweWrYgooHcsk.neSF4RIW4t 3(Boolean , Boolean )
[14:02:10] =================================================
[14:06:40] Server to [Server]: 4
[14:06:40]
[14:06:40] =================================================
[14:06:40] System.IndexOutOfRangeException: Индекс находился вне границ массива.
[14:06:40]
[14:06:40] Server stack trace:
[14:06:40] в WLxT1kvtHRQOtMZZl62.DRdThMvpbN33CGywFW7.wXZFyNGvcs 2(Player[] , Boolean , String , Object[] )
[14:06:40] в WLxT1kvtHRQOtMZZl62.DRdThMvpbN33CGywFW7.ppDoUYCpY9 HF87vxRBGe(Object , Boolean , Object , Object )
[14:06:40] в WLxT1kvtHRQOtMZZl62.DRdThMvpbN33CGywFW7.0AAFyzF3TV d(Player[] , String , Object[] )
[14:06:40] в UXx9sZjCf3yc9i99GpR.69j9o82zIn0dDNk0dpm.LogServer( Player[] , String , Object[] )
[14:06:40] в maddox.game.GameDef.gpLogServer(Player[] to, String format, Object[] args)
[14:06:40] в System.Runtime.Remoting.Messaging.StackBuilderSink ._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
[14:06:40] в System.Runtime.Remoting.Messaging.StackBuilderSink .SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
[14:06:40]
[14:06:40] Exception rethrown at [0]:
[14:06:40] в System.Runtime.Remoting.Proxies.RealProxy.HandleRe turnMessage(IMessage reqMsg, IMessage retMsg)
[14:06:40] в System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData& msgData, Int32 type)
[14:06:40] в maddox.game.IGamePlay.gpLogServer(P

TheEnlightenedFlorist
05-27-2011, 10:15 AM
Alright, one more try.


if (GamePlay.gpAirGroups(1) != null && GamePlay.gpAirGroups(2) != null)
{
if (Time.tickCounter() % 9000 == 0)
{
int totalAircraft = GamePlay.gpAirGroups(1).Length + GamePlay.gpAirGroups(2).Length;
if(GamePlay.gpPlayer().Length > 0)
{
GamePlay.gpLogServer(new Player[] { GamePlay.gpPlayer() }, totalAircraft.ToString(), null);
}
if(GamePlay.gpRemotePlayers().Length > 0)
{
GamePlay.gpLogServer(GamePlay.gpRemotePlayers(), totalAircraft.ToString(), null);
}
}
}

If you're not using a dedicated server, you can get in an aircraft on the server and this should work.

if (GamePlay.gpAirGroups(1) != null && GamePlay.gpAirGroups(2) != null)
{
if (Time.tickCounter() % 9000 == 0)
{
int totalAircraft = GamePlay.gpAirGroups(1).Length + GamePlay.gpAirGroups(2).Length;
if(GamePlay.gpPlayer() != null)
{
GamePlay.gpLogServer(new Player[] { GamePlay.gpPlayer() }, totalAircraft.ToString(), null);
}
}
}

Ataros
05-27-2011, 10:57 AM
For testing i am running a dedi server and joining it with a client from the same PC. I got error messages before joining the server.

It would be nice to have it working on a dedi server. Will try the latest version later. Thank you for your input.

TheEnlightenedFlorist
05-27-2011, 11:02 AM
For testing i am running a dedi server and joining it with a client from the same PC. I got error messages before joining the server.

It would be nice to have it working on a dedi server. Will try the latest version later. Thank you for your input.

I'm sorry it's not working right. The server log methods are a little confusing to me. Tomorrow, I'll see if I can find a better solution.

Flashman
05-27-2011, 11:04 AM
Your efforts are appreciated...as for me, I haven't a bloody clue! Im just muddling along trying to get a mission to work!

Thanks

Ataros
05-27-2011, 05:07 PM
Now it is better.
It says
"maddox.game.Player" does not contain definition for "Length"

[20:55:59] =================================================
[20:55:59] System.Exception: c:\Users\Andy\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\missions\Multi\Dogfight\BoF1\BoF_1_main1_7.c s(105,37): error CS1061: "maddox.game.Player" не содержит определение для "Length". Не удалось найти метод расширения "Length", принимающий первый аргумент типа "maddox.game.Player" (пропущено использование директивы или ссылка на сборку?)
[20:55:59]
[20:55:59] в W95BpjQhQGdapXjq6AD.Y79VY6QHpIXBu63gDbj.DNrbvsoLYT D(String , Boolean , Boolean )
[20:55:59] в W95BpjQhQGdapXjq6AD.Y79VY6QHpIXBu63gDbj.3Iw2CLCaNT nBeBq9j1Yy(Object , Boolean , Boolean )
[20:55:59] в W95BpjQhQGdapXjq6AD.Y79VY6QHpIXBu63gDbj.XBibvrRFwO K(String )
[20:55:59] в W95BpjQhQGdapXjq6AD.Y79VY6QHpIXBu63gDbj.b2WbvifgeN 1(String , Int32 )
[20:55:59] =================================================
[20:55:59]
[20:55:59] =================================================
[20:55:59] System.Exception: c:\Users\Andy\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\missions\Multi\Dogfight\BoF1\BoF_1_main1_7.c s(105,37): error CS1061: "maddox.game.Player" не содержит определение для "Length". Не удалось найти метод расширения "Length", принимающий первый аргумент типа "maddox.game.Player" (пропущено использование директивы или ссылка на сборку?)
[20:55:59]
[20:55:59] в W95BpjQhQGdapXjq6AD.Y79VY6QHpIXBu63gDbj.b2WbvifgeN 1(String , Int32 )
[20:55:59] в PvIUEjqHoL1yDhuyUY9.KErMihqBkLOM7gFVKGE.1sOBZ4gmJ3 (MTsEYPOQbCed3fk571y )
[20:55:59] =================================================

TheEnlightenedFlorist
05-28-2011, 01:08 AM
Alright, I finally have a solution. This won't send a message to the server, but it will appear in the server logs as something like "server to [username]: ". It will appear every five minutes for everybody connected to the server. You can decrease the time interval by changing 9000 to a lower number.

As a reminder, this code goes in the OnTickGame() method and both sides have to have at least one aircraft. I hope this helps. :grin:

if (GamePlay.gpAirGroups(1) != null && GamePlay.gpAirGroups(2) != null)
{
if (Time.tickCounter() % 9000 == 0)
{
int totalAircraft = GamePlay.gpAirGroups(1).Length + GamePlay.gpAirGroups(2).Length;
if (GamePlay.gpRemotePlayers().Length > 0)
{
GamePlay.gpLogServerBegin(GamePlay.gpRemotePlayers (), totalAircraft.ToString());
GamePlay.gpLogServerEnd();
}
}
}

Thee_oddball
05-28-2011, 01:23 AM
Now it is better.
It says
"maddox.game.Player" does not contain definition for "Length"

[20:55:59] =================================================
[20:55:59] System.Exception: c:\Users\Andy\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\missions\Multi\Dogfight\BoF1\BoF_1_main1_7.c s(105,37): error CS1061: "maddox.game.Player" не содержит определение для "Length". Не удалось найти метод расширения "Length", принимающий первый аргумент типа "maddox.game.Player" (пропущено использование директивы или ссылка на сборку?)
[20:55:59]
[20:55:59] в W95BpjQhQGdapXjq6AD.Y79VY6QHpIXBu63gDbj.DNrbvsoLYT D(String , Boolean , Boolean )
[20:55:59] в W95BpjQhQGdapXjq6AD.Y79VY6QHpIXBu63gDbj.3Iw2CLCaNT nBeBq9j1Yy(Object , Boolean , Boolean )
[20:55:59] в W95BpjQhQGdapXjq6AD.Y79VY6QHpIXBu63gDbj.XBibvrRFwO K(String )
[20:55:59] в W95BpjQhQGdapXjq6AD.Y79VY6QHpIXBu63gDbj.b2WbvifgeN 1(String , Int32 )
[20:55:59] =================================================
[20:55:59]
[20:55:59] =================================================
[20:55:59] System.Exception: c:\Users\Andy\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\missions\Multi\Dogfight\BoF1\BoF_1_main1_7.c s(105,37): error CS1061: "maddox.game.Player" не содержит определение для "Length". Не удалось найти метод расширения "Length", принимающий первый аргумент типа "maddox.game.Player" (пропущено использование директивы или ссылка на сборку?)
[20:55:59]
[20:55:59] в W95BpjQhQGdapXjq6AD.Y79VY6QHpIXBu63gDbj.b2WbvifgeN 1(String , Int32 )
[20:55:59] в PvIUEjqHoL1yDhuyUY9.KErMihqBkLOM7gFVKGE.1sOBZ4gmJ3 (MTsEYPOQbCed3fk571y )
[20:55:59] =================================================

Error CS1061
This error occurs when you try to call a method or access a class member that does not exist.

TheEnlightenedFlorist
05-28-2011, 01:24 AM
Error CS1061
This error occurs when you try to call a method or access a class member that does not exist.

Yeah, that was my bad. I was trying to write code without an IDE. :grin:

My latest snippet of code should work though. ;)

Ataros
05-28-2011, 06:54 AM
Thanks a lot again! I'll install it tomorrow when I am at my gaming PC.

adonys
07-28-2011, 05:55 AM
Mate, you're using the log to read the commands, or you've found a beter way?

CaptainDoggles
07-28-2011, 06:12 AM
This is an awesome project; please make it open source so others can contribute.

TheEnlightenedFlorist
07-29-2011, 05:02 AM
Mate, you're using the log to read the commands, or you've found a beter way?

No. It uses an external application. If you find a way to read text from the chat log, do let me know.

TheEnlightenedFlorist
07-29-2011, 05:27 AM
This is an awesome project; please make it open source so others can contribute.

I have attached them. Unfortunately, they are in separate Visual Studio solutions (and not very well written, in my opinion).

Also, it turns out there's a much easier way to reference the dll than using reflection.

//$reference IL2ServerMasterLibrary.dll
using IL2ServerMasterLibrary;

Then...

ServerMaster master = new ServerMaster("pass", 27340);
string[] command = master.popCommand();

CaptainDoggles
07-29-2011, 06:19 AM
I have attached them. Unfortunately, they are in separate Visual Studio solutions (and not very well written, in my opinion).

Also, it turns out there's a much easier way to reference the dll than using reflection.

//$reference IL2ServerMasterLibrary.dll
using IL2ServerMasterLibrary;

Then...

ServerMaster master = new ServerMaster("pass", 27340);
string[] command = master.popCommand();

Thanks! I'll delve into the code this weekend.

adonys
07-29-2011, 07:19 AM
I have attached them. Unfortunately, they are in separate Visual Studio solutions (and not very well written, in my opinion).

Also, it turns out there's a much easier way to reference the dll than using reflection.

//$reference IL2ServerMasterLibrary.dll
using IL2ServerMasterLibrary;

Then...

ServerMaster master = new ServerMaster("pass", 27340);
string[] command = master.popCommand();

Have you tested it? Because this referencing of a namespace (which it actually is) might just look for the dll to already be loaded, and might not load it by itself (and where it would look for it? core folder? bob folder? current script folder?) if it finds out is not loaded.

You might also use kegetys' way to have a dll loaded at the start of the game.

TheEnlightenedFlorist
07-29-2011, 08:55 AM
It works. It looks in the root directory of IL-2. Maybe it would make more sense if it were:

//$reference parts/ServerMaster/IL2ServerMasterLibrary.dll

adonys
07-29-2011, 09:14 AM
but isn't that line actually a comment? or you just meant it as a comment to show the path were it will look for the dll..

TheEnlightenedFlorist
07-29-2011, 10:33 AM
Technically, yes. IL-2 is obviously using it to reference the external dll before compiling the script. How that is done is beyond me.

CaptainDoggles
07-29-2011, 05:15 PM
Some parsers will read the first line, even if it's commented. Example: unix shell scripts.

adonys
07-30-2011, 07:30 AM
obviously they must have a parser which seems to look even after // chars for special words (as $reference).

41Sqn_Banks
07-30-2011, 07:33 AM
There is another keyword that can be placed within the mission script:

//$debug


This will give you more information if exceptions occure. I think the main purpose of the //$reference keyword is to allow the creation of a own base class for your mission. Without the reference the .dll that contains the base class is not loaded.

wildwillie
09-12-2011, 12:43 PM
Tried this yesterday and it worked when I used my client to run as a server. Was able to send the "Test" command and got Received back.

When I tested this on our Dedicated server it did not work. (Dedicated server uses Win 2008 Server OS (64bit)

The 1st problem I found and modified to work for me was in the code where you create the socket. New code I had to change the ipAddress.AddressFamily piece.

// Create a TCP/IP socket.
Socket client = new Socket(ipAddress.AddressFamily,
SocketType.Stream, ProtocolType.Tcp);

Now on the server it loads the server master and creates the port, but I do not get a "received" message back when I issue a command and I do not see any errors.

Any Ideas ?

WildWillie

wildwillie
09-14-2011, 12:51 AM
Also, it turns out there's a much easier way to reference the dll than using reflection.


Code:
//$reference IL2ServerMasterLibrary.dll
using IL2ServerMasterLibrary;Then...


Code:
ServerMaster master = new ServerMaster("pass", 27340);
string[] command = master.popCommand();

If using the above syntax in my mission script do I still need the OnBattleStarted/OnBattleStoped methods to declare everything ?

I would think no by your example, but I get the following error in my server log when the above code is used instead of the "Reflections" stuff.

=================================================
System.Exception: c:\Users\willie\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\missions\Multi\Dogfight\main.cs(24,24): error CS0236: A field initializer cannot reference the non-static field, method, or property 'Mission.master'

at elUgjJyQSTyUw5ACkC5.DycAUsynQYrfCiQcD9l.7xH8TZeymA 7(String , Boolean , Boolean )
at elUgjJyQSTyUw5ACkC5.DycAUsynQYrfCiQcD9l.o9e0xJrppZ Os9Hdpx1qr(Object , Boolean , Boolean )
at elUgjJyQSTyUw5ACkC5.DycAUsynQYrfCiQcD9l.gKP8TsfiPQ n(String )
at elUgjJyQSTyUw5ACkC5.DycAUsynQYrfCiQcD9l.x9MliMrTRj jBgALGw0Ov(Object )
at elUgjJyQSTyUw5ACkC5.DycAUsynQYrfCiQcD9l.yJF8aliJrV 2(String , Int32 )
=================================================

=================================================
System.Exception: c:\Users\willie\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\missions\Multi\Dogfight\main.cs(24,24): error CS0236: A field initializer cannot reference the non-static field, method, or property 'Mission.master'

at elUgjJyQSTyUw5ACkC5.DycAUsynQYrfCiQcD9l.yJF8aliJrV 2(String , Int32 )
at LxsOQ2lMvdvAq5WtJux.8x1kchl77DHyoNyKcFY.3utIWKxLiN (vASj0IJYAK5O3O5NAlk )
=================================================


Here is the 1st part of my mission script:

using System;
using maddox.game;
using maddox.game.world;
using System.Collections.Generic;
//$reference IL2ServerMasterLibrary.dll
using IL2ServerMasterLibrary;

public class Mission : AMission
{


// MethodInfo mi;
// Type classType;
// object obj;


int LastMissionLoaded = 0;

double initTime;

ServerMaster master = new ServerMaster("xyz", 27340);
string[] command = master.popCommand();

// public override void OnBattleStarted()
// {
// base.OnBattleStarted();
//
// try
// {
// //Load the new DLL from the specified path and set the current method to popCommand().
// Assembly a = null;
// a = Assembly.LoadFrom("missions/IL2ServerMasterLibrary.dll");
// classType = a.GetType("IL2ServerMasterLibrary.ServerMaster");
// obj = Activator.CreateInstance(classType, new object[] { "dover", 11000 });
// //First argument is the password, second is port number.
// mi = classType.GetMethod("popCommand");
// GamePlay.gpLogServer(new Player[] { GamePlay.gpPlayer() }, " - Server Master Loaded", null);
//
// }
// catch (Exception e)
// {
// GamePlay.gpLogServer(new Player[] { GamePlay.gpPlayer() }, "Could not load Server Master. :(" + e.Message + ")", null);
// }
// }


// public override void OnBattleStoped()
// {
// base.OnBattleStoped();
//
// //Set method to Stop(). Stop the DLL.
// mi = classType.GetMethod("Stop");
// mi.Invoke(obj, null);
// }



Any Ideas ?

WildWillie