| summaryrefslogtreecommitdiff | 
diff options
| author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2016-06-08 17:58:56 +0200 | 
|---|---|---|
| committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2016-06-08 17:58:56 +0200 | 
| commit | 16265ec44520c3926c11127d0a6a6bac82a53275 (patch) | |
| tree | e54aeed621509655e0e5a5c8a0d1ef3bc50be7f9 /src/io/network.c | |
| parent | d29327bdc629dfa37360465b03ef45d205e7a225 (diff) | |
ZoO now appends anything it learns to a file.
Also, removes the "pointing to [...]" message, which was used for debug
purposes.
Diffstat (limited to 'src/io/network.c')
| -rw-r--r-- | src/io/network.c | 15 | 
1 files changed, 15 insertions, 0 deletions
| diff --git a/src/io/network.c b/src/io/network.c index 45be5fb..0c9cf33 100644 --- a/src/io/network.c +++ b/src/io/network.c @@ -436,6 +436,21 @@ READ_NEW_MSG:        if (ZoO_IS_PREFIX("JOIN", (net->in + cmd)))        { +         for (i = 1; (i < 512) && (net->in[i] != '!'); ++i) +         { +         } + +         if ((i == 512) || (i == 1)) +         { +            ZoO_ERROR("Could not find JOIN username: %s", net->in); + +            goto READ_NEW_MSG; +         } + +         *msg_offset = 1; +         *msg_size = (i - 1); +         net->in[i] = '\0'; +           *type = ZoO_JOIN;           return 0; | 


