Official Fulqrum Publishing forum

Official Fulqrum Publishing forum (http://forum.fulqrumpublishing.com/index.php)
-   CoD Multiplayer (http://forum.fulqrumpublishing.com/forumdisplay.php?f=192)
-   -   IL-2 Server Master v1.0 (http://forum.fulqrumpublishing.com/showthread.php?t=23275)

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:

Code:

        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

Quote:

Originally Posted by Ataros (Post 289847)
Now it is better.
It says
"maddox.game.Player" does not contain definition for "Length"

Code:

[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.cs(105,37): error CS1061: "maddox.game.Player" не содержит определение для "Length". Не удалось найти метод  расширения "Length", принимающий первый аргумент типа "maddox.game.Player"  (пропущено использование директивы или ссылка на сборку?)
[20:55:59]       
[20:55:59]          в W95BpjQhQGdapXjq6AD.Y79VY6QHpIXBu63gDbj.DNrbvsoLYTD(String , Boolean , Boolean )
[20:55:59]          в W95BpjQhQGdapXjq6AD.Y79VY6QHpIXBu63gDbj.3Iw2CLCaNTnBeBq9j1Yy(Object , Boolean , Boolean )
[20:55:59]          в W95BpjQhQGdapXjq6AD.Y79VY6QHpIXBu63gDbj.XBibvrRFwOK(String )
[20:55:59]          в W95BpjQhQGdapXjq6AD.Y79VY6QHpIXBu63gDbj.b2WbvifgeN1(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.cs(105,37): error CS1061: "maddox.game.Player" не содержит определение для "Length". Не удалось найти метод  расширения "Length", принимающий первый аргумент типа "maddox.game.Player"  (пропущено использование директивы или ссылка на сборку?)
[20:55:59]       
[20:55:59]          в W95BpjQhQGdapXjq6AD.Y79VY6QHpIXBu63gDbj.b2WbvifgeN1(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

Quote:

Originally Posted by Thee_oddball (Post 290025)
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

Quote:

Originally Posted by adonys (Post 316001)
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

2 Attachment(s)
Quote:

Originally Posted by CaptainDoggles (Post 316005)
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.

Code:

//$reference IL2ServerMasterLibrary.dll
using IL2ServerMasterLibrary;

Then...

Code:

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


CaptainDoggles 07-29-2011 06:19 AM

Quote:

Originally Posted by TheEnlightenedFlorist (Post 316426)
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.

Code:

//$reference IL2ServerMasterLibrary.dll
using IL2ServerMasterLibrary;

Then...

Code:

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

Quote:

Originally Posted by TheEnlightenedFlorist (Post 316426)
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.

Code:

//$reference IL2ServerMasterLibrary.dll
using IL2ServerMasterLibrary;

Then...

Code:

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.


All times are GMT. The time now is 01:40 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.