Rev 3563 | Rev 4143 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3563 | Rev 3981 | ||
---|---|---|---|
Line 26... | Line 26... | ||
26 | 26 | ||
Line 27... | Line 27... | ||
27 | ; Ok, we said something, print it to our textbox |
27 | ; Ok, we said something, print it to our textbox |
Line 28... | Line 28... | ||
28 | 28 | ||
29 | ; TODO: dont send if it's a server window? |
29 | ; TODO: dont send if it's a server window? |
30 | 30 | ||
Line 31... | Line 31... | ||
31 | push [window_open] ; print to the current window |
31 | push [window_active] ; print to the current window |
32 | pop [window_print] |
32 | pop [window_print] |
Line 59... | Line 59... | ||
59 | ; and now send it to the server |
59 | ; and now send it to the server |
Line 60... | Line 60... | ||
60 | 60 | ||
61 | mov dword[packetbuf], 'priv' |
61 | mov dword[packetbuf], 'priv' |
Line 62... | Line 62... | ||
62 | mov dword[packetbuf+4], 'msg ' |
62 | mov dword[packetbuf+4], 'msg ' |
63 | 63 | ||
64 | mov esi, [window_open] |
64 | mov esi, [window_active] |
65 | add esi, window.name |
65 | add esi, window.name |
66 | mov edi, packetbuf+8 |
66 | mov edi, packetbuf+8 |
67 | mov ecx, MAX_WINDOWNAME_LEN |
67 | mov ecx, MAX_WINDOWNAME_LEN |
Line 101... | Line 101... | ||
101 | dd 'help', cmd_usr_help |
101 | dd 'help', cmd_usr_help |
102 | dd 'code', cmd_usr_code |
102 | dd 'code', cmd_usr_code |
103 | ; TODO: All other commands require a connection to the server. |
103 | ; TODO: All other commands require a connection to the server. |
104 | dd 'quer', cmd_usr_quer |
104 | dd 'quer', cmd_usr_quer |
105 | dd 'quit', cmd_usr_quit |
105 | dd 'quit', cmd_usr_quit |
- | 106 | dd 'part', cmd_usr_part |
|
Line 106... | Line 107... | ||
106 | 107 | ||
Line 130... | Line 131... | ||
130 | 131 | ||
Line 131... | Line 132... | ||
131 | 132 | ||
132 | - | ||
133 | cmd_usr_quit: |
- | |
134 | - | ||
135 | cmp [edit1.size], 5 |
- | |
Line -... | Line 133... | ||
- | 133 | ||
- | 134 | cmd_usr_quit: |
|
- | 135 | ||
136 | je .ok |
136 | mov esi, quit_msg |
137 | jb cmd_usr_send |
137 | |
Line 138... | Line 138... | ||
138 | cmp byte[usercommand+5], ' ' |
138 | cmp byte[usercommand+5], ' ' |
Line 139... | Line 139... | ||
139 | jne cmd_usr_send |
139 | jne .default_msg |
140 | 140 | lea esi,[usercommand+6] |
|
Line 153... | Line 153... | ||
153 | 153 | ||
Line -... | Line 154... | ||
- | 154 | ret |
|
- | 155 | ||
- | 156 | ||
- | 157 | ||
- | 158 | ; esi = quit message |
|
- | 159 | cmd_usr_quit_server: |
|
- | 160 | ||
- | 161 | ; User wants to close a channel, send PART command to server |
|
- | 162 | mov dword[packetbuf], 'QUIT' |
|
- | 163 | mov word[packetbuf+4], ' :' |
|
- | 164 | lea edi, [packetbuf+6] |
|
- | 165 | ; Append our quit msg |
|
- | 166 | @@: |
|
- | 167 | lodsb |
|
- | 168 | stosb |
|
- | 169 | test al, al |
|
- | 170 | jnz @r |
|
- | 171 | ; end the command with a CRLF |
|
- | 172 | dec edi |
|
- | 173 | mov ax, 0x0a0d |
|
- | 174 | stosw |
|
- | 175 | ||
- | 176 | lea esi, [edi - packetbuf] ; calculate length |
|
- | 177 | mcall send, [socketnum], packetbuf, , 0 ; and finally send to server |
|
- | 178 | ||
Line 154... | Line 179... | ||
154 | ret |
179 | ret |
Line 155... | Line 180... | ||
155 | 180 | ||
156 | 181 | ||
Line 303... | Line 328... | ||
303 | 328 | ||
Line -... | Line 329... | ||
- | 329 | ret |
|
- | 330 | ||
- | 331 | ||
- | 332 | ||
- | 333 | ; User typed a part command |
|
- | 334 | cmd_usr_part: |
|
- | 335 | ||
- | 336 | cmp byte[usercommand+5], 13 ; parameters given? |
|
- | 337 | jne cmd_usr_send |
|
- | 338 | ||
- | 339 | mov esi, [window_active] ; window is not a server window? |
|
- | 340 | cmp [esi + window.type], WINDOWTYPE_SERVER |
|
- | 341 | je @f |
|
- | 342 | ||
- | 343 | call window_close ; OK, close currently open (channel/chat/..) window |
|
- | 344 | @@: |
|
- | 345 | ||
- | 346 | ret |
|
- | 347 | ||
- | 348 | ; Send part command to server |
|
- | 349 | ; esi must point to channel name (ASCIIZ) |
|
- | 350 | cmd_usr_part_channel: |
|
- | 351 | ||
- | 352 | ; User wants to close a channel, send PART command to server |
|
- | 353 | mov dword[packetbuf], 'PART' |
|
- | 354 | mov byte[packetbuf+4], ' ' |
|
- | 355 | lea edi, [packetbuf+5] |
|
- | 356 | @@: |
|
- | 357 | lodsb |
|
- | 358 | stosb |
|
- | 359 | test al, al |
|
- | 360 | jnz @r |
|
- | 361 | ; end the command with a CRLF |
|
- | 362 | dec edi |
|
- | 363 | mov ax, 0x0a0d |
|
- | 364 | stosw |
|
- | 365 | ||
- | 366 | lea esi, [edi - packetbuf] ; calculate length |
|
- | 367 | mcall send, [socketnum], packetbuf, , 0 ; and finally send to server |
|
- | 368 | ||
304 | ret |
369 | ret |
Line 305... | Line 370... | ||
305 | 370 | ||
306 | 371 | ||
307 | 372 | ; The user typed some undefined command, just recode it and send to the server |