Commit graph

113 commits

Author SHA1 Message Date
initsuj
aed891e3c8 Fixed IndexOutOfRangeException when bot is unloaded on update 2016-02-23 11:19:14 -07:00
Pokechu22
6d4ec86619 Add an "AfterGameJoined" method to ChatBot.cs.
Since messages can't be sent in Initialize(), a method that's called when the chat bot can first send messages is needed.  This method is called when the login completes or when the bot is loaded if the login is already been completed.
2016-02-07 14:55:29 -08:00
Pokechu22
1ea8f119d9 Give ChatBots access to plugin channels.
Chatbots may find it useful to send messages over plugin channels.  This allows REGISTERing, UNREGISTERing, and sending over plugin channels, with built-in checking if the server also registered the channel (which can be disabled by the bot if needed). Unused channels are UNREGISTERed when a bot is disabled.
2016-02-07 14:55:10 -08:00
Pokechu22
207732cd86 Add an option to add a delay between bot message
Because bots can send several messages quickly, this adds an option to slow down the rate at which messages are produced (to avoid issues with antispam plugins).  This should help solve part of the troubles @mobdon was having in #105.

Right now the default time is 2 seconds per message.  However, messages are sent imediately if the bot doesn't need to delay (so if it's a bot that only outputs one or two messages, those will still happen imediately).  Also, note that it's limited per-bot right now.

I also added an optional parameter to the SendText method so that bots can avoid this behavior if they need to.  In some cases, they'll want to send multiple messages.
2016-01-29 16:18:59 -08:00
ORelio
902b04656c Fix pathfinding to coordinates
- Now possible to walk to given coordinates
- Fix sending location before it is received
2015-12-13 21:58:55 +01:00
ORelio
b0c8f82697 Add simple movements with /move command
- Determine if we can move to the specified direction
 - Add moving ability to the specified direction
 - Add /move command for triggering moves
 - Add move decomp. into steps (more natural)
 - Add pathfinding routines (still WIP)
 - SO YES YOU CAN NOW WALK USING MCC!!!
2015-12-12 16:48:38 +01:00
ORelio
49702e30b8 Add block material database
Taken from Bukkit's Material class, with credits.
Allows to know types and properties of blocks.
+ Use database for "is solid" checks
+ Add "can harm players" method
+ Faster movements, falling seems natural now
+ Shorter error message when ping failed
2015-12-09 23:04:00 +01:00
ORelio
5d8d42e3d1 Terrain: Fix coordinate parsing (negative coords)
- Optimize readNextUShortsLittleEndian network reading method
- Various coordinate computation issues, negative chunk offsets
- Properly parse negative coordinates for block change events
- Properly reach ground if less than 1 block over the ground
2015-12-08 00:34:40 +01:00
ORelio
cb00c28b6e Add world handling (and fall to ground)
- World is now properly parsed and stored from chunk data
- Block changes are also handled and world updated accordingly
- Added ground checking, the player will move down to reach the ground
- Performance tweaking in Protocol18, using lists instead of arrays
- Fix player look not properly skipped causing invalid location after
teleport
2015-11-30 15:30:49 +01:00
ORelio
72bd485e67 Add basic location handling
- Retrieve player location from the server
- Send back player location from the server
- Requires that a specific setting is enabled
- Should allow items to be picked up by the player
- May also trigger some anti chead plugins
2015-11-27 17:16:37 +01:00
Pokechu22
7cc87d8e71 Detect and store the list of forge mods. 2015-10-24 15:06:13 -07:00
ORelio
29975da627 Merge onlyforlogin and enabled in proxy settings
The 'enabled' setting can now be set to 'login' for enabling proxy only
for logging in to the Minecraft account, and then connect to the server
directly without proxy. Useful when Minecraft login is blocked on some
network, but not Minecraft servers (port 25565) (original idea and
enhancement by ZizzyDizzyMC)
2015-10-22 20:56:08 +02:00
ORelio
a5bf62bc94 Merge pull request #99 from ZizzyDizzyMC/Indev
Ability to use proxy only for minecraft login
2015-10-18 18:04:50 +02:00
ZizzyDizzyMC
a65e632522 Fixed some things about pull request 99.
Changed LoginOnlyProxy to OnlyForLogin in settings, changed McTcpClient
so I was not using assignment operator. (Was a mistake anyway.)
2015-10-16 04:50:56 -04:00
ZizzyDizzyMC
0b870e2b49 Proxy Setting addition.
Added 'loginonlyproxy' option with true / false boolean options.
on 'true' only the minecraft login is redirected to the proxy.
Otherwise both the login and the server connection are routed though the
chosen proxy.

