Welcome Guest [Log In] [Register]
GELMAN & FRIENDS - OUT OF BUSINESS

This is goodbye. We've all helped run an awesome server for 5 years now. We've met a lot of interesting people. Made some great memories. Built some incredible things. But everything has to come to an end. Our activity had dropped to nearly zero. I stopped developing MCLight in 2014. There was no point in keeping this going anymore.

So I announced that December 31st, 2015 would be the final day of Gelman and Friends. These forums will remain online. The logs, website, and Faceboook page will remain online. If you want to contact me you can try these forums, my email (mtm4440@rit.edu), or my Facebook. And to answer your last question, no, MCLight will not be released. Thank you everyone for the too-many-to-count good (and bad) times I've had on here. By the way, that secret account of mine on the server that had no IP trace was trixent37. I'll miss you all. Well...most of you.

-Your former MCLight Developer and G&F Admin,
Matt Miles
Welcome to MCLight. We hope you enjoy your visit.


You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
HUGE BUG! BANNED NOOBS CAN CRASH SERVER; GAMER!
Topic Started: Sep 11 2011, 11:27 PM (644 Views)
Gamerkd
Member Avatar
Administrator
Ya, programming isn't that complicated. Only the concepts are.

What that does is takes the message coming in (the chat), then sets that to the same message but with the replacements.
Offline Profile Quote Top
 
Big_mij
Member Avatar
Call me master.
Kinda like simple Algebra!

2 = 1+x and x=1...
But without an x.
So 2=1+1

so then it's just message is no longer just message, but message now equals this color.

I learned more in the past 5 minutes than all day at school.
Offline Profile Quote Top
 
Gamerkd
Member Avatar
Administrator
Yeah, it's very similar to that. Here's another more complex example. The GrieferWatchSystem. It may look complicated at first but you'll see it's not that bad.

Code:
 

//Calculate griefer ratio
if (systemWatch == true && loginBlocks > 50)
{
double ratio = (double)loginCBlocks / (double)loginDBlocks;


if (ratio < .20 && grieferNotified == false)
{
GlobalMessage("%cGRIEFER ALERT: &b" + name + " %6may be a potential griefer!");
GlobalMessage("%6[" + loginCBlocks + " created, " + loginDBlocks + " destroyed] . %cVote to ban them using /vot only if YOU ARE SURE they are griefing. Use this as a guide only!");
if(Server.griefers.ContainsKey(name.ToLower()) == false)
Server.griefers.Add(name.ToLower(), 0);
grieferNotified = true;
canBeBanned = true;
}

if (ratio >= .30 && grieferNotified == true)
grieferNotified = false;
}


The matching (lined up) {} are sections of code you can enter or skip depending on if the IF STATEMENT is true.

Ok, so systemWatch is a boolean. That means its a "yes" or "no". System watch is set to YES when they have under 5 logins once they login.
LoginBlocks is how many blocks they have modified.
So for it to enter that section of code, the person needs to be watched by the system (systemWatch=YES) AND modified more than 50 blocks (modifiedBlocks >50).
Next it calculates its ratio which is then set to its own variable (ratio).
If the ratio is less than .20 (in the black) AND the person hasn't already be notified, it will enter THAT section of code.

In that section it will:
Print the message to the server.
If the list of griefers (those can be voted for) doesn't contain this player. Add them to it.
Then grieferNotified is set to YES so it wont print the message again and go through this section.
The canBeBanned is set to YES so they can be banned.


Towards the end it will check if their ratio is above .30 AND if they were notified before. If this is true then it will take them off the notified list so they can notified AGAIN. This way if someone griefs to .20 then goes on a good streak up to 100, then griefs again they will be NOTIFIED TWICE.

Let me know if you understood any of that.
Offline Profile Quote Top
 
Big_mij
Member Avatar
Call me master.
I understand it, besides minor details.
Minor things like why 50 DBlocks is = to .20

or why in codes (I've seen it before) where you have to say &&.

But that's just my curiousness wanting to know everything.
Offline Profile Quote Top
 
Phyre
Member Avatar

what i was talking about was to say
to write in white just type %%%ff
which would turn the f white while also keeping the second f and the third percentage sign. so it'd look like
to write in white just type %f
Offline Profile Quote Top
 
Gamerkd
Member Avatar
Administrator
Shit, that's what breaking.

%%%f wordfilters into %%f which tries to color a color and breaks. I never accounted for more than two %'s.
Offline Profile Quote Top
 
Big_mij
Member Avatar
Call me master.
message = message .ReplaceAll("&&&", "&")

am I dev yet?
Offline Profile Quote Top
 
Gamerkd
Member Avatar
Administrator
What about %%%% and %%%%% and %%%%%%%%%%%.

It's infinite, so a different approach needs to be taken. See: RegEx.
Offline Profile Quote Top
 
Big_mij
Member Avatar
Call me master.
I assume
message = message.ReplaceAll(">%", "%")
Isn't the way to go.
Offline Profile Quote Top
 
Gamerkd
Member Avatar
Administrator
Nope because things in " "'s are literal strings. You can't do math with them.

That's why I use toLower() on the strings, because when I do String1.equals(String2)..

String1 = ThEpAinMan616
String2 = thepainman616

...they are not the same and need to be brought to the same level.
Offline Profile Quote Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
Go to Next Page
« Previous Topic · Complaints/Comments · Next Topic »