GithubHelp home page GithubHelp logo

battlebit-community-server-api's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

battlebit-community-server-api's Issues

Cancellable Callbacks

Here is a example:

public static async Task<bool> OnPlayerChat(MujPlayer player, ChatChannel channel, string msg)
{
	if (msg.StartsWith("!"))
	{
	    return false; // to cancel event so it doesn't show up in chat
        }
        return true;
}

Another example for this:

public static async Task<bool> OnPlayerChat(MujPlayer player, ChatChannel channel, string msg)
{
	if (PassProfanityFilter(msg))
	{
	    return false; // to cancel event so it doesn't show up in chat
	}
        return true;
}

Any different ways would to cancel events would be nice aswell

[Bug] PlayerStats resets every new round session.

Describe the bug
Using the internal DiskStorage to save and restore player data, if a player keeps connection till round ends and do not d/c.
The PlayerStats will not be saved fo this player, and when a new round starts, it's stats become all 000.

To Reproduce
Steps to reproduce the behavior:

  1. round 1, Player A kills Player B
  2. round 1, Player B disconnects.
  3. round 1, Player A force end game
  4. round 2, Plaer a disconnects.
  5. Player A get 0 kill, few round 2 PlayTimeSeconds
  6. Player B gets 1 dead, round 1 PlayTimeSeconds

Expected behavior
In each round ends, the SaveData work as intentional, like official servers. So we can keep the progress.

Screenshots
none

Additional context
none

[Feature Request] Allow sending IL for specific events.

Is your feature request related to a problem? Please describe.
There currently is no feasible way of handling events that get called with very often and/or require very little delay to function.
Examples are when a player uses a tool, when a player gets damaged and when a vehicle uses a weapon.
I would ideally be able to control when a player can damage, as well as by how much.

Describe the solution you'd like
Depending on how much work you want to be done by the API, I see 2 possible options,

  1. GameServer has a method to override as if these events were normal ones, and during GameServerConnected the server sends the method body to the game server.
  2. You have to manually send over the method body to the game server.
    The game server would then store the method body locally (Dictionary<Enum LocalEvent, Action>) and execute it when the event happens. Whitelisting/blacklisting namespaces, methods, and similar (potentially rejecting a method when it gets received), as well as adding timeout shouldn't be very hard.
    Any errors than happen during execution should cause the method to be disabled/deleted and the error sent back to the API.
    Feel free to more or less copy https://github.com/moddedmcplayer/ILON which was made specifically to demonstrate that it is possible.

Describe alternatives you've considered
Implementing these types of events like any other -> too much traffic.

Additional context
When I say method body I am referring to method body and any other needed metadata.
Bundling this together with a mono dedicated server build release, if it ever happens, would be nice as it would allow us to just directly reference Assembly-CSharp, eliminating potential duplicated code.

[Feature Request] Allow API to set Permissions.txt path/edit in-code

Is your feature request related to a problem? Please describe.
I currently have to update 4 separate Permissions.txt files on 2 separate machines.

Describe the solution you'd like
Perhaps an event so we can return player rank.

Describe alternatives you've considered
Setting Permissions.txt path for one machine

[Bug] Player.Message cuts 1 character off the string

Describe the bug
When using Player.Message, the message shown has 1 character stripped from the end of the string

To Reproduce
Steps to reproduce the behavior:

  1. Send a message to a player trough Player.Message

Expected behavior
The message should be shown as it was sent from the API

Screenshots
image
image

[bug] GameServer FixedSize

I am not aware of the exact issue here since I do not have the Game Server code, but if I set FixedSize=none or not at all in the server start arguments, and try to play with map/gamemode rotations and end the game, the voting screen is empty, can't vote for anything, counter goes down to 1, and nothing happens except the continuous zoom out. The server starts spamming null reference exceptions:

image

This could perhaps be due to incompatibilities with the scale/gamemode/map selections, but the server should surely be able to handle these cases and others, so that this doesn't happen.

Match/Round callbacks

Hi,

I want to do more detailed stat tracking, generating reports after rounds/matches. There don't seem to be any match or round related callbacks, such as:

OnMatchStart
OnMatchFinish
OnRoundStart
OnRoundFinish

Could probably condense these, but all I think I would need is the GameServer passed back.

[Feature Request] Voxel world modification

