Skip to content

Commit

Permalink
whatever i changed
Browse files Browse the repository at this point in the history
  • Loading branch information
crutchy- committed Dec 27, 2014
1 parent f121e55 commit e8eac82
Show file tree
Hide file tree
Showing 5 changed files with 157 additions and 12 deletions.
5 changes: 3 additions & 2 deletions ircd/cmd/cmd_join.php
Expand Up @@ -40,8 +40,9 @@ function cmd_join($client_index,$items)
$hostname=$nicks[strtolower($nick)]["hostname"];
$ident_prefix=$nicks[strtolower($nick)]["connection"]["ident_prefix"];
$msg=":".$nick."!".$ident_prefix.$username."@".$hostname." JOIN ".$chan;
$msg="*** JOIN MESSAGE RECEIVED FROM $addr";
do_reply($client_index,$msg);
#$msg="*** JOIN MESSAGE RECEIVED FROM $addr";
#do_reply($client_index,$msg);
broadcast($msg);
}

#####################################################################################################
Expand Down
92 changes: 92 additions & 0 deletions scripts/forward.php
Expand Up @@ -58,4 +58,96 @@

#####################################################################################################

function forward_join()
{
global $parts;
if (count($parts)<>2)
{
return;
}
# trailing = <nick> <channel>
$nick=strtolower($parts[0]);
$channel=strtolower($parts[1]);
forward_msg(chr(2)." * $nick has joined $channel");
}

#####################################################################################################

function forward_kick()
{
global $parts;
if (count($parts)<>2)
{
return;
}
# trailing = <channel> <nick>
$nick=strtolower($parts[1]);
$channel=strtolower($parts[0]);
forward_msg(chr(2)." * $nick has been kicked from $channel");
}

#####################################################################################################

function forward_nick()
{
global $parts;
if (count($parts)<>2)
{
return;
}
# trailing = <old-nick> <new-nick>
$old_nick=strtolower($parts[0]);
$new_nick=strtolower($parts[1]);
forward_msg(chr(2)." * $old_nick is now known as $new_nick");
}

#####################################################################################################

function forward_part()
{
global $parts;
if (count($parts)<>2)
{
return;
}
$nick=$parts[0];
$channel=$parts[1];
forward_msg(chr(2)." * $nick has left $channel");
}

#####################################################################################################

function forward_quit()
{
global $trailing;
forward_msg(chr(2)." * $trailing has quit");
}

#####################################################################################################

function forward_privmsg()
{
global $parts;
if (count($parts)<3)
{
return;
}
# trailing = <nick> <channel> <trailing>
$nick=$parts[0];
$channel=$parts[1];
array_shift($parts);
array_shift($parts);
$trailing=implode(" ",$parts);
forward_msg(" $channel: <$nick> $trailing");
}

#####################################################################################################

function forward_msg($msg)
{
privmsg(chr(3)."10".$msg);
}

#####################################################################################################

?>
9 changes: 9 additions & 0 deletions scripts/irciv/irciv.php
Expand Up @@ -60,6 +60,15 @@
case "dev-op":
if (is_gm()==True)
{
/*foreach ($player_data as $account => $data)
{
$n=count($player_data[$account]["units"]);
for ($i=0;$i<$n;$i++)
{
$player_data[$account]["units"][$i]["movement"]=$unit_movement[$player_data[$account]["units"][$i]["type"]];
}
}*/
$irciv_data_changed=True;
}
break;
case "register-channel":
Expand Down
19 changes: 15 additions & 4 deletions scripts/irciv/irciv_lib.php
Expand Up @@ -31,11 +31,18 @@

#####################################################################################################

$unit_strengths=array();
# d=defense,a=attack,l=land,s=sea,a=air
# dl,ds,da,al,as,aa
$unit_strengths["settler"]="2,0,0,0,0,0";
$unit_strengths["warrior"]="1,0,0,1,0,0";

