Purpose: let your server detect if a connecting person is using silabsoft client or not and enable you to make different codes for silabsoft only and other client
Difficulty: 2/10 or 3/10
Assumed Knowledge: c+p & basic java
Server Base: homemade server, not based on anyone's but it should work on all servers
Classes Modified: client.java (u also need the UID things in server.java but i'm not editing it)
Procedure
Step 1:
ok lets start at the very beginning
go to the place were your welcome message is located at
on the most servers its in public void initialize()
inside public void initialize add this somewhere:
Code:
if (daUID == 82128902) {
silabs = true;
sendMessage("gamesetting changed to silabsoft mode");
}
now go to
Code:
public class client extends Player implements Runnable {under it add:
Code:
public boolean silabs = false;
public int daUID = 0;
Step 2:
now search for:
Code:
serverSessionKey = inStream.readQWord();
under it add:
Code:
int UID = inStream.readDWord();
daUID = UID;
Step 3: to use this piece of code:
ok i show u now how to use this piece of code
lets say u want to make a members only quest
the quest name is 'warrior troubles'
and to open the quest journal there is a void called warriortroubles()
and its the first member quest on the list
the code will look like this (under case 185
Code:
case 49228:
warriortroubles();
break;
now the code allows every1 to click the button and see the menu
to make it so
only ppl who use silabsoft client can use and see the menu
and ppl who dont get a message that they cant use it because they dont have silabsoft client
u should make a code like this:
Code:
case 49228:
if (silabs) {
warriortroubles();
} else if (!silabs) {
sendMessage("you cant see this quest information because your not using silabsoft client");
sendMessage("to do this quest please (for example) visit the forums and download the silabsoft client");
sendMessage("thanks for your understanding");
break;
and for the ppl who are really going to use this in their servers and are bad at coding
u should make it so that they cant overload there chatbox and lagg their server whith massing the button
so add 'actionTimer = ...; 'inside it
if you dont have it,
declare
Code:
public int actionTimer = 0;
somewhere
under public boolean process add
Code:
if (actionTimer > 0) {
actionTimer--;
}
and then modify your code to this:
Code:
case 49228:
if (actionTimer == 0) {
if (silabs) {
warriortroubles();
actionTimer += 5;
/**modify this to whatever you want += can be changed to 5 but with += u add 2,5 *seconds to the wait time every time the person clicks, change the 5 to whatever u want *but half the digit to get the seconds,timer 10 will be 5 seconds wait time
**/
} else if (!silabs) {
sendMessage("you cant use this button when ur not at silabsoft client");
}
} else if (actionTimer > 0) {
//add a reaction on massing the button here like:
sendMessage("dont mass this button!");
}
break;
i hopefully helped alot of ppl
i thing this is pretty usefull for alot of servers
thanks for reading/using btw
Credits: 100% to me
if this tut is posted on other forums its leeched from here
if its not leeched then i posted it myself
extra: please notice that this tutorail is re-posted