Fulqrum Publishing Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official Fulqrum Publishing forum > Fulqrum Publishing > IL-2 Sturmovik: Cliffs of Dover > CoD Multiplayer

CoD Multiplayer Everything about multiplayer in IL-2 CoD

Reply
 
Thread Tools Display Modes
  #21  
Old 05-28-2011, 01:08 AM
TheEnlightenedFlorist TheEnlightenedFlorist is offline
Approved Member
 
Join Date: May 2011
Location: SLC, Utah, USA
Posts: 143
Default

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.

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();
                }
            }
        }

Last edited by TheEnlightenedFlorist; 05-29-2011 at 02:05 AM.
Reply With Quote
  #22  
Old 05-28-2011, 01:23 AM
Thee_oddball Thee_oddball is offline
Approved Member
 
Join Date: Mar 2011
Posts: 812
Default

Quote:
Originally Posted by Ataros View Post
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.
__________________
Gigabyte Z68
Intel 2500K (@4.3 ghz)212 CM Cooler
8GB Ram
EVGA 660SC (super clocked) 2GB Vram
CORSAIR CMPSU-750TX 750W
64 GB SSD SATA II HD
WIN7 UL 64BIT
Reply With Quote
  #23  
Old 05-28-2011, 01:24 AM
TheEnlightenedFlorist TheEnlightenedFlorist is offline
Approved Member
 
Join Date: May 2011
Location: SLC, Utah, USA
Posts: 143
Default

Quote:
Originally Posted by Thee_oddball View Post
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.

My latest snippet of code should work though.
Reply With Quote
  #24  
Old 05-28-2011, 06:54 AM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

Thanks a lot again! I'll install it tomorrow when I am at my gaming PC.
Reply With Quote
  #25  
Old 07-28-2011, 05:55 AM
adonys adonys is offline
Approved Member
 
Join Date: Apr 2010
Posts: 850
Default

Mate, you're using the log to read the commands, or you've found a beter way?
Reply With Quote
  #26  
Old 07-28-2011, 06:12 AM
CaptainDoggles's Avatar
CaptainDoggles CaptainDoggles is offline
Approved Member
 
Join Date: Jun 2011
Posts: 1,198
Default

This is an awesome project; please make it open source so others can contribute.
Reply With Quote
  #27  
Old 07-29-2011, 05:02 AM
TheEnlightenedFlorist TheEnlightenedFlorist is offline
Approved Member
 
Join Date: May 2011
Location: SLC, Utah, USA
Posts: 143
Default

Quote:
Originally Posted by adonys View Post
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.
Reply With Quote
  #28  
Old 07-29-2011, 05:27 AM
TheEnlightenedFlorist TheEnlightenedFlorist is offline
Approved Member
 
Join Date: May 2011
Location: SLC, Utah, USA
Posts: 143
Default

Quote:
Originally Posted by CaptainDoggles View Post
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();
Attached Files
File Type: zip IL2ServerMaster.zip (1.07 MB, 7 views)
File Type: zip IL2ServerMasterLibrary.zip (42.6 KB, 8 views)

Last edited by TheEnlightenedFlorist; 07-29-2011 at 05:32 AM.
Reply With Quote
  #29  
Old 07-29-2011, 06:19 AM
CaptainDoggles's Avatar
CaptainDoggles CaptainDoggles is offline
Approved Member
 
Join Date: Jun 2011
Posts: 1,198
Default

Quote:
Originally Posted by TheEnlightenedFlorist View Post
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.
Reply With Quote
  #30  
Old 07-29-2011, 07:19 AM
adonys adonys is offline
Approved Member
 
Join Date: Apr 2010
Posts: 850
Default

Quote:
Originally Posted by TheEnlightenedFlorist View Post
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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:35 AM.


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