Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

JoshTheEvilInsaneGod

Members
  • Posts

    16
  • Joined

  • Last visited

    Never

Posts posted by JoshTheEvilInsaneGod

  1. @jcsnider:

    > The real thing that needs to be finished is the networking… I am using some 3rd party stuff while I should be using System.Net.Sockets which I just couldn't get working. Once networking is fixed all the other bugs are very easy once found.

    My C# version I did uses the System.Net.Socket namespace. Um here is my c# socket system feel free to do what you please with it.
    Sorry that its in c# , did not feel to up for recoding it to support vb use a lot of unsafe code meaning pointers, PInvoke and other dark forces of c#. If you want to use this or need help with using this leave me line.

    Note this is only for the game server. Game Client needs to have this part as well for sending and recv. The game Client Connect feautre you just need to create a socket and do Socket.Connect(ip,port)
    ```
    //#define Socket
    //#define Native_Socket
    //#define Native_Winsock
    //#define UseCore
    namespace Core.Net.Sockets
    {
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Net;
    using System.Net.Sockets;
        public class NetworkClient
        {
            private Socket socket;
            private byte[] buffer;
            private NetworkServerSocket server;
            public Socket Socket { get { return socket; } }
            public NetworkServerSocket Server { get { return server; } }
            public object Owner;
            public string IP;
            public bool Alive;

            public NetworkClient(NetworkServerSocket _server, Socket _socket, int buffer_len)
            {
                Alive = true;
                server = _server;
                socket = _socket;
                buffer = new byte[buffer_len];
                try { IP = (socket.RemoteEndPoint as IPEndPoint).Address.ToString(); }
                catch (SocketException) {}
            }
            public void BeginReceive()
            {
                try
                {
                    socket.BeginReceive(buffer, 0, buffer.Length, SocketFlags.None, new AsyncCallback(Receive), null);
                }
                catch (SocketException)
                {
                    server.InvokeDisconnect(this);
                }
            }
            private void Receive(IAsyncResult res)
            {
                if (socket != null)
                {
                    try
                    {
                        int len = socket.EndReceive(res);
                        if (this.Alive)
                        {
                            if (len > 0)
                            {
                                byte[] received = new byte[len];
                                unsafe
                                {
                                    fixed (byte* recv_ptr = received, buf_ptr = buffer)
                                    {
                                        MSVCRT.memcpy(recv_ptr, buf_ptr, len);
                                    }
                                }
                                if (server.OnReceive != null)
                                {
                                    server.OnReceive(this, received);
                                }

                                BeginReceive();
                            }
                            else
                            {
                                server.InvokeDisconnect(this);
                            }
                        }
                    }
                    catch (SocketException)
                    {
                        server.InvokeDisconnect(this);
                    }
                }
            }
            public void Send(byte[] Packet)
            {
                if (Alive)
                {
                    try
                    {
                        socket.BeginSend(Packet, 0, Packet.Length, SocketFlags.None, new AsyncCallback(EndSend), null);
                    }
                    catch (SocketException)
                    {
                        Server.InvokeDisconnect(this);
                    }
                }
            }
            private void EndSend(IAsyncResult res)
            {
                try
                {
                    socket.EndSend(res);
                }
                catch (SocketException)
                {
                    server.InvokeDisconnect(this);
                }
            }
            public void Disconnect()
            {
                try { socket.Disconnect(false); }
                catch (SocketException) { }
                server.InvokeDisconnect(this);
            }
        }

        public delegate void NetworkClientConnection(NetworkClient Client);
        public delegate void NetworkClientReceive(NetworkClient Client, byte[] Packet);

        public class NetworkServerSocket
        {
            private Socket server;
            private int m_Port;

            public Socket Socket { get { return server; } }
            public int Port { get { return m_Port; } }

            public NetworkClientConnection OnConnect;
            public NetworkClientReceive OnReceive;
            public NetworkClientConnection OnDisconnect;

            public int ClientBufferSize;

            public NetworkServerSocket()
            {
                server = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
            }
            public void Prepare(int port, int backlog)
            {
                m_Port = port;
                server.Bind(new IPEndPoint(IPAddress.Any, m_Port));
                server.Listen(backlog);
            }
            public void BeginAccept()
            {
                server.BeginAccept(new AsyncCallback(Accept), null);
            }
            private void Accept(IAsyncResult res)
            {
                Socket client_socket;
                try { client_socket = server.EndAccept(res); }
                catch (SocketException)
                {
                    BeginAccept();
                    return;
                }

                client_socket.ReceiveBufferSize = ClientBufferSize;
                NetworkClient client = new NetworkClient(this, client_socket, ClientBufferSize);
                if (OnConnect != null)
                {
                    OnConnect(client);
                }
                client.BeginReceive();
                BeginAccept();
            }
            public void InvokeDisconnect(NetworkClient Client)
            {
                if (!Client.Alive)
                    return;
                Client.Alive = false;
                if (OnDisconnect != null)
                    OnDisconnect(Client);
            }
        }
    }

    ```
    Native Imports used
    ```
            [DllImport("msvcrt.dll")]
            public static extern void* memcpy(void* dst, void* src, int length);
            [DllImport("msvcrt.dll")]
            public static extern void* memset(void* dst, byte fill, int length);
            [DllImport("msvcrt.dll")]
            public static extern void* malloc(int size);
            [DllImport("msvcrt.dll")]
            public static extern void free(void* memblock);
            [DllImport("msvcrt.dll")]
            public static extern void* realloc(void* memblock, int size);
            [DllImport("msvcrt.dll")]
            public static extern int memcmp(void* buf1, void* buf2, int count);

    ```
  2. Lol DrNova allways optimistic about that game, Ima 137 137 137 Pure Trojan On the phoneix server Full +12 -7 Everthing cpt the things that cant be uped higher than that , On top of tat just made my +12 horse and i got a +12 Ninja Ninja Ninja , So yea i dont buy dbs as much never bulked yet xD but i win evething in the loto xD
  3. I agree 100% that java is a great and ultimate source for the game develoment but Zetta out of all my time using C++ and C# with my programs and in my dev. I never ever use microsoft .net framwork. Since the start of learning to programing the first thing i did and set off was to re/write my own framework , not its not like fully completed but if there ever is a time when i would need something like that If is something that i have wrote my self. But all i am saying really is (since i am not appart of the dev team,) I think then if you guys are going to be continuing a vb6 version , java , and any other kind, Wouldn't it be smart to do a server in vb.net rather than vb6 , because the java source would be more power full that using vb6 , because it has all the resources. And i want to say this just because it is something i learned a long time ago " It does not matter what you code in , or or good it is , Anyone can code a program , and you may think its good, but a master at any language can make it better." What this mean is even tho you coded a java version of the source , that does not mean that a vb.net version could not match or even over power the java engine . Well if ya need me so i stop posting so long and would like to disscuss this more with me msn = [email protected] kk hope it all works out
  4. WAAA sorry did not feel like reading 8 pages of posts been busy with my c++ projects , Why not update to vb.net , i read alot about the server but using vb.net 2k8 with all its features would make the server 10x more stable and not to mention the use of higher version of Direct X ?? Since there is a java version why not just update it all? if no one will do it , i would be more than happy to do it now that school is over i have alot more free time, to work on dev. marsh add me on i lost you msn when i got my laptop msn = [email protected]
  5. My First try xD All images cept the main one where done by me in Photo Shop Pro - But with out no more talking delays i give u Eclipse Eclipse
    [![](http://img126.imageshack.us/img126/9137/zeroeclispenetqw6.png)](http://imageshack.us)
    [![](http://img126.imageshack.us/img126/zeroeclispenetqw6.png/1/w1024.png)](http://g.imageshack.us/img126/zeroeclispenetqw6.png/1/)
  6. No, you got this post all wrong lol. I posted it at 2am and just wanted to let people know if that wanted to run auto updater before clinet they would do so with this code. Its not the best way but that is how i do it. But starting tommrow my source will be upgraded to c# cause i know c# better lol,
  7. This is the Coding if you would want to run your auto updater before you game client :) enjoy if any questions on out to use it/ implement just ask its pretty eassy.
    ```

    Dim stAppName As String

            stAppName = "C:\ZeroSoldier\Updater.exe"
            Call Shell(stAppName, 1)

    ```
    Just have this run before everthing else then have it check to make sure updating is done and complete .(Questions are welcome)
  8. @Shadowwulf:

    > wow… so you are going to end up paying like 4 grand for a 300 dollar POS? (usualy the deal you get with rent to own)

    27 payments of 45$ (with insurance)
    As for the specs, dont know if these are good or not

    AMD Athlon 64 X2 Duel Core Proccesor 3800+ 2.00GHz
    1022mb RAM
    Radeon X 1300 GFX card 511mb mem (256 dedicated)
  9. The Idea sounds awesome, but i been reminding people about the W.I.P rules for posting. So it would be nice if you could post 3 of the required items before one of the Admins/Mods delete this topic, hate to see a good idea delted umm just for your info if you dint read it here are the required items needed before posting in the W.I.P Section:
    - screenshots
    - a storyline
    - GFX, GUI, SFX,… to show.
    - info
    - a website
    - a(n) alpha, beta, delta, gamma, epsilon, eta, zeta, theta,... version to download. (greece letters yes I know them all 23)
    - feature list
  10. Hey looks good Jarmendes, but just for your fyi the W.I.P rules state that u need 3 of the following:

    - screenshots
    - a storyline
    - GFX, GUI, SFX,… to show.
    - info
    - a website
    - a(n) alpha, beta, delta, gamma, epsilon, eta, zeta, theta,... version to download. (greece letters yes I know them all 23)
    - feature list

    So if you can post/update your main post with some more info than you have that would be great other wise the Mods/Admins forsure will delelte your post for lacking in reading the the terms to post in here.

    Hope this works out.

    JoshTheEvilInsaneGod
  11. You dontt HAVE to learn Visual Basic, you can do a ton with the scripting language(except for duel screens, whatever that is)

    All scripts go in the sever folder>scripts folder>main.txt
    Take a read through this to learn where everything is

    To learn scripting
    [http://www.touchofdeathforums.com/smf/index.php?board=162.0](http://www.touchofdeathforums.com/smf/index.php?board=162.0)
    Scripting board, with tutorials sub sections, script database, ect

    [http://www.touchofdeathforums.com/smf/index.php/topic,8502.0.html](http://www.touchofdeathforums.com/smf/index.php/topic,8502.0.html)
    ALL COMMANDS list.  Most of them are easily explained, bookmark this and take the time to look through them.
    Most scripting commands are easy to learn.  Also, look through scripts other people have posted, and see how they did it, you can learn alot through studying others scripts.
    It isnt as hard as it seems at first, once you start to understand it, it comes easy.
    Practice writing simple scripts at first, and then move on to harder ones.
    And if you ever get stuck, post your script and ask for help, and people can show you what went wrong.

    The news black box is actually in the source (vb6) it covers the background image.
    Need VB6 to edit that.

    To edit the classes, go to the classes folder in your server folder, and change the sprite number in each class.ini file to the number you want.  Remember, spritesheet starts at 0, not 1
×
×
  • Create New...