Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 38

Thread: Source Code for Current C# Implementation

  1. #21

    Default

    I'll try testing it a bit. Could you look at my source code changes though and offer some feedback?
    Browse MOHAA Servers Post GameSpy Era

    VISIT MOHREBORN.COM FOR LATEST INFORMATION



    Medal of Honor: Game Server Browser Fixer - Patches your MOHAA, MOHSH, and MOHBT game binaries to allow you to retrieve a list of game servers within the multi-player menu in-game even after GameSpy ceases operation!

    Medal of Honor: Query Launcher - Find, browse, organize, join, get your ping, and get more information regarding all Medal of Honor (AA, SH, & BT) servers from your PC at any time!
    Medal of Honor: Web Server Master List - Find and browse all Medal of Honor servers online using your browser!
    Add your Medal of Honor Server to the Master List
    YouTube Video for Medal of Honor: Query Launcher and MOHAASERVERS.TK!



    MOHAA Mods and Utilities
    OwN-3m-All's Mods
    Make Me Stock - A program that allows you to easily move-in and move-out non-stock mods and other files at the click of a button. Automates adding / removing mods without having to copy / move files manually.



    Quality Game Servers

    Rent dedicated Dallas Texas, Kansas City, Las Vegas Nevada, Chicago, Pennsylvania, and Sofia Bulgaria MOHAA and other game servers from We Be HostiN starting at $10 a month.


  2. #22
    Über Prodigy & Developer Razo[R]apiD's Avatar
    Join Date
    May 2010
    Location
    Poland, Lublin
    Posts
    3,257

    Default

    I think you should use BeginReceiveFrom

    Here's a good example of async udp server:
    http://www.codeproject.com/Articles/...us-UDP-sockets

  3. #23

    Default

    For now, I don't see any additional benefit from using BeginReceiveFrom rather than BeginReceive. I'll leave it for now and will test it on my Windows machine with a server using the cvar you provided to see if it works.

    What does the client currently receive from the master server when the server browser is used? Doesn't it just receive a list of IPs and Ports... then client goes and queries them for ping and server information? If this is the case, I already have logic in my PHP based version to return servers in an array that have sent an acknowledgement of being alive within the past 10 minutes. I'm just not sure how I should send the data... one server:ip port combo at a time or the entire array within a message sent by the socket?

    With the PHP version, the Online field in the database will most likely not be used... simply, we check the time before last acknowledgement. I think the PHP one has the potential to work just as well as the C# version. I'll post source after I've tested it as well to see if it works. This of course takes time.
    Browse MOHAA Servers Post GameSpy Era

    VISIT MOHREBORN.COM FOR LATEST INFORMATION



    Medal of Honor: Game Server Browser Fixer - Patches your MOHAA, MOHSH, and MOHBT game binaries to allow you to retrieve a list of game servers within the multi-player menu in-game even after GameSpy ceases operation!

    Medal of Honor: Query Launcher - Find, browse, organize, join, get your ping, and get more information regarding all Medal of Honor (AA, SH, & BT) servers from your PC at any time!
    Medal of Honor: Web Server Master List - Find and browse all Medal of Honor servers online using your browser!
    Add your Medal of Honor Server to the Master List
    YouTube Video for Medal of Honor: Query Launcher and MOHAASERVERS.TK!



    MOHAA Mods and Utilities
    OwN-3m-All's Mods
    Make Me Stock - A program that allows you to easily move-in and move-out non-stock mods and other files at the click of a button. Automates adding / removing mods without having to copy / move files manually.



    Quality Game Servers

    Rent dedicated Dallas Texas, Kansas City, Las Vegas Nevada, Chicago, Pennsylvania, and Sofia Bulgaria MOHAA and other game servers from We Be HostiN starting at $10 a month.


  4. #24
    Über Prodigy & Developer Razo[R]apiD's Avatar
    Join Date
    May 2010
    Location
    Poland, Lublin
    Posts
    3,257

    Default

    Quote Originally Posted by own3mall View Post
    For now, I don't see any additional benefit from using BeginReceiveFrom rather than BeginReceive.
    Well, from what I understood, BeginReceiveFrom is the proper asynchronous method for UDP socket.

    Even in C, you use recvfrom for UDP and recv for TCP.

  5. #25
    Über Prodigy & Developer Razo[R]apiD's Avatar
    Join Date
    May 2010
    Location
    Poland, Lublin
    Posts
    3,257

    Default

    I didn't reversed the custom protocol MoHAA uses yet. It may take me a day or two (first I have to have time ) but this can be done quite fast.

  6. #26

    Default

    Quote Originally Posted by Razo[R]apiD View Post
    Well, from what I understood, BeginReceiveFrom is the proper asynchronous method for UDP socket.

    Even in C, you use recvfrom for UDP and recv for TCP.
    Yes, you are correct. However, the C# code is not using a typical socket construct. I'm using the UdpClient class (appears to create sockets and remove some of the craziness). It uses the BeginReceive method for async UDP packets. I'm going to see if this class works with my current code. If it does not, then I will go back to officially using a socket and using the BeginReceiveFrom call. The code for this would be easy too... I'm spending a lot of time searching everything and looking for examples. That's the way I understand it after doing more research. Either approach *should* work. Documentation on this stuff is pretty piss poor.
    Browse MOHAA Servers Post GameSpy Era

    VISIT MOHREBORN.COM FOR LATEST INFORMATION



    Medal of Honor: Game Server Browser Fixer - Patches your MOHAA, MOHSH, and MOHBT game binaries to allow you to retrieve a list of game servers within the multi-player menu in-game even after GameSpy ceases operation!

    Medal of Honor: Query Launcher - Find, browse, organize, join, get your ping, and get more information regarding all Medal of Honor (AA, SH, & BT) servers from your PC at any time!
    Medal of Honor: Web Server Master List - Find and browse all Medal of Honor servers online using your browser!
    Add your Medal of Honor Server to the Master List
    YouTube Video for Medal of Honor: Query Launcher and MOHAASERVERS.TK!



    MOHAA Mods and Utilities
    OwN-3m-All's Mods
    Make Me Stock - A program that allows you to easily move-in and move-out non-stock mods and other files at the click of a button. Automates adding / removing mods without having to copy / move files manually.



    Quality Game Servers

    Rent dedicated Dallas Texas, Kansas City, Las Vegas Nevada, Chicago, Pennsylvania, and Sofia Bulgaria MOHAA and other game servers from We Be HostiN starting at $10 a month.


  7. #27
    Administrator James's Avatar
    Join Date
    May 2010
    Location
    on the intraweb
    Posts
    3,180

    Default

    RR, if you have the source code I sent a while ago, I already reversed it. Well, not reversed it, I just modified it in memoru. I believe MOHAA 1.11 uses protocol 8 and I made it 9 when testing version 1.12.

    http://www.x-null.net/James/version/1.JPG

  8. #28

    Default

    The credentials in the source code for the database do not work. At least, I was unable to even query a server at that IP address. Has the information changed? I want to use my script to dump all the tables into a file so I can test locally.
    Browse MOHAA Servers Post GameSpy Era

    VISIT MOHREBORN.COM FOR LATEST INFORMATION



    Medal of Honor: Game Server Browser Fixer - Patches your MOHAA, MOHSH, and MOHBT game binaries to allow you to retrieve a list of game servers within the multi-player menu in-game even after GameSpy ceases operation!

    Medal of Honor: Query Launcher - Find, browse, organize, join, get your ping, and get more information regarding all Medal of Honor (AA, SH, & BT) servers from your PC at any time!
    Medal of Honor: Web Server Master List - Find and browse all Medal of Honor servers online using your browser!
    Add your Medal of Honor Server to the Master List
    YouTube Video for Medal of Honor: Query Launcher and MOHAASERVERS.TK!



    MOHAA Mods and Utilities
    OwN-3m-All's Mods
    Make Me Stock - A program that allows you to easily move-in and move-out non-stock mods and other files at the click of a button. Automates adding / removing mods without having to copy / move files manually.



    Quality Game Servers

    Rent dedicated Dallas Texas, Kansas City, Las Vegas Nevada, Chicago, Pennsylvania, and Sofia Bulgaria MOHAA and other game servers from We Be HostiN starting at $10 a month.


  9. #29

    Default

    I fixed up my version quite a bit. It's in the DropBox folder MoHAABox\OwN-3m-All\MoHAAMasterserver.

    If "config.txt" is located within the service installation directory (directory from where it runs), it will read the file for mysql database credentials. If it's not located (so when xnull / razo is testing, make sure you delete this file) , it will use x-null's database information by default (hardcoded). This helps with testing.

    I ran it on my XP x86 SP3 slow Atom machine, and every 5 minutes or so, the database entry would update properly. I fixed the way my socket was working because my original code was not correct and was crashing hard. I also fixed a log problem in my version. I think this version is ready for testing. It's using Async UDP and should be threaded. I restarted my computer, and the service started and was running just fine. It was updating the database like it was supposed to. Please take a look and test it?

    Also, have we found out anything more about how the information should be sent back to the client from the master server? Right now, the master server is just listening for servers. It's not returning the list to the client's ingame browser.
    Browse MOHAA Servers Post GameSpy Era

    VISIT MOHREBORN.COM FOR LATEST INFORMATION



    Medal of Honor: Game Server Browser Fixer - Patches your MOHAA, MOHSH, and MOHBT game binaries to allow you to retrieve a list of game servers within the multi-player menu in-game even after GameSpy ceases operation!

    Medal of Honor: Query Launcher - Find, browse, organize, join, get your ping, and get more information regarding all Medal of Honor (AA, SH, & BT) servers from your PC at any time!
    Medal of Honor: Web Server Master List - Find and browse all Medal of Honor servers online using your browser!
    Add your Medal of Honor Server to the Master List
    YouTube Video for Medal of Honor: Query Launcher and MOHAASERVERS.TK!



    MOHAA Mods and Utilities
    OwN-3m-All's Mods
    Make Me Stock - A program that allows you to easily move-in and move-out non-stock mods and other files at the click of a button. Automates adding / removing mods without having to copy / move files manually.



    Quality Game Servers

    Rent dedicated Dallas Texas, Kansas City, Las Vegas Nevada, Chicago, Pennsylvania, and Sofia Bulgaria MOHAA and other game servers from We Be HostiN starting at $10 a month.


  10. #30
    Über Prodigy & Developer Razo[R]apiD's Avatar
    Join Date
    May 2010
    Location
    Poland, Lublin
    Posts
    3,257

    Default

    Hey what is the status? Do we want a C# version or PHP/Python version? Where are we going to host it?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •