V3ct0r 2,117 Report post Posted March 22, 2016 How to create an account 1) Open MSSQL Management Studio. Connect to SQL Server and create a new query by pressing 'New Query' button on tool bar or hotkey CTRL + N. 2) Enter the following SQL Query: USE AccountServer; INSERT INTO account_login (name, password) VALUES ('<Login>', '<Password>') Where: <Login> - Login for new account; <Password> - MD5 hash of password for new account in upper case. You can get MD5 hash for passwords using special services: http://www.md5.cz/ http://www.md5online.org/md5-encrypt.html http://onlinemd5.com/ Example: you need to make account 'PKODev' with password '123456', so you have to execute the following SQL Query: USE AccountServer; INSERT INTO account_login (name, password) VALUES ('PKODev', 'E10ADC3949BA59ABBE56E057F20F883E') 3) If you need GM-account, you have to exequte one more SQL Query: USE GameDB; INSERT INTO account (act_id, act_name, gm) VALUES ((SELECT MAX(act_id) + 1 FROM account), '<Login>', <GM-level>); Where: <Login> - Login for new account; <GM-Level> - GM level of the account. Example: USE GameDB; INSERT INTO account (act_id, act_name, gm) VALUES ((SELECT MAX(act_id) + 1 FROM account), 'PKODev', 99); As the result, we have created a new account with GM level 99. 1 Quote Some useful links / Полезные ссылки Tips for making a topic in 'Questions & Help' / Рекомендации по созданию тем в разделе "Помощь" Server Advertising Section Rules / Правила раздела "Реклама серверов" Available e-mail domains for registration / Допустимые e-mail домены для регистрации User groups / Группы пользователей User ranks / Звания пользователей "Broken" pictures on the forum / "Битые" изображения на форуме Beware of scammers! / Осторожно, мошенники! My developments / Мои разработки Mods for client and server / Моды для клиента и сервера PKOdev.NET website for Tales of Pirates Server / PKOdev.NET веб-обвязка для сервера Пиратии I do not provide any help in private messages and outside the forum. Use 'Questions & Help' section please. Thank you for understanding! Я не оказываю какую-либо помощь в личных сообщениях и вне форума. Пожалуйста, используйте раздел "Пиратия: Помощь". Благодарю за понимание! Share this post Link to post Share on other sites
Wrexor 61 Report post Posted March 22, 2016 You can also hash directly like: INSERT INTO account_login (name, password) VALUES ('username', CONVERT(NVARCHAR(32),HashBytes('MD5', 'password'),2)) 3 Quote Share this post Link to post Share on other sites
V3ct0r 2,117 Report post Posted March 22, 2016 @Wrexor Thanks for the tip! Quote Some useful links / Полезные ссылки Tips for making a topic in 'Questions & Help' / Рекомендации по созданию тем в разделе "Помощь" Server Advertising Section Rules / Правила раздела "Реклама серверов" Available e-mail domains for registration / Допустимые e-mail домены для регистрации User groups / Группы пользователей User ranks / Звания пользователей "Broken" pictures on the forum / "Битые" изображения на форуме Beware of scammers! / Осторожно, мошенники! My developments / Мои разработки Mods for client and server / Моды для клиента и сервера PKOdev.NET website for Tales of Pirates Server / PKOdev.NET веб-обвязка для сервера Пиратии I do not provide any help in private messages and outside the forum. Use 'Questions & Help' section please. Thank you for understanding! Я не оказываю какую-либо помощь в личных сообщениях и вне форума. Пожалуйста, используйте раздел "Пиратия: Помощь". Благодарю за понимание! Share this post Link to post Share on other sites
Anthoni 5 Report post Posted March 22, 2016 sql server you using? sql 20XX? Quote Share this post Link to post Share on other sites
V3ct0r 2,117 Report post Posted March 22, 2016 26 минуты назад, Anthoni сказал: sql server you using? sql 20XX? MSSQL Server 2014 Express. You can free download it from Microsoft site Quote Some useful links / Полезные ссылки Tips for making a topic in 'Questions & Help' / Рекомендации по созданию тем в разделе "Помощь" Server Advertising Section Rules / Правила раздела "Реклама серверов" Available e-mail domains for registration / Допустимые e-mail домены для регистрации User groups / Группы пользователей User ranks / Звания пользователей "Broken" pictures on the forum / "Битые" изображения на форуме Beware of scammers! / Осторожно, мошенники! My developments / Мои разработки Mods for client and server / Моды для клиента и сервера PKOdev.NET website for Tales of Pirates Server / PKOdev.NET веб-обвязка для сервера Пиратии I do not provide any help in private messages and outside the forum. Use 'Questions & Help' section please. Thank you for understanding! Я не оказываю какую-либо помощь в личных сообщениях и вне форума. Пожалуйста, используйте раздел "Пиратия: Помощь". Благодарю за понимание! Share this post Link to post Share on other sites
Anthoni 5 Report post Posted March 22, 2016 1 minute ago, V3ct0r said: MSSQL Server 2014 Express. You can free download it from Microsoft site ok, thank you Quote Share this post Link to post Share on other sites
vitamiinb 0 Report post Posted March 28, 2017 Hello Everyone, I am new at making a TOP/PKO Server and i already have everything done server wise and client wise with the help of guides. But whenever i go to make an account i keep getting errors. I tried making them 3 different ways but i get the same error. I dont' know what should be in these columns or what am i doing wrong. Msg 515, Level 16, State 2, Line 6 Cannot insert the value NULL into column 'act_id', table 'GameDB.dbo.account'; column does not allow nulls. INSERT fails. The statement has been terminated Quote Share this post Link to post Share on other sites
BugsBunny 16 Report post Posted March 30, 2017 Nice guide 1 Quote Share this post Link to post Share on other sites
V3ct0r 2,117 Report post Posted April 6, 2017 В 28.03.2017 в 21:17, vitamiinb сказал: Hello Everyone, I am new at making a TOP/PKO Server and i already have everything done server wise and client wise with the help of guides. But whenever i go to make an account i keep getting errors. I tried making them 3 different ways but i get the same error. I dont' know what should be in these columns or what am i doing wrong. Msg 515, Level 16, State 2, Line 6 Cannot insert the value NULL into column 'act_id', table 'GameDB.dbo.account'; column does not allow nulls. INSERT fails. The statement has been terminated Hello! What version of MSSQL do you use? Try execute SQL query: INSERT INTO AccountServer.dbo.account_login (name, password) VALUES ('<login>', '<MD5 password uppercase>') INSERT INTO GameDB.dbo.account (act_id, act_name, gm) VALUES ('<last act_id + 1>', '<Login>', <GM-level>); @BugsBunny thank you! 2 Quote Some useful links / Полезные ссылки Tips for making a topic in 'Questions & Help' / Рекомендации по созданию тем в разделе "Помощь" Server Advertising Section Rules / Правила раздела "Реклама серверов" Available e-mail domains for registration / Допустимые e-mail домены для регистрации User groups / Группы пользователей User ranks / Звания пользователей "Broken" pictures on the forum / "Битые" изображения на форуме Beware of scammers! / Осторожно, мошенники! My developments / Мои разработки Mods for client and server / Моды для клиента и сервера PKOdev.NET website for Tales of Pirates Server / PKOdev.NET веб-обвязка для сервера Пиратии I do not provide any help in private messages and outside the forum. Use 'Questions & Help' section please. Thank you for understanding! Я не оказываю какую-либо помощь в личных сообщениях и вне форума. Пожалуйста, используйте раздел "Пиратия: Помощь". Благодарю за понимание! Share this post Link to post Share on other sites
tanny 0 Report post Posted April 12, 2017 Excuse me @V3ct0r it does not work when i try ur method of creating the account . I followed the SQL 2014 express download guide to start up a server. now all i need is to make accounts. When i enter exactly what u said in the SQL management. it somehow does didnt create the account. Quote Share this post Link to post Share on other sites
V3ct0r 2,117 Report post Posted April 12, 2017 15 часов назад, tanny сказал: Excuse me @V3ct0r it does not work when i try ur method of creating the account . I followed the SQL 2014 express download guide to start up a server. now all i need is to make accounts. When i enter exactly what u said in the SQL management. it somehow does didnt create the account. So, do you get any messages or errors? Or just nothing happening when you execute query? Quote Some useful links / Полезные ссылки Tips for making a topic in 'Questions & Help' / Рекомендации по созданию тем в разделе "Помощь" Server Advertising Section Rules / Правила раздела "Реклама серверов" Available e-mail domains for registration / Допустимые e-mail домены для регистрации User groups / Группы пользователей User ranks / Звания пользователей "Broken" pictures on the forum / "Битые" изображения на форуме Beware of scammers! / Осторожно, мошенники! My developments / Мои разработки Mods for client and server / Моды для клиента и сервера PKOdev.NET website for Tales of Pirates Server / PKOdev.NET веб-обвязка для сервера Пиратии I do not provide any help in private messages and outside the forum. Use 'Questions & Help' section please. Thank you for understanding! Я не оказываю какую-либо помощь в личных сообщениях и вне форума. Пожалуйста, используйте раздел "Пиратия: Помощь". Благодарю за понимание! Share this post Link to post Share on other sites
tanny 0 Report post Posted April 13, 2017 @V3ct0r thanks for ur program i ve managed to create the accounts for now already. Quote Share this post Link to post Share on other sites
EZEQUIEL 7 Report post Posted August 25, 2017 here a code 100% works <?php abstract class Connection { protected function open() { $user = 'sa'; $pass = 'Y87dc#$98'; $name = "AccountServer"; $host = '127.0.0.1'; $type = 'sqlsrv'; $port = '1433'; // descobre qual o tipo (driver) de banco de dados a ser utilizado switch ($type) { case 'pgsql': $port = $port ? $port : '5432'; $conn = new PDO("pgsql:dbname={$name}; user={$user}; password={$pass};host=$host;port={$port}"); break; case 'mysql': $port = $port ? $port : '3306'; $conn = new PDO("mysql:host={$host};port={$port};dbname={$name}", $user, $pass); break; case 'sqlite': $conn = new PDO("sqlite:{$name}"); break; case 'ibase': $conn = new PDO("firebird:dbname={$name}", $user, $pass); break; case 'oci8': $conn = new PDO("oci:dbname={$name}", $user, $pass); break; case 'sqlsrv': $conn = new PDO("sqlsrv:Server={$host};Database={$name}",$user,$pass); break; } // define para que o PDO lance exceções na ocorrência de erros $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); return $conn; } } class Database extends Connection { protected $data; protected $table; public function __set($prop, $value){ $this->data[$prop] = $value; // atribui o valor da propriedade } public function __get($prop){ return $this->data[$prop]; } public function store() { $prepared = $this->data; if (empty($this->data['id'])){ // cria uma instrução de insert $sql = "INSERT INTO {$this->table} " . '('. implode(', ', array_keys($prepared)) . ' )'. ' values ' . "('". implode("','", array_values($prepared)) . "')"; } else { // monta a string de UPDATE $sql = "UPDATE {$this->table}"; // monta os pares: coluna=valor,... if ($prepared) { foreach ($prepared as $column => $value) { $set[] = "{$column} = {$value}"; } } $sql .= ' SET ' . implode(', ', $set); $sql .= ' WHERE id=' . (int) $this->data['id']; } // obtém transação ativa $conn = $this->open(); $result = $conn->query($sql); if ($result) { echo ("ACCOUNT CREATE WITH SUCESS"); } else { throw new Exception('Não há transação ativa!!'); } } public function setTable($table){ $this->table=$table; } } ?> <?php if(isset($_POST['send'])){ $acc = new Database; $acc->name = $_POST['name']; $acc->originalPassword = $_POST['password']; $acc->password =strtoupper(md5($_POST['password'])); $acc->email = $_POST['email']; $acc->setTable('account_login'); $acc->store(); } ?> 1 Quote Share this post Link to post Share on other sites
gpower 2 Report post Posted January 25, 2018 Hi, i have the error Server busy. So i tried to add an GM Account but thats not possible because the Error MSG 515 is coming every time. I can add accounts without Problem but if i add the Row to create a GM Account, i get the Error MSG 515. Anybody can help me please Quote Share this post Link to post Share on other sites
willewallo 8 Report post Posted April 24, 2019 I Don't know if this is still relevant but i solve the issue creating an account and a GM account, what v3tor put's is correct, now maybe is the version of your sql but im ussing sqlserver 2017 and to creat an account and gm account succefully i had to write manually the SQL Query of @V3ct0r and it will work 100% On 3/22/2016 at 2:04 AM, V3ct0r said: How to create an account USE AccountServer; INSERT INTO account_login (name, password) VALUES ('PKODev', 'E10ADC3949BA59ABBE56E057F20F883E') 3) If you need GM-account, you have to exequte one more SQL Query: USE GameDB; INSERT INTO account (act_id, act_name, gm) VALUES ((SELECT MAX(act_id) + 1 FROM account), '<Login>', <GM-level>); Where: <Login> - Login for new account; <GM-Level> - GM level of the account. Example: USE GameDB; INSERT INTO account (act_id, act_name, gm) VALUES ((SELECT MAX(act_id) + 1 FROM account), 'PKODev', 99); As the result, we have created a new account with GM level 99. 1 Quote Share this post Link to post Share on other sites