BattleBit-Community-Server-API/Program.cs

38 lines
895 B
C#
Raw Normal View History

2023-07-28 03:24:00 +03:00
using BattleBitAPI;
using BattleBitAPI.Common;
using BattleBitAPI.Common.Enums;
using BattleBitAPI.Server;
2023-07-28 03:24:00 +03:00
using System.Numerics;
2023-03-03 15:15:17 +03:00
class Program
{
static void Main(string[] args)
{
2023-07-28 03:24:00 +03:00
var listener = new ServerListener<MyPlayer>();
listener.OnGetPlayerStats += OnGetPlayerStats;
listener.OnSavePlayerStats += OnSavePlayerStats;
listener.Start(29294);//Port
Thread.Sleep(-1);
2023-03-03 15:15:17 +03:00
}
2023-07-28 03:24:00 +03:00
public static PlayerStats Stats;
private static async Task OnSavePlayerStats(ulong steamID, PlayerStats stats)
2023-03-03 15:15:17 +03:00
{
2023-07-28 03:24:00 +03:00
Stats = stats;
2023-03-03 15:15:17 +03:00
}
2023-07-28 03:24:00 +03:00
private static async Task<PlayerStats> OnGetPlayerStats(ulong steamID)
2023-03-03 15:15:17 +03:00
{
2023-07-28 03:24:00 +03:00
if (Stats == null)
Stats = new PlayerStats();
Stats.Progress.Rank = 155;
Stats.Roles = Roles.Moderator;
Stats.IsBanned = true;
return Stats;
2023-03-03 15:15:17 +03:00
}
2023-07-28 03:24:00 +03:00
}
class MyPlayer : Player
{
}