1: <?php
2:
3: namespace Budabot\Core;
4:
5: /*
6: * $Id: aochat.php,v 1.1 2006/12/08 15:17:54 genesiscl Exp $
7: *
8: * Modified to handle the recent problem with the integer overflow
9: *
10: * Copyright (C) 2002-2005 Oskari Saarenmaa <auno@auno.org>.
11: *
12: * AOChat, a PHP class for talking with the Anarchy Online chat servers.
13: * It requires the sockets extension (to connect to the chat server..)
14: * from PHP 4.2.0+ and either the GMP or BCMath extension (for generating
15: * and calculating the login keys) to work.
16: *
17: * A disassembly of the official java chat client[1] for Anarchy Online
18: * and Slicer's AO::Chat perl module[2] were used as a reference for this
19: * class.
20: *
21: * [1]: <http://www.anarchy-online.com/content/community/forumsandchat/>
22: * [2]: <http://www.hackersquest.org/ao/>
23: *
24: * Updates to this class can be found from the following web site:
25: * http://auno.org/dev/aochat.html
26: *
27: **************************************************************************
28: *
29: * This program is free software; you can redistribute it and/or modify
30: * it under the terms of the GNU General Public License as published by
31: * the Free Software Foundation; either version 2 of the License, or
32: * (at your option) any later version.
33: *
34: * This program is distributed in the hope that it will be useful, but
35: * WITHOUT ANY WARRANTY; without even the implied warranty of
36: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
37: * General Public License for more details.
38: *
39: * You should have received a copy of the GNU General Public License
40: * along with this program; if not, write to the Free Software
41: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
42: * USA
43: *
44: */
45:
46: /* New "extended" messages, parser and abstraction.
47: * These were introduced in 16.1. The messages use postscript
48: * base85 encoding (not ipv6 / rfc 1924 base85). They also use
49: * some custom encoding and references to further confuse things.
50: *
51: * Messages start with the magic marker ~& and end with ~
52: * Messages begin with two base85 encoded numbers that define
53: * the category and instance of the message. After that there
54: * are an category/instance defined amount of variables which
55: * are prefixed by the variable type. A base85 encoded number
56: * takes 5 bytes. Variable types:
57: *
58: * s: string, first byte is the length of the string
59: * i: signed integer (b85)
60: * u: unsigned integer (b85)
61: * f: float (b85)
62: * R: reference, b85 category and instance
63: * F: recursive encoding
64: * ~: end of message
65: *
66: */
67:
68: class AOExtMsg {
69: public $args, $category, $instance, $message_string, $message;
70: }
71: