Register for your free account! | Forgot your password?

Go Back   elitepvpers > Shooter > S4 League
You last visited: Today at 19:49

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Can't create arcade/cube rooms in S10 emulator

Discussion on Can't create arcade/cube rooms in S10 emulator within the S4 League forum part of the Shooter category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Mar 2014
Posts: 6
Received Thanks: 0
Unhappy Can't create arcade/cube rooms in S10 emulator

Hey hi, I'm currently trying out , I ran the setup smoothly and got the server running, but when I try to create an arcade map or cube conquest, the game says "can't find a room"



I have some basic knowledge and got to re add some weapons and things that weren't present in the emulator via heidisql

What should I tweak in the server emulator? I know the emulator is not complete and all, but I just really wanted to play those game modes.

Thanks in advance.
pepeasafares is offline  
Old 06/01/2023, 19:20   #2

 
Anja Mielbrecht's Avatar
 
elite*gold: 55
Join Date: Nov 2018
Posts: 449
Received Thanks: 165
Check if the gamemodes are enabled "/Gameserver/game/GameRuleFactory.cs"
Code:
Add(GameRule.Horde, room => new ConquestGameRule(room));
Anja Mielbrecht is offline  
Old 06/05/2023, 06:23   #3
 
elite*gold: 0
Join Date: Mar 2014
Posts: 6
Received Thanks: 0
Quote:
Originally Posted by Anja Mielbrecht View Post
Check if the gamemodes are enabled "/Gameserver/game/GameRuleFactory.cs"
Code:
Add(GameRule.Horde, room => new ConquestGameRule(room));
Thanks, I've checked and in fact, that code was missing, but I noticed that "ConquestGameRule.cs" is also missing from the "GameRules" folder. I tried creating one from GameRuleBase.cs and ArcadeGameRule.cs but still, when I try to create a conquest or arcade room, it says "cannot find a room"

The GameRuleFactory.cs now looks like this:

Code:
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using Netsphere.Game.GameRules;


namespace Netsphere.Game
{
    internal class GameRuleFactory
    {
        private readonly IDictionary<GameRule, Func<Room, GameRuleBase>> _gameRules = new ConcurrentDictionary<GameRule, Func<Room, GameRuleBase>>();

        public GameRuleFactory()
        {
            Add(GameRule.Touchdown, room => new TouchdownGameRule(room));
            Add(GameRule.Deathmatch, room => new DeathmatchGameRule(room));
            Add(GameRule.Chaser, room => new ChaserGameRule(room));
            Add(GameRule.BattleRoyal, room => new BattleRoyalGameRule(room));
            
            Add(GameRule.Practice, room => new PracticeGameRule(room));
            Add(GameRule.CombatTrainingTD, room => new TouchdownTrainingGameRule(room));
            Add(GameRule.CombatTrainingDM, room => new DeathmatchTrainingGameRule(room));
            
            Add(GameRule.Warfare, room => new WarfareGameRule(room));
            Add(GameRule.Siege, room => new SiegeGameRule(room));
            Add(GameRule.Arena, room => new ArenaGameRule(room));
            Add(GameRule.Arcade, room => new ArcadeGameRule(room));

            Add(GameRule.Horde, room => new ConquestGameRule(room));
        }

        public void Add(GameRule gameRule, Func<Room, GameRuleBase> gameRuleFactory)
        {
            if (!_gameRules.TryAdd(gameRule, gameRuleFactory))
                throw new Exception($"GameRule {gameRule} already registered");
        }

        public void Remove(GameRuleBase gameRule)
        {
            _gameRules.Remove(gameRule.GameRule);
        }

        public GameRuleBase Get(GameRule gameRule, Room room)
        {
            Func<Room, GameRuleBase> gameRuleFactory;
            if (!_gameRules.TryGetValue(gameRule, out gameRuleFactory))
                throw new Exception($"GameRule {gameRule} not registered");

            return gameRuleFactory(room);
        }

