ipa: Make the handler a variable on the class side
* Making it a classVariable will make subclasses manipulate the base variable. By making it a variable on the class side avoids this issue.
This commit is contained in:
parent
12bdaf75f6
commit
3e8d588e9b
|
@ -24,7 +24,9 @@ Object subclass: IPAProtoHandler [
|
|||
behavior.'>
|
||||
<category: 'OsmoNetwork-IPA'>
|
||||
|
||||
handlers := nil.
|
||||
IPAProtoHandler class [
|
||||
| handlers |
|
||||
]
|
||||
|
||||
IPAProtoHandler class >> initialize [
|
||||
<category: 'private'>
|
||||
|
@ -35,6 +37,10 @@ Object subclass: IPAProtoHandler [
|
|||
at: IPAConstants msgIdAck put: #handleIdAck:.
|
||||
]
|
||||
|
||||
IPAProtoHandler class >> handlers [
|
||||
^ handlers
|
||||
]
|
||||
|
||||
registerOn: aDispatcher [
|
||||
<category: 'initialize'>
|
||||
aDispatcher addHandler: IPAConstants protocolIPA on: self with: #handleMsg:.
|
||||
|
@ -54,7 +60,7 @@ Object subclass: IPAProtoHandler [
|
|||
| selector |
|
||||
<category: 'dispatch'>
|
||||
|
||||
selector := handlers at: (aMsg first asInteger) ifAbsent: [
|
||||
selector := self class handlers at: (aMsg first asInteger) ifAbsent: [
|
||||
self logError: 'IPA message not understood', aMsg first asInteger asString
|
||||
area: #ipa.
|
||||
^ false
|
||||
|
|
Reference in New Issue