![]() |
|
|||||||
| CoD Multiplayer Everything about multiplayer in IL-2 CoD |
![]() |
|
|
Thread Tools | Display Modes |
|
#31
|
|||
|
|||
|
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 |
|
#32
|
|||
|
|||
|
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..
|
|
#33
|
|||
|
|||
|
Technically, yes. IL-2 is obviously using it to reference the external dll before compiling the script. How that is done is beyond me.
|
|
#34
|
||||
|
||||
|
Some parsers will read the first line, even if it's commented. Example: unix shell scripts.
|
|
#35
|
|||
|
|||
|
obviously they must have a parser which seems to look even after // chars for special words (as $reference).
|
|
#36
|
|||
|
|||
|
There is another keyword that can be placed within the mission script:
Code:
//$debug Last edited by 41Sqn_Banks; 07-30-2011 at 08:35 AM. |
|
#37
|
|||
|
|||
|
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. Code:
// Create a TCP/IP socket.
Socket client = new Socket(ipAddress.AddressFamily,
SocketType.Stream, ProtocolType.Tcp);
Any Ideas ? WildWillie |
|
#38
|
|||
|
|||
|
Quote:
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. Code:
================================================= 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.7xH8TZeymA7(String , Boolean , Boolean ) at elUgjJyQSTyUw5ACkC5.DycAUsynQYrfCiQcD9l.o9e0xJrppZOs9Hdpx1qr(Object , Boolean , Boolean ) at elUgjJyQSTyUw5ACkC5.DycAUsynQYrfCiQcD9l.gKP8TsfiPQn(String ) at elUgjJyQSTyUw5ACkC5.DycAUsynQYrfCiQcD9l.x9MliMrTRjjBgALGw0Ov(Object ) at elUgjJyQSTyUw5ACkC5.DycAUsynQYrfCiQcD9l.yJF8aliJrV2(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.yJF8aliJrV2(String , Int32 ) at LxsOQ2lMvdvAq5WtJux.8x1kchl77DHyoNyKcFY.3utIWKxLiN(vASj0IJYAK5O3O5NAlk ) ================================================= Here is the 1st part of my mission script: Code:
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);
// }
WildWillie |
![]() |
|
|