        public bool Contains(GameRule gameRule)
        {
            return _gameRules.ContainsKey(gameRule);
        }
    }
}
and the Game/GameRules/ConquestGameRule.cs looks like this:

Code:
using System;
using System.IO;
using System.Linq;
using Netsphere.Network.Message.GameRule;
using Netsphere.Network.Data.GameRule;

// ReSharper disable once CheckNamespace
namespace Netsphere.Game.GameRules
{
    internal class PracticeGameRule : GameRuleBase
    {
        private const uint PlayersNeededToStart = 1;
        
        public override GameRule GameRule => GameRule.Practice;
        public override Briefing Briefing { get; }
        

        public PracticeGameRule(Room room)
            : base(room)
        {
            Briefing = new Briefing(this);

            StateMachine.Configure(GameRuleState.Waiting)
                .PermitIf(GameRuleStateTrigger.StartPrepare, GameRuleState.Prepare, CanPrepareGame);

            StateMachine.Configure(GameRuleState.Prepare)
                .PermitIf(GameRuleStateTrigger.StartGame, GameRuleState.FirstHalf, CanStartGame);

            StateMachine.Configure(GameRuleState.FirstHalf)
                .SubstateOf(GameRuleState.Playing)
                .Permit(GameRuleStateTrigger.StartHalfTime, GameRuleState.EnteringHalfTime)
                .Permit(GameRuleStateTrigger.StartResult, GameRuleState.EnteringResult);

            StateMachine.Configure(GameRuleState.EnteringHalfTime)
                .SubstateOf(GameRuleState.Playing)
                .Permit(GameRuleStateTrigger.StartHalfTime, GameRuleState.HalfTime)
                .Permit(GameRuleStateTrigger.StartResult, GameRuleState.EnteringResult);

            StateMachine.Configure(GameRuleState.HalfTime)
                .SubstateOf(GameRuleState.Playing)
                .Permit(GameRuleStateTrigger.StartSecondHalf, GameRuleState.SecondHalf)
                .Permit(GameRuleStateTrigger.StartResult, GameRuleState.EnteringResult);

            StateMachine.Configure(GameRuleState.SecondHalf)
                .SubstateOf(GameRuleState.Playing)
                .Permit(GameRuleStateTrigger.StartResult, GameRuleState.EnteringResult);

            StateMachine.Configure(GameRuleState.EnteringResult)
                .SubstateOf(GameRuleState.Playing)
                .Permit(GameRuleStateTrigger.StartResult, GameRuleState.Result);

            StateMachine.Configure(GameRuleState.Result)
                .SubstateOf(GameRuleState.Playing)
                .Permit(GameRuleStateTrigger.EndGame, GameRuleState.Waiting);
        }

        public override void Initialize()
        {
            Room.TeamManager.Add(Team.Alpha, (uint)(Room.Options.PlayerLimit), (uint)0);

            base.Initialize();
        }

        public override void Cleanup()
        {
            Room.TeamManager.Remove(Team.Alpha);

            base.Cleanup();
        }

        public override void Update(TimeSpan delta)
        {
            base.Update(delta);

            var teamMgr = Room.TeamManager;

            if (StateMachine.IsInState(GameRuleState.Playing) &&
                !StateMachine.IsInState(GameRuleState.EnteringResult) &&
                !StateMachine.IsInState(GameRuleState.Result))
            {
                if (StateMachine.IsInState(GameRuleState.FirstHalf))
                {
                    // Still have enough players?
                    if (teamMgr.PlayersPlaying.Count() < PlayersNeededToStart)
                        StateMachine.Fire(GameRuleStateTrigger.StartResult);

                    // Did we reach ScoreLimit?
                    if (teamMgr.PlayersPlaying.Any(plr => plr.RoomInfo.Stats.TotalScore >= Room.Options.ScoreLimit))
                        StateMachine.Fire(GameRuleStateTrigger.StartResult);

                    // Did we reach round limit?
                    var roundTimeLimit = TimeSpan.FromMilliseconds(Room.Options.TimeLimit.TotalMilliseconds);
                    if (RoundTime >= roundTimeLimit)
                        StateMachine.Fire(GameRuleStateTrigger.StartResult);
                }
            }
        }

