Aldeia RPG

Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.

Suporte ao desenvolvimento de jogos


+7
KamuiRyu
adiif1
mahdiias
dilorka
kleberbp
GallighanMaker
Dooolly
11 participantes

    [EO]Servidor MySQL

    dilorka
    dilorka
    Iniciante
    Iniciante


    Mensagens : 38
    Créditos : 3

    [EO]Servidor MySQL - Página 2 Empty Re: [EO]Servidor MySQL

    Mensagem por dilorka Qua Set 09, 2015 2:52 pm

    Mt Bom Dooolly +1 cred vo ve se coloco na minha vlw por disponibilizar


    _________________
    Successful Projeto Apocalypse Online Eu Apoio Successful
    mahdiias
    mahdiias
    Iniciante
    Iniciante


    Mensagens : 74
    Créditos : 2

    [EO]Servidor MySQL - Página 2 Empty Re: [EO]Servidor MySQL

    Mensagem por mahdiias Sáb Set 19, 2015 9:52 pm

    Dooolly escreveu:
    [EO]Servidor MySQL - Página 2 ImifP2b2fbBVy

    O que é MySQL?
    O MySQL é um sistema de gerenciamento de banco de dados, que utiliza a linguagem SQL (Linguagem de Consulta Estruturada) como interface. É atualmente um dos bancos de dados mais populares , com mais de 10 milhões de instalações pelo mundo.

    Características

    • Portabilidade (suporta praticamente qualquer plataforma atual);
    • Compatibilidade (existem drivers ODBC, JDBC e .NET e módulos de interface para diversas linguagens de programação, como Delphi, Java, C/C++, C#, Visual Basic, Python, Perl, PHP, ASP e Ruby)
    • Excelente desempenho e estabilidade;
    • Pouco exigente quanto a recursos de novos hardware;
    • Facilidade no manuseio;
    • É um Software Livre com base na GPL (entretanto, se o programa que acessar o Mysql não for GPL, uma licença comercial deverá ser adquirida);
    • Contempla a utilização de vários Storage Engines como MyISAM, InnoDB, Falcon, BDB, Archive, Federated, CSV, Solid…
    • Suporta controle transacional;
    • Suporta Triggers;
    • Suporta Cursors (Non-Scrollable e Non-Updatable);
    • Suporta Stored Procedures e Functions;
    • Replicação facilmente configurável;
    • Interfaces gráficas (MySQL Toolkit) de fácil utilização cedidos pela MySQL Inc.


    Servidor Pronto

    Tutorial
    Antes de começar façam Backup do seu Servidor, não iremos mexer no Cliente

    Primeiramente vamos instalar uma nova Referencia!
    No topo do VB6 vá em Project>References e marque a opção
    Microsoft ActiveX Data Objects 2.6 Library
    [EO]Servidor MySQL - Página 2 IubczZBGXJ08N

    No modDatabase apague toda essa sub:
    Código:
    Sub SavePlayer(ByVal index As Long)

    Agora apague toda a:
    Código:
    Function FindChar(ByVal Name As String) As Boolean

    Agora apague toda a:
    Código:
    Function PasswordOK(ByVal Name As String, ByVal Password As String) As Boolean

    Apague toda a:
    Código:
    Function CharExist(ByVal index As Long) As Boolean

    Apague toda a:
    Código:
    Sub LoadPlayer(ByVal index As Long, ByVal Name As String)

    Apague toda a:
    Código:
    Function AccountExist(ByVal Name As String) As Boolean

    Procure por:
    Código:
    ' Serves as a constructor

    Abaixo adicione:
    Código:
    Dim File As String
        
        File = App.Path & "\Data\mysql.ini"
        If Not FileExist(File, True) Then
           PutVar File, "MYSQL", "Host", "127.0.0.1"
           PutVar File, "MYSQL", "Port", 3306
           PutVar File, "MYSQL", "Database", "Database"
           PutVar File, "MYSQL", "User", "root"
           PutVar File, "MYSQL", "Password", "  "
        End If

        Call SetStatus("Connecting to Database...")
        Call ConnectDatabase(GetVar(File, "MYSQL", "Host"), GetVar(File, "MYSQL", "Port"), GetVar(File, "MYSQL", "Database"), GetVar(File, "MYSQL", "User"), GetVar(File, "MYSQL", "Password"))

    Agora instale os seguintes arquivos:
    Arquivos*
    Driver ODBC 3.51*

    Vamos instalar o modMySQL
    Extraia o arquivo rar dentro da pasta do servidor.

    Volte para o Visual Basic e clique com o Botão Direito do Mouse na pasta modules Assim:
    [EO]Servidor MySQL - Página 2 IblJe3G5hlxwXz

    Vai aparecer o seguinte:
    [EO]Servidor MySQL - Página 2 ItSpdUhxJxLJA

    Clique em Existing, vai em src, e selecione o modMySQL
    [EO]Servidor MySQL - Página 2 IXQ0N0jIYkl4x

    Agora vamos Configurar
    Instale o Driver ODBC Connector 3.51(Eu já havia deixado o link!)

    Para configurar você vai precisar de um lugar para hospedar seu Database.
    Vou ensinar como hospedar em seu computador.

    Para isso você vai precisar do VertrigoServ
    Baixar VertrigoServ

    Instale-o, Não vou fazer um tutorial disso pois irá ficar muito extenso, mas não tem dificuldade!

    Depois de instalado, abra seu navegador, e digite: http://localhost/phpmyadmin
    Vai pedir o login e a senha, você pode usar a padrão que é:
    Login: root
    Senha: vertrigo

    Vai aparecer algo semelhante a isso:
    Imagem Grande:

    Clique em Base de Dados, no topo da pagina!
    Ai onde tem Create Database, você digita um nome para seu banco de dados, ex: mundoninja, mundo_ninja. Não pode usar espaços.
    Depois clique em Criar

    Agora que sua Base de Dados foi criada, ela irá aparecer em uma lista a sua esquerda.
    Clique nela e depois vá em Importar.
    [EO]Servidor MySQL - Página 2 IVr2N8ZLg5Zh7

    Clique em Selecionar Arquivo. E Selecione o arquivo Eclipse30.sql que você já havia baixado junto com o modMySQL.
    Feito isso execute o servidor para que o arquivo MySQL.ini seja criado. Vai dá um erro, mas é normal.

    Depois do arquivo ter sido criado vá na pasta Data. Na pasta do server, e abra o arquivo MySQL.INI
    Vai está assim:
    Código:
    [MYSQL]
    Host=127.0.0.1
    Port=3306
    Database=Database
    User=root
    Password=

    Propriedades

    • Host: Numero do ip onde seu servidor está hospedado. Ser estiver hospedado junto com o server, deixa como está.
    • Port: Pode deixar como está.
    • Database: Aqui é o nome da base de dados que você criou no phpmyadmin
    • User=Usuário do host, aquele que você usou no para entrar no phpmyadmin, "root"
    • Password=Senha do host, aquele que você usou no para entrar no phpmyadmin, "vertrigo"


    Finalmente terminamos o tutorial pode testa-lo.

    Créditos
    Eu por Criar o Tutorial
    Valentine por ajudar a melhorar
    Dragonick por criar e dar permissão para dispor
    Tópico Original







    Nao consigo achar o codigo :' Serves as a constructor o que eu faço?
    Dooolly
    Dooolly
    Colaborador
    Colaborador


    Medalhas : [EO]Servidor MySQL - Página 2 Trophy12
    Mensagens : 1227
    Créditos : 153

    Ficha do personagem
    Nível: 1
    Experiência:
    [EO]Servidor MySQL - Página 2 Left_bar_bleue0/0[EO]Servidor MySQL - Página 2 Empty_bar_bleue  (0/0)
    Vida:
    [EO]Servidor MySQL - Página 2 Left_bar_bleue30/30[EO]Servidor MySQL - Página 2 Empty_bar_bleue  (30/30)

    [EO]Servidor MySQL - Página 2 Empty Re: [EO]Servidor MySQL

    Mensagem por Dooolly Sáb Set 19, 2015 10:01 pm

    mahdiias escreveu:Nao consigo achar o codigo :' Serves as a constructor o que eu faço?

    Tenta tirar o ":" que você botou durante a busca, procure Apenas por:

    ' Serves as a constructor
    avatar
    adiif1
    Novato
    Novato


    Mensagens : 11
    Créditos : 0

    [EO]Servidor MySQL - Página 2 Empty Re: [EO]Servidor MySQL

    Mensagem por adiif1 Dom Set 20, 2015 1:10 pm

    Help someone with task? ; /

    Código:

    [size=12]  If Player(index).CurrentTask > 0 Then[/size][size=12][/size]
    [size=12]        If Task(Player(index).CurrentTask).Type = TASK_TYPE_TALKTONPC Then[/size][size=12][/size]
    [size=12]            If NpcNum = Task(Player(index).CurrentTask).Data1 Then[/size][size=12][/size]
    [size=12]                If Task(Player(index).CurrentTask).RewardItem > 0 Then[/size][size=12][/size]
    [size=12]                    If FindOpenInvSlot(index, Task(Player(index).CurrentTask).RewardItem) > 0 Then[/size][size=12][/size]
    [size=12]                        GiveInvItem index, Task(Player(index).CurrentTask).RewardItem, Task(Player(index).CurrentTask).RewardAmount[/size][size=12][/size]
    [size=12]                        Call SendChatBubble(MapNum, MapNpcNum, TARGET_TYPE_NPC, Trim$(Task(Player(index).CurrentTask).CompleteMsg))[/size][size=12][/size]
    [size=12]                        PlayerMsg index, "Task complete", White[/size][size=12][/size]
    [size=12]                        If Task(Player(index).CurrentTask).Repeat = True Then[/size][size=12][/size]
    [size=12]                            Player(index).TaskKill = 0[/size][size=12][/size]
    [size=12]                            Player(index).TaskComplete(Player(index).CurrentTask) = False[/size][size=12][/size]
    [size=12]                            Player(index).CurrentTask = 0[/size][size=12][/size]
    [size=12]                        Else[/size][size=12][/size]
    [size=12]                            Player(index).TaskKill = 0[/size][size=12][/size]
    [size=12]                            Player(index).TaskComplete(Player(index).CurrentTask) = True[/size][size=12][/size]
    [size=12]                            Player(index).CurrentTask = 0[/size][size=12][/size]
    [size=12]                        End If[/size][size=12][/size]
    [size=12]                        Call SendPlayerData(index)[/size][size=12][/size]
    [size=12]                    Else[/size][size=12][/size]
    [size=12]                        PlayerMsg index, "Your inventory is full.", White[/size][size=12][/size]
    [size=12]                    End If[/size][size=12][/size]
    [size=12]                Else[/size][size=12][/size]
    [size=12]                    Call SendChatBubble(MapNum, MapNpcNum, TARGET_TYPE_NPC, Trim$(Task(Player(index).CurrentTask).CompleteMsg))[/size][size=12][/size]
    [size=12]                    PlayerMsg index, "Task complete", White[/size][size=12][/size]
    [size=12]                    If Task(Player(index).CurrentTask).Repeat = True Then[/size][size=12][/size]
    [size=12]                        Player(index).TaskKill = 0[/size][size=12][/size]
    [size=12]                        Player(index).TaskComplete(Player(index).CurrentTask) = False[/size][size=12][/size]
    [size=12]                        Player(index).CurrentTask = 0[/size][size=12][/size]
    [size=12]                    Else[/size][size=12][/size]
    [size=12]                        Player(index).TaskKill = 0[/size][size=12][/size]
    [size=12]                        Player(index).TaskComplete(Player(index).CurrentTask) = True[/size][size=12][/size]
    [size=12]                        Player(index).CurrentTask = 0[/size][size=12][/size]
    [size=12]                    End If[/size][size=12][/size]
    [size=12]                    Call SendPlayerData(index)[/size][size=12][/size]
    [size=12]                End If[/size][size=12][/size]
    [size=12]                Exit Sub[/size][size=12][/size]
    [size=12]            End If[/size][size=12][/size]
    [size=12]        End If[/size][size=12][/size]
    [size=12]    End If[/size]
    [size=12]
    Dooolly
    Dooolly
    Colaborador
    Colaborador


    Medalhas : [EO]Servidor MySQL - Página 2 Trophy12
    Mensagens : 1227
    Créditos : 153

    Ficha do personagem
    Nível: 1
    Experiência:
    [EO]Servidor MySQL - Página 2 Left_bar_bleue0/0[EO]Servidor MySQL - Página 2 Empty_bar_bleue  (0/0)
    Vida:
    [EO]Servidor MySQL - Página 2 Left_bar_bleue30/30[EO]Servidor MySQL - Página 2 Empty_bar_bleue  (30/30)

    [EO]Servidor MySQL - Página 2 Empty Re: [EO]Servidor MySQL

    Mensagem por Dooolly Dom Set 20, 2015 2:23 pm

    adiif1 escreveu:Help someone with task? ; /

    Código:

    If Player(index).CurrentTask > 0 Then
            If Task(Player(index).CurrentTask).Type = TASK_TYPE_TALKTONPC Then
                If NpcNum = Task(Player(index).CurrentTask).Data1 Then
                    If Task(Player(index).CurrentTask).RewardItem > 0 Then[/size]
                        If FindOpenInvSlot(index, Task(Player(index).CurrentTask).RewardItem) > 0 Then
                            GiveInvItem index, Task(Player(index).CurrentTask).RewardItem, Task(Player(index).CurrentTask).RewardAmount
                            Call SendChatBubble(MapNum, MapNpcNum, TARGET_TYPE_NPC, Trim$(Task(Player(index).CurrentTask).CompleteMsg))
                            PlayerMsg index, "Task complete", White
                            If Task(Player(index).CurrentTask).Repeat = True Then
                                Player(index).TaskKill = 0
                                Player(index).TaskComplete(Player(index).CurrentTask) = False
                                Player(index).CurrentTask = 0
                            Else
                                Player(index).TaskKill = 0
                                Player(index).TaskComplete(Player(index).CurrentTask) = True
                                Player(index).CurrentTask = 0
                            End If
                            Call SendPlayerData(index)
                        Else
                            PlayerMsg index, "Your inventory is full.", White
                        End If
                    Else
                        Call SendChatBubble(MapNum, MapNpcNum, TARGET_TYPE_NPC, Trim$(Task(Player(index).CurrentTask).CompleteMsg))
                        PlayerMsg index, "Task complete", White
                        If Task(Player(index).CurrentTask).Repeat = True Then
                            Player(index).TaskKill = 0
                            Player(index).TaskComplete(Player(index).CurrentTask) = False
                            Player(index).CurrentTask = 0
                        Else
                            Player(index).TaskKill = 0
                            Player(index).TaskComplete(Player(index).CurrentTask) = True
                            Player(index).CurrentTask = 0
                        End If
                        Call SendPlayerData(index)
                    End If
                    Exit Sub
                End If
            End If
        End If

    For the quest system by alatar, in SavePlayer add:
    Código:
    ' Missões
            TempString = vbNullString
            For J = 1 To MAX_QUESTS
              If LenB(TempString) Then TempString = TempString & vbNewLine
              TempString = TempString & J & " " & .PlayerQuest(J).ActualTask & " " & .PlayerQuest(J).CurrentCount & " " & .PlayerQuest(J).Status
            Next
           
            Tabela!Quests = TempString

    and in LoadPlayer, add:
    Código:
    ' Missões
        TempString = Tabela!Quests
       
        If LenB(TempString) Then
          TempStr = Split(TempString, vbNewLine)
          For J = 0 To UBound(TempStr)
              TempStr2 = Split(TempStr(J), " ")
              Player(Index).PlayerQuest(J + 1).ActualTask = TempStr2(1)
              Player(Index).PlayerQuest(J + 1).CurrentCount = TempStr2(2)
              Player(Index).PlayerQuest(J + 1).Status = TempStr2(3)
          Next
        End If

    Remember to add new entities in the database , "Quests" without quotes!
    avatar
    adiif1
    Novato
    Novato


    Mensagens : 11
    Créditos : 0

    [EO]Servidor MySQL - Página 2 Empty Re: [EO]Servidor MySQL

    Mensagem por adiif1 Dom Set 20, 2015 2:38 pm

    adiif1 escreveu:Dont work ;/

    i add

    Código:

    Dim TempString As String, TempStr As String, TempStr2 As String, TempStr3 As String

    add table Quests [text]

    Expected array 
    For J = 0 To UBound(TempStr)


    Sorry is not alatar questy ;/
    Dooolly
    Dooolly
    Colaborador
    Colaborador


    Medalhas : [EO]Servidor MySQL - Página 2 Trophy12
    Mensagens : 1227
    Créditos : 153

    Ficha do personagem
    Nível: 1
    Experiência:
    [EO]Servidor MySQL - Página 2 Left_bar_bleue0/0[EO]Servidor MySQL - Página 2 Empty_bar_bleue  (0/0)
    Vida:
    [EO]Servidor MySQL - Página 2 Left_bar_bleue30/30[EO]Servidor MySQL - Página 2 Empty_bar_bleue  (30/30)

    [EO]Servidor MySQL - Página 2 Empty Re: [EO]Servidor MySQL

    Mensagem por Dooolly Dom Set 20, 2015 3:37 pm

    What then enter the system , how could I help without any information ?
    avatar
    adiif1
    Novato
    Novato


    Mensagens : 11
    Créditos : 0

    [EO]Servidor MySQL - Página 2 Empty Re: [EO]Servidor MySQL

    Mensagem por adiif1 Dom Set 20, 2015 4:04 pm

    Código:

    Public Const MAX_TASKS As Long = 255

    ' Task
    Public Const TASK_TYPE_GATHERITEM As Byte = 0
    Public Const TASK_TYPE_KILLNPC As Byte = 1
    Public Const TASK_TYPE_TALKTONPC As Byte = 2

    If Player(index).CurrentTask > 0 Then
            If Task(Player(index).CurrentTask).Type = TASK_TYPE_TALKTONPC Then
                If NpcNum = Task(Player(index).CurrentTask).Data1 Then
                    If Task(Player(index).CurrentTask).RewardItem > 0 Then
                        If FindOpenInvSlot(index, Task(Player(index).CurrentTask).RewardItem) > 0 Then
                            GiveInvItem index, Task(Player(index).CurrentTask).RewardItem, Task(Player(index).CurrentTask).RewardAmount
                            Call SendChatBubble(MapNum, MapNpcNum, TARGET_TYPE_NPC, Trim$(Task(Player(index).CurrentTask).CompleteMsg))
                            PlayerMsg index, "Task complete", White
                            If Task(Player(index).CurrentTask).Repeat = True Then
                                Player(index).TaskKill = 0
                                Player(index).TaskComplete(Player(index).CurrentTask) = False
                                Player(index).CurrentTask = 0
                            Else
                                Player(index).TaskKill = 0
                                Player(index).TaskComplete(Player(index).CurrentTask) = True
                                Player(index).CurrentTask = 0
                            End If
                            Call SendPlayerData(index)
                        Else
                            PlayerMsg index, "Your inventory is full.", White
                        End If
                    Else
                        Call SendChatBubble(MapNum, MapNpcNum, TARGET_TYPE_NPC, Trim$(Task(Player(index).CurrentTask).CompleteMsg))
                        PlayerMsg index, "Task complete", White
                        If Task(Player(index).CurrentTask).Repeat = True Then
                            Player(index).TaskKill = 0
                            Player(index).TaskComplete(Player(index).CurrentTask) = False
                            Player(index).CurrentTask = 0
                        Else
                            Player(index).TaskKill = 0
                            Player(index).TaskComplete(Player(index).CurrentTask) = True
                            Player(index).CurrentTask = 0
                        End If
                        Call SendPlayerData(index)
                    End If
                    Exit Sub
                End If
            End If
        End If

    I do not know what more can I give
    This is a custom quest system[task]
    GallighanMaker
    GallighanMaker
    Colaborador
    Colaborador


    Medalhas : [EO]Servidor MySQL - Página 2 ZgLkiRU
    Mensagens : 985
    Créditos : 102

    Ficha do personagem
    Nível: 1
    Experiência:
    [EO]Servidor MySQL - Página 2 Left_bar_bleue0/0[EO]Servidor MySQL - Página 2 Empty_bar_bleue  (0/0)
    Vida:
    [EO]Servidor MySQL - Página 2 Left_bar_bleue30/30[EO]Servidor MySQL - Página 2 Empty_bar_bleue  (30/30)

    [EO]Servidor MySQL - Página 2 Empty Re: [EO]Servidor MySQL

    Mensagem por GallighanMaker Qua Set 30, 2015 4:01 pm

    @Dooolly To usando um sistema de guild mas não está salvando no banco de dados. Sabe o que eu teria que fazer para salvar?. A guild está sendo salva em um arquivo .dat na pasta guilds dentro do servidor ainda. Pelo que eu vi eu teria q apagar o loadguild, saveguild etc e passar para o modMySql mas não sei ao certo os parâmetros da guild.


    _________________
    [EO]Servidor MySQL - Página 2 8dVK0ku
    using C# and import Python developer || Expert in Unity Engine IDE. || [EO]Servidor MySQL - Página 2 769_heart 2D pixel games.
    Dooolly
    Dooolly
    Colaborador
    Colaborador


    Medalhas : [EO]Servidor MySQL - Página 2 Trophy12
    Mensagens : 1227
    Créditos : 153

    Ficha do personagem
    Nível: 1
    Experiência:
    [EO]Servidor MySQL - Página 2 Left_bar_bleue0/0[EO]Servidor MySQL - Página 2 Empty_bar_bleue  (0/0)
    Vida:
    [EO]Servidor MySQL - Página 2 Left_bar_bleue30/30[EO]Servidor MySQL - Página 2 Empty_bar_bleue  (30/30)

    [EO]Servidor MySQL - Página 2 Empty Re: [EO]Servidor MySQL

    Mensagem por Dooolly Qua Set 30, 2015 7:28 pm

    GallighanMaker escreveu:@Dooolly To usando um sistema de guild mas não está salvando no banco de dados. Sabe o que eu teria que fazer para salvar?. A guild está sendo salva em um arquivo .dat na pasta guilds dentro do servidor ainda. Pelo que eu vi eu teria q apagar o loadguild, saveguild etc e passar para o modMySql mas não sei ao certo os parâmetros da guild.

    Acho que você teria que modificar a sub saveplayer e loadplayer, adicionar novas colunas as tabelas que passei. Porque não está salvando a guild do jogador no banco de dados, sempre que fizer algo que modifique a PlayerRec você terá que adicionar ao Banco de Dados.

    o codigo para salvar seria

    Tabela!Nome_Da_Coluna_Que_Criou = Player(Index).Variavel

    Para Carregar é só inverter

    Player(Index).Variavel = Tabela!Nome_Da_Coluna_Que_Criou

    dá uma olhada no modMySQL lá tem as sub saveplayer e loadplayer.

    Conteúdo patrocinado


    [EO]Servidor MySQL - Página 2 Empty Re: [EO]Servidor MySQL

    Mensagem por Conteúdo patrocinado


      Data/hora atual: Sáb Jul 27, 2024 2:52 am