Would love to see implementation of packets for directly reading & writing to the Voxel world to allow for direct map modification
(adding & removing voxels)

i.e
(Server -> API)
OnWorldSpawn(voxels: Voxel[]);
OnVoxelBuild(voxel, playerl); (cancellable)
OnVoxelDestroy(voxe;, player); (cancellable)

(API -> Server)
CreateVoxel(x, y);
DestroyVoxel(x, y);

Voxel {
x: int,
y: int,
... additonal data
}

OnAPlayerKilledAnotherPlayer callback missing headshot

I'm currently working on creating a database and store statistics in here such as linking usernames to steamID's and user reports etc, but I would also like to store the statistics about headshots but the callback OnAPlayerKilledAnotherPlayer only has the distance and weapon. I would like to see this being added so I can automatically flag players which have an insane amount of headshots compared to body kills.

[Bug] `SpawnPlayer` does not work

Describe the bug
SpawnPlayer does not work

To Reproduce
Steps to reproduce the behavior:
Try to use Player.SpawnPlayer. I've tried passing in valid loadouts/wearings/positions/lookpositions.

I've also tried having a command where, upon its execution, saves the players loadout/wearings/position, and then tries to kill, wait a few seconds (to be sure it's not some timing issue), and spawn them like so:

PlayerLoadout l = p.CurrentLoadout;
PlayerWearings w = p.CurrentWearings;
Vector3 pos = p.Position;
Vector3 lookPos = pos;
lookPos.X += 1;

p.Kill();

await Task.Delay(5000);

p.SpawnPlayer(l, w, pos, lookPos, PlayerStand.Standing, 0f);

Expected behavior
Spawn the player

Additional Context
It's worked for me before a few weeks back. Not sure what changed.

[Feature Request] Ability to clear a Message Window for specific player.

Is your feature request related to a problem? Please describe.
If you send a Message popup to a player. After some cases the message is not valid, you should able help them to remove it.
the float fadeout time with 0f, and a null message won;t work ,it shows a blank forever Message popup
image

Describe the solution you'd like
A function to turn off specific player.SteamID if it has one.

Describe alternatives you've considered
if msg = null or fadeout = 0f, close player's msg.

Additional context
N/A

[Feature Request] Ability to outline/highlight players.

Request
The ability to highlight a player(s) in 3D space for friendlies only or even for the enemy team.

Why
Among the chaos would help identify a unique player amongst a crowd.

Example Usage
One use case is a VIP game mode where one or both teams have a VIP player to protect that is highlighted for them so they all know WHO they are protecting visually.

[Feature Request] `ForceEndGame` overload with winning team

Is your feature request related to a problem? Please describe.
Usually I want to declare a winning team no matter the tickets, and setting them is quite unreliable due to calling force end game and the tickets are as they would be in a vanilla server, they don't seem to get affected if you call end game after setting them

Describe the solution you'd like
An overloaded (or optional parameter) ForceEndGame version would let us decide the winning team without any further issue

Describe alternatives you've considered
Changing the losing team's tickets to 0, and the other one to a higher number > 0

Additional context
Changing team tickets used to work, until one of the recent update it no longer worked. I used a Task delay after the game was declared finished by my game mode implementation, but no luck there either.

[Bug] Server with no ppl join will force rolling to CONQ

Describe the bug

Server decided to change map due can not collect enough players
Unable to find a gamemode/size/map with current settings
Game ended, won => Nobody

If you are hosting anthing else but not CONQ, even if you set the gamemode manually, the server will choose a default map CONQ Azagor.

var arges = $"-batchmode -nographics -lowmtumode " +
                        $"-Name={Name} -Password={Password} -Port={Port} -MaxPing={MaxPing} -LocalIP={LocalIP} -AntiCheat={AntiCheat} -Hz={Hz} " +
                        $"-VoxelMode={VoxelMode} -ConfigPath={ConfigPath} -ApiEndpoint={ApiEndpoint} -ApiToken={ApiToken} " +
                        $"-FirstSize={FirstSize} -MaxSize={MaxSize} " +
                        $"-FirstGamemode={FirstGamemode} -FirstMap={FirstMap}";

To Reproduce
Steps to reproduce the behavior:
Just set a first gamemode to other, use setgamemode() in GameState.waiting to define another mode , and wait.

Expected behavior
If you define a game mode, the game should look for mode's available mapList rotation.

Screenshots
N/A

