Obrolan (182)

    [Guide - Detailed]Navicat and Your Server

    Share
    avatar
    Cruey
    Eudemons Developer
    Eudemons Developer

    Jumlah posting Jumlah posting : 18
    Experience Experience : 53
    Reputation Reputation : 1
    Join date Join date : 2012-08-18
    Lokasi Lokasi : Brazilian
    Female

    Mini Icon Topic [Guide - Detailed]Navicat and Your Server

    Post by Cruey on Sat Aug 18, 2012 3:29 pm

    Welcome to the How to run your server Guide!

    You may be familiar with my other guide. Time for round 2 Smile

    This is about running your server. NOT EDITING THE CLIENT!

    There quite a few things you need to know to successfully run a server, this time we are going to have a table of contents.

    Table of Contents

    1. Navicat Basics
    2. Server Rules
    3. Quick Edits And PM Data
    4. Queries
    5. Back Ups


    • FAQ's
    • Credits


    Chapter 1 Navicat Basics

    Im sure by now you know how to start your server and how to login. But what about other people? How often should I do my maintenance? Things like that well I am going to be answering all questions on this thread about how you RUN a server.

    The first thing you need to know is how to navigate the DB. Almost everything in the server is in the DB.

    A list of things found in the DB:

    1. NPC
    2. Levels
    3. Experience
    4. Eudemon Stats
    5. Money
    6. Actions***
    7. Server Messages
    8. Legions
    9. Families
    10. Totems
    11. Monsters
    12. Items
    13. Accounts


    And that's not all.

    So let me stress how important it is to know whats in your database. Its VERY important.

    So you want to edit something in your DB?

    Solution: Navicat

    This entire guide will most likely revolve around Navicat.

    Google it, Download it.

    Now When you open it it will need a connection.



    Click on Connection.
    Enter your username and password and give the connection a name.
    Click test connection.
    If it says connection successful you win!(If not you got the wrong user name and password.)



    Now you can access your DB.
    Double Click or Right Click -> Open Connection the connection you just made.
    Double Click or Right Click -> Open Database on your DB (in most cases its my).
    Now you can see your DB in the right hand window.



    There are a few things you can do now.
    We will cover those later.

    Lets take a look at the interface.
    The two main Things you will be using are:

    Tables and Queries

    In tables you can directly modify properties and values.
    In queries if you know the code you can mass modify values.


    There are a lot of things that we don't know about these servers yet. So explore and mess around, maybe you will discover the next big thing Wink.
    Warning: If you really want to mess with things that you have no idea what they do, make a backup first!

    Some common things people edit are in accounts, such as VIP level. Another thing is the Medal_select in cq_users.

    Chapter 2 Server Rules

    Believe it or not Rules are another very important part of a server, if you don't display the rules in the open, where everyone can see them and access them whenever, people will start to believe that you are making rules up as you go. Make sure you follow these rules yourself. Keep a mortal account for when you want to mingle in with other users. Never give your mortal donation items, even if everyone has them. Be consistent, no one likes randomness, they feel left out when they didn't know it was going to happen, they see chaos and run.

    Make rules for your GM's and other PM's. If you don't have rules for them they can really overpower themselves and/or ruin the server. Be sure to explain to your GM's and PM's that if they EVER break a rule their time as staff is over. If someone see's something happen and they don't know whats going on in the background but they know that PM/GM just broke the rules, they will tell people, when you don't act upon what is happening, they think you don't care, even if its a first offense, you need to show action, maybe suspend the account for a couple days.

    Back to being consistent, there are many things that need to stay consistent.
    Things such as Legion Wars, Server Maintenance, etc. You can hold random events, such as hide and seek, things like that. But when you need to have big events keep them scheduled so everyone has a chance to try and make it.

    A sample list of rules for Players:
    1. Players cannot cheat, hack, code, reverse engineer, or otherwise modify the client, with or without knowledge.
    2. Players are not to advertise the server on other servers or openly anywhere.
    3. Players are not to use automation scripts, codes, or other automatic input/entry methods, with or without knowledge.
    4. Players are not to flame others, words such as noob, noobcake, idiot, retard, etc. are not allowed on this server, they degrade others and hurt server reputation.
    5. Players are not allowed to perform any action, with or without knowledge of the action, that is intended or provokes a denial of service or any other action that will degrade service or the ability of the server. (This includes organized masses.)

    Any break of these rules will result in x hours muted/banned. X to be determined by the staff based on the severity of the infraction. Staff reserve the right to temporarily remove you ability to access the service until proper research has been done and a conclusion has been reached by at least 3 staff members.


    Sample Rules for PM/GM:
    1. You agree to never use any commands or make any modifications to the server that will benefit your mortal account.
    2. You agree to never use any commands or make any modifications to the server that will degrade performance and/or ruin the server, with or without knowledge.
    3. You agree to never freely give anything to another mortal, yours or a friends, you also agree to never give special discounts for donation items, or give such items away free to anyone, with or without knowledge of the action.
    4. You agree to follow all of the player rules.
    5. You agree to never PK intentionally or unintentionally any other player without prior consent and another staff member available to monitor and approve of the action before it happens. Duels are acceptable.
    6. You agree to never use any commands or make any modifications to the server that will benefit a specific account or group, with or without knowledge, for any reason without consulting at least 3 other staff members.

    Any infraction of these rules will result in immediate removal of powers and all staff will convene to determine the severity of your punishment. The game owner reserves the right to remove any and all properties from your and your mortals possession, remove all powers, delete your accounts, and/or completely bar you from the service, for any reason whatsoever the game owner sees fit.


    Notice how these rules leave very little room for loop holes yet they exist. This is designed to allow fun to take place, not to mention it shows teamwork and responsibility. Also note the amount of power displayed by being game owner and that the only person that this applies to is other GM/PM's. This is to allow quick action against someone who goes power hungry.

    Keep a sense of balance, fun, and fairness in your servers and everything will move smoothly.


    Chapter 3: Quick Edits and PM Data
    Quick edits are simple things to do.
    Lets make an example of how to find a problem and how to fix it.
    While you are PM whenever you provoke a CQ_Actions it will display its properties in chat. These properties can be directly retraced back to CQ_Actions.

    Example:
    Code:
    3015500: [3015501,0]. type[101], data[0], param:[Hello~there,~[PM]~D®en~would~you~like~to~buy~some~groceries?].

    Heres what each item meant:

    3015500 - Meant the ID of the cq_action
    3015501 - Meant the next things to do after this was ran successfully.
    0 - Meant the next thing to do if it failed. (0 means do nothing/close window)
    101 - is the type, what is it provoking? A window? A system message?
    0 - was data, this pulls information from the server or client, such as item information.
    The text - was the Parameter, the information in which to use with the data and type.

    Heres a quick list of some types:
    Code:

    101- Npc window, will continue to add to the NPC until 102 is reached. Requires ~ as spaces or will fail.
    102- User options, at the end of the parameter add the CQ_Action ID that will be performed when that action is selected. Also requires ~ as space.
    1001 - Condition check or cq_user modification. Ex. Param would be 'money += 1' to add 1 money to the character that chooses that option.
    1003 - Teleport, Parameter usage: [mapid] [x coord] [y coord]
    125 - Broadcast? Used with data: 2011 Parameter is your message, does not require ~ as space.
    1010 - Effect + Broadcast? Used with data: 2011 Parameter is your message, does not require ~ as space. In most cases invoked with an item (such as god eudemon stone)

    There are many others, feel free to let me know if you find any!
    For Learning Purposes please DO NOT post a release of all the data and type codes in this thread! Let some newer developers feel accomplished.

    So lets say we found this code:

    Code:
    3015500: [3015500,0]. type[101], data[0], param:[Hello there, %user_name would you like to buy some groceries?].

    First error: No Tildes.
    Second error: The next ID refers to itself, causing an infinite loop.

    Lets fix it.

    WAIT it says %user_name !
    Code:
    %user_name is what you use to make a message display the users name in the chat window.


    Open Navicat.
    Open your Connection and DB.
    Open the table Cq_action.
    Press CTRL+F
    There will be a search at the bottom.
    Enter 3015500 (The cq_action ID)
    It will automatically start searching, It may not find it, notice in the bottom right that there is a Record x of x then some arrows?
    Click the next arrow then click find next. Do this until you find the cq_action with ID 3015500.
    Code:
    TIP: If you click the screw driver and wrench you can uncheck  limit records and search them all at once.
    Warning: Doing so on a remote connection will take a while, especially on slow connections.
    Now that we have found it it seems like its in the same format doesn't it?
    Click on the id_next field in the row with the cq_action ID. Its now editable.
    Change it to the next id that this NPC will use.
    Click on the little check mark on the bottom left.
    Voila~ Fixed the infinite loop.
    Now go to param and click it. You can now edit all the spaces and replace them with ~.

    Code:
    Tip: Some are long and hard to see when you use just that little box, if you click memo mode in the top right next to image mode you will get a little box at the bottom that shows all the contents in an easy to see view.
    Be sure to click the check mark before exiting that window!

    Ok I updated the server with the new info, now what? It still doesn't work!

    Here's why:
    The game server still has the old code in memory, we need to update it.
    We can do that in 2 ways:

    1. We can restart the server and kick everyone off of it. (Not such a good idea...)
    2. We can use the following PM code:

    Code:
    /reloadaction [cq_action ID]
    Using the code will result in a system message in the top left saying AN ACTION UPDATE!

    You just learned to fix NPC chat issues and use Navicat to make DB changes!

    Chapter 4: Queries

    There are quite a few things you need to know about queries. All queries start with a command. Here is a small list of Starting commands:
    Code:

    UPDATE - Changes something
    INSERT INTO- Adds something
    DELETE FROM - Removes something
    SELECT - Displays something

    Each have their own syntax (way of being used) and I will discuss these below:

    UPDATE
    The parts of the syntax that need to be replaced with database specific values will be in brackets.
    Code:

    UPDATE [table] SET `[row]` = [value] WHERE `[ID]` [expression] [value];

    An expression is something such as =, <, >.

    INSERT INTO
    The parts of the syntax that need to be replaced with database specific values will be in brackets.
    Code:

    INSERT INTO [table] ([row], [row2]) VALUES ('[value]', '[value]');


    DELETE FROM
    The parts of the syntax that need to be replaced with database specific values will be in brackets.
    Code:

    DELETE FROM [table] WHERE [row] [expression] [value];

    SELECT
    The parts of the syntax that need to be replaced with database specific values will be in brackets.
    Code:

    SELECT [row],[row2],[row3] FROM [table] WHERE [row] [expression] [value];


    A wildcard can be used for all in between SELECT and FROM. (A wildcard is an asterisk)

    WHERE Statement

    Using WHERE in your statements can be optional. There are some additional things you can add on top of these. A great example is when your using the WHERE statement. If you want to add more expressions you can use AND or OR.

    Here is an example query.

    Code:

    UPDATE accounts SET `password` =  FSDDG6548FEJKU5DFGDF55489 WHERE `Username` = ThatGuy AND `id` = 125401;

    You can also make mass edits using this code.

    Code:

    UPDATE accounts SET `VIP` = 7 WHERE `id` > 0;

    These codes have not been tested and may refer to things not in the database, they are just examples.

    If you catch any syntax errors please let me know.


    For those of you that want more information on mySQL queries, google mySQL tutorials. There are many and they will all help you further understand the syntax. Knowing the syntax is very important so you can make edits to releases to avoid breaking your own server.


    Chapter 5: Back Ups

    You can make a backup in many ways.
    Here is the easiest:
    Get WinRAR if you don't already have it.
    Go to [Your server files]/mysql/data
    Right Click your database folder (usually my)
    Click add to archive.
    Under the name put [Servername][Date]
    Example: Demi-Flame2010-Aug-19.rar

    To restore the backup right click then click extract here...
    (Files that are being accessed by the server can still be copied then pasted to make a back up of if it says file accessed by another service or program)

    FAQ's
    Any question asked that has some value, I will add then answer.


    Common Questions:
    Q. I cant login why?
    A. Most of the time people can't login is that under accounts in the db they created a name with a Capital letter. Some are Client vs DB issues (Values in the server database and client don't match). Another issue is a plain format password. Passwords need to be specially formatted.

    Q. How do I become a PM/GM?
    A. Easy, go to cq_users in your data base and find your username. Add [PM] anywhere in your name and voila~ PM.

    Credits

    Drenferalis
    avatar
    [CEO]Ryan



    Jumlah posting Jumlah posting : 121
    Experience Experience : 196
    Reputation Reputation : 1
    Join date Join date : 2012-07-14
    Age Age : 21
    Lokasi Lokasi : DKI Jakarta
    Male

    Mini Icon Topic Re: [Guide - Detailed]Navicat and Your Server

    Post by [CEO]Ryan on Sun Sep 02, 2012 2:39 pm

    Nice Info Cruey, ^_^


    _________________
    X-Gaming Community



      Current date/time is Wed Sep 20, 2017 8:53 am