        public override PlayerRecord GetPlayerRecord(Player plr)
        {
            return new PracticePlayerRecord(plr);
        }

        public override void OnScoreKill(Player killer, Player assist, Player target, AttackAttribute attackAttribute, LongPeerId ScoreTarget = null, LongPeerId ScoreKiller = null, LongPeerId ScoreAssist = null)
        {
            Respawn(Room.Creator);
            if (ScoreAssist != null)
            {

                Room.Broadcast(
                    new ScoreKillAssistAckMessage(new ScoreAssistDto(ScoreKiller, ScoreAssist,
                        ScoreTarget, attackAttribute)));
            }
            else
            {
                Room.Broadcast(
                    new ScoreKillAckMessage(new ScoreDto(ScoreKiller, ScoreTarget,
                        attackAttribute)));
            }
            return;
        }
        
        private bool CanPrepareGame()
        {
            if (!StateMachine.IsInState(GameRuleState.Waiting))
                return false;
            
            return true;
        }
        private bool CanStartGame()
        {
            return true;
        }

        private static PracticePlayerRecord GetRecord(Player plr)
        {
            return (PracticePlayerRecord)plr.RoomInfo.Stats;
        }
    }

    internal class PracticePlayerRecord : PlayerRecord
    {
        public override uint TotalScore => GetTotalScore();

        public uint BonusKills { get; set; }
        public uint BonusKillAssists { get; set; }
        public int Unk5 { get; set; }
        public int Unk6 { get; set; }
        public int Unk7 { get; set; } // Increases kill score
        public int Unk8 { get; set; } // increases kill assist score
        public int Unk9 { get; set; }
        public int Unk10 { get; set; }
        public int Unk11 { get; set; }

        public PracticePlayerRecord(Player plr)
            : base(plr)
        { }

        public override void Serialize(BinaryWriter w, bool isResult)
        {
            base.Serialize(w, isResult);

            w.Write(Kills);
            w.Write(Kills);
            w.Write(Kills);
            w.Write(Kills);
            w.Write(Kills);
            w.Write(Kills);
            w.Write(Kills);
            w.Write(Kills);
            w.Write(Kills);
            w.Write(Kills);
            w.Write(Kills);
        }

        public override void Reset()
        {
            base.Reset();

            KillAssists = 0;
            BonusKills = 0;
            BonusKillAssists = 0;
            Unk5 = 0;
            Unk6 = 0;
            Unk7 = 0;
            Unk8 = 0;
            Unk9 = 0;
            Unk10 = 0;
            Unk11 = 0;
        }

        private uint GetTotalScore()
        {
            return Kills * 2 +
                KillAssists +
                BonusKills * 5 +
                BonusKillAssists;
        }
    }
}
pepeasafares is offline  
Old 06/05/2023, 12:34   #4

 
Anja Mielbrecht's Avatar
 
elite*gold: 55
Join Date: Nov 2018
Posts: 449
Received Thanks: 165
Quote:
Originally Posted by pepeasafares View Post
Thanks, I've checked and in fact, that code was missing, but I noticed that "ConquestGameRule.cs" is also missing from the "GameRules" folder. I tried creating one from GameRuleBase.cs and ArcadeGameRule.cs but still, when I try to create a conquest or arcade room, it says "cannot find a room"

The GameRuleFactory.cs now looks like this:

Code:
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using Netsphere.Game.GameRules;