[Feature Request] Set friendly nameplates display range.

Is your feature request related to a problem? Please describe.
When setting FriendlyHUDEnabled to false this removes the friendly pips how ever nameplates still come up for friendlies when your centre of screen hovers over them.

Describe the solution you'd like
I think a good solution could be allowing the API to set the range of which friendly nameplates will display at 0 to x with 0 being essentially off. This range could even be extended to pips too.

Describe alternatives you've considered
Another alternative could just be a simple toggle however I feel like this is more limiting.

Additional context
This could also be a bug and those nameplates shouldn't be displayed when Modifications.FriendlyHUDEnabled = false;
But still extending the feature set for friendly hud would be nice.

Feature Suggestions

  • A Clan field for the players class: can be useful for clan whitelist/blacklist as well as competitive servers(maybe auto assigning clans to each team)
  • A Match field for Gameserver class: this can be useful to get current match data like tickets/flags captured/current objectives taken
  • A Squad field for players class: can be used to modify the amount of squad abilites the squad has. (reduce build cost, increase max builds from 20 to 50 etc)
  • Extended roles enum: patreon, content creator, supporter etc

Now here are some suggestions for some call back some of them may have been implemented already(not a full list just what I could think of the top of my head):

PLAYER CALLBACKS
OnPlayerConnected
OnPlayerDisconnected
OnPlayerChat
OnPlayerSpawn
OnPlayerRespawn
OnPlayerSuicide
OnPlayerRevive
OnPlayerBandage
OnPlayerReported
OnPlayerCorpseSpawn
OnPlayerCorpseDespawn
OnPlayerHeal
OnPlayerShoot
OnPlayerDeath
OnPlayerKill
OnPlayerReload
OnPlayerDrive
OnPlayerMountEntity
OnPlayerSwitchSeat
OnPlayerRepairBuildable
OnPlayerReSupply
OnPlayerPushBoat
OnPlayerDepositCash
OnPlayerSwitchWeapons
OnPlayerClick
OnMarkerAdded

PLAYER FLAGS
CanUseVoice
CanUseChat
CanResupply
CanReload
CanBuild
CanBypassQueue
CanPickupThrowable

ENTITY(vehicles, boats, helis) CALLBACKS
OnEntityStart
OnEntityStop
OnEntityDestroy
OnEntityGetHit

SERVER CALLBACKS
OnVehicleSpawn
OnSquadAbilityPlace
OnSquadAbilityUnPlace
OnThrowableSpawn
OnServerInit
SpawnVehicle
SpawnPrefab
SendAnnouncement
WarnPlayer
SendMessageToPlayer
SayMessage
ForceReloadMap
ForceChangeMap
ForceLoadMap
ForceStartMatch

BUILDINGS CALLBACKS
OnStructureCollapse
OnWallBreak

Thank you for coming to my ted talk.

[Bug] Setting RoundSettings OnTick bugs out TimeLeft

Describe the bug
Changing various RoundSettings during OnTick (e. TeamATickets) results in desync of TimeLeft on the gameserver & on the API.

What exactly happens;

  • Gameserver sends RoundSettings packet to API, receives it like so; { timeleft = 23, tickets = 80 }
  • Changing the Tickets & Sending back the packet through the API like so; { timeleft = 23, tickets = 79 }
  • However, by the time the GameServer receives the updated RoundSettings packet, the TimeLeft on the GameServer is already different than on the API, Resulting in bugged out behaviour (time goes down very slowly, or not at all)

To Reproduce
Steps to reproduce the behavior:

  1. Perform the steps explained above.

Expected behavior
Time left not bugging out when unchanged.

Solution
Implement different packets for TimeLeft & RoundSettings

[Bug] Never gonna give you up

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

OnPlayerJoiningToServer setting team does not work

Code

public override async Task OnPlayerJoiningToServer(ulong steamId, PlayerJoiningArguments args)
 {
 args.Team = Team.TeamA;
 Console.WriteLine(args.Team);
}

Output

TeamA
TeamA

Expected behaviour: Both players that joined the server are on team A

Actual behaviour: One player is on team A and one player is on team B.

[Feature Request] Enable/Disable Vaulting

Is your feature request related to a problem? Please describe.
Let us disable vaulting globally or per-player.

Describe the solution you'd like
ServerSettings.VaultEnabled = false;
Player.VaultEnabled = false;

Additional context
Useful to stop climbing on top of roofs and vaulting up steep rockfaces in more hardcore orientated games.

[Feature Request] Maps and GameMode enums

   public enum GameMaps : byte
    {
        None = 0,

        Azagor = 1,
        Basra = 2,
        Contruction = 3,
        District = 4,
        DustyDew = 5,
        Equardovo = 6,
        Frugis = 7,
        Isle = 8,
        Lonovo = 9,
        MultuIslands = 10,
        Namak = 11,
        OilDunes = 12,
        River = 13,
        Salhan = 14,
        SandySunset = 15,
        TensaTown = 16,
        Valley = 17,
        Wakistan = 18,
        WineParadise = 19,
        VoxelLand = 20,
    }
   public enum GameMode : byte
   {
	Null = 0,

	TDM = 1,
	AAS = 2,
	RUSH = 3,
	CONQ = 4,
	DOMI = 5,
	ELI = 6,
	INFCONQ = 7,
	FRONTLINE = 8,
	GunGameFFA = 9,
	FFA = 10,
	GunGameTeam = 11,
	SuicideRush = 12,
	CatchGame = 13,
	Infected = 14,
	CashRun = 15,
	VoxelFortify = 16,
	VoxelTrench = 17,
	CTF = 18,
   }

[Bug] CaptureFlagSpeedMultiplier not working in DOMI and ELI

Describe the bug
Modifications.CaptureFlagSpeedMultiplier in Player
or player.Modifications.CaptureFlagSpeedMultiplier in Gameserver

Those float set to below 1f, is not working.

To Reproduce

  1. set Modifications.CaptureFlagSpeedMultiplier = 0.1f, in MyPlayer OnSpawned
  2. get into the game with DOMI or ELI that doing Flag Capturing
  3. Spped the same as 1f default speed.
  4. Set to 0 will not turn off Capturing too.

Expected behavior
The same as CaptureFlagSpeedMultiplier says.

Screenshots
N.A

Additional context
Tested on both Progression and non-progression.
Test Gameserver version 2.1.1 Hotfix

[Feature Request] Open the TDM random spawn call for OnPlayerSpawning

Is your feature request related to a problem? Please describe.
As I am building 128 and 254 ppl Death Match mode. There's a issue where I cannot spawn ppl randomly and TMD only supports 16 vs 16.

        public override async Task<OnPlayerSpawnArguments> OnPlayerSpawning(MyPlayer player,
            OnPlayerSpawnArguments request)
        {
            try
            {
                request.Loadout = SpawnManager.GetRandom(); // 出生后随机装备
                request.SpawnStand = PlayerStand.Standing; // 站着出生
                request.SpawnProtection = 5f; // 出生不动保护 5 秒

                int beforePosTime = 15;

                while (true)
                {
                    if (player.positionBef.Count > 0)
                    {
                        var pb = player.positionBef.Last();
                        player.positionBef.Remove(pb);
                        Console.Out.WriteLineAsync($"{pb.position}");

                        if (TimeUtil.GetUtcTimeMs() - pb.time > 1000 * beforePosTime)
                        {
                            if (AllPlayers.FirstOrDefault(o =>
                                    Vector3.Distance(o.Position, pb.position) < 20f && o.Team != player.Team) == null)
                            {
                                request.SpawnPosition = new Vector3
                                    { X = pb.position.X - 500, Y = pb.position.Y - 250, Z = pb.position.Z - 500 };
                                request.RequestedPoint = PlayerSpawningPosition.SpawnAtPoint;
                                Console.WriteLine(
                                    $"{DateTime.Now.ToString("MM/dd HH:mm:ss")} - {player.Name} 即将复活在 {request.SpawnPosition}");
                                break;
                            }
                        }

                        beforePosTime = beforePosTime + 15;
                    }
                    else
                    {
                        Console.WriteLine($"{DateTime.Now.ToString("MM/dd HH:mm:ss")} - {player.Name} 复活在选择点");
                        break;
                    }
                }

                player.positionBef.Clear();

                // TODO 在 Oki 部署了真正的地图边界且地面以上随机出生点后,再使用真正的随机出生点,做 RandomSpawn Points 需要适配地图太多且有任何改动都要重新写数值
                // 由于 Oki 在 Discord 中提及了地图边界的问题以及 SpawnPosition 的不可写问题,所以暂时使用 TDM 模式的固定出生点
                Console.Out.WriteLineAsync($"{DateTime.Now.ToString("MM/dd HH:mm:ss")} - {player.Name} 复活,MagazineIndex:{request.Loadout.PrimaryWeapon.MagazineIndex},SkinIndex:{request.Loadout.PrimaryWeapon.SkinIndex},requestPosition:{request.SpawnPosition.X},{request.SpawnPosition.Y},{request.SpawnPosition.Z}。。LookDirection:{request.LookDirection.X},{request.LookDirection.Y},{request.LookDirection.Z}");
            }
            catch (Exception ee)
            {
                Console.Out.WriteLineAsync($"{DateTime.Now.ToString("MM/dd HH:mm:ss")} - {ee.StackTrace}");
            }

            return request;
        }

after a few tries and the Spawn args of Position is different from real spawn Position, the large DM mode is now paused.

Describe the solution you'd like
Add a RandomVector3() method for Vector3 SpawnPosition

Describe alternatives you've considered
Or let community servers can hold Ultra size of TDM map.

Additional context
Codes

[Bug] Not able to enable Friendly Fire

Describe the bug
Setting FriendlyFireEnabled to true does not enable friendly fire.

To Reproduce
Set ServerSettings.FriendlyFireEnabled to true

Expected behaviour
For players to be able to kill players on their own team.

Screenshot
Visual indicator it's doing damage but does not actually do damage.
image

Additional context
Only a visual blood splat effect becomes enabled on friendlies.

[bug] Player.HP not being updated

I have a command that is supposed to check if the player is alive before further processing. When a player is spawned in, they type a command, and the IsAlive property is still false. I see that this property depends on HP >=0. I checked this property as well. It is still at -1 when a player is alive.

[Feature Request] Event args

Heres an example: Instead of OnDamagedPlayer(Player player, Player attacker, (ref) float damage), use OnDamagedPlayer(OnDamagedPlayerArgs ev) where

public class OnDamagedPlayerArgs
{
    public Player Player { get; }
    public Player Attacker { get; }
    public float Damage { get; set; }
}

You could also include a bool Cancel { get; set; } for cancelling instead of using return values, which allows for other event handler to interact with already cancelled events. Similarly you can also use the set accessors to change variables such as damage without needing to declare variables as ref.

Handling Multiple Server Subclasses under one Listener

With the advertisement and expected behavior of the API being able to handle multiple servers, I don't believe there is any direct support for handling different GameServer/Player subclasses. Currently, we template the ServerListener with the subclass we want, and if we make another GameServer/Player subclass pair, it seems the only way would be to create another ServerListener.

I don't know what the alternative is, but this seems unoptimal. Perhaps we can delegate the subclass we want in the GameServerConnected/Reconnected callbacks (this is probably not possible since it's essentially a downcast)? I'm not sure of the magic involved for this, but it would be nice, unless there's another alternative I'm not aware of.

[Feature Request] Control of vehicle spawns

Is your feature request related to a problem? Please describe.
My project (all out war RTS with varying limited resources allocated to either side) requires being able to spawn specific vehicle types in the starting area.

Describe the solution you'd like
Obviously I don't know how the internal spawning system is handled, since there is limited space in the starting area for each vehicle type... but it would be ideal to have a vehicle spawns queue. If the spaces are full for a vehicle type, a new vehicle from the queue would be spawned once a player has moved away the previous vehicle.

It may be necessary to have a seperate queue for each vehicle type, since if you plan on using the C# Queue<T> collection, it would be difficult to handle multiple vehicle types as they could be pulled at different rates - such that a helicopter being next on the queue would block humvees from spawning in empty spaces because a player hasn't flown away the helicopters yet.

Being able to add new vehicles to the queue(s) is of course a necessary sub-feature, but this would simply be calling Enqueue().

I find it likely that there is an existing queue that is added to when a vehicle is destroyed or on other events. However, it would be nice to have fine control of what goes into this queue - for example, not readding destroyed vehicles into the pool. This would mean that it would be possible for a faction to "run out" of a specific vehicle type if the queue is empty and destroyed vehicles are not added back.

Finally, some properties that expose details of the queue(s) would be nice. A use for this could be a faction having a banner placed on their screen to warn of a low stockpile of a certain vehicle type.

[Feature Request] Granular roles & decorations

