- 3
- Posts
- 10
- Years
- Seen Jun 15, 2017
How to make a Pokemon Mystery Universe Server!
First of all!
BEFORE YOU GONNE DO THIS ALL, DO IT AT OWN RISK, IF YOU GONNE MAKE IT PUBLIC OR WHATEVER PEOPLE MIGHT BE ABLE TO HACK YOU! so please don't give me the fault if you make it public... The source is a bit unsafty...
Thanks for coming to my tutorial!
I hope this will help you! Though
you need to know one thing: How to Portforward
Here is no tutoiral here for portforwarding so be sure to find one somewhere!
Parts
1. The Programs
1.1 - Downloads All Programs
1.2 - Installing Winrar
1.3- Installing MySQL Server
1.4 - Installing C# Visual Studio Express 2010
1.5 - Installing Navicat
2. Setting up the Server
2.1 - Extract Server
2.2 - Load Up DataBase
2.3 - Navicat
2.4 - Setting up Server Stuff
3. Setting up the Client
3.1 - Extract The Client
3.2 - Connect to Server
4. Extra
4.1 - Client Is not loading maps
4.2 - Server Is not Saving Passwords/every password = correct
4.3 - Change yourself to Mapper/Admin/Scripter/...
4.4 - Client Building Solution (error)
1.1 - Downloads All Programs
1.2 - Installing winrar
1.3 - Installing MySQL Server
1.4 - Installing C# Visual Studio Express 2010
1.5 - Installing Navicat
2.1 - Extract Server
2.2 - Load Up DataBase
2.3 - Navicat
Open Navicat Premium
Click "Trail"
Click "File > New Connection > MySQL..."
Call "Connection Name:" Localhost
Call "Host Name/IP Address:" Localhost
Call "Port:" 3306 UNLESS you changed the port at MySQL
Call "User Name:" root
Call "Password:" (your password)
Press "Test Connection"
If "1045 - Acces denied for user 'root'@'localhost' (using password: YES)
You insert Wrong Password
If "2003 - Can't connect to MySQL server on 'localhost' (10038)
You Insert Wrong Port
If "Connection Succesfull"
Done
2.4 - Setting up Server Stuff
3.1 - Extract The Client
3.2 - Connect to Server
4.1 - Client Is not loading maps
4.2 - Server Is not Saving Passwords/every password = correct
4.3 - Change yourself to Mapper/Admin/Scripter/...
4.4 - Client Building Solution (error) (somthing with error box)
I hope the tutorial helped! If you have more question, be sure to ask! ^-^
Aswell Thanks to PMU 7 to make this possible (x
For people that don't wanne make one!
if you don't want to go through the trouble of setting up your own server, but still want to make dungeons, Download the mystery dungeon community project: tinyurl . com/MDX-Update-1
OR Visit the website: Pmdcommunity.x10.mx
ScreenShots
Wait for this please!
Or type this in your browser:
tinypic.com/r/wqyqms/8
tinypic.com/view.php?pic=34rht0k&s=8
First of all!
BEFORE YOU GONNE DO THIS ALL, DO IT AT OWN RISK, IF YOU GONNE MAKE IT PUBLIC OR WHATEVER PEOPLE MIGHT BE ABLE TO HACK YOU! so please don't give me the fault if you make it public... The source is a bit unsafty...
Thanks for coming to my tutorial!
I hope this will help you! Though
you need to know one thing: How to Portforward
Here is no tutoiral here for portforwarding so be sure to find one somewhere!
Parts
1. The Programs
1.1 - Downloads All Programs
1.2 - Installing Winrar
1.3- Installing MySQL Server
1.4 - Installing C# Visual Studio Express 2010
1.5 - Installing Navicat
2. Setting up the Server
2.1 - Extract Server
2.2 - Load Up DataBase
2.3 - Navicat
2.4 - Setting up Server Stuff
3. Setting up the Client
3.1 - Extract The Client
3.2 - Connect to Server
4. Extra
4.1 - Client Is not loading maps
4.2 - Server Is not Saving Passwords/every password = correct
4.3 - Change yourself to Mapper/Admin/Scripter/...
4.4 - Client Building Solution (error)
1.1 - Downloads All Programs
Spoiler:
PMU-Source -> tinyurl.com/PMU-Source
MY-SQL Server -> tinyurl.com/PMU-MySQL
WinRar -> tinyurl.com/PMU-Winrar
NaviCat -> tinyurl.com/PMU-NaviCat
C# -> tinyurl.com/PMU-Visual-Studio
(C# Visual Studio 2010 EXPRESS)
(Sorry I need approval, I didn't sent 15 messages yet
MY-SQL Server -> tinyurl.com/PMU-MySQL
WinRar -> tinyurl.com/PMU-Winrar
NaviCat -> tinyurl.com/PMU-NaviCat
C# -> tinyurl.com/PMU-Visual-Studio
(C# Visual Studio 2010 EXPRESS)
(Sorry I need approval, I didn't sent 15 messages yet
1.2 - Installing winrar
Spoiler:
Open Installer
click on "Install"
Press "close"
Done
click on "Install"
Press "close"
Done
1.3 - Installing MySQL Server
Spoiler:
Open Installer
Click on "Install MySQL Products"
Click on "Execute"
Click on "Next"
Select "Server only"
Click on "Next"
Click again on "Next"
Click on "execute"
After it's installed
Click on "Next"
Click then again "Next"
At "Config Type:", It doesn't realy care what you use, but use what fits
I recommend "Development Machine"
Be Sure "Enable TCP/IP Networking" Is enabled
Feel free to change "port number", but if you want to keep it on 3306, leave it then
Be sure "Open Firewall port for networ access" is enabled
Be sure "Show Advanced Configuration" is not enabled
Click "Next"
Type in "MySQL Root Password:" your own secret password!
Repeat the password in "Repeat Password:"
Click "Next"
Leave everything on default, just click "next"
After it's Configured
Click "Next"
Click "Finish"
Click on "Install MySQL Products"
Click on "Execute"
Click on "Next"
Select "Server only"
Click on "Next"
Click again on "Next"
Click on "execute"
After it's installed
Click on "Next"
Click then again "Next"
At "Config Type:", It doesn't realy care what you use, but use what fits
I recommend "Development Machine"
Be Sure "Enable TCP/IP Networking" Is enabled
Feel free to change "port number", but if you want to keep it on 3306, leave it then
Be sure "Open Firewall port for networ access" is enabled
Be sure "Show Advanced Configuration" is not enabled
Click "Next"
Type in "MySQL Root Password:" your own secret password!
Repeat the password in "Repeat Password:"
Click "Next"
Leave everything on default, just click "next"
After it's Configured
Click "Next"
Click "Finish"
1.4 - Installing C# Visual Studio Express 2010
Spoiler:
Open Installer
After It Loaded the Setup
Click "Next"
Select "I have read and accept the license terms"
Click "Next"
Click again "Next"
After Download/Installed
click "Exit"
After It Loaded the Setup
Click "Next"
Select "I have read and accept the license terms"
Click "Next"
Click again "Next"
After Download/Installed
click "Exit"
1.5 - Installing Navicat
Spoiler:
Open Installer
Click "Next"
Select "I accept the agreements"
Click "Next"
Click again "Next"
Click again "Next"
Click again "Next" (lol)
Click "Install"
Click "Finish"
Click "Next"
Select "I accept the agreements"
Click "Next"
Click again "Next"
Click again "Next"
Click again "Next" (lol)
Click "Install"
Click "Finish"
2.1 - Extract Server
Spoiler:
Open "PMUSource" File
Open "Server.zip"
Click on "Extract to"
Make a Folder Somewhere. and Select it with Winrar
be sure the folder is called "Server"
Click on "ok"
Open "Server.zip"
Click on "Extract to"
Make a Folder Somewhere. and Select it with Winrar
be sure the folder is called "Server"
Click on "ok"
2.2 - Load Up DataBase
Spoiler:
Open The Folder Where you extracted it
Right Click "Content_data"
Click "Extract to Content_data\"
After Extracting
Go in the Folder "Content_Data"
Right click "LoadTableBackup"
Click on "Edit"
Click "Run"
Change "-u usernameHere -pPasswordHere"
Example: If My Password on MySQL = Zorua321
You Changed it to "-u root -pZorua321"
!!! Remember to do them all 3 !!!
Save The File
Open "LoadTableBackup"
Click "Run"
!!! It Should Take more then 1 min, IF it took 1 min OR
Less, Somthing happend wrong... !!!
My time: One and a half hour
If it Succesfully Loaded
Do "Press any key to continue . . ."
done
If it UNSuccesfully Loaded
Repeat 2.2
Right Click "Content_data"
Click "Extract to Content_data\"
After Extracting
Go in the Folder "Content_Data"
Right click "LoadTableBackup"
Click on "Edit"
Click "Run"
Change "-u usernameHere -pPasswordHere"
Example: If My Password on MySQL = Zorua321
You Changed it to "-u root -pZorua321"
!!! Remember to do them all 3 !!!
Save The File
Open "LoadTableBackup"
Click "Run"
!!! It Should Take more then 1 min, IF it took 1 min OR
Less, Somthing happend wrong... !!!
My time: One and a half hour
If it Succesfully Loaded
Do "Press any key to continue . . ."
done
If it UNSuccesfully Loaded
Repeat 2.2
2.3 - Navicat
Spoiler:
Open Navicat Premium
Click "Trail"
Click "File > New Connection > MySQL..."
Call "Connection Name:" Localhost
Call "Host Name/IP Address:" Localhost
Call "Port:" 3306 UNLESS you changed the port at MySQL
Call "User Name:" root
Call "Password:" (your password)
Press "Test Connection"
If "1045 - Acces denied for user 'root'@'localhost' (using password: YES)
You insert Wrong Password
If "2003 - Can't connect to MySQL server on 'localhost' (10038)
You Insert Wrong Port
If "Connection Succesfull"
Done
2.4 - Setting up Server Stuff
Spoiler:
GoTo "Server/Build/Data"
Right click "Config"
Click "Edit"
Change: <DatabaseUser>UsernameHere</DatabaseUser>
<DatabasePassword>PasswordHere</DatabasePassword>
Example: If "Zorua321" = Password of MySQL
<DatabaseUser>root</DatabaseUser>
<DatabasePassword>Zorua321</DatabasePassword>
Save The File
GoTo "Server/Build"
Open "Server"
If error
You did somthing wrong, Please repeat all the steps From 2.0!
If Server Starts up
Goodjob! Your server is Succesfully Working!
Right click "Config"
Click "Edit"
Change: <DatabaseUser>UsernameHere</DatabaseUser>
<DatabasePassword>PasswordHere</DatabasePassword>
Example: If "Zorua321" = Password of MySQL
<DatabaseUser>root</DatabaseUser>
<DatabasePassword>Zorua321</DatabasePassword>
Save The File
GoTo "Server/Build"
Open "Server"
If error
You did somthing wrong, Please repeat all the steps From 2.0!
If Server Starts up
Goodjob! Your server is Succesfully Working!
3.1 - Extract The Client
Spoiler:
Open "PMUSource" File
Open "Client.zip"
Click on "Extract to"
Make a Folder Somewhere. and Select it with Winrar
be sure the folder is called "Client"
Click on "ok"
Open "Client.zip"
Click on "Extract to"
Make a Folder Somewhere. and Select it with Winrar
be sure the folder is called "Client"
Click on "ok"
3.2 - Connect to Server
Spoiler:
Goto "Client/Build"
!!! Be Sure "settings" file at = <Port>4001</Port>
<Server>localhost</Server> !!!
Open "PMU"
If Server says offline "For you"
Is the Port/<Server> Right?
is the Server up?
If Server says Online
Goodjob! Have fun playing~
!!! Be Sure "settings" file at = <Port>4001</Port>
<Server>localhost</Server> !!!
Open "PMU"
If Server says offline "For you"
Is the Port/<Server> Right?
is the Server up?
If Server says Online
Goodjob! Have fun playing~
4.1 - Client Is not loading maps
Spoiler:
GoTo "Client\Build\MapData"
Delete EVERYTHING Inside
Delete EVERYTHING Inside
4.2 - Server Is not Saving Passwords/every password = correct
Spoiler:
GoTo "Server/Server"
Open "Server" " (Not the folder, but the c# file)
(if is somthing pop's up when it's started, click "yes")
In the "Solution Explorer" Find "Security"
Under "Security" click on "PasswordGen.cs"
REPLACE
public class PasswordGen
{
// Define default min and max password lengths.
private static int DEFAULT_MIN_PASSWORD_LENGTH = 8;
private static int DEFAULT_MAX_PASSWORD_LENGTH = 10;
// Define supported password characters divided into groups.
// You can add (or remove) characters to (from) these groups.
private static string PASSWORD_CHARS_LCASE = "abcdefgijkmnopqrstwxyz";
private static string PASSWORD_CHARS_UCASE = "ABCDEFGHJKLMNPQRSTWXYZ";
private static string PASSWORD_CHARS_NUMERIC = "23456789";
private static string PASSWORD_CHARS_SPECIAL = "()!";
/// <summary>
/// Generates a random password.
/// </summary>
/// <returns>
/// Randomly generated password.
/// </returns>
/// <remarks>
/// The length of the generated password will be determined at
/// random. It will be no shorter than the minimum default and
/// no longer than maximum default.
/// </remarks>
public static string Generate() {
return Generate(DEFAULT_MIN_PASSWORD_LENGTH,
DEFAULT_MAX_PASSWORD_LENGTH);
}
/// <summary>
/// Generates a random password of the exact length.
/// </summary>
/// <param name="length">
/// Exact password length.
/// </param>
/// <returns>
/// Randomly generated password.
/// </returns>
public static string Generate(int length) {
return Generate(length, length);
}
/// <summary>
/// Generates a random password.
/// </summary>
/// <param name="minLength">
/// Minimum password length.
/// </param>
/// <param name="maxLength">
/// Maximum password length.
/// </param>
/// <returns>
/// Randomly generated password.
/// </returns>
/// <remarks>
/// The length of the generated password will be determined at
/// random and it will fall with the range determined by the
/// function parameters.
/// </remarks>
public static string Generate(int minLength,
int maxLength) {
// Make sure that input parameters are valid.
if (minLength <= 0 || maxLength <= 0 || minLength > maxLength)
return null;
// Create a local array containing supported password characters
// grouped by types. You can remove character groups from this
// array, but doing so will weaken the password strength.
char[][] charGroups = new char[][]
{
PASSWORD_CHARS_LCASE.ToCharArray(),
PASSWORD_CHARS_UCASE.ToCharArray(),
PASSWORD_CHARS_NUMERIC.ToCharArray(),
PASSWORD_CHARS_SPECIAL.ToCharArray()
};
// Use this array to track the number of unused characters in each
// character group.
int[] charsLeftInGroup = new int[charGroups.Length];
// Initially, all characters in each group are not used.
for (int i = 0; i < charsLeftInGroup.Length; i++)
charsLeftInGroup = charGroups.Length;
// Use this array to track (iterate through) unused character groups.
int[] leftGroupsOrder = new int[charGroups.Length];
// Initially, all character groups are not used.
for (int i = 0; i < leftGroupsOrder.Length; i++)
leftGroupsOrder = i;
// Because we cannot use the default randomizer, which is based on the
// current time (it will produce the same "random" number within a
// second), we will use a random number generator to seed the
// randomizer.
// Use a 4-byte array to fill it with random bytes and convert it then
// to an integer value.
byte[] randomBytes = new byte[4];
// Generate 4 random bytes.
RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider();
rng.GetBytes(randomBytes);
// Convert 4 bytes into a 32-bit integer value.
int seed = (randomBytes[0] & 0x7f) << 24 |
randomBytes[1] << 16 |
randomBytes[2] << 8 |
randomBytes[3];
// Now, this is real randomization.
Random random = new Random(seed);
// This array will hold password characters.
char[] password = null;
// Allocate appropriate memory for the password.
if (minLength < maxLength)
password = new char[random.Next(minLength, maxLength + 1)];
else
password = new char[minLength];
// Index of the next character to be added to password.
int nextCharIdx;
// Index of the next character group to be processed.
int nextGroupIdx;
// Index which will be used to track not processed character groups.
int nextLeftGroupsOrderIdx;
// Index of the last non-processed character in a group.
int lastCharIdx;
// Index of the last non-processed group.
int lastLeftGroupsOrderIdx = leftGroupsOrder.Length - 1;
// Generate password characters one at a time.
for (int i = 0; i < password.Length; i++) {
// If only one character group remained unprocessed, process it;
// otherwise, pick a random character group from the unprocessed
// group list. To allow a special character to appear in the
// first position, increment the second parameter of the Next
// function call by one, i.e. lastLeftGroupsOrderIdx + 1.
if (lastLeftGroupsOrderIdx == 0)
nextLeftGroupsOrderIdx = 0;
else
nextLeftGroupsOrderIdx = random.Next(0,
lastLeftGroupsOrderIdx);
// Get the actual index of the character group, from which we will
// pick the next character.
nextGroupIdx = leftGroupsOrder[nextLeftGroupsOrderIdx];
// Get the index of the last unprocessed characters in this group.
lastCharIdx = charsLeftInGroup[nextGroupIdx] - 1;
// If only one unprocessed character is left, pick it; otherwise,
// get a random character from the unused character list.
if (lastCharIdx == 0)
nextCharIdx = 0;
else
nextCharIdx = random.Next(0, lastCharIdx + 1);
// Add this character to the password.
password = charGroups[nextGroupIdx][nextCharIdx];
// If we processed the last character in this group, start over.
if (lastCharIdx == 0)
charsLeftInGroup[nextGroupIdx] =
charGroups[nextGroupIdx].Length;
// There are more unprocessed characters left.
else {
// Swap processed character with the last unprocessed character
// so that we don't pick it until we process all characters in
// this group.
if (lastCharIdx != nextCharIdx) {
char temp = charGroups[nextGroupIdx][lastCharIdx];
charGroups[nextGroupIdx][lastCharIdx] =
charGroups[nextGroupIdx][nextCharIdx];
charGroups[nextGroupIdx][nextCharIdx] = temp;
}
// Decrement the number of unprocessed characters in
// this group.
charsLeftInGroup[nextGroupIdx]--;
}
// If we processed the last group, start all over.
if (lastLeftGroupsOrderIdx == 0)
lastLeftGroupsOrderIdx = leftGroupsOrder.Length - 1;
// There are more unprocessed groups left.
else {
// Swap processed group with the last unprocessed group
// so that we don't pick it until we process all groups.
if (lastLeftGroupsOrderIdx != nextLeftGroupsOrderIdx) {
int temp = leftGroupsOrder[lastLeftGroupsOrderIdx];
leftGroupsOrder[lastLeftGroupsOrderIdx] =
leftGroupsOrder[nextLeftGroupsOrderIdx];
leftGroupsOrder[nextLeftGroupsOrderIdx] = temp;
}
// Decrement the number of unprocessed groups.
lastLeftGroupsOrderIdx--;
}
}
// Convert password characters into a string and return the result.
return new string(password);
}
}
TO
(/spoiler)
Then in the Toolbar "Tools>Settings>Expert Settings"
Then Check if Right from the sortha "play button" It says "Released"
Press "F6" or "Build>Build Solution" in ToolBar
Done
Open "Server" " (Not the folder, but the c# file)
(if is somthing pop's up when it's started, click "yes")
In the "Solution Explorer" Find "Security"
Under "Security" click on "PasswordGen.cs"
REPLACE
Spoiler:
public class PasswordGen
{
// Define default min and max password lengths.
private static int DEFAULT_MIN_PASSWORD_LENGTH = 8;
private static int DEFAULT_MAX_PASSWORD_LENGTH = 10;
// Define supported password characters divided into groups.
// You can add (or remove) characters to (from) these groups.
private static string PASSWORD_CHARS_LCASE = "abcdefgijkmnopqrstwxyz";
private static string PASSWORD_CHARS_UCASE = "ABCDEFGHJKLMNPQRSTWXYZ";
private static string PASSWORD_CHARS_NUMERIC = "23456789";
private static string PASSWORD_CHARS_SPECIAL = "()!";
/// <summary>
/// Generates a random password.
/// </summary>
/// <returns>
/// Randomly generated password.
/// </returns>
/// <remarks>
/// The length of the generated password will be determined at
/// random. It will be no shorter than the minimum default and
/// no longer than maximum default.
/// </remarks>
public static string Generate() {
return Generate(DEFAULT_MIN_PASSWORD_LENGTH,
DEFAULT_MAX_PASSWORD_LENGTH);
}
/// <summary>
/// Generates a random password of the exact length.
/// </summary>
/// <param name="length">
/// Exact password length.
/// </param>
/// <returns>
/// Randomly generated password.
/// </returns>
public static string Generate(int length) {
return Generate(length, length);
}
/// <summary>
/// Generates a random password.
/// </summary>
/// <param name="minLength">
/// Minimum password length.
/// </param>
/// <param name="maxLength">
/// Maximum password length.
/// </param>
/// <returns>
/// Randomly generated password.
/// </returns>
/// <remarks>
/// The length of the generated password will be determined at
/// random and it will fall with the range determined by the
/// function parameters.
/// </remarks>
public static string Generate(int minLength,
int maxLength) {
// Make sure that input parameters are valid.
if (minLength <= 0 || maxLength <= 0 || minLength > maxLength)
return null;
// Create a local array containing supported password characters
// grouped by types. You can remove character groups from this
// array, but doing so will weaken the password strength.
char[][] charGroups = new char[][]
{
PASSWORD_CHARS_LCASE.ToCharArray(),
PASSWORD_CHARS_UCASE.ToCharArray(),
PASSWORD_CHARS_NUMERIC.ToCharArray(),
PASSWORD_CHARS_SPECIAL.ToCharArray()
};
// Use this array to track the number of unused characters in each
// character group.
int[] charsLeftInGroup = new int[charGroups.Length];
// Initially, all characters in each group are not used.
for (int i = 0; i < charsLeftInGroup.Length; i++)
charsLeftInGroup = charGroups.Length;
// Use this array to track (iterate through) unused character groups.
int[] leftGroupsOrder = new int[charGroups.Length];
// Initially, all character groups are not used.
for (int i = 0; i < leftGroupsOrder.Length; i++)
leftGroupsOrder = i;
// Because we cannot use the default randomizer, which is based on the
// current time (it will produce the same "random" number within a
// second), we will use a random number generator to seed the
// randomizer.
// Use a 4-byte array to fill it with random bytes and convert it then
// to an integer value.
byte[] randomBytes = new byte[4];
// Generate 4 random bytes.
RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider();
rng.GetBytes(randomBytes);
// Convert 4 bytes into a 32-bit integer value.
int seed = (randomBytes[0] & 0x7f) << 24 |
randomBytes[1] << 16 |
randomBytes[2] << 8 |
randomBytes[3];
// Now, this is real randomization.
Random random = new Random(seed);
// This array will hold password characters.
char[] password = null;
// Allocate appropriate memory for the password.
if (minLength < maxLength)
password = new char[random.Next(minLength, maxLength + 1)];
else
password = new char[minLength];
// Index of the next character to be added to password.
int nextCharIdx;
// Index of the next character group to be processed.
int nextGroupIdx;
// Index which will be used to track not processed character groups.
int nextLeftGroupsOrderIdx;
// Index of the last non-processed character in a group.
int lastCharIdx;
// Index of the last non-processed group.
int lastLeftGroupsOrderIdx = leftGroupsOrder.Length - 1;
// Generate password characters one at a time.
for (int i = 0; i < password.Length; i++) {
// If only one character group remained unprocessed, process it;
// otherwise, pick a random character group from the unprocessed
// group list. To allow a special character to appear in the
// first position, increment the second parameter of the Next
// function call by one, i.e. lastLeftGroupsOrderIdx + 1.
if (lastLeftGroupsOrderIdx == 0)
nextLeftGroupsOrderIdx = 0;
else
nextLeftGroupsOrderIdx = random.Next(0,
lastLeftGroupsOrderIdx);
// Get the actual index of the character group, from which we will
// pick the next character.
nextGroupIdx = leftGroupsOrder[nextLeftGroupsOrderIdx];
// Get the index of the last unprocessed characters in this group.
lastCharIdx = charsLeftInGroup[nextGroupIdx] - 1;
// If only one unprocessed character is left, pick it; otherwise,
// get a random character from the unused character list.
if (lastCharIdx == 0)
nextCharIdx = 0;
else
nextCharIdx = random.Next(0, lastCharIdx + 1);
// Add this character to the password.
password = charGroups[nextGroupIdx][nextCharIdx];
// If we processed the last character in this group, start over.
if (lastCharIdx == 0)
charsLeftInGroup[nextGroupIdx] =
charGroups[nextGroupIdx].Length;
// There are more unprocessed characters left.
else {
// Swap processed character with the last unprocessed character
// so that we don't pick it until we process all characters in
// this group.
if (lastCharIdx != nextCharIdx) {
char temp = charGroups[nextGroupIdx][lastCharIdx];
charGroups[nextGroupIdx][lastCharIdx] =
charGroups[nextGroupIdx][nextCharIdx];
charGroups[nextGroupIdx][nextCharIdx] = temp;
}
// Decrement the number of unprocessed characters in
// this group.
charsLeftInGroup[nextGroupIdx]--;
}
// If we processed the last group, start all over.
if (lastLeftGroupsOrderIdx == 0)
lastLeftGroupsOrderIdx = leftGroupsOrder.Length - 1;
// There are more unprocessed groups left.
else {
// Swap processed group with the last unprocessed group
// so that we don't pick it until we process all groups.
if (lastLeftGroupsOrderIdx != nextLeftGroupsOrderIdx) {
int temp = leftGroupsOrder[lastLeftGroupsOrderIdx];
leftGroupsOrder[lastLeftGroupsOrderIdx] =
leftGroupsOrder[nextLeftGroupsOrderIdx];
leftGroupsOrder[nextLeftGroupsOrderIdx] = temp;
}
// Decrement the number of unprocessed groups.
lastLeftGroupsOrderIdx--;
}
}
// Convert password characters into a string and return the result.
return new string(password);
}
}
TO
Spoiler:
public class RandomPassword
{
// Define default min and max password lengths.
private static int DEFAULT_MIN_PASSWORD_LENGTH = 8;
private static int DEFAULT_MAX_PASSWORD_LENGTH = 10;
// Define supported password characters divided into groups.
// You can add (or remove) characters to (from) these groups.
private static string PASSWORD_CHARS_LCASE = "abcdefgijkmnopqrstwxyz";
private static string PASSWORD_CHARS_UCASE = "ABCDEFGHJKLMNPQRSTWXYZ";
private static string PASSWORD_CHARS_NUMERIC = "23456789";
private static string PASSWORD_CHARS_SPECIAL = "()!";
/// <summary>
/// Generates a random password.
/// </summary>
/// <returns>
/// Randomly generated password.
/// </returns>
/// <remarks>
/// The length of the generated password will be determined at
/// random. It will be no shorter than the minimum default and
/// no longer than maximum default.
/// </remarks>
public static string Generate()
{
return Generate(DEFAULT_MIN_PASSWORD_LENGTH,
DEFAULT_MAX_PASSWORD_LENGTH);
}
/// <summary>
/// Generates a random password of the exact length.
/// </summary>
/// <param name="length">
/// Exact password length.
/// </param>
/// <returns>
/// Randomly generated password.
/// </returns>
public static string Generate(int length)
{
return Generate(length, length);
}
/// <summary>
/// Generates a random password.
/// </summary>
/// <param name="minLength">
/// Minimum password length.
/// </param>
/// <param name="maxLength">
/// Maximum password length.
/// </param>
/// <returns>
/// Randomly generated password.
/// </returns>
/// <remarks>
/// The length of the generated password will be determined at
/// random and it will fall with the range determined by the
/// function parameters.
/// </remarks>
public static string Generate(int minLength,
int maxLength)
{
// Make sure that input parameters are valid.
if (minLength <= 0 || maxLength <= 0 || minLength > maxLength)
return null;
// Create a local array containing supported password characters
// grouped by types. You can remove character groups from this
// array, but doing so will weaken the password strength.
char[][] charGroups = new char[][]
{
PASSWORD_CHARS_LCASE.ToCharArray(),
PASSWORD_CHARS_UCASE.ToCharArray(),
PASSWORD_CHARS_NUMERIC.ToCharArray(),
PASSWORD_CHARS_SPECIAL.ToCharArray()
};
// Use this array to track the number of unused characters in each
// character group.
int[] charsLeftInGroup = new int[charGroups.Length];
// Initially, all characters in each group are not used.
for (int i=0; i<charsLeftInGroup.Length; i++)
charsLeftInGroup = charGroups.Length;
// Use this array to track (iterate through) unused character groups.
int[] leftGroupsOrder = new int[charGroups.Length];
// Initially, all character groups are not used.
for (int i=0; i<leftGroupsOrder.Length; i++)
leftGroupsOrder = i;
// Because we cannot use the default randomizer, which is based on the
// current time (it will produce the same "random" number within a
// second), we will use a random number generator to seed the
// randomizer.
// Use a 4-byte array to fill it with random bytes and convert it then
// to an integer value.
byte[] randomBytes = new byte[4];
// Generate 4 random bytes.
RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider();
rng.GetBytes(randomBytes);
// Convert 4 bytes into a 32-bit integer value.
int seed = (randomBytes[0] & 0x7f) << 24 |
randomBytes[1] << 16 |
randomBytes[2] << 8 |
randomBytes[3];
// Now, this is real randomization.
Random random = new Random(seed);
// This array will hold password characters.
char[] password = null;
// Allocate appropriate memory for the password.
if (minLength < maxLength)
password = new char[random.Next(minLength, maxLength+1)];
else
password = new char[minLength];
// Index of the next character to be added to password.
int nextCharIdx;
// Index of the next character group to be processed.
int nextGroupIdx;
// Index which will be used to track not processed character groups.
int nextLeftGroupsOrderIdx;
// Index of the last non-processed character in a group.
int lastCharIdx;
// Index of the last non-processed group.
int lastLeftGroupsOrderIdx = leftGroupsOrder.Length - 1;
// Generate password characters one at a time.
for (int i=0; i<password.Length; i++)
{
// If only one character group remained unprocessed, process it;
// otherwise, pick a random character group from the unprocessed
// group list. To allow a special character to appear in the
// first position, increment the second parameter of the Next
// function call by one, i.e. lastLeftGroupsOrderIdx + 1.
if (lastLeftGroupsOrderIdx == 0)
nextLeftGroupsOrderIdx = 0;
else
nextLeftGroupsOrderIdx = random.Next(0,
lastLeftGroupsOrderIdx);
// Get the actual index of the character group, from which we will
// pick the next character.
nextGroupIdx = leftGroupsOrder[nextLeftGroupsOrderIdx];
// Get the index of the last unprocessed characters in this group.
lastCharIdx = charsLeftInGroup[nextGroupIdx] - 1;
// If only one unprocessed character is left, pick it; otherwise,
// get a random character from the unused character list.
if (lastCharIdx == 0)
nextCharIdx = 0;
else
nextCharIdx = random.Next(0, lastCharIdx+1);
// Add this character to the password.
password = charGroups[nextGroupIdx][nextCharIdx];
// If we processed the last character in this group, start over.
if (lastCharIdx == 0)
charsLeftInGroup[nextGroupIdx] =
charGroups[nextGroupIdx].Length;
// There are more unprocessed characters left.
else
{
// Swap processed character with the last unprocessed character
// so that we don't pick it until we process all characters in
// this group.
if (lastCharIdx != nextCharIdx)
{
char temp = charGroups[nextGroupIdx][lastCharIdx];
charGroups[nextGroupIdx][lastCharIdx] =
charGroups[nextGroupIdx][nextCharIdx];
charGroups[nextGroupIdx][nextCharIdx] = temp;
}
// Decrement the number of unprocessed characters in
// this group.
charsLeftInGroup[nextGroupIdx]--;
}
// If we processed the last group, start all over.
if (lastLeftGroupsOrderIdx == 0)
lastLeftGroupsOrderIdx = leftGroupsOrder.Length - 1;
// There are more unprocessed groups left.
else
{
// Swap processed group with the last unprocessed group
// so that we don't pick it until we process all groups.
if (lastLeftGroupsOrderIdx != nextLeftGroupsOrderIdx)
{
int temp = leftGroupsOrder[lastLeftGroupsOrderIdx];
leftGroupsOrder[lastLeftGroupsOrderIdx] =
leftGroupsOrder[nextLeftGroupsOrderIdx];
leftGroupsOrder[nextLeftGroupsOrderIdx] = temp;
}
// Decrement the number of unprocessed groups.
lastLeftGroupsOrderIdx--;
}
}
// Convert password characters into a string and return the result.
return new string(password);
}
}
/// <summary>
/// Illustrates the use of the RandomPassword class.
/// </summary>
public class RandomPasswordTest
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
// Print 100 randomly generated passwords (8-to-10 char long).
for (int i=0; i<100; i++)
Console.WriteLine(RandomPassword.Generate(8, 10));
}
}
{
// Define default min and max password lengths.
private static int DEFAULT_MIN_PASSWORD_LENGTH = 8;
private static int DEFAULT_MAX_PASSWORD_LENGTH = 10;
// Define supported password characters divided into groups.
// You can add (or remove) characters to (from) these groups.
private static string PASSWORD_CHARS_LCASE = "abcdefgijkmnopqrstwxyz";
private static string PASSWORD_CHARS_UCASE = "ABCDEFGHJKLMNPQRSTWXYZ";
private static string PASSWORD_CHARS_NUMERIC = "23456789";
private static string PASSWORD_CHARS_SPECIAL = "()!";
/// <summary>
/// Generates a random password.
/// </summary>
/// <returns>
/// Randomly generated password.
/// </returns>
/// <remarks>
/// The length of the generated password will be determined at
/// random. It will be no shorter than the minimum default and
/// no longer than maximum default.
/// </remarks>
public static string Generate()
{
return Generate(DEFAULT_MIN_PASSWORD_LENGTH,
DEFAULT_MAX_PASSWORD_LENGTH);
}
/// <summary>
/// Generates a random password of the exact length.
/// </summary>
/// <param name="length">
/// Exact password length.
/// </param>
/// <returns>
/// Randomly generated password.
/// </returns>
public static string Generate(int length)
{
return Generate(length, length);
}
/// <summary>
/// Generates a random password.
/// </summary>
/// <param name="minLength">
/// Minimum password length.
/// </param>
/// <param name="maxLength">
/// Maximum password length.
/// </param>
/// <returns>
/// Randomly generated password.
/// </returns>
/// <remarks>
/// The length of the generated password will be determined at
/// random and it will fall with the range determined by the
/// function parameters.
/// </remarks>
public static string Generate(int minLength,
int maxLength)
{
// Make sure that input parameters are valid.
if (minLength <= 0 || maxLength <= 0 || minLength > maxLength)
return null;
// Create a local array containing supported password characters
// grouped by types. You can remove character groups from this
// array, but doing so will weaken the password strength.
char[][] charGroups = new char[][]
{
PASSWORD_CHARS_LCASE.ToCharArray(),
PASSWORD_CHARS_UCASE.ToCharArray(),
PASSWORD_CHARS_NUMERIC.ToCharArray(),
PASSWORD_CHARS_SPECIAL.ToCharArray()
};
// Use this array to track the number of unused characters in each
// character group.
int[] charsLeftInGroup = new int[charGroups.Length];
// Initially, all characters in each group are not used.
for (int i=0; i<charsLeftInGroup.Length; i++)
charsLeftInGroup = charGroups.Length;
// Use this array to track (iterate through) unused character groups.
int[] leftGroupsOrder = new int[charGroups.Length];
// Initially, all character groups are not used.
for (int i=0; i<leftGroupsOrder.Length; i++)
leftGroupsOrder = i;
// Because we cannot use the default randomizer, which is based on the
// current time (it will produce the same "random" number within a
// second), we will use a random number generator to seed the
// randomizer.
// Use a 4-byte array to fill it with random bytes and convert it then
// to an integer value.
byte[] randomBytes = new byte[4];
// Generate 4 random bytes.
RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider();
rng.GetBytes(randomBytes);
// Convert 4 bytes into a 32-bit integer value.
int seed = (randomBytes[0] & 0x7f) << 24 |
randomBytes[1] << 16 |
randomBytes[2] << 8 |
randomBytes[3];
// Now, this is real randomization.
Random random = new Random(seed);
// This array will hold password characters.
char[] password = null;
// Allocate appropriate memory for the password.
if (minLength < maxLength)
password = new char[random.Next(minLength, maxLength+1)];
else
password = new char[minLength];
// Index of the next character to be added to password.
int nextCharIdx;
// Index of the next character group to be processed.
int nextGroupIdx;
// Index which will be used to track not processed character groups.
int nextLeftGroupsOrderIdx;
// Index of the last non-processed character in a group.
int lastCharIdx;
// Index of the last non-processed group.
int lastLeftGroupsOrderIdx = leftGroupsOrder.Length - 1;
// Generate password characters one at a time.
for (int i=0; i<password.Length; i++)
{
// If only one character group remained unprocessed, process it;
// otherwise, pick a random character group from the unprocessed
// group list. To allow a special character to appear in the
// first position, increment the second parameter of the Next
// function call by one, i.e. lastLeftGroupsOrderIdx + 1.
if (lastLeftGroupsOrderIdx == 0)
nextLeftGroupsOrderIdx = 0;
else
nextLeftGroupsOrderIdx = random.Next(0,
lastLeftGroupsOrderIdx);
// Get the actual index of the character group, from which we will
// pick the next character.
nextGroupIdx = leftGroupsOrder[nextLeftGroupsOrderIdx];
// Get the index of the last unprocessed characters in this group.
lastCharIdx = charsLeftInGroup[nextGroupIdx] - 1;
// If only one unprocessed character is left, pick it; otherwise,
// get a random character from the unused character list.
if (lastCharIdx == 0)
nextCharIdx = 0;
else
nextCharIdx = random.Next(0, lastCharIdx+1);
// Add this character to the password.
password = charGroups[nextGroupIdx][nextCharIdx];
// If we processed the last character in this group, start over.
if (lastCharIdx == 0)
charsLeftInGroup[nextGroupIdx] =
charGroups[nextGroupIdx].Length;
// There are more unprocessed characters left.
else
{
// Swap processed character with the last unprocessed character
// so that we don't pick it until we process all characters in
// this group.
if (lastCharIdx != nextCharIdx)
{
char temp = charGroups[nextGroupIdx][lastCharIdx];
charGroups[nextGroupIdx][lastCharIdx] =
charGroups[nextGroupIdx][nextCharIdx];
charGroups[nextGroupIdx][nextCharIdx] = temp;
}
// Decrement the number of unprocessed characters in
// this group.
charsLeftInGroup[nextGroupIdx]--;
}
// If we processed the last group, start all over.
if (lastLeftGroupsOrderIdx == 0)
lastLeftGroupsOrderIdx = leftGroupsOrder.Length - 1;
// There are more unprocessed groups left.
else
{
// Swap processed group with the last unprocessed group
// so that we don't pick it until we process all groups.
if (lastLeftGroupsOrderIdx != nextLeftGroupsOrderIdx)
{
int temp = leftGroupsOrder[lastLeftGroupsOrderIdx];
leftGroupsOrder[lastLeftGroupsOrderIdx] =
leftGroupsOrder[nextLeftGroupsOrderIdx];
leftGroupsOrder[nextLeftGroupsOrderIdx] = temp;
}
// Decrement the number of unprocessed groups.
lastLeftGroupsOrderIdx--;
}
}
// Convert password characters into a string and return the result.
return new string(password);
}
}
/// <summary>
/// Illustrates the use of the RandomPassword class.
/// </summary>
public class RandomPasswordTest
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
// Print 100 randomly generated passwords (8-to-10 char long).
for (int i=0; i<100; i++)
Console.WriteLine(RandomPassword.Generate(8, 10));
}
}
(/spoiler)
Then in the Toolbar "Tools>Settings>Expert Settings"
Then Check if Right from the sortha "play button" It says "Released"
Press "F6" or "Build>Build Solution" in ToolBar
Done
4.3 - Change yourself to Mapper/Admin/Scripter/...
Spoiler:
Close The Server With Task Manager
Open Navicat
Goto "localhost\pmu_players\characteristics"
!!! Be Sure you Registered/create a charachter already !!!
At your name at Access change the number to 1-6
1 -> Moderator
2 -> Mapper
3 -> Developer
4 -> Admin
5 -> ServerHost
6 -> Scripter
Open Navicat
Goto "localhost\pmu_players\characteristics"
!!! Be Sure you Registered/create a charachter already !!!
At your name at Access change the number to 1-6
1 -> Moderator
2 -> Mapper
3 -> Developer
4 -> Admin
5 -> ServerHost
6 -> Scripter
4.4 - Client Building Solution (error) (somthing with error box)
Spoiler:
GoTo "Client/Client"
Open "Client" " (Not the folder, but the c# file)
Click "The Error Box" error
Remove
private void InitializeComponent()
{
this.SuspendLayout();
//
// ErrorBox
//
this.ClientSize = new System.Drawing.Size(284, 262);
this.Name = "ErrorBox";
this.Load += new System.EventHandler(this.ErrorBox_Load);
this.ResumeLayout(false);
}
private void ErrorBox_Load(object sender, EventArgs e)
{
}
now you can build!
Open "Client" " (Not the folder, but the c# file)
Click "The Error Box" error
Remove
Spoiler:
private void InitializeComponent()
{
this.SuspendLayout();
//
// ErrorBox
//
this.ClientSize = new System.Drawing.Size(284, 262);
this.Name = "ErrorBox";
this.Load += new System.EventHandler(this.ErrorBox_Load);
this.ResumeLayout(false);
}
private void ErrorBox_Load(object sender, EventArgs e)
{
}
now you can build!
I hope the tutorial helped! If you have more question, be sure to ask! ^-^
Aswell Thanks to PMU 7 to make this possible (x
For people that don't wanne make one!
if you don't want to go through the trouble of setting up your own server, but still want to make dungeons, Download the mystery dungeon community project: tinyurl . com/MDX-Update-1
OR Visit the website: Pmdcommunity.x10.mx
ScreenShots
Spoiler:
Wait for this please!
Or type this in your browser:
tinypic.com/r/wqyqms/8
tinypic.com/view.php?pic=34rht0k&s=8
Last edited: