Skip to content

Commit

Permalink
Updated the extension to support the latest API changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
DorCoMaNdO committed Jan 27, 2015
1 parent 18cc7ed commit 0cbe6ab
Show file tree
Hide file tree
Showing 23 changed files with 329 additions and 163 deletions.
179 changes: 156 additions & 23 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,25 +1,158 @@
/SyncToy_3f894b4a-cf09-47ad-a7c6-0c9d16ac6621.dat
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.sln.docstates
*.sqlite
*.rar
bin
/*.dat
/CoMaNdO.Example/bin
/CoMaNdO.Example/obj
/CoMaNdO.Uptime/bin
/CoMaNdO.Uptime/obj
/CoMaNdO.Polls/bin
/CoMaNdO.Polls/obj
/CoMaNdO.Gambling/bin
/CoMaNdO.Gambling/obj
/CoMaNdO.Greetings/bin
/CoMaNdO.Greetings/obj
/CoMaNdO.MultipleOutputs/bin
/CoMaNdO.MultipleOutputs/obj
/CoMaNdO.UserRanks/bin
/CoMaNdO.UserRanks/obj
/CoMaNdO.Auctions/bin
/CoMaNdO.Auctions/obj
/CoMaNdO.Giveaways/bin
/CoMaNdO.Giveaways/obj
/CoMaNdO.SongRequests/bin
/CoMaNdO.SongRequests/obj

# Build results

[Dd]ebug/
[Rr]elease/
x64/
build/
[Bb]in/
[Oo]bj/

# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
!packages/*/build/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.log
*.scc

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile

# Visual Studio profiler
*.psess
*.vsp
*.vspx

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

# NCrunch
*.ncrunch*
.*crunch*.local.xml

# Installshield output folder
[Ee]xpress/

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/

# Publish Web Output
*.Publish.xml

# NuGet Packages Directory
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
#packages/

# Windows Azure Build Output
csx
*.build.csdef

# Windows Store app package directory
AppPackages/

# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.[Pp]ublish.xml
*.pfx
*.publishsettings

# RIA/Silverlight projects
Generated_Code/

# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