Provide a system for defining custom text, color, and permissions for players instead of specifying generic "VIP", "Moderator", and "Admin" roles.

Ideally, permissions would be per-command instead of remaining in the generic "admin/mod" categories. SCP: Secret Laboratory has a good implementation here.

Expected Capabilities

  1. Ability to assign "Donator" roles with custom colors without administrator commands
  2. Ability to assign "Junior Moderator" roles with extremely limited permissions dictated by server owner.
  3. Ability to assign "Zombie" or "Human" roles for gamemodes while still specifying administrator permissions for individual players
  4. No requirement that these be set from join, but can be changed throughout the time the player is connected.

[Bug] Unable to connect to API when restarting the server while players are connected

Describe the bug
When restarting a game server with a connected API while there are players on the server, the new game server instance will spam

API: Unable to connect to API server: Object reference not set to an instance of an object.

until the API is restarted.

To Reproduce
Steps to reproduce the behavior:

  1. Start server and API, order does not matter
  2. Connect a client to the server
  3. Restart the server by quickly closing and reopening
  4. If the server starts before the client is being disconnected, the error will occur

Expected behavior
The server should successfully reconnect and the client should probably not stay connected if the server is restarted.

Screenshots
https://www.youtube.com/watch?v=8lVF8pOIKrU

Additional context
Tested with simple community server API implementation, not using the modules runner.
It seems that the player, who was connected to the previous server, is still connected in the new server and will mess up the communication between the server and the API. The exception occurs at Player.cs in the getter of Squad because GameServer is null for this player.

[Bug] When next map == curMap with the same mode. Server freeze.

Describe the bug
Currently I use my RNG to randomly choose a next map (in config) when a new round begins.

public override async Task OnGameStateChanged(GameState oldState, GameState newState)
                case GameState.Playing:
                        this.MapRotation.ClearRotation();
                        var nextMap = MapManager.GetARandomAvailableMap(Gamemode, Map);
                        this.MapRotation.SetRotation(nextMap);

As a test result, if you dont remove cur Map from that result array, the game will freeze in map votes.

To Reproduce
As the code above presented.

Expected behavior
Should we allow player to play a same map after this round?
If it shoudn't I've alter the GetARandomAvailableMap function to opt in a Map and it will RNG other maps.

Screenshots
Sorry, this I just remembered the MapVote list is blank and when Endgame countdown hits zero, nothing happened.
When you quit the server and rejoin, received ERR CODE:1. the server prints 6000ms timeout.

Additional context
N/A
Should be easy to reproduce.

[Bug] Changing the gamemode rotation results in a NotifyNewMapRotation message

Describe the bug

When setting a new gamemode rotation via the setgamemoderotation command, the server will send a packet tagged as NotifyNewMapRotation to the API, containing the current map rotation.

To Reproduce
Steps to reproduce the behavior:
1.Go to ServerListener.cs to the case-handler for NotifyNewMapRotation
2. Put in a ConsoleWriteLine
3. Set a new Gamemode rotation

Expected behavior
ConsoleWriteLine will not show up

Screenshots

Multiple GameServers on one ip have same ServerHash

Steps to reproduce:

  • Make mActiveConnections public(is this bad practice lmao)
  • Create Two GameServers with same ip but different port number
  • add the two GameServers to the mActiveConnections Dictionary.

Obviously I don't have access to the game build with api support so to simulate multiple gameservers I created two GameServer objects

image
^^ Is this supposed to be intentional?

If each of the servers were to have different IPs then you can place them in the dictionary.
image

P.S. ignore the ugly console output formatting lol

[feature request] OnEntitySpawning

When entities, specifically vehicles, are about to spawn, make it possible to prevent them from spawning so we can have modes, like frontline, without any vehicles.

Even cooler, using an entity spawn request which lets us edit attributes of vehicles (speed multiplier, ammo counts, health).

My specific reason for this is that I want the zombie mode to use frontline but without vehicles or only with specific vehicles (eg humvee but no helicopters or tanks).

[Feature Request] Expose/update PlayerProgress

Is your feature request related to a problem? Please describe.
Especially on non official progression servers I want to be able to manage my own progression.
The granularity of data available during a match is limited to kills and revives.

PlayerProgress has a lot of extremely important and valuable information that alone can be used to build a custom progression system, however that is only available when a player joins and when a player disconnects. No updates mid game.

