#1
|
|||
|
|||
Write to Launcher console process?
I'm trying to write to the MP Launcher console from a sub-mission script. The code below works in the main mission script ie. It will write the connection status in the console window, but it fails where I put the same script in the sub-mission script.cs. I thought I might have to construct a process-writer to write from the sub-mission to the Launcher console, but I can't get this to work. Help appeciated.
code removed by author I've tried this but often come up with a "System.Array does not contain a definition for StandardInput" inputWriter = process.StandardInput; // Create the console writer (fails) inputWriter.WriteLine("... Connected to MP game console failed."); //process.WriteLine("... Connected to MP game console failed.");
__________________
When one engine fails on a two engine bomber, you will always have enough power left to get to the scene of the crash. Get the latest COD Team Fusion patch info HERE Last edited by salmo; 10-18-2012 at 09:15 AM. |
#2
|
|||
|
|||
I haven't tried it but you might want to try AttachConsole(-1).
|
#3
|
|||
|
|||
Looks like you need a reference to the System.Runtime.InteropServices & the kernel32.dll file which contains the AttachConsole routine. This code-set has no compiler errors but doesn't write to the parent console either ...
__________________
When one engine fails on a two engine bomber, you will always have enough power left to get to the scene of the crash. Get the latest COD Team Fusion patch info HERE Last edited by salmo; 10-18-2012 at 09:16 AM. |
#4
|
|||
|
|||
Quote:
__________________
Core i7 3930K @ 4.8GHz; 16Gb DDR3 (Vengeance); nVidia GTX580; OS disk: 150Gb 10000rpm; SIM disk: 300Gb 10000rpm; Windows 7 x64 Ultimate |
#5
|
|||
|
|||
On Dedicated Server you can use GamePlay.gpPlayer() to write to the Console, on Dedi gpPlayer() is the server itself.
null sends the message to all, with the gpPlayer only the server (Console) gets the message. |
#6
|
|||
|
|||
Quote:
GamePlay.gpLogServer(GamePlay.gpPlayer(), "... Connected to MP launcher console OK.", null);
__________________
When one engine fails on a two engine bomber, you will always have enough power left to get to the scene of the crash. Get the latest COD Team Fusion patch info HERE |
#7
|
|||
|
|||
does this help?
Code:
private void sendChatMessageTo(int army, string msg, object[] parms) { List<Player> Players = new List<Player>(); //Singleplayer or Dedi Server if (GamePlay.gpPlayer() != null) { if (GamePlay.gpPlayer().Army() == army || army == -1) Players.Add(GamePlay.gpPlayer()); } // Multiplayer if (GamePlay.gpRemotePlayers() != null || GamePlay.gpRemotePlayers().Length > 0) { foreach (Player p in GamePlay.gpRemotePlayers()) { if (p.Army() == army || army == -1) Players.Add(p); } } if (Players != null && Players.Count > 0) GamePlay.gpLogServer(Players.ToArray(), msg, parms); }
__________________
__________________ Win7, 64bit Ultra Asus P8P67Pro MB Intel i7-2600K Coursair 16GB (4x 4GB), DDR3-1600MHz Gainward Nvidia 580GTX 3GB DDR5 850-Watt Modular Power Supply WIN7 and COD on Gskill SSD 240GB 40" Panasonic LCD TrackIR5 + Thrustmaster Warthog stick, throttle & pedals |
#8
|
|||
|
|||
Sorry to say it doesn't Wolf. I'm trying to write script-log information to the Launcher console from a sub-mission script, not write to the game screen chat window.
__________________
When one engine fails on a two engine bomber, you will always have enough power left to get to the scene of the crash. Get the latest COD Team Fusion patch info HERE |
#9
|
|||
|
|||
Quote:
Ask about this naryv on Sukhoi.ru, he know how do this. |
#10
|
|||
|
|||
I've tried using the 'Sending server console commands from script' example below, but the code below throws a "missing reference required error" at the line in the sub-mission script where SendServerCommand function is called
__________________
When one engine fails on a two engine bomber, you will always have enough power left to get to the scene of the crash. Get the latest COD Team Fusion patch info HERE Last edited by salmo; 10-18-2012 at 09:16 AM. |
Thread Tools | |
Display Modes | |
|
|