# SQL Server files
App_Data/*.mdf
App_Data/*.ldf


#LightSwitch generated files
GeneratedArtifacts/
_Pvt_Extensions/
ModelManifest.xml

# =========================
# Windows detritus
# =========================

# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Mac desktop service store files
.DS_Store
14 changes: 7 additions & 7 deletions CoMaNdO.Auctions/Auctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ public void Load()
Events.OnDisconnect += Events_OnDisconnect;
}

private void Events_Connected(string channel, string nick, bool partnered)
private void Events_Connected(string channel, string nick, bool partnered, bool subprogram)
{
Commands.Add("!auction", Command_Auction, 2, 0);
Commands.Add("!bid", Command_Bid, 0, 0);
Commands.Add(this, "!auction", Command_Auction, 2, 0);
Commands.Add(this, "!bid", Command_Bid, 0, 0);

if (Auction.Loop == null) Auction.Loop = new Timer(auctionLoopHandler, null, Timeout.Infinite, Timeout.Infinite);
Auction.Loop.Change(Timeout.Infinite, Timeout.Infinite);
}

private void Command_Auction(string user, string cmd, string[] args)
private void Command_Auction(string user, Command cmd, string[] args)
{
if (args.Length > 0)
{
Expand Down Expand Up @@ -71,7 +71,7 @@ private void Command_Auction(string user, string cmd, string[] args)
}
}

private void Command_Bid(string user, string cmd, string[] args)
private void Command_Bid(string user, Command cmd, string[] args)
{
if (args.Length > 0)
{
Expand All @@ -84,7 +84,7 @@ private void auctionLoopHandler(Object state)
{
if (Auction.Open && Auction.highBidder != "")
{
Chat.SendMessage(Users.GetDisplayName(Auction.highBidder) + " is currently winning, with a bid of " + Auction.highBid + "!");
Chat.SendMessage(Users.GetDisplayName(Auction.highBidder, NameAlterLevel.Cosmetic) + " is currently winning, with a bid of " + Auction.highBid + "!");
}
}

Expand All @@ -103,7 +103,7 @@ private void Events_OnDisconnect()
public string Author { get { return "CoMaNdO"; } }
public string UniqueID { get { return "CoMaNdO.Auctions"; } }
public string ContactInfo { get { return "[email protected]"; } }
public string Version { get { return "0.0.2"; } }
public string Version { get { return "0.0.3"; } }
public int ApiVersion { get { return 0; } }
public int LoadPriority { get { return 1; } }

Expand Down
2 changes: 1 addition & 1 deletion CoMaNdO.Auctions/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.2")]
[assembly: AssemblyVersion("0.0.3")]
//[assembly: AssemblyFileVersion("1.0.0.0")]
8 changes: 4 additions & 4 deletions CoMaNdO.Example/Example.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ public void Load()
}
}

private void Events_Connected(string channel, string nick, bool partnered) // We register our commands after the bot is connected to the channel.
private void Events_Connected(string channel, string nick, bool partnered, bool subprogram) // We register our commands after the bot is connected to the channel.
{
Commands.Add("!example", Command_Example); // We add the command with a handler that will perform the task we want it to.
Commands.Add(this, "!example", Command_Example); // We add the command with a handler that will perform the task we want it to.
}

private void Command_Example(string user, string command, string[] args)
private void Command_Example(string user, Command cmd, string[] args)
{
// Output
Chat.SendMessage("My first command, YAY!");
Expand All @@ -47,7 +47,7 @@ private void Command_Example(string user, string command, string[] args)
public string Author { get { return "CoMaNdO"; } } // Your name/nickname.
public string UniqueID { get { return "CoMaNdO.Example"; } } // Will be used for data storage, to keep a unique space for your extension, you'd normally want to put your name/nickname and the name of the extension.
public string ContactInfo { get { return "[email protected]"; } } // Will be used to refer people for suggestions, error reports and more.
public string Version { get { return "0.0.3"; } } // The version of the extension.
public string Version { get { return "0.0.4"; } } // The version of the extension.
public int ApiVersion { get { return 0; } } // The API version that it has been built with, changes to the API version will be posted on the blog. The use of ApiVersion 0 is if you believe that changes to the API won't affect your code, this is highly doubtable unless you're me.
public int LoadPriority { get { return 3; } }

Expand Down
2 changes: 1 addition & 1 deletion CoMaNdO.Example/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.3")]
[assembly: AssemblyVersion("0.0.4")]
//[assembly: AssemblyFileVersion("1.0.0.0")]
19 changes: 11 additions & 8 deletions CoMaNdO.Gambling/Gambling.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ public class Gambling : IExtension

public void Load()
{
Pool.Load();
Pool.Load(this);
}

public string Name { get { return "Gambling System"; } }
public string FileName { get { return "CoMaNdO.Gambling.dll"; } }
public string Author { get { return "CoMaNdO"; } }
public string UniqueID { get { return "CoMaNdO.Gambling"; } }
public string ContactInfo { get { return "[email protected]"; } }
public string Version { get { return "0.0.1"; } }
public string Version { get { return "0.0.2"; } }
public int ApiVersion { get { return 0; } }
public int LoadPriority { get { return 1; } }

Expand Down Expand Up @@ -73,18 +73,21 @@ static class Pool
private static System.Threading.Timer BetQueue;
public static List<string> Options = new List<string>();
public static bool Running, Locked;
private static IExtension extension;

public static void Load()
public static void Load(IExtension sender)
{
extension = sender;

Events.Connected += Events_Connected;
Events.Currency.OnQueue += Events_OnCurrencyQueue;
Events.OnDisconnect += Events_OnDisconnect;
}

private static void Events_Connected(string channel, string nick, bool partnered)
private static void Events_Connected(string channel, string nick, bool partnered, bool subprogram)
{
Commands.Add("!gamble", Command_Gamble, 2, 0);
Commands.Add("!bet", Command_Bet, 0, 0);
Commands.Add(extension, "!gamble", Command_Gamble, 2, 0);
Commands.Add(extension, "!bet", Command_Bet, 0, 0);

if (BetQueue == null) BetQueue = new System.Threading.Timer(BetQueueHandler, null, Timeout.Infinite, Timeout.Infinite);
BetQueue.Change(Timeout.Infinite, Timeout.Infinite);
Expand Down Expand Up @@ -324,7 +327,7 @@ public static List<string> buildBetOptions(string[] temp, int index = 3)
return betOptions;
}

private static void Command_Gamble(string user, string cmd, string[] args)
private static void Command_Gamble(string user, Command cmd, string[] args)
{
if (args.Length > 0)
{
Expand Down Expand Up @@ -513,7 +516,7 @@ private static void Command_Gamble(string user, string cmd, string[] args)
}
}

private static void Command_Bet(string user, string cmd, string[] args)
private static void Command_Bet(string user, Command cmd, string[] args)
{
if (Running)
{
Expand Down
2 changes: 1 addition & 1 deletion CoMaNdO.Gambling/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.1")]
[assembly: AssemblyVersion("0.0.2")]
//[assembly: AssemblyFileVersion("1.0.0.0")]
Loading

0 comments on commit 0cbe6ab

Please sign in to comment.