Skip to content

Commit 0cbe6ab

Browse files
committed
Updated the extension to support the latest API changes.
1 parent 18cc7ed commit 0cbe6ab

File tree

23 files changed

+329
-163
lines changed

23 files changed

+329
-163
lines changed

.gitignore

+156-23
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,158 @@
1-
/SyncToy_3f894b4a-cf09-47ad-a7c6-0c9d16ac6621.dat
1+
## Ignore Visual Studio temporary files, build results, and
2+
## files generated by popular Visual Studio add-ons.
3+
4+
# User-specific files
5+
*.suo
6+
*.user
7+
*.sln.docstates
28
*.sqlite
39
*.rar
4-
bin
5-
/*.dat
6-
/CoMaNdO.Example/bin
7-
/CoMaNdO.Example/obj
8-
/CoMaNdO.Uptime/bin
9-
/CoMaNdO.Uptime/obj
10-
/CoMaNdO.Polls/bin
11-
/CoMaNdO.Polls/obj
12-
/CoMaNdO.Gambling/bin
13-
/CoMaNdO.Gambling/obj
14-
/CoMaNdO.Greetings/bin
15-
/CoMaNdO.Greetings/obj
16-
/CoMaNdO.MultipleOutputs/bin
17-
/CoMaNdO.MultipleOutputs/obj
18-
/CoMaNdO.UserRanks/bin
19-
/CoMaNdO.UserRanks/obj
20-
/CoMaNdO.Auctions/bin
21-
/CoMaNdO.Auctions/obj
22-
/CoMaNdO.Giveaways/bin
23-
/CoMaNdO.Giveaways/obj
24-
/CoMaNdO.SongRequests/bin
25-
/CoMaNdO.SongRequests/obj
10+
11+
# Build results
12+
13+
[Dd]ebug/
14+
[Rr]elease/
15+
x64/
16+
build/
17+
[Bb]in/
18+
[Oo]bj/
19+
20+
# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
21+
!packages/*/build/
22+
23+
# MSTest test Results
24+
[Tt]est[Rr]esult*/
25+
[Bb]uild[Ll]og.*
26+
27+
*_i.c
28+
*_p.c
29+
*.ilk
30+
*.meta
31+
*.obj
32+
*.pch
33+
*.pdb
34+
*.pgc
35+
*.pgd
36+
*.rsp
37+
*.sbr
38+
*.tlb
39+
*.tli
40+
*.tlh
41+
*.tmp
42+
*.tmp_proj
43+
*.log
44+
*.vspscc
45+
*.vssscc
46+
.builds
47+
*.pidb
48+
*.log
49+
*.scc
50+
51+
# Visual C++ cache files
52+
ipch/
53+
*.aps
54+
*.ncb
55+
*.opensdf
56+
*.sdf
57+
*.cachefile
58+
59+
# Visual Studio profiler
60+
*.psess
61+
*.vsp
62+
*.vspx
63+
64+
# Guidance Automation Toolkit
65+
*.gpState
66+
67+
# ReSharper is a .NET coding add-in
68+
_ReSharper*/
69+
*.[Rr]e[Ss]harper
70+
71+
# TeamCity is a build add-in
72+
_TeamCity*
73+
74+
# DotCover is a Code Coverage Tool
75+
*.dotCover
76+
77+
# NCrunch
78+
*.ncrunch*
79+
.*crunch*.local.xml
80+
81+
# Installshield output folder
82+
[Ee]xpress/
83+
84+
# DocProject is a documentation generator add-in
85+
DocProject/buildhelp/
86+
DocProject/Help/*.HxT
87+
DocProject/Help/*.HxC
88+
DocProject/Help/*.hhc
89+
DocProject/Help/*.hhk
90+
DocProject/Help/*.hhp
91+
DocProject/Help/Html2
92+
DocProject/Help/html
93+
94+
# Click-Once directory
95+
publish/
96+
97+
# Publish Web Output
98+
*.Publish.xml
99+
100+
# NuGet Packages Directory
101+
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
102+
#packages/
103+
104+
# Windows Azure Build Output
105+
csx
106+
*.build.csdef
107+
108+
# Windows Store app package directory
109+
AppPackages/
110+
111+
# Others
112+
sql/
113+
*.Cache
114+
ClientBin/
115+
[Ss]tyle[Cc]op.*
116+
~$*
117+
*~
118+
*.dbmdl
119+
*.[Pp]ublish.xml
120+
*.pfx
121+
*.publishsettings
122+
123+
# RIA/Silverlight projects
124+
Generated_Code/
125+
126+
# Backup & report files from converting an old project file to a newer
127+
# Visual Studio version. Backup files are not needed, because we have git ;-)
128+
_UpgradeReport_Files/
129+
Backup*/
130+
UpgradeLog*.XML
131+
UpgradeLog*.htm
132+
133+
# SQL Server files
134+
App_Data/*.mdf
135+
App_Data/*.ldf
136+
137+
138+
#LightSwitch generated files
139+
GeneratedArtifacts/
140+
_Pvt_Extensions/
141+
ModelManifest.xml
142+
143+
# =========================
144+
# Windows detritus
145+
# =========================
146+
147+
# Windows image file caches
148+
Thumbs.db
149+
ehthumbs.db
150+
151+
# Folder config file
152+
Desktop.ini
153+
154+
# Recycle Bin used on file shares
155+
$RECYCLE.BIN/
156+
157+
# Mac desktop service store files
158+
.DS_Store

CoMaNdO.Auctions/Auctions.cs

+7-7
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ public void Load()
1919
Events.OnDisconnect += Events_OnDisconnect;
2020
}
2121

22-
private void Events_Connected(string channel, string nick, bool partnered)
22+
private void Events_Connected(string channel, string nick, bool partnered, bool subprogram)
2323
{
24-
Commands.Add("!auction", Command_Auction, 2, 0);
25-
Commands.Add("!bid", Command_Bid, 0, 0);
24+
Commands.Add(this, "!auction", Command_Auction, 2, 0);
25+
Commands.Add(this, "!bid", Command_Bid, 0, 0);
2626

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

31-
private void Command_Auction(string user, string cmd, string[] args)
31+
private void Command_Auction(string user, Command cmd, string[] args)
3232
{
3333
if (args.Length > 0)
3434
{
@@ -71,7 +71,7 @@ private void Command_Auction(string user, string cmd, string[] args)
7171
}
7272
}
7373

74-
private void Command_Bid(string user, string cmd, string[] args)
74+
private void Command_Bid(string user, Command cmd, string[] args)
7575
{
7676
if (args.Length > 0)
7777
{
@@ -84,7 +84,7 @@ private void auctionLoopHandler(Object state)
8484
{
8585
if (Auction.Open && Auction.highBidder != "")
8686
{
87-
Chat.SendMessage(Users.GetDisplayName(Auction.highBidder) + " is currently winning, with a bid of " + Auction.highBid + "!");
87+
Chat.SendMessage(Users.GetDisplayName(Auction.highBidder, NameAlterLevel.Cosmetic) + " is currently winning, with a bid of " + Auction.highBid + "!");
8888
}
8989
}
9090

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

CoMaNdO.Auctions/Properties/AssemblyInfo.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("0.0.2")]
35+
[assembly: AssemblyVersion("0.0.3")]
3636
//[assembly: AssemblyFileVersion("1.0.0.0")]

CoMaNdO.Example/Example.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ public void Load()
3131
}
3232
}
3333

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

39-
private void Command_Example(string user, string command, string[] args)
39+
private void Command_Example(string user, Command cmd, string[] args)
4040
{
4141
// Output
4242
Chat.SendMessage("My first command, YAY!");
@@ -47,7 +47,7 @@ private void Command_Example(string user, string command, string[] args)
4747
public string Author { get { return "CoMaNdO"; } } // Your name/nickname.
4848
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.
4949
public string ContactInfo { get { return "[email protected]"; } } // Will be used to refer people for suggestions, error reports and more.
50-
public string Version { get { return "0.0.3"; } } // The version of the extension.
50+
public string Version { get { return "0.0.4"; } } // The version of the extension.
5151
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.
5252
public int LoadPriority { get { return 3; } }
5353

CoMaNdO.Example/Properties/AssemblyInfo.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("0.0.3")]
35+
[assembly: AssemblyVersion("0.0.4")]
3636
//[assembly: AssemblyFileVersion("1.0.0.0")]

CoMaNdO.Gambling/Gambling.cs

+11-8
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ public class Gambling : IExtension
1515

1616
public void Load()
1717
{
18-
Pool.Load();
18+
Pool.Load(this);
1919
}
2020

2121
public string Name { get { return "Gambling System"; } }
2222
public string FileName { get { return "CoMaNdO.Gambling.dll"; } }
2323
public string Author { get { return "CoMaNdO"; } }
2424
public string UniqueID { get { return "CoMaNdO.Gambling"; } }
2525
public string ContactInfo { get { return "[email protected]"; } }
26-
public string Version { get { return "0.0.1"; } }
26+
public string Version { get { return "0.0.2"; } }
2727
public int ApiVersion { get { return 0; } }
2828
public int LoadPriority { get { return 1; } }
2929

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

77-
public static void Load()
78+
public static void Load(IExtension sender)
7879
{
80+
extension = sender;
81+
7982
Events.Connected += Events_Connected;
8083
Events.Currency.OnQueue += Events_OnCurrencyQueue;
8184
Events.OnDisconnect += Events_OnDisconnect;
8285
}
8386

84-
private static void Events_Connected(string channel, string nick, bool partnered)
87+
private static void Events_Connected(string channel, string nick, bool partnered, bool subprogram)
8588
{
86-
Commands.Add("!gamble", Command_Gamble, 2, 0);
87-
Commands.Add("!bet", Command_Bet, 0, 0);
89+
Commands.Add(extension, "!gamble", Command_Gamble, 2, 0);
90+
Commands.Add(extension, "!bet", Command_Bet, 0, 0);
8891

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

327-
private static void Command_Gamble(string user, string cmd, string[] args)
330+
private static void Command_Gamble(string user, Command cmd, string[] args)
328331
{
329332
if (args.Length > 0)
330333
{
@@ -513,7 +516,7 @@ private static void Command_Gamble(string user, string cmd, string[] args)
513516
}
514517
}
515518

516-
private static void Command_Bet(string user, string cmd, string[] args)
519+
private static void Command_Bet(string user, Command cmd, string[] args)
517520
{
518521
if (Running)
519522
{

CoMaNdO.Gambling/Properties/AssemblyInfo.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("0.0.1")]
35+
[assembly: AssemblyVersion("0.0.2")]
3636
//[assembly: AssemblyFileVersion("1.0.0.0")]

0 commit comments

Comments
 (0)