namespace Netsphere.Game
{
    internal class GameRuleFactory
    {
        private readonly IDictionary<GameRule, Func<Room, GameRuleBase>> _gameRules = new ConcurrentDictionary<GameRule, Func<Room, GameRuleBase>>();

        public GameRuleFactory()
        {
            Add(GameRule.Touchdown, room => new TouchdownGameRule(room));
            Add(GameRule.Deathmatch, room => new DeathmatchGameRule(room));
            Add(GameRule.Chaser, room => new ChaserGameRule(room));
            Add(GameRule.BattleRoyal, room => new BattleRoyalGameRule(room));
            
            Add(GameRule.Practice, room => new PracticeGameRule(room));
            Add(GameRule.CombatTrainingTD, room => new TouchdownTrainingGameRule(room));
            Add(GameRule.CombatTrainingDM, room => new DeathmatchTrainingGameRule(room));
            
            Add(GameRule.Warfare, room => new WarfareGameRule(room));
            Add(GameRule.Siege, room => new SiegeGameRule(room));
            Add(GameRule.Arena, room => new ArenaGameRule(room));
            Add(GameRule.Arcade, room => new ArcadeGameRule(room));

            Add(GameRule.Horde, room => new ConquestGameRule(room));
        }

        public void Add(GameRule gameRule, Func<Room, GameRuleBase> gameRuleFactory)
        {
            if (!_gameRules.TryAdd(gameRule, gameRuleFactory))
                throw new Exception($"GameRule {gameRule} already registered");
        }

        public void Remove(GameRuleBase gameRule)
        {
            _gameRules.Remove(gameRule.GameRule);
        }

        public GameRuleBase Get(GameRule gameRule, Room room)
        {
            Func<Room, GameRuleBase> gameRuleFactory;
            if (!_gameRules.TryGetValue(gameRule, out gameRuleFactory))
                throw new Exception($"GameRule {gameRule} not registered");

            return gameRuleFactory(room);
        }

        public bool Contains(GameRule gameRule)
        {
            return _gameRules.ContainsKey(gameRule);
        }
    }
}
and the Game/GameRules/ConquestGameRule.cs looks like this:

Code:
using System;
using System.IO;
using System.Linq;
using Netsphere.Network.Message.GameRule;
using Netsphere.Network.Data.GameRule;

// ReSharper disable once CheckNamespace
namespace Netsphere.Game.GameRules
{
    internal class PracticeGameRule : GameRuleBase
    {
        private const uint PlayersNeededToStart = 1;
        
        public override GameRule GameRule => GameRule.Practice;
        public override Briefing Briefing { get; }
        

        public PracticeGameRule(Room room)
            : base(room)
        {
            Briefing = new Briefing(this);

            StateMachine.Configure(GameRuleState.Waiting)
                .PermitIf(GameRuleStateTrigger.StartPrepare, GameRuleState.Prepare, CanPrepareGame);

            StateMachine.Configure(GameRuleState.Prepare)
                .PermitIf(GameRuleStateTrigger.StartGame, GameRuleState.FirstHalf, CanStartGame);

            StateMachine.Configure(GameRuleState.FirstHalf)
                .SubstateOf(GameRuleState.Playing)
                .Permit(GameRuleStateTrigger.StartHalfTime, GameRuleState.EnteringHalfTime)
                .Permit(GameRuleStateTrigger.StartResult, GameRuleState.EnteringResult);

            StateMachine.Configure(GameRuleState.EnteringHalfTime)
                .SubstateOf(GameRuleState.Playing)
                .Permit(GameRuleStateTrigger.StartHalfTime, GameRuleState.HalfTime)
                .Permit(GameRuleStateTrigger.StartResult, GameRuleState.EnteringResult);

            StateMachine.Configure(GameRuleState.HalfTime)
                .SubstateOf(GameRuleState.Playing)
                .Permit(GameRuleStateTrigger.StartSecondHalf, GameRuleState.SecondHalf)
                .Permit(GameRuleStateTrigger.StartResult, GameRuleState.EnteringResult);

            StateMachine.Configure(GameRuleState.SecondHalf)
                .SubstateOf(GameRuleState.Playing)
                .Permit(GameRuleStateTrigger.StartResult, GameRuleState.EnteringResult);

            StateMachine.Configure(GameRuleState.EnteringResult)
                .SubstateOf(GameRuleState.Playing)
                .Permit(GameRuleStateTrigger.StartResult, GameRuleState.Result);

            StateMachine.Configure(GameRuleState.Result)
                .SubstateOf(GameRuleState.Playing)
                .Permit(GameRuleStateTrigger.EndGame, GameRuleState.Waiting);
        }

        public override void Initialize()
        {
            Room.TeamManager.Add(Team.Alpha, (uint)(Room.Options.PlayerLimit), (uint)0);

            base.Initialize();
        }

        public override void Cleanup()
        {
            Room.TeamManager.Remove(Team.Alpha);

            base.Cleanup();
        }

        public override void Update(TimeSpan delta)
        {
            base.Update(delta);

            var teamMgr = Room.TeamManager;

            if (StateMachine.IsInState(GameRuleState.Playing) &&
                !StateMachine.IsInState(GameRuleState.EnteringResult) &&
                !StateMachine.IsInState(GameRuleState.Result))
            {
                if (StateMachine.IsInState(GameRuleState.FirstHalf))
                {
                    // Still have enough players?
                    if (teamMgr.PlayersPlaying.Count() < PlayersNeededToStart)
                        StateMachine.Fire(GameRuleStateTrigger.StartResult);

                    // Did we reach ScoreLimit?
                    if (teamMgr.PlayersPlaying.Any(plr => plr.RoomInfo.Stats.TotalScore >= Room.Options.ScoreLimit))
                        StateMachine.Fire(GameRuleStateTrigger.StartResult);

                    // Did we reach round limit?
                    var roundTimeLimit = TimeSpan.FromMilliseconds(Room.Options.TimeLimit.TotalMilliseconds);
                    if (RoundTime >= roundTimeLimit)
                        StateMachine.Fire(GameRuleStateTrigger.StartResult);
                }
            }
        }

        public override PlayerRecord GetPlayerRecord(Player plr)
        {
            return new PracticePlayerRecord(plr);
        }

        public override void OnScoreKill(Player killer, Player assist, Player target, AttackAttribute attackAttribute, LongPeerId ScoreTarget = null, LongPeerId ScoreKiller = null, LongPeerId ScoreAssist = null)
        {
            Respawn(Room.Creator);
            if (ScoreAssist != null)
            {

                Room.Broadcast(
                    new ScoreKillAssistAckMessage(new ScoreAssistDto(ScoreKiller, ScoreAssist,
                        ScoreTarget, attackAttribute)));
            }
            else
            {
                Room.Broadcast(
                    new ScoreKillAckMessage(new ScoreDto(ScoreKiller, ScoreTarget,
                        attackAttribute)));
            }
            return;
        }
        
        private bool CanPrepareGame()
        {
            if (!StateMachine.IsInState(GameRuleState.Waiting))
                return false;
            
            return true;
        }
        private bool CanStartGame()
        {
            return true;
        }

        private static PracticePlayerRecord GetRecord(Player plr)
        {
            return (PracticePlayerRecord)plr.RoomInfo.Stats;
        }
    }

    internal class PracticePlayerRecord : PlayerRecord
    {
        public override uint TotalScore => GetTotalScore();

        public uint BonusKills { get; set; }
        public uint BonusKillAssists { get; set; }
        public int Unk5 { get; set; }
        public int Unk6 { get; set; }
        public int Unk7 { get; set; } // Increases kill score
        public int Unk8 { get; set; } // increases kill assist score
        public int Unk9 { get; set; }
        public int Unk10 { get; set; }
        public int Unk11 { get; set; }