$unit_movement=array();
# land,sea,air
# 0=no,1=yes
$unit_movement["settler"]="1,0,0";
$unit_movement["warrior"]="1,0,0";

#####################################################################################################

function output_help()
Expand Down Expand Up @@ -1154,8 +1161,10 @@ function move_active_unit($account,$dir)
}
else
{
$player_unit=is_foreign_unit($account,$x,$y);
$player_city=is_foreign_city($account,$x,$y);
$forein_unit=False;
$forein_city=False;
$player_unit=is_foreign_unit($account,$x,$y,$forein_unit);
$player_city=is_foreign_city($account,$x,$y,$forein_city);
if ($player_unit!==False)
{
$player_data[$account]["status_messages"][]="move $caption failed for active unit (player \"$player_unit\" has occupying unit)";
Expand Down Expand Up @@ -1183,7 +1192,7 @@ function move_active_unit($account,$dir)

#####################################################################################################

function is_foreign_unit($account,$x,$y)
function is_foreign_unit($account,$x,$y,&$forein_unit)
{
global $player_data;
if (player_ready($account)==False)
Expand All @@ -1199,6 +1208,7 @@ function is_foreign_unit($account,$x,$y)
$unit=$player_data[$player]["units"][$i];
if (($unit["x"]==$x) and ($unit["y"]==$y))
{
$forein_unit=$unit;
return $player;
}
}
Expand All @@ -1209,7 +1219,7 @@ function is_foreign_unit($account,$x,$y)

#####################################################################################################

function is_foreign_city($account,$x,$y)
function is_foreign_city($account,$x,$y,&$forein_city)
{
global $player_data;
if (player_ready($account)==False)
Expand All @@ -1225,6 +1235,7 @@ function is_foreign_city($account,$x,$y)
$city=$player_data[$player]["cities"][$i];
if (($city["x"]==$x) and ($city["y"]==$y))
{
$forein_city=$city;
return $player;
}
}
Expand Down
44 changes: 38 additions & 6 deletions scripts/minion.php
Expand Up @@ -45,6 +45,8 @@
array_shift($parts);
$trailing=trim(implode(" ",$parts));

$forward=False;

switch ($cmd)
{
case "new":
Expand All @@ -54,7 +56,14 @@
return;
}
#$socket=fsockopen("ssl://irc.sylnt.us","6697");
$socket=fsockopen("irc.sylnt.us","6667");
if (count($parts)==2)
{
$socket=fsockopen($parts[0],$parts[1]);
}
else
{
$socket=fsockopen("irc.sylnt.us","6667");
}
if ($socket===False)
{
term_echo("ERROR CREATING IRC SOCKET");
Expand All @@ -76,7 +85,14 @@
$items=parse_data($data);
if ($items!==False)
{
rawmsg($data);
if ($items["cmd"]=="FORWARD")
{
$forward=$items["params"];
}
else
{
rawmsg($data);
}
}
}
}
Expand All @@ -91,17 +107,29 @@
continue;
}
term_echo($bot_nick." >> ".$data);
if ($forward!==False)
{
echo "/IRC $data\n";
}
$items=parse_data($data);
if ($items===False)
{
continue;
}
if ($items["cmd"]==376) # RPL_ENDOFMOTD (RFC1459)
{
term_echo("joining \"$dest\"...");
dojoin($dest);
term_echo("joining \"#\"...");
dojoin("#");
if (isset($parts[2])==True)
{
term_echo("joining \"".$parts[2]."\"...");
dojoin($parts[2]);
}
else
{
term_echo("joining \"$dest\"...");
dojoin($dest);
term_echo("joining \"#\"...");
dojoin("#");
}
}
if ($items["nick"]<>$bot_nick)
{
Expand Down Expand Up @@ -136,6 +164,10 @@
case "raw":
handle_bot_data($trailing,$bot_nick);
break;
case "forward":
$data="FORWARD $trailing";
handle_bot_data($data,$bot_nick);
break;
}

#####################################################################################################
Expand Down

0 comments on commit e8eac82

Please sign in to comment.