Skip to content

Commit

Permalink
推送玩家列表
Browse files Browse the repository at this point in the history
  • Loading branch information
KirosHan committed Jan 30, 2024
1 parent faa7a52 commit dde5011
Show file tree
Hide file tree
Showing 12 changed files with 10 additions and 6 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified .vs/Palworld-server-protector-DotNet/v17/.futdcache.v2
Binary file not shown.
Binary file modified .vs/Palworld-server-protector-DotNet/v17/.suo
Binary file not shown.
Binary file not shown.
Binary file not shown.
10 changes: 7 additions & 3 deletions Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,16 +191,20 @@ private void Timer_Tick(object sender, EventArgs e)
// Clear the playersView
playersView.Items.Clear();

var playerList = "";
// Add the players information to the playersView
foreach (var player in players)
{
var item = new ListViewItem(new[] { player.name, player.uid, player.steam_id });
playersView.Items.Add(item);
playerList = playerList + player.name + ",";
}
playersTimercounter += 1;
if (playersTimercounter >= playersTimerthreshold) {
if (playersTimercounter >= playersTimerthreshold)
{
playersTimercounter = 0;
SendWebhookAsync("在线玩家统计", $"当前在线玩家:{players.Count}人。");
playerList = playerList.TrimEnd(',');
SendWebhookAsync("在线玩家统计", $"当前在线玩家:{players.Count}人。\r\n{playerList}");
}
}
catch (Exception ex)
Expand Down Expand Up @@ -784,7 +788,7 @@ private void checkBox_geplayers_CheckedChanged(object sender, EventArgs e)
{
if (checkBox_geplayers.Checked)
{
playersTimercounter = 0;
playersTimercounter = playersTimerthreshold;//启动即触发一次
getplayerTimer.Start();
labelForgetplayers.Text = "[ 开启 ]";
OutputMessageAsync($"已启用自动获取在线玩家。");
Expand Down
6 changes: 3 additions & 3 deletions Palworld-server-protector-DotNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
<ApplicationIcon>icon.ico</ApplicationIcon>
<AssemblyVersion>2.5.1</AssemblyVersion>
<AssemblyVersion>2.5.2</AssemblyVersion>
<Copyright>Kiros @ONBETA</Copyright>
<Version>$(VersionPrefix)2.5.1</Version>
<Version>$(VersionPrefix)2.5.2</Version>
<Company>$(Authors)@ONBETA</Company>
<FileVersion>2.5.1</FileVersion>
<FileVersion>2.5.2</FileVersion>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit dde5011

Please sign in to comment.