[Ircphpstats-devel] [CVS] Module phpstats: Change committed
Status: Inactive
Brought to you by:
mrvolta
|
From: Mr. v. <mr...@us...> - 2003-03-18 18:16:04
|
Committer : volta <mr...@us...>
CVSROOT : /cvsroot/ircphpstats
Module : phpstats
Commit time: 2003-03-18 18:16:03 UTC
Modified files:
handlers/burst.php
Log message:
Bug me.
---------------------- diff included ----------------------
Index: phpstats/handlers/burst.php
diff -u phpstats/handlers/burst.php:1.1 phpstats/handlers/burst.php:1.2
--- phpstats/handlers/burst.php:1.1 Sun Mar 9 13:51:28 2003
+++ phpstats/handlers/burst.php Tue Mar 18 10:15:52 2003
@@ -5,7 +5,6 @@
E-mail: <vo...@gm...>
This program is free but copyrighted software; see the file LICENSE for
details.
- $Id: burst.php,v 1.1 2003/03/09 21:51:28 mrvolta Exp $
*/
$b = 1;
@@ -49,15 +48,13 @@
if ($val == "k") { $keyed = true; countinue; };
if ($val == "l") { $limited = true; countinue; };
};
- unset($modes);
- $modes = substr($array[4],1);
// key only
if ($keyed && !$limited) {
$users = $array[6];
$limit = NULL;
- $key = $array[5];
+ $channelkey = $array[5];
// do we have bans?
if (($array[7][0] == ":") && ($array[7][1] == "%")) {
@@ -77,7 +74,7 @@
// limit only
elseif ($limited && !$keyed) {
$users = $array[6];
- $key = NULL;
+ $channelkey = NULL;
$limit = $array[5];
// do we have bans?
@@ -98,9 +95,23 @@
// both limit and key
elseif ($limited && $keyed) {
$users = $array[7];
- $key = $array[6];
- $limit = $array[5];
-
+ // this requires some extra code here, because the P10 protocol doesn't explain the order of key and limit (param 5 and 6)
+ reset($modes);
+ $keyfirst = false;
+ $limitfirst = false;
+ foreach ($modes as $key => $val) {
+ if ($val == "k") { $keyfirst = true; break; }
+ elseif ($val == "l") { $limitfirst = true; break; };
+ };
+ if ($keyfirst && !$limitfirst) {
+ $channelkey = $array[5];
+ $limit = $array[6];
+ }
+ elseif (!$keyfirst && $limitfirst) {
+ $channelkey = $array[6];
+ $limit = $array[5];
+ };
+
// do we have bans?
if (($array[8][0] == ":") && ($array[8][1] == "%")) {
$bans[] = substr($array[8],2);
@@ -110,18 +121,21 @@
$bans[] = $val;
};
}
-
+
// no bans
else {
$bans = NULL;
};
+
+ $modes = substr($array[4],1);
}
+
// no key or limit
else {
$users = $array[5];
$limit = NULL;
- $key = NULL;
+ $channelkey = NULL;
// do we have bans?
if (($array[6][0] == ":") && ($array[5][1] == "%")) {
@@ -145,7 +159,7 @@
$users = $array[4];
$modes = "";
$limit = NULL;
- $key = NULL;
+ $channelkey = NULL;
// do we have bans?
if (($array[5][0] == ":") && ($array[5][1] == "%")) {
@@ -170,7 +184,7 @@
// deop and devoice all users, remove all modes, add new modes,
// remove all bans, apply new bans, reset the creationts
$channel[$name]->changets($timestamp,$name);
- $channel[$name]->burst_younger($modes,$limit,$key,$name);
+ $channel[$name]->burst_younger($modes,$limit,$channelkey,$name);
if (count($bans) != 0) {
foreach ($bans as $key => $val) {
$channel[$name]->addban($val,$name,$server[$source]->returnname(),time());
@@ -179,7 +193,7 @@
}
// same timestamp
elseif ($channel[$name]->returnts() == $timestamp) {
- $channel[$name]->burst_same($modes,$limit,$key,$name);
+ $channel[$name]->burst_same($modes,$limit,$channelkey,$name);
if (count($bans) != 0) {
foreach ($bans as $key1 => $val1) {
$isadded = false;
@@ -197,7 +211,7 @@
}
// channel doesn't exist
else {
- $channel[$name] = new channel($timestamp,$modes,$limit,$key,NULL,NULL);
+ $channel[$name] = new channel($timestamp,$modes,$limit,$channelkey,NULL,NULL);
sql_createchannel($name,$channel[$name]);
sql_channelnumber(++$channelnumber);
if ($bans != NULL) {
----------------------- End of diff -----------------------
|