Skip to content

Commit 625fb7a

Browse files
committed
fix game ids, plugin perms
1 parent b340822 commit 625fb7a

File tree

4 files changed

+45
-34
lines changed

4 files changed

+45
-34
lines changed

Build.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#!/usr/bin/env python3
22
import BuildConfig
33
import time
4-
import websocket
5-
from websocket import create_connection
64
import json
75
import threading
86
import argparse

TebexOxide/PluginEvent.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System.Net;
22
using Newtonsoft.Json;
3-
using Oxide.Core.Libraries;
43
using Oxide.Plugins;
54
using Tebex.Adapters;
65
using Tebex.API;
@@ -52,7 +51,7 @@ public PluginEvent(TebexPlugin plugin, TebexPlatform platform, EnumEventLevel le
5251

5352
TebexTelemetry tel = platform.GetTelemetry();
5453

55-
GameId = "Rust"; // always Rust
54+
GameId = platform.GetGameId();
5655
FrameworkId = tel.GetServerSoftware(); // Oxide / Carbon
5756
RuntimeVersion = tel.GetRuntimeVersion(); // version of Rust
5857
FrameworkVersion = tel.GetServerVersion(); // version of Oxide

TebexOxide/TebexPlatform.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ namespace Tebex.Triage
44
{
55
public class TebexPlatform
66
{
7+
private String _gameId;
78
private String _pluginVersion;
89
private TebexTelemetry _telemetry;
9-
public TebexPlatform(String pluginVersion, TebexTelemetry _telemetry)
10+
11+
public TebexPlatform(String gameId, String pluginVersion, TebexTelemetry _telemetry)
1012
{
1113
this._pluginVersion = pluginVersion;
1214
this._telemetry = _telemetry;
13-
15+
this._gameId = gameId;
1416
}
1517

1618
public TebexTelemetry GetTelemetry()
@@ -22,5 +24,10 @@ public string GetPluginVersion()
2224
{
2325
return _pluginVersion;
2426
}
27+
28+
public string GetGameId()
29+
{
30+
return _gameId;
31+
}
2532
}
2633
}

TebexOxide/TebexPlugin.cs

Lines changed: 35 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System.Globalization;
21
using Newtonsoft.Json;
32
using Oxide.Core.Libraries;
43
using Oxide.Core.Libraries.Covalence;
@@ -8,7 +7,7 @@
87

98
namespace Oxide.Plugins
109
{
11-
[Info("Tebex", "Tebex", "2.0.10")]
10+
[Info("Tebex", "Tebex", "2.0.11")]
1211
[Description("Official support for the Tebex server monetization platform")]
1312
public class TebexPlugin : CovalencePlugin
1413
{
@@ -18,12 +17,20 @@ public class TebexPlugin : CovalencePlugin
1817

1918
public static string GetPluginVersion()
2019
{
21-
return "2.0.10";
20+
return "2.0.11";
2221
}
2322

2423
public TebexPlatform GetPlatform(IServer server)
2524
{
26-
return new TebexPlatform(GetPluginVersion(), new TebexTelemetry("Oxide", server.Version, server.Protocol));
25+
String gameId = "";
26+
27+
#if RUST
28+
gameId = "Rust";
29+
#else
30+
gameId = "7 Days";
31+
#endif
32+
33+
return new TebexPlatform(gameId, GetPluginVersion(), new TebexTelemetry("Oxide", server.Version, server.Protocol));
2734
}
2835

2936

@@ -41,21 +48,21 @@ private void Init()
4148
}
4249

4350
// Register permissions
44-
permission.RegisterPermission("tebex.secret", this);
45-
permission.RegisterPermission("tebex.sendlink", this);
46-
permission.RegisterPermission("tebex.forcecheck", this);
47-
permission.RegisterPermission("tebex.refresh", this);
48-
permission.RegisterPermission("tebex.report", this);
49-
permission.RegisterPermission("tebex.ban", this);
50-
permission.RegisterPermission("tebex.lookup", this);
51-
permission.RegisterPermission("tebex.debug", this);
52-
permission.RegisterPermission("tebex.setup", this);
51+
permission.RegisterPermission("tebexplugin.secret", this);
52+
permission.RegisterPermission("tebexplugin.sendlink", this);
53+
permission.RegisterPermission("tebexplugin.forcecheck", this);
54+
permission.RegisterPermission("tebexplugin.refresh", this);
55+
permission.RegisterPermission("tebexplugin.report", this);
56+
permission.RegisterPermission("tebexplugin.ban", this);
57+
permission.RegisterPermission("tebexplugin.lookup", this);
58+
permission.RegisterPermission("tebexplugin.debug", this);
59+
permission.RegisterPermission("tebexplugin.setup", this);
5360

5461
// Register user permissions
55-
permission.RegisterPermission("tebex.info", this);
56-
permission.RegisterPermission("tebex.categories", this);
57-
permission.RegisterPermission("tebex.packages", this);
58-
permission.RegisterPermission("tebex.checkout", this);
62+
permission.RegisterPermission("tebexplugin.info", this);
63+
permission.RegisterPermission("tebexplugin.categories", this);
64+
permission.RegisterPermission("tebexplugin.packages", this);
65+
permission.RegisterPermission("tebexplugin.checkout", this);
5966

6067
// Check if auto reporting is disabled and show a warning if so.
6168
if (!BaseTebexAdapter.PluginConfig.AutoReportingEnabled)
@@ -321,7 +328,7 @@ private BaseTebexAdapter.TebexConfig GetDefaultConfig()
321328
private void TebexSecretCommand(IPlayer player, string command, string[] args)
322329
{
323330
// Secret can only be ran as the admin
324-
if (!player.HasPermission("tebex.secret"))
331+
if (!player.HasPermission("tebexplugin.secret"))
325332
{
326333
_adapter.ReplyPlayer(player, "You do not have permission to run this command.");
327334
_adapter.ReplyPlayer(player, "If you are an admin, grant permission to use `tebex.secret`");
@@ -357,7 +364,7 @@ private void TebexSecretCommand(IPlayer player, string command, string[] args)
357364
[Command("tebex.info", "tebex:info", "tebex.information", "tebex:information")]
358365
private void TebexInfoCommand(IPlayer player, string command, string[] args)
359366
{
360-
if (!player.HasPermission("tebex.info"))
367+
if (!player.HasPermission("tebexplugin.info"))
361368
{
362369
_adapter.ReplyPlayer(player, "You do not have permission to run that command.");
363370
return;
@@ -376,7 +383,7 @@ private void TebexInfoCommand(IPlayer player, string command, string[] args)
376383
[Command("tebex.checkout", "tebex:checkout")]
377384
private void TebexCheckoutCommand(IPlayer player, string command, string[] args)
378385
{
379-
if (!player.HasPermission("tebex.checkout"))
386+
if (!player.HasPermission("tebexplugin.checkout"))
380387
{
381388
_adapter.ReplyPlayer(player, "You do not have permission to run that command.");
382389
return;
@@ -449,7 +456,7 @@ private void TebexHelpCommand(IPlayer player, string command, string[] args)
449456
[Command("tebex.debug", "tebex:debug")]
450457
private void TebexDebugCommand(IPlayer player, string command, string[] args)
451458
{
452-
if (!player.HasPermission("tebex.debug"))
459+
if (!player.HasPermission("tebexplugin.debug"))
453460
{
454461
_adapter.ReplyPlayer(player, "You do not have permission to run that command.");
455462
return;
@@ -482,7 +489,7 @@ private void TebexDebugCommand(IPlayer player, string command, string[] args)
482489
[Command("tebex.forcecheck", "tebex:forcecheck")]
483490
private void TebexForceCheckCommand(IPlayer player, string command, string[] args)
484491
{
485-
if (!player.HasPermission("tebex.forcecheck"))
492+
if (!player.HasPermission("tebexplugin.forcecheck"))
486493
{
487494
_adapter.ReplyPlayer(player, "You do not have permission to run that command.");
488495
return;
@@ -497,7 +504,7 @@ private void TebexForceCheckCommand(IPlayer player, string command, string[] arg
497504
[Command("tebex.refresh", "tebex:refresh")]
498505
private void TebexRefreshCommand(IPlayer player, string command, string[] args)
499506
{
500-
if (!player.HasPermission("tebex.refresh"))
507+
if (!player.HasPermission("tebexplugin.refresh"))
501508
{
502509
_adapter.ReplyPlayer(player, "You do not have permission to run that command.");
503510
return;
@@ -523,7 +530,7 @@ private void TebexRefreshCommand(IPlayer player, string command, string[] args)
523530
[Command("tebex.ban", "tebex:ban")]
524531
private void TebexBanCommand(IPlayer commandRunner, string command, string[] args)
525532
{
526-
if (!commandRunner.HasPermission("tebex.ban"))
533+
if (!commandRunner.HasPermission("tebexplugin.ban"))
527534
{
528535
_adapter.ReplyPlayer(commandRunner, $"{command} can only be used by administrators.");
529536
return;
@@ -564,7 +571,7 @@ private void TebexUnbanCommand(IPlayer commandRunner, string command, string[] a
564571
[Command("tebex.categories", "tebex:categories", "tebex.listings", "tebex:listings")]
565572
private void TebexCategoriesCommand(IPlayer player, string command, string[] args)
566573
{
567-
if (!player.HasPermission("tebex.categories"))
574+
if (!player.HasPermission("tebexplugin.categories"))
568575
{
569576
_adapter.ReplyPlayer(player, "You do not have permission to run that command.");
570577
return;
@@ -576,7 +583,7 @@ private void TebexCategoriesCommand(IPlayer player, string command, string[] arg
576583
[Command("tebex.packages", "tebex:packages")]
577584
private void TebexPackagesCommand(IPlayer player, string command, string[] args)
578585
{
579-
if (!player.HasPermission("tebex.packages"))
586+
if (!player.HasPermission("tebexplugin.packages"))
580587
{
581588
_adapter.ReplyPlayer(player, "You do not have permission to run that command.");
582589
return;
@@ -588,7 +595,7 @@ private void TebexPackagesCommand(IPlayer player, string command, string[] args)
588595
[Command("tebex.lookup", "tebex:lookup")]
589596
private void TebexLookupCommand(IPlayer player, string command, string[] args)
590597
{
591-
if (!player.HasPermission("tebex.lookup"))
598+
if (!player.HasPermission("tebexplugin.lookup"))
592599
{
593600
_adapter.ReplyPlayer(player, "You do not have permission to run that command.");
594601
return;
@@ -623,7 +630,7 @@ private void TebexLookupCommand(IPlayer player, string command, string[] args)
623630
[Command("tebex.sendlink", "tebex:sendlink")]
624631
private void TebexSendLinkCommand(IPlayer commandRunner, string command, string[] args)
625632
{
626-
if (!commandRunner.HasPermission("tebex.sendlink"))
633+
if (!commandRunner.HasPermission("tebexplugin.sendlink"))
627634
{
628635
_adapter.ReplyPlayer(commandRunner, "You must be an administrator to run this command.");
629636
return;

0 commit comments

Comments
 (0)