Provides a semi-workaround to issues #89 and #80 on ORelio/Indev
2015-10-15 21:20:29 -04:00
ORelio
b25a665c82 Delay BrandInfo sending
Implement Game Join event and send Brand Info only when server
acknowledged game join, as ZizzyDizzyMC did before, else server may
generate an invalid packet error because it was still in "login" mode
and not in "playing" mode. Fix second issue in #95
2015-09-30 20:01:57 +02:00
ORelio
8560753949 Extend BrandInfo setting
Brand Information tells the server what client is being used to connect
to the server, possible values are the following:

- none (do not tell anything)
- vanilla (tells that you are using MC vanilla)
- mcc (tell that you are using MCC + version)

This will usually not do anything unless plugins developers use this
information for developing some MCC interoperability eg more chat
interactions instead of using GUIs. This could also be used to block
third party clients, that's why brand information can be disabled or
changed to vanilla.
2015-09-29 14:03:33 +02:00
ORelio
67f17cbb3e Remove packet debugging code 2015-07-30 17:32:42 +02:00
ORelio
a6b3bf0481 AutoRespond tests and fixes
- Automatically add [BotName] tags to log lines
- Fix case handling and actionPrivate used for public messages
- Add a sample file for basic and regex matches
2015-06-21 16:40:13 +02:00
ORelio
3ce91188c7 Add support for C# scripts in scripting bot
- Now scripts can also be written in C#
- C# scripts can access ChatBot API
- Add more methods in ChatBot API
- Add an example of C# script file
- Coding style fixes: method names ucfirst
2015-06-20 22:58:18 +02:00
ORelio
0029561135 AutoRespond improvements
- Add improvements from pull request #76
- Add support for regexes instead of simple matches
- Add support for internal MCC commands eg script
- Add support for flexible INI file containing matches

TODO: Testing, sample INI file, proper documentation
2015-06-11 23:37:20 +02:00
ORelio
53156bdf98 Normalize AutoRespond bot
Move FromFile method from bots to ChatBot class
Rename file and class, removing space and underscore.
2015-05-26 19:17:37 +02:00
ORelio
b07091e3dd Merge branch 'Indev' of https://github.com/ORelio/Minecraft-Console-Client into Indev 2015-05-26 19:03:50 +02:00
ORelio
f7c729835a Add delay between sends of long messages
When a very long message is typed, a delay of 2 seconds is by default
used before sending parts of the long messages. The delay can be
modified or set back to 0 in configuration file, if necessary.
2015-05-26 19:01:39 +02:00
Bancey
43fa3fb4b4 Auto Respond Bot
This bot allows users to add a bot that can detect and respond to
certain text.

