Results 1 to 10 of 10

Thread: Server mod

  1. #1

    Default Server mod

    If I want to create a mod that just runs on the server, say, to modify output to the log, how would I initialize it? Take for example a basic Hello World script. What if I wanted this to run everytime a new game is started?

    Code:
    class HelloWorld extends UTGame;
    
    function Init()
    {
    	LogInternal("===========");
    	LogInternal("Hello World");
    	LogInternal("===========");
    }
    I tried messing around with running the init via events such as:

    Code:
    event PostBeginPlay()
    {
    	Super.PostBeginPlay();
    	Init();
    }
    ...but to no avail.

  2. #2
    MSgt. Shooter Person
    Join Date
    Oct 2007
    Posts
    193
    Gamer IDs

    Gamertag: Pfhoenix0

    Default

    First of all, all GameInfo classes exist solely on the server. Second, any function not declared simulated will not run on clients. Third, you can't force a GameInfo subclass to run when every game starts up - every game is its own GameInfo class.

    Perhaps you should start with a mutator, to help you learn the basic class interactions and how they work.
    Fleet Wars
    Jetpack for UT3
    Raggy Weapons
    SpeedBump
    Mod Exemplar Project
    Official Proelium Site
    Official UnrealScript IRC Channel - #unrealscript on irc.enterthegame.com

  3. #3
    Iron Guard
    Join Date
    Oct 2007
    Location
    Netherlands
    Posts
    673

    Default

    Quote Originally Posted by Pfhoenix View Post
    Second, any function not declared simulated will not run on clients.
    While in general true, this might be an oversimplification. Functions that are not declared simulated can actually run on clients, for example in some special cases where the client owning an actor is the authority on that actor.

  4. #4

    Default

    Quote Originally Posted by Pfhoenix View Post
    First of all, all GameInfo classes exist solely on the server. Second, any function not declared simulated will not run on clients. Third, you can't force a GameInfo subclass to run when every game starts up - every game is its own GameInfo class.

    Perhaps you should start with a mutator, to help you learn the basic class interactions and how they work.
    Of course it runs only on the server - that's where I want this to run. So we extend UTDeathMatch, but this still doesn't answer my question.

    I don't need a mutator, that's why.

  5. #5
    MSgt. Shooter Person
    Join Date
    Jun 2007
    Posts
    337

    Default

    Subclassing UTGame creates a completely new GameType (like Deathmatch, CTF,...). To run a certain GameType on the server, you need to specify the "path" (Package.ClassName) in the commandline.
    So if you don't load the GameType, there can't be any PostBeginPlay()-calls.

    Oh, and although the UTGame-Actor doesn't exists (normally) on clients, it might be needed to have the package sent to them. The reason is, that other objects might call a static-function in the GameType-class client-side (like the GetLoadingHints()-function or whatever it was called in UT2k4).
    Unreal Dependencies: UnrealDeps (Updated: 27.01.11)
    Check dependencies of unreal packages; uz, uz2, uz3 standalone compression/decompression

    A multifunctional UT2004 mutator: Clan Manager 1h 6T (Updated 04.07.09)
    (Clanmember-/Admin-enter-messages, Clantag-Protection, Clanchat, Player-Logging, AFK-Detector, WhoIs, "second" private server to keep non-clanmembers out and much more.) Source included.

    Check client screenshots for cheats (an UT2004-Mutator): Screenshot Sender (Updated: 27.11.08)

  6. #6

    Default

    This is just a test I'm trying to perform, but what I really need to do is include a server mod that extends Info and dump data to a file. So far things are looking good, except for some method of actually calling the routine each time a new match starts up.

  7. #7

    Default

    How are you going to call it if its not a mutator? You need a mutator to call
    Code:
    Class servermut extends UTMutator
    
    function InitMutator(string Options, out string ErrorMessage)
    {
        Init()
        Super.InitMutator(Options, ErrorMessage);
    }
    Unless you are talking about the concept of ServerActor that the old UT's had.. now sure how that works in UT3

  8. #8

    Default

    Quote Originally Posted by KewlAzMe View Post
    Unless you are talking about the concept of ServerActor that the old UT's had.. now sure how that works in UT3
    Yes, a UT2004 style ServerActor - that's what I need to do.

  9. #9

    Default

    where has the ServerActor Section in ut3 gone? I can't find it in the inifiles...
    [DFP] Drunken Fun Players: dfp.clanintern.de
    -=([DFP])=-Server#1 [VCTF][Mapvote]: ut3://85.14.219.51:7477
    -=([DFP])=-Server#2 [VCTF][Custom]: ut3://85.14.219.51:7577

  10. #10
    Redeemer
    Join Date
    Sep 2002
    Location
    Ireland
    Posts
    1,143

    Default

    In UTEngine.ini under [Engine.GameEngine], add
    ServerActors=YourPackage.YourClass

    Unfortunately server actors are now only initialized the first time you start the server up, and are lost during level-streaming transitions; the only way to prevent that is to use a mutators 'GetSeamlessTravelActorList' function to carry the serveractor on to the next level, but that kind of removes the point in using serveractors in the first place, as you can just use a mutator instead.


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.