Describe the solution you'd like
PlayerProgress should be a property of Player, just like position. I understand it's a lot of data, so I would definitely not expect that information to be constantly updated, however even just a once-a-minute update from the gameserver would be more than enough for me to dynamically compute the player's rank/stats.

Describe alternatives you've considered
Alternatives are very limited since the APIs are not privy to granular information such as shots fired, headshots, shots hit, revives etc.

If PlayerProgress cannot be a member of Player, then even just having a callback that's called once every so often with everyone's progression would be enough.

[Bug] Suicides are not correctly counted in PlayerProgress

Describe the bug
PlayerProgress holds all the stats for a player. It's currently available on join and on disconnect.
suicides is part of the fields available, however it doesn't seem to be updated when blowing yourself up or falling/bleeding to death.

To Reproduce
Steps to reproduce the behavior:

  1. Join the server, log the playerprogress (suicides)
  2. Kill yourself (grenade or fall damage)
  3. disconnect from the game and log playerprogress (suicides)
  4. notice how deaths increases but suicides don't

Expected behavior
when the killer and the victim are the same, it should always count as suicide

[Bug] wild coordinates

Describe the bug
Kill coordinates are not the same as spectate coordinates in the same place

To Reproduce
Steps to reproduce the behavior:
die, the api OnPlayerKillArguments tells [ 570.96204, 304.9897, 497.32202 ].
spectate and go to the same place =>[ 71, 56, -3,2 ]

Expected behavior
I don't know, maybe give same coords ? 0.0

Screenshots
If applicable, add screenshots to help explain your problem.
BattleBit_PNWvyQshKN

[Bug] Gameserver doesn't seem to know what RUSH is

Description:
Trying to append the 'RUSH' gamemode to the gamemode rotation results in the server (not the API) returning Unable to convert gamemode of RUSH

Reproduction
Add the following into the GameServer.OnConnected callback:

GamemodeRotation.AddToRotation("RUSH");
GamemodeRotation.AddToRotation("RS");
GamemodeRotation.AddToRotation("rush");
GamemodeRotation.AddToRotation("rs");

Expected Behavior
For the 'RUSH' gamemode to be added to the rotation with no server error of not bneing able to covert the gamemode.

Result
This is the Gameservers responce:
image

[Feature Request] Ability to hide flags on Conq, InfConq & Dom

Is your feature request related to a problem? Please describe.

We have a game mode that requires TDM, but TDM is not available on all player sizes at most 16v16.

Describe the solution you'd like

To get around this it would be nice if we could set the capture multiplier for the flags.

It would be nice if we could do the following things:

  1. Hide the flags.
  2. Change the flag capture speed (See "Describe alternatives you've considered")
  3. Ability to disable the base game mode from modifying the tickets so we can use that as a scoreboard without the base game mode messing with the tickets.
  4. (Optional) Ability to have TDM be played on more sizes.
    I. Ability to disable tickets being taken away on death.

Describe alternatives you've considered

I have already tried player.Modifications.CaptureFlagSpeedMultiplier, which did not change the capture speed.

Additional context

[Feature Request] Extending the Squad leader menu

Request

Allow us to register custom buttons (and therefore a category for them to reside in) to the Squad Leader Menu (O bind) using an id of our choosing that gets sent back to the API along with the player who clicked the button and some contextual data (are they looking at a player, vehicle, in a vehicle etc).

Why

This will reduce the need for chat commands to do things that should feel fluid during gameplay. Likely useful for every game mode at some point.

Example Usage

  • Custom loadouts via menu.
  • Attachments menu.
  • In the future let the player spawn in-game items such as ammo crates from the back of vehicles if they are in them (like squad supply crates).

[Bug] `Map` and `Gamemode` variables never update

Describe the bug
The Map and Gamemode variables part of the GameServer class only store the launched map and gamemode and never change past that even when both have changed

To Reproduce
Add to the server class:

public override async Task OnRoundStarted()
{
    await Console.Out.WriteLineAsync($"Round Started - Map:{Map}, Gamemode:{Gamemode}");
}

Launch the server and API.
Join the server and force the round to start.
End the round and vote on a different map and gamemode to what started.
Force the new round to start and look at the output from OnRoundStarted in the API console.

Expected behaviour
The only out put will be the map and gamemode set in the server launch args.

Screenshots
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.