![]() |
|
CoD Multiplayer Everything about multiplayer in IL-2 CoD |
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
![]()
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!
![]() 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. Code:
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. } } } 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. ![]() 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 Last edited by TheEnlightenedFlorist; 05-26-2011 at 04:23 AM. |
|
|