        public PracticePlayerRecord(Player plr)
            : base(plr)
        { }

        public override void Serialize(BinaryWriter w, bool isResult)
        {
            base.Serialize(w, isResult);

            w.Write(Kills);
            w.Write(Kills);
            w.Write(Kills);
            w.Write(Kills);
            w.Write(Kills);
            w.Write(Kills);
            w.Write(Kills);
            w.Write(Kills);
            w.Write(Kills);
            w.Write(Kills);
            w.Write(Kills);
        }

        public override void Reset()
        {
            base.Reset();

            KillAssists = 0;
            BonusKills = 0;
            BonusKillAssists = 0;
            Unk5 = 0;
            Unk6 = 0;
            Unk7 = 0;
            Unk8 = 0;
            Unk9 = 0;
            Unk10 = 0;
            Unk11 = 0;
        }

        private uint GetTotalScore()
        {
            return Kills * 2 +
                KillAssists +
                BonusKills * 5 +
                BonusKillAssists;
        }
    }
}
Check this thread you will find better emulators. I believe I had played conquest and scenario on one of them.
Anja Mielbrecht is offline  
Old 06/05/2023, 14:57   #5
 
elite*gold: 50
Join Date: Jan 2017
Posts: 712
Received Thanks: 594
Code:
        private uint GetTotalScore()
        {
            return Kills * 2 +
                KillAssists +
                BonusKills * 5 +
                BonusKillAssists;
        }
Isn't it a little bit interesting? 🙃
0N1K4G3 is offline  
Old 04/19/2024, 06:19   #6
 
xAmbiente's Avatar
 
elite*gold: 0
Join Date: Jun 2021
Posts: 21
Received Thanks: 15
Quote:
public override void Serialize(BinaryWriter w, bool isResult)
{
base.Serialize(w, isResult);

w.Write(Kills);
w.Write(Kills);
w.Write(Kills);
w.Write(Kills);
w.Write(Kills);
w.Write(Kills);
w.Write(Kills);
w.Write(Kills);
w.Write(Kills);
w.Write(Kills);
w.Write(Kills);
}
Also this is quite interesting! XD
xAmbiente is offline  
Reply

Tags
emulator, s4 league


Similar Threads Similar Threads
[05.02.14] Maphack by IamSuperman [Create Zombie Rooms in CQC & Event Rooms]
02/09/2014 - WarRock Hacks, Bots, Cheats & Exploits - 7 Replies
Hello Guys, updated MapHack again. Still only works on 64 Bit Operating Systems and Premium required #added Event Room Function How does it work? video: http://www.youtube.com/watch?v=_wa_9CXsZJg image: http://s14.directupload.net/images/140125/cbao4f7v .png
Neuster Metin2 Server-Emulator ACM-Emulator [99% Auto-Create]
05/26/2013 - Metin2 Private Server - 12 Replies
Moin leute ich möchte euch den neuen Metin 2 Server-Emulator vorstellen! Features: - Er erstellt alles alleine, nur noch IP eintragen und los legen. - Aktuelle Online Version vom Publish-Mt2. - Es lässt sich ganz leicht über ein externes Programm (unten der link dazu) yang, waffen, rüstungen, Serverrates, Monsterlevel, drachenmünzen, drops von bestimmt gegnern, uvm.. vergeben. - Root-fähig, Hamachi-fähig - localhost-fähig, d.h. du ein ein weiterer spieler könnt, ohne probleme auf dem...
[SAMMELTHREAD] Rooms mit PW - lvl up rooms
11/09/2012 - CrossFire - 10 Replies
Hey Com, hab gesehn es gibt oft Threads wo und was etwas stattfindet.. also postet einfach eure Channels Rooms Pws etc. hier rein so wird allen das etwas leichter gemacht ,D MFG 『eNergyy』™



All times are GMT +1. The time now is 19:49.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.