mirror of
https://github.com/MrOkiDoki/BattleBit-Community-Server-API.git
synced 2025-01-09 11:17:30 -03:00
New changes, don't use yet
This commit is contained in:
parent
3b8a386f1d
commit
4fc6d311c7
3 changed files with 23 additions and 7 deletions
|
@ -324,7 +324,7 @@ namespace BattleBitAPI.Server
|
|||
{
|
||||
|
||||
}
|
||||
public virtual async Task<OnPlayerSpawnArguments> OnPlayerSpawning(TPlayer player, OnPlayerSpawnArguments request)
|
||||
public virtual async Task<OnPlayerSpawnArguments?> OnPlayerSpawning(TPlayer player, OnPlayerSpawnArguments request)
|
||||
{
|
||||
return request;
|
||||
}
|
||||
|
@ -542,7 +542,7 @@ namespace BattleBitAPI.Server
|
|||
SpawnPosition = position,
|
||||
LookDirection = lookDirection,
|
||||
SpawnStand = stand,
|
||||
SpawnProtection = spawnProtection
|
||||
SpawnProtection = spawnProtection,
|
||||
};
|
||||
|
||||
//Respond back.
|
||||
|
|
|
@ -976,7 +976,7 @@ namespace BattleBitAPI.Server
|
|||
{
|
||||
ulong steamID = stream.ReadUInt64();
|
||||
|
||||
var request = new OnPlayerSpawnArguments();
|
||||
OnPlayerSpawnArguments request = new OnPlayerSpawnArguments();
|
||||
request.Read(stream);
|
||||
ushort vehicleID = stream.ReadUInt16();
|
||||
|
||||
|
@ -984,15 +984,25 @@ namespace BattleBitAPI.Server
|
|||
{
|
||||
async Task mHandle()
|
||||
{
|
||||
request = await server.OnPlayerSpawning((TPlayer)client, request);
|
||||
var responseSpawn = await server.OnPlayerSpawning((TPlayer)client, request);
|
||||
|
||||
//Respond back.
|
||||
using (var response = Common.Serialization.Stream.Get())
|
||||
{
|
||||
response.Write((byte)NetworkCommuncation.SpawnPlayer);
|
||||
response.Write(steamID);
|
||||
request.Write(response);
|
||||
response.Write(vehicleID);
|
||||
|
||||
if (responseSpawn != null)
|
||||
{
|
||||
response.Write(true);
|
||||
request.Write(response);
|
||||
response.Write(vehicleID);
|
||||
}
|
||||
else
|
||||
{
|
||||
response.Write(false);
|
||||
}
|
||||
|
||||
server.WriteToSocket(response);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,9 +56,15 @@ class MyGameServer : GameServer<MyPlayer>
|
|||
}
|
||||
public override async Task OnTick()
|
||||
{
|
||||
foreach (var item in AllPlayers)
|
||||
{
|
||||
item.GameServer.ForceStartGame();
|
||||
}
|
||||
}
|
||||
public override async Task<OnPlayerSpawnArguments> OnPlayerSpawning(MyPlayer player, OnPlayerSpawnArguments request)
|
||||
public override async Task<OnPlayerSpawnArguments?> OnPlayerSpawning(MyPlayer player, OnPlayerSpawnArguments request)
|
||||
{
|
||||
return null;
|
||||
|
||||
request.Wearings.Eye = "Eye_Zombie_01";
|
||||
request.Wearings.Face = "Face_Zombie_01";
|
||||
request.Wearings.Face = "Hair_Zombie_01";
|
||||
|
|
Loading…
Reference in a new issue