2017-11-22 06:11:40 +00:00
|
|
|
package libnmdc
|
|
|
|
|
|
|
|
type AdcProtocol struct {
|
|
|
|
hc *HubConnection
|
|
|
|
}
|
|
|
|
|
2017-11-22 07:02:11 +00:00
|
|
|
func NewAdcProtocol(hc *HubConnection) Protocol {
|
2017-11-22 06:11:40 +00:00
|
|
|
proto := AdcProtocol{}
|
|
|
|
proto.hc = hc
|
|
|
|
|
2017-11-22 07:02:21 +00:00
|
|
|
// Start logging in
|
|
|
|
hc.SayRaw("HSUP ADBASE ADTIGR\n")
|
2017-11-22 06:22:13 +00:00
|
|
|
|
2017-11-22 06:11:40 +00:00
|
|
|
return &proto
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *AdcProtocol) ProcessCommand(msg string) {
|
|
|
|
this.hc.processEvent(HubEvent{EventType: EVENT_DEBUG_MESSAGE, Message: msg})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *AdcProtocol) SayPublic(msg string) {
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *AdcProtocol) SayPrivate(user, message string) {
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *AdcProtocol) ProtoMessageSeparator() string {
|
|
|
|
return "\n"
|
|
|
|
}
|