The bot can be enabled/disabled via the ini file. (disabled by default)
The bot uses 2 files to let the user set what to pickup and what to
respond.
2015-05-19 15:36:20 +01:00
ORelio
57c66c82d7 Merge error handlers
- Merge all error handling code into one method
- Fix ConsoleIO not clearing the line being typed upon reset
- Update console title upon logging in to the server
- Pass "failed to ping this IP" to AutoRelog (thx doranchak)
2015-04-22 10:27:53 +02:00
ORelio
6261e7adb7 More startup error handling
- Pass minecraft login failure message to AutoRelog bot (suggestion by
doranchak)
- Fix NullReferenceException in McTcpClient caused by SocketException in
ProxyHandler
- Refactor error handling code in Program.InitializeClient()
- More detailed error messages on network errors.
2015-04-20 17:26:16 +02:00
ORelio
ea17ec87f1 Better exception catching
- Better catch in proxy handler
- Better catch in StartClient (thx doranchak)
2015-04-06 11:42:43 +02:00
ORelio
05a141c50d Improve offline interactions
- Add prompt for Minecraft version
- Improve offline-mode command prompt
- Fix default value on parse error in protocol handler
- Fix failed to connect not showing offline prompt
2015-03-25 22:50:20 +01:00
ORelio
aaced855d8 Catch exceptions for bots for onTextReceived
Avoid crashing due to bots not properly processing text
2015-03-23 13:57:31 +01:00
ORelio
858ad12783 Fix concurrency crashes for player list
Bug report by doranchak (forum post no 1136)
2015-03-19 22:08:26 +01:00
ORelio
e4916033fa Fix crash on disconnect when failed to connect
Fix #67 and bug report by doranchak (post no 1084 on forum thread at
minecraft forums)
2015-03-02 21:35:45 +01:00
ORelio
24c4344a70 Fix scripts failing to send msg after reco
Script was using old disposed handler
Fixed by properly updating reference
Bug report by 1092CQ (thanks!)
2015-01-23 22:07:46 +01:00
ORelio
f82041288d /list command improvements
Coding style, Guid, interface, Fallback Command
2014-11-10 20:43:00 +01:00
lokulin
7fa2e0d02e fixed whitespace to fit with code style 2014-11-11 00:55:42 +11:00
lokulin
07fed5cd24 Added a player list command /list 2014-11-11 00:32:32 +11:00
Lauchlin
284d335b2a Update short to ushort 2014-11-05 02:05:33 +11:00
ORelio
050b2985f5 Fix crash on RemoteControl launching a Script
List containing bots is modifier while being enumerated: crash
Fixed by copying the list before enumerating
Bug report by Nicconyancat
2014-10-08 08:05:45 +02:00
ORelio
96a614b617 Fix ThreadAbortException beign reported to the user
This exception is normal when disconnecting from the server and should
be ignored.
2014-09-07 15:11:39 +02:00
ORelio
b0b65b7ce0 Add offline command prompt
Fix #42, and allow more interactive commands when not connected to a
server. /quit, /reco, /connect are the only allowed commands in this
limited command prompt.
Updated Assembly Info, version number is now 1.8.0.
2014-08-18 15:10:15 +02:00
ORelio
2907b9c587 Account list file support
Accounts can be stored in a file and used while (re)connecting
+ Check that the server IP is valid (avoid /connect <player>)
+ Fix command prompt not exiting while exiting the server
+ SendChatMessage() -> SendText() method name change
2014-06-19 19:24:03 +02:00
ORelio
36690b8b34 Commands as separate classes
Each command is now in its own class in the 'Commands' namespace, and
loaded through reflection.
2014-06-18 13:32:17 +02:00
ORelio
715bc09872 Add different command handling modes
+ Fix [AppVars] INI section not being processed
+ Fix set var=value command not working properly
See
http://www.minecraftforum.net/topic/1314800-winmaclinux-minecraft-console-client-179/page__st__500#entry32178614
for details about command handling modes.
2014-06-18 00:49:45 +02:00
ORelio
c4c5e2efd9 Chatlog, Message sending fixes
- Fix ChatLog not creating the folder containing log file
- Fix chat prompt not sending regular text messages
2014-06-16 14:23:56 +02:00
ORelio
87d4687394 Add set varname=value MCC command
- Allow to use vars declared in scripts or directly by the user
- Commands my now use %variable% as well
- Moved "help" command from RemoteControl to inner MCC command manager
- The only special command is "wait", which is only available in scripts
Todo: Solve ambiguity between MCC help and Server help commands
Note: Auto accept tpa suggested by MousePak
Note: Manually choosing MC version suggested by ZizzyDizzyMC
2014-06-14 18:48:43 +02:00
ORelio
9456e82923 Handle all internal MCC commands in one place
- MCC internal commands for command prompt, remote control and scripts
are handled in one place, thus it's no more needed to add them in 3
different places.
- "exit" command in scripts is not equivalent to "/quit"
- removed "disconnect" command in scripts /!\
- bots can now easily perform internal MCC commands.
2014-06-14 13:20:15 +02:00
ORelio
283074bb63 Store server IP and server port in distinct vars
- Change "replaceVars" to "expandVars" (more explicit)
- Store server IP and server port in distinct vars in Settings class
- Add setServerIP setter in Settings which automatically split a
host:port string
- Add %serverip% variable which use the new ServerPort setting
- Fix "text%incompletevarnameatstringend" strings
2014-06-13 16:50:55 +02:00
ORelio
068b87a11a Variable engine done, catch bot exceptions
- %variable% variables can be declared in the INI file and used
elsewhere
- Default argument 'true' for WriteLineFormatted in ConsoleIO
- Exceptions thrown by bots no longer disconnect from the server, stack
trace is printed instead
2014-06-11 20:40:25 +02:00
ORelio
898a04a843 Various fixes
- Re-add support for MC 1.6 chat color names
- Re-add support for MC 1.5- vanilla whispers in ChatBot
- Add /connect in main chat prompt (reported by TNT-UP)
2014-06-03 13:05:53 +02:00
ORelio
c8332eb845 Add 'exit on failure' setting
- Automatically close on connection lost or other failure
- Feature suggested by TorchRJ_
- Also, forgot to mention in 'App refactoring almost done' :
- Issue depending on username and/or server should be fixed
2014-05-31 12:56:54 +02:00