mirror of
https://github.com/reactos/reactos.git
synced 2024-12-25 16:50:57 +00:00
give Arch a little more variety
svn path=/trunk/; revision=12296
This commit is contained in:
parent
0b50bd52b2
commit
eba02683e2
6 changed files with 124 additions and 20 deletions
|
@ -17,11 +17,63 @@ using std::vector;
|
|||
|
||||
const char* ArchBlackmann = "ArchBlackmann";
|
||||
|
||||
vector<string> tech_replies;
|
||||
vector<string> tech, module, dev, stru, period;
|
||||
|
||||
const char* TechReply()
|
||||
void ImportList ( vector<string>& list, const char* filename )
|
||||
{
|
||||
return tech_replies[rand()%tech_replies.size()].c_str();
|
||||
File f ( filename, "r" );
|
||||
string line;
|
||||
while ( f.next_line ( line, true ) )
|
||||
list.push_back ( line );
|
||||
}
|
||||
|
||||
const char* ListRand ( const vector<string>& list )
|
||||
{
|
||||
return list[rand()%list.size()].c_str();
|
||||
}
|
||||
|
||||
string TechReply()
|
||||
{
|
||||
string t = ListRand(tech);
|
||||
string out;
|
||||
const char* p = t.c_str();
|
||||
while ( *p )
|
||||
{
|
||||
if ( *p == '%' )
|
||||
{
|
||||
if ( !strnicmp ( p, "%dev%", 5 ) )
|
||||
{
|
||||
out += ListRand(dev);
|
||||
p += 5;
|
||||
}
|
||||
else if ( !strnicmp ( p, "%period%", 8 ) )
|
||||
{
|
||||
out += ListRand(period);
|
||||
p += 8;
|
||||
}
|
||||
else if ( !strnicmp ( p, "%module%", 8 ) )
|
||||
{
|
||||
out += ListRand(module);
|
||||
p += 8;
|
||||
}
|
||||
else if ( !strnicmp ( p, "%stru%", 6 ) )
|
||||
{
|
||||
out += ListRand(stru);
|
||||
p += 6;
|
||||
}
|
||||
else
|
||||
out += *p++;
|
||||
}
|
||||
const char* p2 = strchr ( p, '%' );
|
||||
if ( !p2 )
|
||||
p2 = p + strlen(p);
|
||||
if ( p2 > p )
|
||||
{
|
||||
out += string ( p, p2-p );
|
||||
p = p2;
|
||||
}
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
// do custom stuff with the IRCClient from your subclass via the provided callbacks...
|
||||
|
@ -60,7 +112,7 @@ public:
|
|||
strlwr ( &text2[0] );
|
||||
if ( !strnicmp ( text2.c_str(), ArchBlackmann, strlen(ArchBlackmann) ) )
|
||||
{
|
||||
string reply = ssprintf("%s: %s", from.c_str(), TechReply());
|
||||
string reply = ssprintf("%s: %s", from.c_str(), TechReply().c_str());
|
||||
flog.printf ( "TECH-REPLY: %s\n", reply.c_str() );
|
||||
return PrivMsg ( channel, reply );
|
||||
}
|
||||
|
@ -98,11 +150,11 @@ public:
|
|||
int main ( int argc, char** argv )
|
||||
{
|
||||
srand ( time(NULL) );
|
||||
File f ( "tech.txt", "r" );
|
||||
string line;
|
||||
while ( f.next_line ( line, true ) )
|
||||
tech_replies.push_back ( line );
|
||||
f.close();
|
||||
ImportList ( tech, "tech.txt" );
|
||||
ImportList ( stru, "stru.txt" );
|
||||
ImportList ( dev, "dev.txt" );
|
||||
ImportList ( period, "period.txt" );
|
||||
ImportList ( module, "module.txt" );
|
||||
|
||||
printf ( "initializing IRCClient debugging\n" );
|
||||
IRCClient::SetDebug ( true );
|
||||
|
|
14
rosapps/games/ArchBlackmann/dev.txt
Normal file
14
rosapps/games/ArchBlackmann/dev.txt
Normal file
|
@ -0,0 +1,14 @@
|
|||
Royce3
|
||||
kjk_hyperion
|
||||
tamlin
|
||||
GvG
|
||||
filip2307
|
||||
hardon
|
||||
w3seek
|
||||
arty
|
||||
sedwards
|
||||
Exception
|
||||
blight_
|
||||
jimtabor
|
||||
mtempel
|
||||
Gge
|
13
rosapps/games/ArchBlackmann/module.txt
Normal file
13
rosapps/games/ArchBlackmann/module.txt
Normal file
|
@ -0,0 +1,13 @@
|
|||
the kernel
|
||||
ntoskrnl
|
||||
win32k
|
||||
msafd
|
||||
ws2_32
|
||||
user32
|
||||
shell32
|
||||
the cache manager
|
||||
tdi
|
||||
the scheduler
|
||||
the thread queue
|
||||
the message queue
|
||||
atapi
|
11
rosapps/games/ArchBlackmann/period.txt
Normal file
11
rosapps/games/ArchBlackmann/period.txt
Normal file
|
@ -0,0 +1,11 @@
|
|||
minute
|
||||
hour
|
||||
day
|
||||
week
|
||||
fortnight
|
||||
month
|
||||
year
|
||||
decade
|
||||
century
|
||||
millenium
|
||||
eon
|
7
rosapps/games/ArchBlackmann/stru.txt
Normal file
7
rosapps/games/ArchBlackmann/stru.txt
Normal file
|
@ -0,0 +1,7 @@
|
|||
FAST_MUTEX
|
||||
KPCR
|
||||
PEB
|
||||
TEB
|
||||
SPINLOCK
|
||||
APC
|
||||
DPC
|
|
@ -1,11 +1,11 @@
|
|||
What do you think I am, your personal tech support?
|
||||
You *know* a FAST_MUTEX is non-re-entrant, right?
|
||||
You *know* a %stru% is non-re-entrant, right?
|
||||
The answer to that is so simple, I'm not going to waste my time telling you.
|
||||
Well, of course... if you're not below DISPATCH_LEVEL, ros is gonna explode on ya.
|
||||
Well, of course... if you're not below DISPATCH_LEVEL, ros is gonna explode on ya when you try to do that ( duh! ).
|
||||
I don't think that functionality has been implemented, yet.
|
||||
What do you mean it crashed? It can't crash there!
|
||||
Wow. That's a new one.
|
||||
Ask Filip, I bet he knows.. he knows everything...
|
||||
Ask %dev%, I bet he knows.. he knows everything...
|
||||
When's the last time you rebuilt?
|
||||
Have you tried a make clean?
|
||||
Is it plugged in?
|
||||
|
@ -17,23 +17,27 @@ Try surrounding it with parenthesis.
|
|||
Don't you know going around dereferncing null pointers all day can be hazardous to your health?
|
||||
Well, duh!
|
||||
There's a bit in cr3 for problems like that.
|
||||
Just add a field to the PEB to keep track of it!
|
||||
Just add a field to the %stru% to keep track of it!
|
||||
Don't worry about it... the garbage collector in the kernel will clean it up for you.
|
||||
Did I do that?
|
||||
Didn't %dev% fix that already?
|
||||
Yes, I think I've seen that bug before... no... that was another program.
|
||||
I could tell you, but then I'd have to unlink() you.
|
||||
Well if you'd get some sleep, maybe you'd figure it out... not all of us can keep the hours arty can...
|
||||
Well if you'd get some sleep, maybe you'd figure it out... not all of us can keep the hours %dev% can...
|
||||
You did what? Uh oh... that can't be good.
|
||||
Well... I could tell you, but the answer's pretty complicated. Why don't you wait to read about it in the book I'm writing.
|
||||
Yeah, that's happened to me, before, too. All you have to do is wrap it in an SEH block and forget about it.
|
||||
Just put a NULL dereference in there and commit it. It helps get bugs fixed fast! (Not that I would know)
|
||||
ASSERT is your friend!
|
||||
I dunno.. but I bet GvG could find it for you.
|
||||
I dunno.. but I bet %dev% could find it for you.
|
||||
I hereby declare that code is perfect. Your problem must be elsewhere.
|
||||
I wrote that code... it must be perfect.
|
||||
$#@!$ One of these days I'm gonna throw %module% out the window!!! Sorry, what were you saying?
|
||||
maybe I broke it in my last commit. Maybe I did it on purpose...
|
||||
Have you tried debugging it? I got a can of Raid...
|
||||
Just delete it, it can't be that important ( You should see all the useless cruft I got rid of in %module% )
|
||||
Try queueing a work item...
|
||||
My DPC fell in love with an APC in the scheduler, and the code has been hell since...
|
||||
My %stru% fell in love with some %stru% in %module%, and %module% has been hell since...
|
||||
Maybe the PEB is getting corrupted. Try allocating a new PEB and overwriting the old one. That's what I did last time I had a bug like that.
|
||||
Hmm.. that seems to have been introduced by my last commit... I bet CVS mixed up the bits during the commit.
|
||||
It can't possibly be my fault, so I don't care.
|
||||
|
@ -41,14 +45,17 @@ I'm not experiencing that problem, perhaps it's all in your mind.
|
|||
Well... like a good friend of mine said... "Don't Panic!"
|
||||
It just shows you how far ReactOS has come along! A year ago a bug like that wouldn't have even been possible!
|
||||
Just surround the code with an #if 0/#endif block, it solves all my problems!
|
||||
You know.. if kjk_hyperion had implemented lsa for us, we wouldn't be having this problem.
|
||||
You know.. if %dev% would just finish %module% for us, we wouldn't be having this problem.
|
||||
I say we move on to the next function, since we can't seem to figure this one out.
|
||||
Well, sure, that would have been my first guess, too.... TEN YEARS AGO :p
|
||||
yup, that sounds like a problem.
|
||||
If I wanted to talk about VB, I'd go bug Alex...
|
||||
ask arty
|
||||
ask %dev%
|
||||
Thank you for that amazingly keen insight, Commander Obvious.
|
||||
I dont know about that, but I just fixed a problem in MSAFD for Arty.
|
||||
Sorry, can't help you right now, trying to track down this bug %dev% caused in %module%
|
||||
I dont know about that, but I just fixed a problem in %module% for %dev%
|
||||
How should I know? I'm still trying to figure out this main() thing... ooh! wanna see what I did in the kernel?
|
||||
lol!
|
||||
*wink*
|
||||
*wink*
|
||||
42
|
||||
It's gonna take me %period%s to fix all %dev%'s bugs in %module% :(
|
Loading…
Reference in a new issue