aboutsummaryrefslogtreecommitdiff
path: root/process.go
diff options
context:
space:
mode:
authorEdzell <derz@elidragon.com>2022-05-10 18:28:34 +0200
committerEdzell <derz@elidragon.com>2022-05-10 18:28:34 +0200
commit4e602d1c73d738e3e7f3071a265b6bcf408342e1 (patch)
treee3bc94aede408b4bf299608ed887928afde9a8ef /process.go
parent517c85caa157a83c6badecfbcef06354ecbdf870 (diff)
Plugin interact
Diffstat (limited to 'process.go')
-rw-r--r--process.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/process.go b/process.go
index 60f4f1a..7c5b71e 100644
--- a/process.go
+++ b/process.go
@@ -33,7 +33,7 @@ func (cc *ClientConn) process(pkt mt.Pkt) {
}
cc.setState(csInit)
- if cmd.SerializeVer <= latestSerializeVer {
+ /*if cmd.SerializeVer <= latestSerializeVer {
cc.Log("<-", "invalid serializeVer", cmd.SerializeVer)
ack, _ := cc.SendCmd(&mt.ToCltKick{Reason: mt.UnsupportedVer})
@@ -57,7 +57,7 @@ func (cc *ClientConn) process(pkt mt.Pkt) {
}
return
- }
+ }*/
if len(cmd.PlayerName) == 0 || len(cmd.PlayerName) > maxPlayerNameLen {
cc.Log("<-", "invalid player name length")
@@ -438,6 +438,10 @@ func (cc *ClientConn) process(pkt mt.Pkt) {
return
}
+ if handleInteraction(cmd, cc) { // if return true: already handled
+ return
+ }
+
if _, ok := cmd.Pointed.(*mt.PointedAO); ok {
srv.swapAOID(&cmd.Pointed.(*mt.PointedAO).ID)
}
@@ -445,6 +449,7 @@ func (cc *ClientConn) process(pkt mt.Pkt) {
done := make(chan struct{})
go func(done chan<- struct{}) {
+
result, isCmd := onChatMsg(cc, cmd)
if !isCmd {
forward(pkt)
@@ -736,6 +741,8 @@ func (sc *ServerConn) process(pkt mt.Pkt) {
return
case *mt.ToCltMediaPush:
+ prepend(sc.mediaPool, &cmd.Filename)
+
var exit bool
for _, f := range clt.media {
if f.name == cmd.Filename {
@@ -748,7 +755,6 @@ func (sc *ServerConn) process(pkt mt.Pkt) {
break
}
- prepend(sc.mediaPool, &cmd.Filename)
if cmd.ShouldCache {
cacheMedia(mediaFile{
name: cmd.Filename,