C# 클래스 SteamBot.UserHandler

The abstract base class for users of SteamBot that will allow a user to extend the functionality of the Bot.
파일 보기 프로젝트 열기: Jessecar96/SteamBot 1 사용 예제들

공개 메소드들

메소드 설명
GetOtherInventory ( ) : void

Gets the other's inventory and stores it in OtherInventory.

OnBotCommand ( string command ) : void

Called when an 'exec' command is given via botmanager.

OnChatRoomMessage ( SteamID chatID, SteamID sender, string message ) : void

Called when a chat message is sent in a chatroom

OnFriendAdd ( ) : bool

Called when the user adds the bot as a friend.

OnFriendRemove ( ) : void

Called when the user removes the bot as a friend.

OnGroupAdd ( ) : bool

Called when the bot is invited to a Steam group

OnLoginCompleted ( ) : void

Called when the bot is fully logged in.

OnMessage ( string message, EChatEntryType type ) : void

Called whenever a message is sent to the bot. This is limited to regular and emote messages.

OnMessageHandler ( string message, EChatEntryType type ) : void
OnStatusError ( Trade status ) : void
OnTradeAccept ( ) : void
OnTradeAcceptHandler ( ) : void
OnTradeAddItem ( Schema schemaItem, Inventory inventoryItem ) : void
OnTradeAwaitingConfirmation ( long tradeOfferID ) : void
OnTradeClose ( ) : void
OnTradeError ( string error ) : void
OnTradeInit ( ) : void
OnTradeMessage ( string message ) : void
OnTradeMessageHandler ( string message ) : void
OnTradeOfferUpdated ( TradeOffer offer ) : void

Called when a trade offer is updated, including the first time it is seen. When the bot is restarted, this might get called again for trade offers it's been previously called on. Thus, you can't rely on this method being called only once after an offer is accepted! If you need to rely on that functionality (say for giving users non-Steam currency), you need to keep track of which trades have been paid out yourself

OnTradeReady ( bool ready ) : void
OnTradeReadyHandler ( bool ready ) : void
OnTradeRemoveItem ( Schema schemaItem, Inventory inventoryItem ) : void
OnTradeRequest ( ) : bool

Called whenever a user requests a trade.

OnTradeRequestReply ( bool accepted, string response ) : void

Called when user accepts or denies bot's trade request.

OnTradeTimeout ( ) : void
UserHandler ( Bot bot, SteamID sid ) : System
_OnTradeAwaitingConfirmation ( long tradeOfferID ) : void

보호된 메소드들

메소드 설명
GetUserResponse ( string message = null ) : Task

Waits for the user to enter something into regular or trade chat, then returns it (as the result of a task) Usage: The following displays "How many do you want to buy" and stores the user's response: string userResponse = await GetUserResponse("How many do you want to buy?"); Note: calling this method causes the next user-message to NOT call OnMessage() or OnTradeMessage()

SendChatMessage ( int delayMs, string message ) : void

A helper method for sending a chat message to the other user in the chat window (as opposed to the trade window) after a given delay

SendChatMessage ( string message ) : void

A helper method for sending a chat message to the other user in the chat window (as opposed to the trade window)

SendReplyMessage ( int delayMs, string message ) : void

Sends a message to the user in either the chat window or the trade window, depending on which screen the user sent a message from last, after a gven delay. Useful for responding to commands.

SendReplyMessage ( string message ) : void

Sends a message to the user in either the chat window or the trade window, depending on which screen the user sent a message from last. Useful for responding to commands.

SendTradeMessage ( int delayMs, string message ) : void

A helper method for sending a chat message to the other user in the trade window after a given delay. If the trade has ended, nothing this does nothing

SendTradeMessage ( string message ) : void

A helper method for sending a chat message to the other user in the trade window. If the trade has ended, nothing this does nothing

비공개 메소드들

메소드 설명
HandleWaitingOnUserResponse ( string message ) : bool
SendChatMessageImpl ( string message ) : void
SendMessage ( Action messageFunc, string message, System timer ) : void
SendMessageDelayed ( int delayMs, Action messageFunc, string message ) : void
SendTradeMessageImpl ( string message ) : void

메소드 상세

GetOtherInventory() 공개 메소드

Gets the other's inventory and stores it in OtherInventory.
public GetOtherInventory ( ) : void
리턴 void

GetUserResponse() 보호된 메소드

Waits for the user to enter something into regular or trade chat, then returns it (as the result of a task) Usage: The following displays "How many do you want to buy" and stores the user's response: string userResponse = await GetUserResponse("How many do you want to buy?"); Note: calling this method causes the next user-message to NOT call OnMessage() or OnTradeMessage()
protected GetUserResponse ( string message = null ) : Task
message string An option message to display to the user. /// Sent to whichever chat (normal or trade) is currently being used.
리턴 Task

OnBotCommand() 공개 메소드

Called when an 'exec' command is given via botmanager.
public OnBotCommand ( string command ) : void
command string The command message.
리턴 void

OnChatRoomMessage() 공개 메소드

Called when a chat message is sent in a chatroom
public OnChatRoomMessage ( SteamID chatID, SteamID sender, string message ) : void
chatID SteamKit2.SteamID The SteamID of the group chat
sender SteamKit2.SteamID The SteamID of the sender
message string The message sent
리턴 void

OnFriendAdd() 공개 추상적인 메소드

Called when the user adds the bot as a friend.
public abstract OnFriendAdd ( ) : bool
리턴 bool

OnFriendRemove() 공개 추상적인 메소드

Called when the user removes the bot as a friend.
public abstract OnFriendRemove ( ) : void
리턴 void

OnGroupAdd() 공개 추상적인 메소드

Called when the bot is invited to a Steam group
public abstract OnGroupAdd ( ) : bool
리턴 bool

OnLoginCompleted() 공개 추상적인 메소드

Called when the bot is fully logged in.
public abstract OnLoginCompleted ( ) : void
리턴 void

OnMessage() 공개 추상적인 메소드

Called whenever a message is sent to the bot. This is limited to regular and emote messages.
public abstract OnMessage ( string message, EChatEntryType type ) : void
message string
type EChatEntryType
리턴 void

OnMessageHandler() 공개 메소드

public OnMessageHandler ( string message, EChatEntryType type ) : void
message string
type EChatEntryType
리턴 void

OnStatusError() 공개 메소드

public OnStatusError ( Trade status ) : void
status Trade
리턴 void

OnTradeAccept() 공개 추상적인 메소드

public abstract OnTradeAccept ( ) : void
리턴 void

OnTradeAcceptHandler() 공개 메소드

public OnTradeAcceptHandler ( ) : void
리턴 void

OnTradeAddItem() 공개 추상적인 메소드

public abstract OnTradeAddItem ( Schema schemaItem, Inventory inventoryItem ) : void
schemaItem Schema
inventoryItem Inventory
리턴 void

OnTradeAwaitingConfirmation() 공개 추상적인 메소드

public abstract OnTradeAwaitingConfirmation ( long tradeOfferID ) : void
tradeOfferID long
리턴 void

OnTradeClose() 공개 메소드

public OnTradeClose ( ) : void
리턴 void

OnTradeError() 공개 추상적인 메소드

public abstract OnTradeError ( string error ) : void
error string
리턴 void

OnTradeInit() 공개 추상적인 메소드

public abstract OnTradeInit ( ) : void
리턴 void

OnTradeMessage() 공개 추상적인 메소드

public abstract OnTradeMessage ( string message ) : void
message string
리턴 void

OnTradeMessageHandler() 공개 메소드

public OnTradeMessageHandler ( string message ) : void
message string
리턴 void

OnTradeOfferUpdated() 공개 추상적인 메소드

Called when a trade offer is updated, including the first time it is seen. When the bot is restarted, this might get called again for trade offers it's been previously called on. Thus, you can't rely on this method being called only once after an offer is accepted! If you need to rely on that functionality (say for giving users non-Steam currency), you need to keep track of which trades have been paid out yourself
public abstract OnTradeOfferUpdated ( TradeOffer offer ) : void
offer TradeOffer
리턴 void

OnTradeReady() 공개 추상적인 메소드

public abstract OnTradeReady ( bool ready ) : void
ready bool
리턴 void

OnTradeReadyHandler() 공개 메소드

public OnTradeReadyHandler ( bool ready ) : void
ready bool
리턴 void

OnTradeRemoveItem() 공개 추상적인 메소드

public abstract OnTradeRemoveItem ( Schema schemaItem, Inventory inventoryItem ) : void
schemaItem Schema
inventoryItem Inventory
리턴 void

OnTradeRequest() 공개 추상적인 메소드

Called whenever a user requests a trade.
public abstract OnTradeRequest ( ) : bool
리턴 bool

OnTradeRequestReply() 공개 메소드

Called when user accepts or denies bot's trade request.
public OnTradeRequestReply ( bool accepted, string response ) : void
accepted bool True if user accepted bot's request, false if not.
response string String response of the callback.
리턴 void

OnTradeTimeout() 공개 추상적인 메소드

public abstract OnTradeTimeout ( ) : void
리턴 void

SendChatMessage() 보호된 메소드

A helper method for sending a chat message to the other user in the chat window (as opposed to the trade window) after a given delay
protected SendChatMessage ( int delayMs, string message ) : void
delayMs int The delay, in milliseconds, to wait before sending the message
message string The message to send to the other user
리턴 void

SendChatMessage() 보호된 메소드

A helper method for sending a chat message to the other user in the chat window (as opposed to the trade window)
protected SendChatMessage ( string message ) : void
message string The message to send to the other user
리턴 void

SendReplyMessage() 보호된 메소드

Sends a message to the user in either the chat window or the trade window, depending on which screen the user sent a message from last, after a gven delay. Useful for responding to commands.
protected SendReplyMessage ( int delayMs, string message ) : void
delayMs int The delay, in milliseconds, to wait before sending the message
message string The message to send to the other user
리턴 void

SendReplyMessage() 보호된 메소드

Sends a message to the user in either the chat window or the trade window, depending on which screen the user sent a message from last. Useful for responding to commands.
protected SendReplyMessage ( string message ) : void
message string The message to send to the other user
리턴 void

SendTradeMessage() 보호된 메소드

A helper method for sending a chat message to the other user in the trade window after a given delay. If the trade has ended, nothing this does nothing
protected SendTradeMessage ( int delayMs, string message ) : void
delayMs int The delay, in milliseconds, to wait before sending the message
message string The message to send to the other user
리턴 void

SendTradeMessage() 보호된 메소드

A helper method for sending a chat message to the other user in the trade window. If the trade has ended, nothing this does nothing
protected SendTradeMessage ( string message ) : void
message string The message to send to the other user
리턴 void

UserHandler() 공개 메소드

public UserHandler ( Bot bot, SteamID sid ) : System
bot Bot
sid SteamKit2.SteamID
리턴 System

_OnTradeAwaitingConfirmation() 공개 메소드

public _OnTradeAwaitingConfirmation ( long tradeOfferID ) : void
tradeOfferID long
리턴 void